Skip to content

Commit

Permalink
1.3
Browse files Browse the repository at this point in the history
1. Fix the bug caused by `jupyterlab-nvdashboard` when solved by `pip`.
2. Finish the new readme file.
  • Loading branch information
cainmagi committed Jun 21, 2021
1 parent 7f1d137 commit 3de59d6
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 20 deletions.
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
#

# Pull base image.
ARG BASE_IMAGE=nvcr.io/nvidia/tensorflow:19.04-py3
ARG BASE_IMAGE=nvcr.io/nvidia/tensorflow:21.05-tf2-py3
FROM $BASE_IMAGE
LABEL maintainer="Yuchen Jin <[email protected]>" \
author="Yuchen Jin <[email protected]>" \
description="Jupyter Lab dockerfile supporting 1.x, 2.x and 3.x versions." \
version="1.3a"
version="1.3"
ARG DEBIAN_FRONTEND=noninteractive
ARG BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh
ARG JLAB_VER=unset
Expand Down
46 changes: 30 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,34 +7,34 @@
If you do not want to change the contents of the dockerfile, you could use such command to build the image:

```Bash
docker build -t jlab:1.0 https://github.com/cainmagi/Dockerfiles.git#jupyterlab
docker build -t jlab:1.3 https://github.com/cainmagi/Dockerfiles.git#jupyterlab
```

We provide 3 examples:

* Start from `pytorch 1.9.0a` image:

```bash
docker build -t jlab-tc:1.0 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:21.05-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh https://github.com/cainmagi/Dockerfiles.git#jupyterlab
docker build -t jlab-tc:1.3 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:21.05-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh https://github.com/cainmagi/Dockerfiles.git#jupyterlab
```

* Start from `cuda 11.1` image:
* Start from `cuda 11.3` image:

```bash
docker build -t jlab-cuda:1.0 --build-arg BASE_IMAGE=nvcr.io/nvidia/cuda:11.1-cudnn8-runtime-ubuntu20.04 --build-arg BASE_LAUNCH="" https://github.com/cainmagi/Dockerfiles.git#jupyterlab
docker build -t jlab-cuda:1.3 --build-arg BASE_IMAGE=nvcr.io/nvidia/cuda:11.3.1-cudnn8-runtime-ubuntu20.04 --build-arg BASE_LAUNCH="" https://github.com/cainmagi/Dockerfiles.git#jupyterlab
```

* Start from `pytorch 1.9.0a`, with Jupyter Lab fully upgraded to `2`:

```bash
docker build -t jlab-tc:1.0 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:21.05-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh --build-arg JLAB_VER=2 --build-arg JLAB_EXTIERS=2 https://github.com/cainmagi/Dockerfiles.git#jupyterlab
docker build -t jlab-tc:1.3 --build-arg BASE_IMAGE=nvcr.io/nvidia/pytorch:21.05-py3 --build-arg BASE_LAUNCH=/usr/local/bin/nvidia_entrypoint.sh --build-arg JLAB_VER=2 --build-arg JLAB_EXTIERS=2 https://github.com/cainmagi/Dockerfiles.git#jupyterlab
```

There are 4 available options:

| Option | Description | Default |
| :-----: | ----- | ----- |
| `BASE_IMAGE` | The base image for building this desktop image. | `nvcr.io/nvidia/tensorflow:19.04-py3` |
| `BASE_IMAGE` | The base image for building this desktop image. | `nvcr.io/nvidia/tensorflow:21.05-tf2-py3` |
| `BASE_LAUNCH` | The entrypoint script from the base image. If there is no entry script, please use `""`. | `/usr/local/bin/nvidia_entrypoint.sh` |
| `JLAB_VER` | The version of the Jupyter Lab to be installed. If set `1`, `2` or `3`, would fully install Jupyter Lab. If set `unset`, the Jupyter Lab would be minimally installed. It means that, no extension would be installed, and if there is already a Jupyter Lab in the base image, nothing would be installed. | `unset` |
| `JLAB_EXTIERS` | The extension tiers to be installed. Could be `1` or `2`. If `JLAB_VER=unset`, nothing would be installed. | `2` |
Expand Down Expand Up @@ -68,7 +68,7 @@ git clone --single-branch -b jupyterlab https://github.com/cainmagi/Dockerfiles.
After that, run such command to build the image:

```Bash
docker build -t jlab:1.0 jupyterlab
docker build -t jlab:1.3 jupyterlab
```

where `jupyterlab` is the folder of the corresponding branch. The options in online building examples could be also used for offline buliding.
Expand All @@ -78,7 +78,7 @@ where `jupyterlab` is the folder of the corresponding branch. The options in onl
* By `Jupyter Lab`: If you want to launch the Jupyter Lab but do not start the desktop, please use

```bash
docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 jlab:1.0 password=openjupyter rootdir=/homelocal
docker run --gpus all -it --rm -v ~:/homelocal -p 6080:6080 jlab:1.3 password=openjupyter rootdir=/homelocal
```

The `password` would override the default random token. The `rootdir` is the root folder of the launched jupyter lab. If not set `rootdir`, the default root folder would be `/homelocal`.
Expand All @@ -88,13 +88,13 @@ where `jupyterlab` is the folder of the corresponding branch. The options in onl
* By `BASH`: If you want to enter the command line but do not start the desktop, please use

```bash
docker run --gpus all -it --rm -v ~:/homelocal jlab:1.0 --bash
docker run --gpus all -it --rm -v ~:/homelocal jlab:1.3 --bash
```

* By any script: If you want run any script inside the docker for only one time, please use

```bash
docker run --gpus all -it --rm -v ~:/homelocal jlab:1.0 script=<the-path-to-your-script>
docker run --gpus all -it --rm -v ~:/homelocal jlab:1.3 script=<the-path-to-your-script>
```

