Skip to content

Instantly share code, notes, and snippets.

@fcollonval
Last active October 5, 2022 13:14
Show Gist options
  • Save fcollonval/89908434ea68d4c829055a2f1983269d to your computer and use it in GitHub Desktop.
Save fcollonval/89908434ea68d4c829055a2f1983269d to your computer and use it in GitHub Desktop.
test JupyterHub

Commands to execute to build and run the JupyterHub:

docker build -t jhub .
docker run -p 8000:8000 --rm jhub

Then open with your web browser: http://127.0.0.1:8000/

The docker for JupyterHub 3 is currently broken - missing a JS asset.
Xref: jupyterhub/jupyterhub#4033

ARG BASE_IMAGE=jupyterhub/jupyterhub:2
FROM $BASE_IMAGE
RUN python3 -m pip install -U setuptools pip \
&& python3 -m pip install -U jupyterlab \
&& useradd --no-log-init -r -u 999 jovyan && mkdir -p /home/jovyan && chown jovyan /home/jovyan \
&& useradd --no-log-init -r -u 998 marc && mkdir -p /home/marc && chown marc /home/marc
COPY ./jupyterhub_config.py /srv/jupyterhub/
"""JupyterHub configuration for testing this service."""
import sys
# c.JupyterHub.log_level = "DEBUG"
c.JupyterHub.authenticator_class = "jupyterhub.auth.DummyAuthenticator"
# c.DummyAuthenticator.password = 'password'
c.Authenticator.admin_users = {"jovyan"}
c.Authenticator.allowed_users = {"jovyan", "marc"}
# c.JupyterHub.load_roles = [
# {
# "name": "admin-interface",
# "description": "",
# "scopes": ["admin-ui"],
# "users": ["jovyan"]
# }
# ]
# c.JupyterHub.redirect_to_server = False
c.JupyterHub.spawner_class = "jupyterhub.spawner.LocalProcessSpawner"
c.LocalProcessSpawner.notebook_dir = "/home/{username}"
c.Spawner.default_url = "/lab"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment