Improve testability

This commit is contained in:
Rob Ballantyne
2025-08-20 09:34:09 +01:00
parent 8797b504af
commit 08c88f7527
+21 -8
View File
@@ -41,20 +41,33 @@ echo_var DEBUG_LOG
echo_var PYWORKER_LOG echo_var PYWORKER_LOG
echo_var MODEL_LOG echo_var MODEL_LOG
env | grep _ >> /etc/environment; # Populate /etc/environment with quoted values
if ! grep -q "VAST" /etc/environment; then
env -0 | grep -zEv "^(HOME=|SHLVL=)|CONDA" | while IFS= read -r -d '' line; do
name=${line%%=*}
value=${line#*=}
printf '%s="%s"\n' "$name" "$value"
done > /etc/environment
fi
if [ ! -d "$ENV_PATH" ] if [ ! -d "$ENV_PATH" ]
then then
echo "setting up venv" echo "setting up venv"
curl -LsSf https://astral.sh/uv/install.sh | sh if ! which uv; then
source ~/.local/bin/env curl -LsSf https://astral.sh/uv/install.sh | sh
git clone https://github.com/vast-ai/pyworker "$SERVER_DIR" source ~/.local/bin/env
fi
uv venv --managed-python "$WORKSPACE_DIR/worker-env" -p 3.10 # Fork testing
source "$WORKSPACE_DIR/worker-env/bin/activate" git clone "${PYWORKER_REPO:-https://github.com/vast-ai/pyworker}" "$SERVER_DIR"
if [[ -n ${PYWORKER_REF:-} ]]; then
(cd "$SERVER_DIR" && git checkout "$PYWORKER_REF")
fi
uv pip install -r vast-pyworker/requirements.txt uv venv --managed-python "$ENV_PATH" -p 3.10
source "$ENV_PATH/bin/activate"
uv pip install -r "${SERVER_DIR}/requirements.txt"
touch ~/.no_auto_tmux touch ~/.no_auto_tmux
else else