forked from b-it-bots/docker
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5 from a2s-institute/ci-test
Update CI
- Loading branch information
Showing
6 changed files
with
68 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,44 +1,67 @@ | ||
[<!--lint ignore no-dead-urls-->![Release cuda11.3.1-ubuntu20.04](https://github.com/a2s-institute/docker-stacks/actions/workflows/cuda11.3.1-ubuntu20.04.yml/badge.svg)](https://github.com/a2s-institute/docker-stacks/actions?workflow=cuda11.3.1-ubuntu20.04) | ||
[<!--lint ignore no-dead-urls-->![Release cuda11.8.0-ubuntu22.04](https://github.com/a2s-institute/docker-stacks/actions/workflows/cuda11.8.0-ubuntu22.04.yml/badge.svg)](https://github.com/a2s-institute/docker-stacks/actions?workflow=cuda11.8.0-ubuntu22.04) | ||
[![Docker Repository on Quay](https://quay.io/repository/a2s-institute/docker-stacks/gpu-notebook/status "Docker Repository on Quay")](https://quay.io/repository/a2s-institute/docker-stacks/gpu-notebook) | ||
# A2S Institute Docker Images | ||
|
||
# a2s-institute docker images | ||
Our stacks provide GPU-enabled Jupyter Notebook in Docker containers, which can also run on Kubernetes. The images are based on [Jupyter docker-stacks jupyter/pytorch-notebook](https://github.com/jupyter/docker-stacks/tree/main/images/pytorch-notebook). All images are published on our [ghcr.io](https://github.com/orgs/a2s-institute/packages) and [quay.io](https://quay.io/user/a2s-institute/). | ||
|
||
Our stacks provide GPU-enabled Jupyter Notebook in Docker containers, which can also be run on Kubernetes. The image is based on [released cuda version](https://hub.docker.com/r/nvidia/cuda/tags?page=1&name=12.) on docker hub and the Jupyter stacks are based on [jupyter/docker-stacks](https://github.com/jupyter/docker-stacks/). All images are published on our [github registry](https://github.com/orgs/a2s-institute/packages). | ||
The stacks contain several machine learning packages such as TensorFlow, PyTorch, scikit-learn, and other machine learning tools. All images also include VSCode and xfce4 desktop environment. | ||
|
||
The stacks contain several machine learning packages such as TensorFlow, PyTorch, scikit-learn, and other machine learning tools. | ||
## Docker stack structure | ||
* [gpu-base-notebook](https://github.com/a2s-institute/docker-stacks/tree/master/base-gpu-notebook): contains Jupyter related libraries and also includes different cuda and pytorch versions. It also has VSCode and xfce4 desktop environment. | ||
* [ml-notebook](https://github.com/a2s-institute/docker-stacks/tree/master/ml-notebook): depends on `gpu-base-notebook` and includes several machine learning libaries such as TensorfLow, Keras, scipy, opencv, etc. | ||
* [nlp-notebook](https://github.com/a2s-institute/docker-stacks/tree/master/nlp-notebook): depends on `ml-notebook` and includes NLP libraries such as spaCy, NLTK, llama-cpp-python and wikipedia-api. | ||
|
||
## Building and running gpu-notebook in a local Docker container | ||
## Avilable versions | ||
* `gpu-base-notebook:cuda11-pytorch-2.2.2` | ||
* `gpu-base-notebook:cuda12-pytorch-2.2.2` | ||
* `ml-notebook:cuda11-pytorch-2.2.2` | ||
* `ml-notebook:cuda12-pytorch-2.2.2` | ||
* `nlp-notebook:cuda11-pytorch-2.2.2` | ||
* `nlp-notebook:cuda12-pytorch-2.2.2` | ||
|
||
<details> | ||
<summary><font color=blue> Older images</font></summary> | ||
|
||
- `ghcr.io/a2s-institute/docker-stacks/gpu-notebook:cuda11.3.1-ubuntu22.04` (no vscode and xfce desktop) | ||
- `ghcr.io/a2s-institute/docker-stacks/gpu-notebook:cuda11.8.0-ubuntu22.04` (no vscode and xfce desktop) | ||
- `ghcr.io/a2s-institute/docker-stacks/gpu-notebook:cuda12.1.0-ubuntu22.04` (no vscode and xfce desktop) | ||
- `ghcr.io/a2s-institute/docker-stacks/gpu-notebook:cuda12.1.0-ubuntu22.04` (no vscode and xfce desktop) | ||
|
||
</details> | ||
|
||
## Building and running A2S images locally | ||
|
||
The base image contains several packages for deep learning projects with NVidia GPU support. | ||
|
||
* Build notebook image with gpu support | ||
``` | ||
bash build_and_publish.sh --registry ghcr.io --publish "" --cuda-version cuda11.8.0-ubuntu22.04 | ||
``` | ||
# cuda11 and pytorch 2.2.2 | ||
bash build_and_publish.sh --registry ghcr.io --publish "" \ | ||
--image gpu-base-notebook --tag cuda11-pytorch-2.2.2 | ||
You can build this image using different cuda versions available [here](https://hub.docker.com/r/nvidia/cuda/tags). | ||
# cuda12 and pytorch 2.2.2 | ||
bash build_and_publish.sh --registry ghcr.io --publish "" \ | ||
--image gpu-base-notebook --tag cuda12-pytorch-2.2.2 | ||
``` | ||
|
||
* Run the image locally | ||
``` | ||
docker run --gpus all --name gpu-notebook -it --rm -d -p 8880:8888 ghcr.io/b-it-bots/docker/gpu-notebook:cuda11.8.0-ubuntu22.04 | ||
# with GPU | ||
docker run --gpus all --name ml-notebook -it --rm -d -p 8888:8888 \ | ||
quay.io/ml-notebook:cuda12-pytorch-2.2.2 | ||
# without GPU | ||
docker run --name ml-notebook -it --rm -d -p 8888:8888 \ | ||
quay.io/ml-notebook:cuda12-pytorch-2.2.2 | ||
``` | ||
|
||
* Login to the container | ||
* Check Jupyter Notebook token via log and open the link | ||
``` | ||
docker exec -ti gpu-notebook bash | ||
docker logs --follow ml-notebook | ||
# check nvidia | ||
nvidia-smi | ||
``` | ||
|
||
## Available images | ||
|
||
* `cuda11.3.1-ubuntu20.04` (python=3.10, pytorch=1.12.1) | ||
* `cuda11.8.9-ubuntu22.04` (python=3.11, pytorch=2.0.0) | ||
|
||
## Monitoring | ||
|
||
You can monitor the GPU usage using nvtop | ||
|
||
![nvtop gpu monitoring](figures/nvtop.png) | ||
<img src="figures/nvtop.png" alt="nvtop gpu monitoring" width="640"> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,10 +7,10 @@ LABEL maintainer="Mohammad Wasil <[email protected]>" | |
USER root | ||
|
||
# Install apt packages | ||
|
||
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ | ||
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list | ||
|
||
RUN apt update -y && \ | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ | ||
"deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \ | ||
apt install -y edgetpu-compiler && \ | ||
apt install -y libxkbcommon0 libxkbcommon-x11-0 && \ | ||
apt install -y build-essential && \ | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,9 +7,10 @@ LABEL maintainer="Mohammad Wasil <[email protected]>" | |
USER root | ||
|
||
# Install apt packages | ||
RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | sudo apt-key add - && \ | ||
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | sudo tee /etc/apt/sources.list.d/coral-edgetpu.list | ||
|
||
RUN apt update -y && \ | ||
curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key add - && \ | ||
echo "deb https://packages.cloud.google.com/apt coral-edgetpu-stable main" | tee /etc/apt/sources.list.d/coral-edgetpu.list && \ | ||
apt install -y edgetpu-compiler && \ | ||
apt install -y libxkbcommon0 libxkbcommon-x11-0 && \ | ||
apt install -y build-essential && \ | ||
|