Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 661d4477d6 |
+8
-19
@@ -47,32 +47,20 @@ 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
|
||||||
return 0
|
else
|
||||||
fi
|
echo "Installing default vastai-sdk"
|
||||||
|
if ! uv pip install vastai-sdk; then
|
||||||
echo "Installing default vastai-sdk"
|
report_error_and_exit "Failed to install vastai-sdk"
|
||||||
if ! uv pip install vastai-sdk; then
|
fi
|
||||||
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!"
|
||||||
@@ -90,7 +78,8 @@ echo_var DEBUG_LOG
|
|||||||
echo_var PYWORKER_LOG
|
echo_var PYWORKER_LOG
|
||||||
echo_var MODEL_LOG
|
echo_var MODEL_LOG
|
||||||
|
|
||||||
if [ -e "$MODEL_LOG" ]; then
|
ROTATE_MODEL_LOG="${ROTATE_MODEL_LOG:-false}"
|
||||||
|
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"
|
||||||
|
|||||||
Reference in New Issue
Block a user