Skip to content

Commit ecc8dd8

Browse files
authored
Merge pull request #93 from rkdarst/srun_optional
SlurmSpawner: make "srun" optional
2 parents 68a4bf9 + 41dc003 commit ecc8dd8

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

batchspawner/batchspawner.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -516,6 +516,11 @@ class SlurmSpawner(UserEnvMixin,BatchSpawnerRegexStates):
516516
help="QoS name to submit job to resource manager"
517517
).tag(config=True)
518518

519+
req_srun = Unicode('srun',
520+
help="Job step wrapper, default 'srun'. Set to '' you do not want "
521+
"to run in job step (affects environment handling)"
522+
).tag(config=True)
523+
519524
batch_script = Unicode("""#!/bin/bash
520525
#SBATCH --output={{homedir}}/jupyterhub_slurmspawner_%j.log
521526
#SBATCH --job-name=spawner-jupyterhub
@@ -531,7 +536,7 @@ class SlurmSpawner(UserEnvMixin,BatchSpawnerRegexStates):
531536
trap 'echo SIGTERM received' TERM
532537
{{prologue}}
533538
which jupyterhub-singleuser
534-
srun {{cmd}}
539+
{% if srun %}{{srun}} {% endif %}{{cmd}}
535540
echo "jupyterhub-singleuser ended gracefully"
536541
{{epilogue}}
537542
""").tag(config=True)

0 commit comments

Comments
 (0)