Configuration

Docker Image

JupyterHub must be started with a Jupyter Docker Stacks image, or a descendant from it.

Jupyter Docker Stacks provides a wide array of Jupyter Notebooks to get you started:

These Docker images are however NOT GPU-enabled. For your convenience we created a fork of the public Jupyter Docker Stacks with GPU-processing capability. These images use nvcr.io/nvidia/cuda:10.0-cudnn7-runtime-ubuntu18.04 as base image instead of a vanilla Ubuntu.

You can use these images by changing the prefix from jupyter/ to gpulab.ilabt.imec.be:5000/jupyter/. For example: a Jupyter notebook with the GPU-enabled Tensorflow and Keras-library can be found under gpulab.ilabt.imec.be:5000/jupyter/tensorflow-notebook.

Adding custom software

JupyterHub supports all Docker images which descend from the Jupyter Docker Stacks

You can add additional software by creating a docker image which starts from an existing Jupyter Docker Stacks-image, and which executes the necessary installation commands. Check the section Using pip install or conda install in a Child Docker image of the Jupyter Docker Stacks documentation for a full example.

If you want to use GPU’s, you’ll need to descend your image from a GPU-enabled image. These are available in the public docker repository gpulab.ilabt.imec.be:5000/jupyter.

For example, to add a library to the GPU-enabled tensorflow-notebook, you can use the following Dockerfile:

# Start from a core gpu-enabled stack version
FROM gpulab.ilabt.imec.be:5000/jupyter/tensorflow-notebook:10.0-cudnn7-ubuntu18.04-v3
# Set user as root so next commands run correctly
USER root
# Install dependencies
RUN apt-get update && apt install graphviz libgraphviz-dev libcgraph6 && rm -rf /var/lib/apt/lists/*
# Install spektral in the default python3 environment
RUN pip install spektral
# Restore the correct user
USER jovyan

After building this image, upload it to a Docker Registry with docker push. You can either use the publicly available gpulab.ilabt.imec.be:5000, upload it to a Docker Registry of gitlab.ilabt.imec.be, or use your own registry. See dockerImage for more info.

For example to build and push this Dockerfile to the public GPULab Docker Registry:

docker build -t gpulab.ilabt.imec.be:5000/jupyter-example/spektral:v1 .
docker push gpulab.ilabt.imec.be:5000/jupyter-example/spektral:v1

Once pushed to the registry, you can start your custom Jupyter Docker Image by specifying the full registry path in the field dockerImage. In this example: gpulab.ilabt.imec.be:5000/jupyter-example/spektral:v1.

When using a docker registry with authentication, this path will be of the form <deployusername>:<password>@gitlab.ilabt.imec.be:4567/<project>/<image>:<tag>. When using a Gitlab Registry you can create a deploy key to get a username and password for letting JupyterHub pull this image.