JupyterHub Spawners

Define the Spawner in jupyterhub_config.py.

c.Spawner.options_form = '<input name="c.Spawner.default_url" val="/lab"/><br>Please Choose <select name="letter" multiple="true"><option value="/lab">Jupyter Lab</option><option value="/tree">Classic Notebook</option></select>'
pip install dockerspawner
# Docker Spawner.
c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner'
c.DockerSpawner.volumes = {'jupyterhub-user-{username}': '/home/jovyan/work', 'jupyterhub-test': {'bind': '/home/jovyan/shared', 'mode': 'rw'}}
# Kube Spawner.
c.KubeSpawner.environment.update({'HADOOP_USER_NAME': get_username})
c.KubeSpawner.extra_pod_config.update({'hostNetwork': "True"})
# Custom Spawner.
class CustomDockerSpawner(DockerSpawner):
    def get_env(self):
        env = super().get_env()
        env['VAR'] = self.user.name 
        return env
c.JupyterHub.spawner_class = CustomDockerSpawner

Examples

results matching ""

    No results matching ""