Skip to content

Commit 072a2cb

Browse files
committed
Add SlurmSpawner.req_output
1 parent 37a2e8e commit 072a2cb

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
@@ -688,12 +688,12 @@ def get_env(self):
688688
class SlurmSpawner(UserEnvMixin, BatchSpawnerRegexStates):
689689
batch_script = Unicode(
690690
"""#!/bin/bash
691-
#SBATCH --output={{homedir}}/jupyterhub_slurmspawner_%j.log
692691
#SBATCH --job-name=spawner-jupyterhub
693692
#SBATCH --chdir={{homedir}}
694693
#SBATCH --export={{keepvars}}
695694
#SBATCH --get-user-env=L
696-
{% if partition %}#SBATCH --partition={{partition}}
695+
{% if output %}#SBATCH --output={% if not output.startswith('/') %}{{homedir}}/{% endif %}{{output}}
696+
{% endif %}{% if partition %}#SBATCH --partition={{partition}}
697697
{% endif %}{% if runtime %}#SBATCH --time={{runtime}}
698698
{% endif %}{% if memory %}#SBATCH --mem={{memory}}
699699
{% endif %}{% if gres %}#SBATCH --gres={{gres}}
@@ -740,6 +740,12 @@ class SlurmSpawner(UserEnvMixin, BatchSpawnerRegexStates):
740740
help="Additional resources (e.g. GPUs) requested",
741741
).tag(config=True)
742742

743+
req_output = Unicode(
744+
"jupyterhub_slurmspawner_%j.log",
745+
help="Batch script standard output and standard error filename pattern."
746+
"Relative filename is considered relative to ``req_homedir``.",
747+
).tag(config=True)
748+
743749
# outputs line like "Submitted batch job 209"
744750
batch_submit_cmd = Unicode("sbatch --parsable").tag(config=True)
745751
# outputs status and exec node like "RUNNING hostname"

0 commit comments

Comments
 (0)