From 3c6eec2410f7836cbef144dbaf69151971dcd6a0 Mon Sep 17 00:00:00 2001 From: Tibo De Peuter Date: Wed, 8 Apr 2026 22:29:29 +0200 Subject: [PATCH] fix(hpc): typos, .env and pythonpath --- scripts/hpc/install.sh | 2 +- scripts/hpc/train.pbs | 14 +++++++++++++- 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/scripts/hpc/install.sh b/scripts/hpc/install.sh index d1b69db..f88d081 100644 --- a/scripts/hpc/install.sh +++ b/scripts/hpc/install.sh @@ -19,7 +19,7 @@ if [ -n "$PBS_O_WORKDIR" ]; then cd "$PBS_O_WORKDIR" fi -mkdir "${PBS_O_WORKDIR}/runs" +mkdir -p "${PBS_O_WORKDIR}/runs" # Mirror configs to $VSC_DATA to avoid home quota limits (3GB) # vsc-venv manages environments relative to the requirements file diff --git a/scripts/hpc/train.pbs b/scripts/hpc/train.pbs index 3d53193..e7d21f0 100644 --- a/scripts/hpc/train.pbs +++ b/scripts/hpc/train.pbs @@ -53,8 +53,20 @@ echo ">>> Starting BrittleStar training..." export MUJOCO_GL=egl export WANDB_DIR="$SCRATCH_RUNDIR" -python src/train.py \ +export PYTHONPATH="$PBS_O_WORKDIR/src:${PYTHONPATH:-}" + +if [ -f "$VSC_DATA/$PROJ_NAME/.env" ]; then + echo ">>> Sourcing API keys from .env..." + export $(grep -v '^#' "$VSC_DATA/$PROJ_NAME/.env" | xargs) +elif [ -f "$PBS_O_WORKDIR/.env" ]; then + echo ">>> Sourcing API keys from .env..." + export $(grep -v '^#' "$PBS_O_WORKDIR/.env" | xargs) +fi + +# TODO Once experiments get serious, change the config +python scripts/train.py \ --env-config-path configs/hpc/smoke_test.yaml \ + --hyperparameter-config-path configs/hpc/smoke_test.yaml \ --run-dir "$SCRATCH_RUNDIR" echo ">>> Staging out results to $DATA_RUNDIR..."