Skip to content

Commit e0253b4

Browse files
t20100consideRatio
authored andcommitted
Add SlurmSpawner.req_output
1 parent f7de5ad commit e0253b4

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

batchspawner/batchspawner.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -666,12 +666,12 @@ def get_env(self):
666666
class SlurmSpawner(UserEnvMixin, BatchSpawnerRegexStates):
667667
batch_script = Unicode(
668668
"""#!/bin/bash
669-
#SBATCH --output={{homedir}}/jupyterhub_slurmspawner_%j.log
670669
#SBATCH --job-name=spawner-jupyterhub
671670
#SBATCH --chdir={{homedir}}
672671
#SBATCH --export={{keepvars}}
673672
#SBATCH --get-user-env=L
674-
{% if partition %}#SBATCH --partition={{partition}}
673+
{% if output %}#SBATCH --output={% if not output.startswith('/') %}{{homedir}}/{% endif %}{{output}}
674+
{% endif %}{% if partition %}#SBATCH --partition={{partition}}
675675
{% endif %}{% if runtime %}#SBATCH --time={{runtime}}
676676
{% endif %}{% if memory %}#SBATCH --mem={{memory}}
677677
{% endif %}{% if gres %}#SBATCH --gres={{gres}}
@@ -717,6 +717,12 @@ class SlurmSpawner(UserEnvMixin, BatchSpawnerRegexStates):
717717
help="Additional resources (e.g. GPUs) requested",
718718
).tag(config=True)
719719

720+
req_output = Unicode(
721+
"jupyterhub_slurmspawner_%j.log",
722+
help="Batch script standard output and standard error filename pattern."
723+
"Relative filename is considered relative to ``req_homedir``.",
724+
).tag(config=True)
725+
720726
# outputs line like "Submitted batch job 209"
721727
batch_submit_cmd = Unicode("sbatch --parsable").tag(config=True)
722728
# outputs status and exec node like "RUNNING hostname"

0 commit comments

Comments
 (0)