Skip to content

OleMussmann/docker-stacks

 
 

Repository files navigation

Jupyter Docker Stacks

Jupyter Docker Stacks are a set of ready-to-run, CUDA enabled, GPU-accelerated Docker images containing Jupyter applications and interactive computing tools for deep learning. Pre-compiled images can be found on Docker Hub.

Quick Start

Whether you pull from Docker Hub or build your own, for GPU acceleration you first have to make sure that Docker containers can talk to the GPU. Right now, only Nvidia GPUs are supported. AMD GPU support will follow in the future.

Setup

  1. Install the latest Nvidia driver. Use your package manager if possible. For recent Ubuntu versions, you can simply open Software & Updates, go to the tab Additional Drivers and install the driver from there.
  2. Install Docker CE - preferrably the latest version from https://docs.docker.com/install/.
  3. Install and test Nvidia Docker.

Images

Image Overview

While this repository is the base for many Docker images, only four are recommended for actual usage:

  • scipy-notebook
    • Without any deep-learning frameworks, this image satisfies your vanilla python GPU-number-crunching needs with for example numba.
  • fastai-notebook
  • tensorflow-notebook
  • mxnet-notebook
    • Rocking Apache's MXNet.

These images come in two different flavours:

  • experimental
    • As raw as it gets, these images always pull the latest software versions when you build them. Not found on Docker Hub.
  • version-pinned
    • If you are not living on the edge, the version-pinned recipes will reproducibly build the same images. The latest version-pinned images will carry the tag latest in addition to their date-tag YYYY-MM-DD. Dropping the tag will always pull latest. You can bypass this repository entirely and pull the images from Docker Hub.

Images are based on different versions of CUDA. Supported are:

  • CUDA 9.2
  • CUDA 10.0
  • CUDA 10.1
  • CUDA 10.2

Choose the highest CUDA version that still works with your target notebook and your latest installed graphics driver.

Linux x86_64 Driver Version CUDA Toolkit
>= 440.33 CUDA 10.2
>= 418.39 CUDA 10.1
>= 410.48 CUDA 10.0
>= 396.26 CUDA 9.2

The image that you want to use is named

isbjornlabs/[NAME]-notebook-cuda[CUDA_VERSION][:TAG]

The experimental version of the fastai notebook, based on CUDA 10.0 is thus called: isbjornlabs/fastai-notebook-cuda10.0:experimental.

The version-pinned version from 2019-05-06 of the mxnet notebook, based on CUDA 9.2 is thus called: isbjornlabs/mxnet-notebook-cuda9.2:2019-05-06.

The latest version of the version-pinned scipy notebook, based on CUDA 10.1 is thus called: isbjornlabs/scipy-notebook-cuda10.1:latest. The latest tag can be omitted for the short version: isbjornlabs/scipy-notebook-cuda10.1

Image Tables

Not all versions are compatible with each other. Consult the tables below to see which notebooks are buildable.

Version-pinned: 2020-06-24
notebook CUDA 9.2 CUDA 10.0 CUDA 10.1 CUDA 10.2
scipy ✔️ ✔️ ✔️ ✔️
fastai ✔️ ✔️ ✔️ ✔️
tensorflow ✔️ ✔️ ✔️ ✔️
mxnet ✔️ ✔️ ✔️ ✔️
Experimental
notebook CUDA 9.2 CUDA 10.0 CUDA 10.1 CUDA 10.2
scipy ✔️ ✔️ ✔️ ✔️
fastai ✔️ ✔️ ✔️ ✔️
tensorflow ✔️ ✔️ ✔️ ✔️
mxnet ✔️ ✔️ ✔️ ✔️

Pinned packages (2020-06-24)

all noteboos
jupyterlab==2.0.2
reason: jupyterlab_bokeh not compatible with jupyterlab > 2.0.x

Examples

The examples below may help you get started if you finished the above installation, know which image you want to use, and want to launch a single Jupyter Notebook server in a container.

The User Guide on ReadTheDocs describes additional uses and features in detail.

docker-compose

The DS_project is a companion repository that simplifies the usage of these notebooks via docker-compose. Check out the README.md to get started.

docker

For an all-manual mode of operation, use docker directly.

Example 1: This command pulls the isbjornlabs/tensorflow-notebook image tagged 2019-05-06 from Docker Hub if it is not already present on the local host. It then starts a container running a Jupyter Notebook server and exposes the server on host port 8888. The server logs appear in the terminal. Visiting http://<hostname>:8888/?token=<token> in a browser loads the Jupyter Notebook dashboard page, where hostname is the name of the computer running docker and token is the secret token printed in the console. The container remains intact for restart after the notebook server exits.

docker run -p 8888:8888 isbjornlabs/tensorflow-notebook:2019-05-06

Example 2: This command performs the same operations as Example 1, but it exposes the server on host port 10000 instead of port 8888. Visiting http://<hostname>:10000/?token=<token> in a browser loads JupyterLab, where hostname is the name of the computer running docker and token is the secret token printed in the console.::

docker run -p 10000:8888 isbjornlabs/tensorflow-notebook:2019-05-06

Example 3: This command pulls the isbjornlabs/fastai-notebook image tagged 2019-05-06 from Docker Hub if it is not already present on the local host. It then starts an ephemeral container running a Jupyter Notebook server and exposes the server on host port 10000. The command mounts the current working directory on the host as /workdir in the container. The server logs appear in the terminal. Visiting http://<hostname>:10000/?token=<token> in a browser loads JupyterLab, where hostname is the name of the computer running docker and token is the secret token printed in the console. Docker destroys the container after notebook server exit, but any files written to /workdir in the container remain intact on the host.

docker run --rm -p 10000:8888 -e JUPYTER_ENABLE_LAB=yes -v "$PWD":/workdir isbjornlabs/fastai-notebook:2019-05-06

Contributing

Feel free to file bug reports and pull requests. However, you are encouraged to contribute to the upstream jupyter docker-stacks instead. See the Contributor Guide on ReadTheDocs for information about how to contribute package updates, recipes, features, tests, and community maintained stacks.

Alternatives

Resources