Skip to content

Commit c439004

Browse files
authored
Merge pull request #177 from yuvipanda/fix/fail-on-error
Fail hard on first error in batch script
2 parents 9641a86 + dab386c commit c439004

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

batchspawner/batchspawner.py

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -504,6 +504,8 @@ class TorqueSpawner(BatchSpawnerRegexStates):
504504
#PBS -v {keepvars}
505505
#PBS {options}
506506
507+
set -euo pipefail
508+
507509
{prologue}
508510
{cmd}
509511
{epilogue}
@@ -543,6 +545,8 @@ class PBSSpawner(TorqueSpawner):
543545
#PBS -v {{keepvars}}
544546
{% if options %}#PBS {{options}}{% endif %}
545547
548+
set -euo pipefail
549+
546550
{{prologue}}
547551
{{cmd}}
548552
{{epilogue}}
@@ -598,6 +602,8 @@ class SlurmSpawner(UserEnvMixin,BatchSpawnerRegexStates):
598602
{% endif %}{% if reservation%}#SBATCH --reservation={{reservation}}
599603
{% endif %}{% if options %}#SBATCH {{options}}{% endif %}
600604
605+
set -euo pipefail
606+
601607
trap 'echo SIGTERM received' TERM
602608
{{prologue}}
603609
which jupyterhub-singleuser
@@ -671,6 +677,8 @@ class GridengineSpawner(BatchSpawnerBase):
671677
#$ -v {keepvars}
672678
#$ {options}
673679
680+
set -euo pipefail
681+
674682
{prologue}
675683
{cmd}
676684
{epilogue}
@@ -761,6 +769,8 @@ class LsfSpawner(BatchSpawnerBase):
761769
#BSUB -o {homedir}/.jupyterhub.lsf.out
762770
#BSUB -e {homedir}/.jupyterhub.lsf.err
763771
772+
set -euo pipefail
773+
764774
{prologue}
765775
{cmd}
766776
{epilogue}

0 commit comments

Comments
 (0)