diff --git a/src/glicid_spawner/templates/slurm_script.jinja b/src/glicid_spawner/templates/slurm_script.jinja index ad403d4..3c01679 100644 --- a/src/glicid_spawner/templates/slurm_script.jinja +++ b/src/glicid_spawner/templates/slurm_script.jinja @@ -28,7 +28,7 @@ echo "The {{job_name}} logs are located in: ${JUPYTER_LOG_DIR}" trap 'echo SIGTERM received' TERM; {# SLURM config -#} - scontrol write batch_script ${SLURM_JOB_ID} -; + scontrol write batch_script ${SLURM_JOB_ID}{% if cluster %} --cluster={{cluster}}{% endif %} -; {# Micromamba config -#} export MAMBA_EXE={{mamba_exe}}; diff --git a/tests/test_spawner.py b/tests/test_spawner.py index 2eb88e0..9dc2a4e 100644 --- a/tests/test_spawner.py +++ b/tests/test_spawner.py @@ -57,6 +57,8 @@ def test_spawner_batch_script(monkeypatch): assert '#SBATCH --cluster=nautilus' in script assert '#SBATCH --qos=short' in script + assert 'scontrol write batch_script ${SLURM_JOB_ID} --cluster=nautilus -;' in script + assert 'export JUPYTER_LOG_DIR="/home/john-doe/.jupyter/spawner/logs"' in script assert 'export MAMBA_EXE=/micromamba/operator/bin/micromamba;' in script