From 4d786b4d1772c4e3e326038797669cedd92c9667 Mon Sep 17 00:00:00 2001 From: LucasArmandVast Date: Fri, 2 Jan 2026 13:23:07 -0500 Subject: [PATCH] SDK Versioning Improvements (#77) * Add SDK_BRANCH --- start_server.sh | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/start_server.sh b/start_server.sh index 4d12a86..129031c 100755 --- a/start_server.sh +++ b/start_server.sh @@ -47,20 +47,32 @@ JSON } 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 echo "Installing vastai-sdk version ${SDK_VERSION}" if ! uv pip install "vastai-sdk==${SDK_VERSION}"; then report_error_and_exit "Failed to install vastai-sdk==${SDK_VERSION}" fi - else - echo "Installing default vastai-sdk" - if ! uv pip install vastai-sdk; then - report_error_and_exit "Failed to install vastai-sdk" - fi + return 0 + fi + + echo "Installing default vastai-sdk" + if ! uv pip install vastai-sdk; then + report_error_and_exit "Failed to install vastai-sdk" fi } - [ -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!" [ "$BACKEND" = "comfyui" ] && [ -z "$COMFY_MODEL" ] && report_error_and_exit "For comfyui backends, COMFY_MODEL must be set!"