## Features
Expand Down Expand Up @@ -150,17 +150,30 @@ To install the following extensions, use the building argument `JLAB_EXTRA_TIERS
| [`jupyterlab_html`](https://github.com/mflevine/jupyterlab_html) | :white_check_mark: | | |
| [`jupyterlab-tensorboard`](https://github.com/chaoleili/jupyterlab_tensorboard) | :white_check_mark: | :white_check_mark: | |
| [`jupyterlab-dash`](https://github.com/plotly/jupyterlab-dash) | :white_check_mark: | :white_check_mark: | |
| [`ipycanvas`](https://github.com/martinRenou/ipycanvas) | :white_check_mark: | :white_check_mark: | :ballot_box_with_check: |
| [`pyviz-comms`](https://github.com/holoviz/pyviz_comms) | :white_check_mark: | :white_check_mark: | :ballot_box_with_check: |
| [`jupyterlab-plotly`](https://github.com/plotly/plotly.py) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| [`bqplot`](https://github.com/bqplot/bqplot) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| [`ipycanvas`](https://github.com/martinRenou/ipycanvas) | :white_check_mark: | :white_check_mark: | :white_check_mark: |

## Test report

> Note:
>
> We use :white_check_mark: to represent the image is fully built. In comparison, :ballot_box_with_check: means the image requires to be built in compatible mode.

### 6/20/2021

The `conda` script for installing jupyter lab has been finished. The script would be used only if the conda is detected. Currently the `conda` script only supports `python>=3.6`.

| Base image | J-lab1 | J-lab2 | J-lab3 |
| ----- | :-----: | :-----: | :-----: |
| `nvcr.io/nvidia/pytorch:19.01-py3` (`conda`) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `nvcr.io/nvidia/tensorflow:19.03-py3` (`pip`) | :ballot_box_with_check: | :ballot_box_with_check: | :ballot_box_with_check: |
| `nvcr.io/nvidia/pytorch:21.05-py3` (`conda`) | :white_check_mark: | :white_check_mark: | :white_check_mark: |
| `nvcr.io/nvidia/tensorflow:21.05-tf2-py3` (`pip`) | :white_check_mark: | :white_check_mark: | :white_check_mark: |

> The deprecated options still work with `Jupyterlab 3.1.0a11`. We do not need to change the option list now.

### 1/30/2021

The `conda` script for installing jupyter lab has been finished. This script only supports `python>=3.6` and would not check or install `conda`. We have tested it on the following images:
Expand Down Expand Up @@ -214,12 +227,13 @@ The following tests has been passed.
## Update records
### ver 1.3 (alpha) @ 6/19/2021
### ver 1.3 @ 6/19/2021
* [x] Support the proxy value for the built image, this value is important for the devices protected by the firewall.
* [ ] Support more extensions: `ipycanvas`.
* [x] Bump the extensions to the newest versions for supporting Jupyter Lab 3: `jupyterlab-git`, `jupyterlab-nvdashboard`, `jupyter-bokeh`.
* [x] Fix a bug caused by the changed address of `get-pip.py`.
1. Support the proxy value for the built image, this value is important for the devices protected by the firewall.
2. Support more extensions: `ipycanvas`.
3. Bump the extensions to the newest versions for supporting Jupyter Lab 3: `jupyterlab-git`, `jupyterlab-nvdashboard`, `jupyter-bokeh`.
4. Fix a bug caused by the changed address of `get-pip.py`.
5. Fix the compatibility issues caused by `jupyterlab-nvdashboard` and `bqplot`.
### ver 1.2 @ 1/30/2021
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-jlab
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,7 @@ then
fi
if [ "x${CUR_PYTHON_VER}" = "xpy37+" ] || [ "x${CUR_PYTHON_VER}" = "xpy36" ]
then
python3 -m pip install jupyter-lsp==0.9.3 jupyterlab-git || fail
python3 -m pip install jupyter-lsp==0.9.3 "jupyterlab-git<=0.24.0" || fail
run_with_nodejs "jupyter labextension install @jupyterlab/git --no-build" || fail
else
python3 -m pip install jupyter-lsp==0.9.2 jupyterlab-git==0.21.1 || fail
Expand Down
2 changes: 1 addition & 1 deletion scripts/install-jlab-conda
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ then
CONDA_TEMP_PKGS=""
fi
if [ "x${EXTRA_TIERS}" = "x2" ] || [ "x${EXTRA_TIERS}" = "x1" ]; then
conda install -y -c conda-forge "ipywidgets>=7.5" "nbdime>=2.0" "nbresuse>=0.3.3,<=0.3.6" jupytext=1.8.2 jupyter-lsp-python=0.9.3 ipympl=0.5.8 sidecar=0.4.0 xeus-python ptvsd bokeh jupyter_bokeh pynvml "jupyterlab-nvdashboard<=0.5.0" python-language-server jupyterlab-git ${CONDA_TEMP_PKGS} || fail
conda install -y -c conda-forge "ipywidgets>=7.5" "nbdime>=2.0" "nbresuse>=0.3.3,<=0.3.6" jupytext=1.8.2 jupyter-lsp-python=0.9.3 ipympl=0.5.8 sidecar=0.4.0 xeus-python ptvsd bokeh jupyter_bokeh pynvml "jupyterlab-nvdashboard<=0.5.0" python-language-server "jupyterlab-git<=0.24.0" ${CONDA_TEMP_PKGS} || fail
python3 -m pip install jupyterlab_hdf || fail
fi
if [ "x${EXTRA_TIERS}" = "x2" ]; then
Expand Down

0 comments on commit 3de59d6

Please sign in to comment.