Add SDK_BRANCH

This commit is contained in:
Lucas Armand
2025-12-22 10:09:14 -08:00
parent 3e8da87ce2
commit 0b02f31aa8
+15 -3
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
fi
echo "Installing default vastai-sdk" echo "Installing default vastai-sdk"
if ! uv pip install vastai-sdk; then if ! uv pip install vastai-sdk; then
report_error_and_exit "Failed to install vastai-sdk" report_error_and_exit "Failed to install vastai-sdk"
fi 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!"