Skip to content

Instantly share code, notes, and snippets.

@dciangot
Created June 11, 2021 15:06
Show Gist options
  • Save dciangot/855ec21ee2e60897378925161735c9e8 to your computer and use it in GitHub Desktop.
Save dciangot/855ec21ee2e60897378925161735c9e8 to your computer and use it in GitHub Desktop.
c.SlurmSpawner.batch_script = """#!/bin/bash
#SBATCH --output={{homedir}}/jupyterhub_slurmspawner_%j.log
#SBATCH --job-name=spawner-jupyterhub
#SBATCH --chdir={{homedir}}
#SBATCH --export={{keepvars}}
#SBATCH --get-user-env=L
#SBATCH --partition={{partition}}
#SBATCH --time={{runtime}}
#SBATCH --mem={{memory}}
#SBATCH --gres={{gres}}
#SBATCH --cpus-per-task={{nprocs}}
#SBATCH --reservation={{reservation}}
#SBATCH {{options}}
set -euo pipefail
trap 'echo SIGTERM received' TERM
{{prologue}}
which jupyterhub-singleuser
{{srun}} {{cmd}}
echo "jupyterhub-singleuser ended gracefully"
{{epilogue}}
"""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment