Add explicit cluster name to slurm script

This commit is contained in:
Benoît Seignovert 2024-03-18 17:56:34 +01:00
parent 8217d63c41
commit 7792d567f5
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 3 additions and 1 deletions

View file

@ -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}};

View file

@ -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