DEPRECATED: it's recommended to use BatchSpawner and a custom options_form
rather than this.
A Sun Grid Engine (SGE) Spawner for JupyterHub.
Designed to work with JupyterHub 0.7.2 but may work with more recent versions too.
Install
sgespawner
into the same Python environment as JupyterHub using e.g.pip install /path/to/sge/clone
Make several changes to your main JupyterHub config file (which might be
/etc/jupyterhub/jupyterhub.py
):Tell JupyterHub to use
sgespawner
to spawn single-user Jupyter servers (and remove any conflictingspawner_class
lines):c.JupyterHub.spawner_class = 'sgespawner.SGESpawner'
Ensure that the environment variables needed to submit SGE jobs (using
qsub
) are defined:c.Spawner.sge_env = {'SGE_ROOT': '/usr/local/sge/live', 'SGE_CELL': 'default', 'SGE_CLUSTER_NAME': 'myclustername'}
Provide the path to the (Jinja2) template used to define the SGE batch jobs that start single-user Jupyter servers:
c.Spawner.sge_template = '/etc/jupyterhub/jupyterhub.sge.j2'
Tailor the Jinja2 template to meet your needs. The only requirements are the lines containing
working_dir
andjh_args
shown in the following example. Here JupyterHub has been installed in a virtualenv that must beactivate``d before use. In addition, SGE is told to ``j``oin the standard output and error output log files and to name the created batch job ``jupyterhub
.#!/bin/bash #$ -j y #$ -wd {{ working_dir }} #$ -N jupyterhub source /usr/virtualenvs/jupyterhub/bin/activate python -m jupyterhub.singleuser {{ jh_args }}
Currently developed and maintained by the Research Software Engineering team at the University of Sheffield.
Work funded by OpenDreamKit, a Horizon2020 European Research Infrastructure project (676541) that aims to advance the open source computational mathematics ecosystem.