Skip to content

Commit

Permalink
Merge pull request #860 from StochSS/hotfixes
Browse files Browse the repository at this point in the history
2.0.1 (master)
  • Loading branch information
seanebum authored Jun 9, 2020
2 parents 4d09e7d + 313ac91 commit 6eb6683
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 7 deletions.
2 changes: 2 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
DOCKER_STOCHSS_IMAGE=stochss-lab

DOCKER_BASE_IMAGE=jupyter/minimal-notebook:latest

JUPYTER_CONFIG_DIR=/opt/stochss-config/.jupyter
7 changes: 4 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
FROM jupyter/minimal-notebook:latest

ARG STOCHSS_PIP_EDITABLE
ARG JUPYTER_CONFIG_DIR

USER root

Expand All @@ -20,11 +21,11 @@ COPY --chown=jovyan:users public_models/ /home/jovyan/Examples

COPY --chown=jovyan:users . /stochss

COPY --chown=jovyan:users stochss-logo.png /home/jovyan/.jupyter/custom/logo.png
COPY --chown=jovyan:users stochss-logo.png $JUPYTER_CONFIG_DIR/custom/logo.png

COPY --chown=jovyan:users custom.css /home/jovyan/.jupyter/custom/custom.css
COPY --chown=jovyan:users custom.css $JUPYTER_CONFIG_DIR/custom/custom.css

COPY --chown=jovyan:users jupyter_notebook_config.py /home/jovyan/.jupyter/jupyter_notebook_config.py
COPY --chown=jovyan:users jupyter_notebook_config.py $JUPYTER_CONFIG_DIR/jupyter_notebook_config.py

RUN pip install --no-cache-dir -e .

Expand Down
7 changes: 5 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,14 @@ clean_notebook_server:
hub: build_hub build run_hub_dev

build_clean: deps webpack
docker build --no-cache -t $(DOCKER_STOCHSS_IMAGE):latest .
docker build \
--build-arg JUPYTER_CONFIG_DIR=$(JUPYTER_CONFIG_DIR) \
--no-cache -t $(DOCKER_STOCHSS_IMAGE):latest .

build: deps webpack
docker build \
-t $(DOCKER_STOCHSS_IMAGE):latest .
--build-arg JUPYTER_CONFIG_DIR=$(JUPYTER_CONFIG_DIR) \
-t $(DOCKER_STOCHSS_IMAGE):latest .

test: build
docker run --rm \
Expand Down
2 changes: 2 additions & 0 deletions jupyterhub/.env
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ DOCKER_STOCHSS_IMAGE=stochss-lab

POWER_USERS_FILE=.power_users

JUPYTER_CONFIG_DIR=/opt/stochss-config/.jupyter

#AUTH_CLASS=jupyterhub.auth.DummyAuthenticator

JUPYTERHUB_VERSION=1.1.0
Expand Down
7 changes: 5 additions & 2 deletions jupyterhub/jupyterhub_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@
# Dockerspawner configuration
#------------------------------------------------------------------------------

c.DockerSpawner.container_image = os.environ['DOCKER_STOCHSS_IMAGE']
c.DockerSpawner.image = os.environ['DOCKER_STOCHSS_IMAGE']
# JupyterHub requires a single-user instance of the Notebook server, so we
# default to using the `start-singleuser.sh` script included in the
# jupyter/docker-stacks *-notebook images as the Docker run command when
Expand All @@ -157,7 +157,10 @@
# Mount the real user's Docker volume on the host to the notebook user's
# notebook directory in the container
c.DockerSpawner.volumes = { 'jupyterhub-user-{username}': notebook_dir }

# Set extra environment variables
c.DockerSpawner.environment = {
'JUPYTER_CONFIG_DIR': os.environ['JUPYTER_CONFIG_DIR']
}
# Remove containers once they are stopped
c.DockerSpawner.remove_containers = True
# For debugging arguments passed to spawned containers
Expand Down

0 comments on commit 6eb6683

Please sign in to comment.