diff --git a/scripts/hpc/install.sh b/scripts/hpc/install.sh index 737f259..541af16 100644 --- a/scripts/hpc/install.sh +++ b/scripts/hpc/install.sh @@ -34,11 +34,15 @@ mkdir -p "$PIP_CACHE_DIR" "$UV_CACHE_DIR" module load vsc-venv echo ">>> Synchronizing and activating environment (vsc-venv)..." +# cd to $VSC_DATA so vsc-venv creates its venvs/ directory there, not in $HOME. +mkdir -p "$VSC_DATA/$PROJ_NAME" +cd "$VSC_DATA/$PROJ_NAME" set +euo pipefail source vsc-venv --activate \ --modules "$HPC_CONFIG_DIR/modules.txt" \ --requirements "$HPC_CONFIG_DIR/requirements.txt" set -euo pipefail +cd "$PBS_O_WORKDIR" # Prepend venv to PYTHONPATH to shadow system packages (e.g. SciPy-bundle compiled # against NumPy 1.x) that are injected by the loaded modules. diff --git a/scripts/hpc/train.pbs b/scripts/hpc/train.pbs index fae4065..1610920 100644 --- a/scripts/hpc/train.pbs +++ b/scripts/hpc/train.pbs @@ -41,11 +41,14 @@ if [ ! -d "$HPC_CONFIG_DIR" ]; then exit 1 fi +# cd to $VSC_DATA so vsc-venv finds its venvs/ directory there, not in $HOME. +cd "$VSC_DATA/$PROJ_NAME" set +euo pipefail source vsc-venv --activate \ --modules "$HPC_CONFIG_DIR/modules.txt" \ --requirements "$HPC_CONFIG_DIR/requirements.txt" set -euo pipefail +cd "$PBS_O_WORKDIR" # Prepend venv to PYTHONPATH to shadow system packages (e.g. SciPy-bundle compiled # against NumPy 1.x) that are injected by the loaded modules.