-
Notifications
You must be signed in to change notification settings - Fork 1
Multi User Deployment with JupyterHub
Sandstone HPC can be deployed on a multi-user system using JupyterHub as a server spawner. In addition to a working JupyterHub installation, you will need to install and configure:
- sandstone-jupyterhub-login A login handler for authenticating Sandstone servers against the hub API.
- sandstone-spawner A custom JupyterHub spawner for starting Sandstone servers.
To install using Pip
pip install sandstone-jupyterhub-login
Clone sandstone-jupyterhub-login, and then install the Python module to your Sandstone IDE environment
python setup.py install
Then modify your Sandstone IDE configuration to use the Sandstone JupyterHub Login and Logout handlers, and to pull the URL prefix from the environment.
import os
LOGIN_HANDLER = 'sandstone_jupyterhub_login.handlers.JupyterHubLoginHandler'
LOGOUT_HANDLER = 'sandstone_jupyterhub_login.handlers.JupyterHubLogoutHandler'
URL_PREFIX = os.environ.get('SANDSTONE_PREFIX', '')
JupyterHub can now invoke Sandstone IDE by running
<sandstone-python-path>/bin/sandstone-jupyterhub
If you have deployed JupyterHub over SSL using a self-signed certificate, then you must deconfigure verification in the login handler:
VERIFY_JH_CERT = False
JupyterHub Spawner class for starting Sandstone HPC user instances
To install using Pip
pip install sandstone-spawner
Clone sandstone-spawner, and then install the module with
python setup.py install
Set the SANDSTONE_SETTINGS
environment variable to the absolute path of your Sandstone settings file, and then set the SANDSTONE_APP_PATH
environment variable to the absolute path of the sandstone-jupyterhub
executable. This executable is provided by sandstone-jupyterhub-login
.
export SANDSTONE_APP_PATH=/path/to/sandstone-jupyterhub
Modify your JupyterHub config file to set the default spawner as SandstoneSpawner
.
c.JupyterHub.spawner_class = 'sandstone_spawner.spawner.SandstoneSpawner'
If you would like JupyterHub to be able to spawn Sandstone as well as Jupyter Notebooks, configure the ProfilesSpawner to wrap the SandstoneSpawner:
c.JupyterHub.spawner_class = 'wrapspawner.ProfilesSpawner'
c.Spawner.http_timeout = 120
c.ProfilesSpawner.profiles = [
('Sandstone HPC', 'sandstone','sandstone_spawner.spawner.SandstoneSpawner', {}),
("Jupyter Notebook", 'local', 'jupyterhub.spawner.LocalProcessSpawner', {'ip':'0.0.0.0'}),
]