This is an example deployment of a multi-container JupyterHub. This JupyterHub uses an extended version of the DockerSpawner to spawn single-user containers with access to one GPU, provided one is available. These instructions apply to Windows.
To set up this JupyterHub, you will need to have installed:- Docker Desktop for Windows
- Ubuntu for WSL2
- NVIDIA Container Toolkit on Ubuntu for WSL2
- Navigate to the settings page for Docker Desktop and go to "Resources" > "WSL Integration";
- Check the option "Enable integration with my default WSL distro";
- Toggle on the integration with Ubuntu; and
- Click "Apply & restart".
You can check that the Docker Engine has access by running,
docker run --rm --gpus all ubuntu nvidia-smi
The output should be a table.
The JupyterHub also relies on a network. To create it, run:
docker network create jupyternet
- If you have two GPUs, type
"01"
; - If you have three GPUs, type
"012"
; - and so on and so forth.
If you want to modify the behavior of the GPUDockerSpawner
, take
the wheel file and change the file extension to ".zip". Navigate to
"gpudockerspawner" > "gpudockerspawner.py" to make your changes. Once you are
complete, create the wheel file from the Python project
(instructions)
and update the Dockerfile.
docker compose up
Congratulations! You've created your own JupyterHub.