Compare commits

..

7 Commits

Author SHA1 Message Date
Lucas Armand 5330039cbf revert worker 2025-12-31 10:31:00 -08:00
Lucas Armand fe999dfd16 removed max_queue_time 2025-12-30 10:26:57 -08:00
Lucas Armand 85707af107 fix name 2025-12-23 18:19:35 -08:00
Lucas Armand 82023f1cfb add comfyui async 2025-12-23 18:11:10 -08:00
Lucas Armand 5f9580dde2 Merge branch 'main' into sdk-versioning 2025-12-22 10:12:26 -08:00
Lucas Armand 0b02f31aa8 Add SDK_BRANCH 2025-12-22 10:09:14 -08:00
Lucas Armand 3e8da87ce2 Add SDK version checking 2025-12-17 20:53:28 -08:00
+19 -8
View File
@@ -47,20 +47,32 @@ JSON
} }
function install_vastai_sdk() { function install_vastai_sdk() {
# If SDK_BRANCH is set, install vastai-sdk from the vast-sdk repo at that branch/tag/commit.
if [ -n "${SDK_BRANCH:-}" ]; then
if [ -n "${SDK_VERSION:-}" ]; then
echo "WARNING: Both SDK_BRANCH and SDK_VERSION are set; using SDK_BRANCH=${SDK_BRANCH}"
fi
echo "Installing vastai-sdk from https://github.com/vast-ai/vast-sdk/ @ ${SDK_BRANCH}"
if ! uv pip install "vastai-sdk @ git+https://github.com/vast-ai/vast-sdk.git@${SDK_BRANCH}"; then
report_error_and_exit "Failed to install vastai-sdk from vast-ai/vast-sdk@${SDK_BRANCH}"
fi
return 0
fi
if [ -n "${SDK_VERSION:-}" ]; then if [ -n "${SDK_VERSION:-}" ]; then
echo "Installing vastai-sdk version ${SDK_VERSION}" echo "Installing vastai-sdk version ${SDK_VERSION}"
if ! uv pip install "vastai-sdk==${SDK_VERSION}"; then if ! uv pip install "vastai-sdk==${SDK_VERSION}"; then
report_error_and_exit "Failed to install vastai-sdk==${SDK_VERSION}" report_error_and_exit "Failed to install vastai-sdk==${SDK_VERSION}"
fi fi
else return 0
echo "Installing default vastai-sdk" fi
if ! uv pip install vastai-sdk; then
report_error_and_exit "Failed to install vastai-sdk" echo "Installing default vastai-sdk"
fi if ! uv pip install vastai-sdk; then
report_error_and_exit "Failed to install vastai-sdk"
fi fi
} }
[ -n "$BACKEND" ] && [ -z "$HF_TOKEN" ] && report_error_and_exit "HF_TOKEN must be set when BACKEND is set!" [ -n "$BACKEND" ] && [ -z "$HF_TOKEN" ] && report_error_and_exit "HF_TOKEN must be set when BACKEND is set!"
[ -z "$CONTAINER_ID" ] && report_error_and_exit "CONTAINER_ID must be set!" [ -z "$CONTAINER_ID" ] && report_error_and_exit "CONTAINER_ID must be set!"
[ "$BACKEND" = "comfyui" ] && [ -z "$COMFY_MODEL" ] && report_error_and_exit "For comfyui backends, COMFY_MODEL must be set!" [ "$BACKEND" = "comfyui" ] && [ -z "$COMFY_MODEL" ] && report_error_and_exit "For comfyui backends, COMFY_MODEL must be set!"
@@ -78,8 +90,7 @@ echo_var DEBUG_LOG
echo_var PYWORKER_LOG echo_var PYWORKER_LOG
echo_var MODEL_LOG echo_var MODEL_LOG
ROTATE_MODEL_LOG="${ROTATE_MODEL_LOG:-false}" if [ -e "$MODEL_LOG" ]; then
if [ "$ROTATE_MODEL_LOG" = "true" ] && [ -e "$MODEL_LOG" ]; then
echo "Rotating model log at $MODEL_LOG to $MODEL_LOG.old" echo "Rotating model log at $MODEL_LOG to $MODEL_LOG.old"
if ! cat "$MODEL_LOG" >> "$MODEL_LOG.old"; then if ! cat "$MODEL_LOG" >> "$MODEL_LOG.old"; then
report_error_and_exit "Failed to rotate model log" report_error_and_exit "Failed to rotate model log"