Skip to content
This repository has been archived by the owner on Apr 25, 2021. It is now read-only.

willfurnass/sgespawner

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

32 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

sgespawner

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.

Installation and usage

  1. Install sgespawner into the same Python environment as JupyterHub using e.g. pip install /path/to/sge/clone

  2. Make several changes to your main JupyterHub config file (which might be /etc/jupyterhub/jupyterhub.py):

    1. Tell JupyterHub to use sgespawner to spawn single-user Jupyter servers (and remove any conflicting spawner_class lines):

      c.JupyterHub.spawner_class = 'sgespawner.SGESpawner'
      
    2. 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'}
      
    3. 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'
      
  3. Tailor the Jinja2 template to meet your needs. The only requirements are the lines containing working_dir and jh_args shown in the following example. Here JupyterHub has been installed in a virtualenv that must be activate``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 }}
    

Credits

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.

About

A Sun Grid Engine Spawner plugin for JupyterHub

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 100.0%