From 990faa0df778fb783fbd6292c1955d4a3c08e152 Mon Sep 17 00:00:00 2001 From: mathematicalmichael Date: Fri, 4 Jan 2019 16:59:31 -0700 Subject: [PATCH] cull idle servers was missing. --- Dockerfile.jupyterhub | 2 ++ jupyterhub_config.py | 15 ++++++++------- 2 files changed, 10 insertions(+), 7 deletions(-) diff --git a/Dockerfile.jupyterhub b/Dockerfile.jupyterhub index 1d1b4f9..e377ca6 100755 --- a/Dockerfile.jupyterhub +++ b/Dockerfile.jupyterhub @@ -20,3 +20,5 @@ RUN pip install jupyterhub-hashauthenticator git+https://github.com/jupyterhub/d # chmod 600 /srv/jupyterhub/secrets/* COPY ./userlist /srv/jupyterhub/userlist +# Download script to automatically stop idle single-user servers +RUN wget https://raw.githubusercontent.com/jupyterhub/jupyterhub/0.9.4/examples/cull-idle/cull_idle_servers.py diff --git a/jupyterhub_config.py b/jupyterhub_config.py index a74a2b0..6c5281c 100755 --- a/jupyterhub_config.py +++ b/jupyterhub_config.py @@ -15,11 +15,12 @@ c.JupyterHub.spawner_class = 'dockerspawner.DockerSpawner' # Spawn containers from this image (or a whitelist) c.DockerSpawner.container_image = os.environ['DOCKER_NOTEBOOK_IMAGE'] # if whitelist enabled, the above line will be ignored in favor of the options below: -c.DockerSpawner.image_whitelist = {'default': "jupyterhub-user", - 'scipy': "jupyter/scipy-notebook", - 'datascience': "jupyter/datascience-notebook", - 'R': 'jupyter/r-notebook', - 'base': "jupyter/base-notebook"} +c.DockerSpawner.image_whitelist = {'fenics': "jupyterhub-user", + 'scipy-notebook': "jupyter/scipy-notebook", + 'datascience-notebook': "jupyter/datascience-notebook", + 'r-notebook': 'jupyter/r-notebook', + 'base-notebook': "jupyter/base-notebook", + 'RStudio': 'rstudio'} # #c.DockerSpawner.container_image = "jupyter/datascience-notebook:7254cdcfa22b" # JupyterHub requires a single-user instance of the Notebook server, so we @@ -50,8 +51,8 @@ c.DockerSpawner.notebook_dir = notebook_dir # notebook directory in the container # c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir } -c.DockerSpawner.volumes = { 'power-user-{username}': notebook_dir, - '/home/mpilosov/Packages/BET':'/home/jovyan/work/shared/' } +c.DockerSpawner.volumes = { 'hub-user-{username}': notebook_dir, + '/home/shared':'/home/jovyan/work/shared/' } # volume_driver is no longer a keyword argument to create_container() # c.DockerSpawner.extra_create_kwargs.update({ 'volume_driver': 'local' })