updates to working config with spawner.

This commit is contained in:
Michael Pilosov 2018-12-28 04:09:31 +00:00
parent d2bed7a1ce
commit 8473a44985
5 changed files with 25 additions and 21 deletions

4
.env
View File

@ -7,7 +7,7 @@
# are not set in the shell environment. # are not set in the shell environment.
# To override these values, set the shell environment variables. # To override these values, set the shell environment variables.
JUPYTERHUB_VERSION=0.9.2 JUPYTERHUB_VERSION=0.9.4
# Name of Docker machine # Name of Docker machine
DOCKER_MACHINE_NAME=jupyterhub DOCKER_MACHINE_NAME=jupyterhub
@ -16,7 +16,7 @@ DOCKER_MACHINE_NAME=jupyterhub
DOCKER_NETWORK_NAME=jupyterhub-network DOCKER_NETWORK_NAME=jupyterhub-network
# Single-user Jupyter Notebook server container image # Single-user Jupyter Notebook server container image
DOCKER_NOTEBOOK_IMAGE=jupyter/minimal-notebook:8ccdfc1da8d5 DOCKER_NOTEBOOK_IMAGE=jupyter/base-notebook
# the local image we use, after pinning jupyterhub version # the local image we use, after pinning jupyterhub version
LOCAL_NOTEBOOK_IMAGE=jupyterhub-user LOCAL_NOTEBOOK_IMAGE=jupyterhub-user

View File

@ -11,11 +11,11 @@ RUN /opt/conda/bin/conda install -yq psycopg2=2.7 && \
dockerspawner==0.9.* dockerspawner==0.9.*
# Copy TLS certificate and key # Copy TLS certificate and key
ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt #ENV SSL_CERT /srv/jupyterhub/secrets/jupyterhub.crt
ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key #ENV SSL_KEY /srv/jupyterhub/secrets/jupyterhub.key
COPY ./secrets/*.crt $SSL_CERT #COPY ./secrets/*.crt $SSL_CERT
COPY ./secrets/*.key $SSL_KEY #COPY ./secrets/*.key $SSL_KEY
RUN chmod 700 /srv/jupyterhub/secrets && \ #RUN chmod 700 /srv/jupyterhub/secrets && \
chmod 600 /srv/jupyterhub/secrets/* # chmod 600 /srv/jupyterhub/secrets/*
COPY ./userlist /srv/jupyterhub/userlist COPY ./userlist /srv/jupyterhub/userlist

View File

@ -38,14 +38,14 @@ userlist:
@exit 1 @exit 1
# Do not require cert/key files if SECRETS_VOLUME defined # Do not require cert/key files if SECRETS_VOLUME defined
secrets_volume = $(shell echo $(SECRETS_VOLUME)) #secrets_volume = $(shell echo $(SECRETS_VOLUME))
ifeq ($(secrets_volume),) #ifeq ($(secrets_volume),)
cert_files=secrets/jupyterhub.crt secrets/jupyterhub.key # cert_files=secrets/jupyterhub.crt secrets/jupyterhub.key
else #else
cert_files= # cert_files=
endif #endif
check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env #check-files: userlist $(cert_files) secrets/oauth.env secrets/postgres.env
pull: pull:
docker pull $(DOCKER_NOTEBOOK_IMAGE) docker pull $(DOCKER_NOTEBOOK_IMAGE)

View File

@ -35,7 +35,7 @@ services:
# Bind Docker volume on host for JupyterHub database and cookie secrets # Bind Docker volume on host for JupyterHub database and cookie secrets
- "data:${DATA_VOLUME_CONTAINER}" - "data:${DATA_VOLUME_CONTAINER}"
ports: ports:
- "443:443" - "8000:8000"
links: links:
- hub-db - hub-db
environment: environment:

View File

@ -35,7 +35,11 @@ notebook_dir = os.environ.get('DOCKER_NOTEBOOK_DIR') or '/home/jovyan/work'
c.DockerSpawner.notebook_dir = notebook_dir c.DockerSpawner.notebook_dir = notebook_dir
# Mount the real user's Docker volume on the host to the notebook user's # Mount the real user's Docker volume on the host to the notebook user's
# notebook directory in the container # notebook directory in the container
c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }
# c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }
c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir, # this connects volumes
'/home/michael/repos/packages/lyricalart':'/home/jovyan/work/shared' }
# volume_driver is no longer a keyword argument to create_container() # volume_driver is no longer a keyword argument to create_container()
# c.DockerSpawner.extra_create_kwargs.update({ 'volume_driver': 'local' }) # c.DockerSpawner.extra_create_kwargs.update({ 'volume_driver': 'local' })
# Remove containers once they are stopped # Remove containers once they are stopped
@ -45,12 +49,12 @@ c.DockerSpawner.debug = True
# User containers will access hub by container name on the Docker network # User containers will access hub by container name on the Docker network
c.JupyterHub.hub_ip = 'jupyterhub' c.JupyterHub.hub_ip = 'jupyterhub'
c.JupyterHub.hub_port = 8080 #c.JupyterHub.hub_port = 8001
# TLS config # TLS config
c.JupyterHub.port = 443 #c.JupyterHub.port = 8000
c.JupyterHub.ssl_key = os.environ['SSL_KEY'] #c.JupyterHub.ssl_key = os.environ['SSL_KEY']
c.JupyterHub.ssl_cert = os.environ['SSL_CERT'] #c.JupyterHub.ssl_cert = os.environ['SSL_CERT']
# Authenticate users with GitHub OAuth # Authenticate users with GitHub OAuth
c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator' c.JupyterHub.authenticator_class = 'oauthenticator.GitHubOAuthenticator'