Skip to content

Commit

Permalink
bump
Browse files Browse the repository at this point in the history
  • Loading branch information
odulcy-mindee committed Nov 15, 2024
1 parent 01a0a5c commit 638d4f4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 47 deletions.
5 changes: 1 addition & 4 deletions .github/workflows/public_docker_images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ jobs:
# Must match version at https://www.python.org/ftp/python/
python: ["3.9.18", "3.10.13", "3.11.8"]
framework: ["tf", "torch", "tf,viz,html,contrib", "torch,viz,html,contrib"]
system: ["cpu", "gpu"]

# Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
permissions:
Expand All @@ -44,7 +43,7 @@ jobs:

- name: Sanitize docker tag
run:
PREFIX_DOCKER_TAG="${{ matrix.framework }}-py${{ matrix.python }}-${{ matrix.system }}-"
PREFIX_DOCKER_TAG="${{ matrix.framework }}-py${{ matrix.python }}-"
PREFIX_DOCKER_TAG=$(echo PREFIX_DOCKER_TAG|sed 's/,/-/g')
echo PREFIX_DOCKER_TAG=${PREFIX_DOCKER_TAG} >> $GITHUB_ENV

Expand All @@ -67,7 +66,6 @@ jobs:
build-args: |
FRAMEWORK=${{ matrix.framework }}
PYTHON_VERSION=${{ matrix.python }}
SYSTEM=${{ matrix.system }}
DOCTR_REPO=${{ github.repository }}
DOCTR_VERSION=${{ github.sha }}
push: false # push only if `import doctr` works
Expand All @@ -85,7 +83,6 @@ jobs:
build-args: |
FRAMEWORK=${{ matrix.framework }}
PYTHON_VERSION=${{ matrix.python }}
SYSTEM=${{ matrix.system }}
DOCTR_REPO=${{ github.repository }}
DOCTR_VERSION=${{ github.sha }}
push: true
Expand Down
33 changes: 2 additions & 31 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,38 +1,10 @@
FROM ubuntu:22.04
FROM nvidia/cuda:12.2.0-base-ubuntu22.04

ENV DEBIAN_FRONTEND=noninteractive
ENV LANG=C.UTF-8
ENV PYTHONUNBUFFERED=1
ENV PYTHONDONTWRITEBYTECODE=1

ARG SYSTEM=gpu

# Enroll NVIDIA GPG public key and install CUDA
RUN if [ "$SYSTEM" = "gpu" ]; then \
apt-get update && \
apt-get install -y gnupg ca-certificates wget && \
# - Install Nvidia repo keys
# - See: https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#network-repo-installation-for-ubuntu
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2204/x86_64/cuda-keyring_1.1-1_all.deb && \
dpkg -i cuda-keyring_1.1-1_all.deb && \
apt-get update && apt-get install -y --no-install-recommends \
cuda-command-line-tools-12-3 \
cuda-cudart-dev-12-3 \
cuda-nvcc-12-3 \
cuda-cupti-12-3 \
cuda-nvprune-12-3 \
cuda-libraries-12-3 \
cuda-nvrtc-12-3 \
libcufft-12-3 \
libcurand-12-3 \
libcusolver-12-3 \
libcusparse-12-3 \
libcublas-12-3 \
# - CuDNN: https://docs.nvidia.com/deeplearning/sdk/cudnn-install/index.html#ubuntu-network-installation
libcudnn8=8.9.6.50-1+cuda12.2 \
libnvinfer-plugin8=8.6.1.6-1+cuda12.0 \
libnvinfer8=8.6.1.6-1+cuda12.0; \
fi

RUN apt-get update && apt-get install -y --no-install-recommends \
# - Other packages
Expand All @@ -48,8 +20,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
# - Packages for docTR
libgl1-mesa-dev libsm6 libxext6 libxrender-dev libpangocairo-1.0-0 \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/* \
fi
&& rm -rf /var/lib/apt/lists/*

# Install Python
ARG PYTHON_VERSION=3.10.13
Expand Down
19 changes: 9 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -258,34 +258,33 @@ We offer Docker container support for easy testing and deployment. [Here are the

#### Using GPU with docTR Docker Images

The docTR Docker images are GPU-ready and based on CUDA `12.3`.
However, to use GPU support with these Docker images, please ensure that Docker is configured to use your GPU.
The docTR Docker images are GPU-ready and based on CUDA `12.2`.
Please ensure that Docker is configured to use your GPU.

To verify and configure GPU support for Docker, please follow the instructions provided in the [NVIDIA Container Toolkit Installation Guide](https://docs.nvidia.com/datacenter/cloud-native/container-toolkit/latest/install-guide.html).

Once Docker is configured to use GPUs, you can run docTR Docker containers with GPU support:

```shell
docker run -it --gpus all ghcr.io/mindee/doctr:tf-py3.8.18-gpu-2023-09 bash
docker run -it --gpus all ghcr.io/mindee/doctr:torch-py3.9.18-2024-10 bash
```

#### Available Tags

The Docker images for docTR follow a specific tag nomenclature: `<framework>-py<python_version>-<system>-<doctr_version|YYYY-MM>`. Here's a breakdown of the tag structure:
The Docker images for docTR follow a specific tag nomenclature: `<deps>-py<python_version>-<doctr_version|YYYY-MM>`. Here's a breakdown of the tag structure:

- `<framework>`: `tf` (TensorFlow) or `torch` (PyTorch).
- `<deps>`: `tf`, `torch`, `tf-viz-html-contrib` or `torch-viz-html-contrib`.
- `<python_version>`: `3.9.18`, `3.10.13` or `3.11.8`.
- `<system>`: `cpu` or `gpu`
- `<doctr_version>`: a tag >= `v0.7.1`
- `<doctr_version>`: a tag >= `v0.11.0`
- `<YYYY-MM>`: e.g. `2014-10`

Here are examples of different image tags:

| Tag | Description |
|----------------------------|---------------------------------------------------|
| `tf-py3.8.18-cpu-v0.7.1` | TensorFlow version `3.8.18` with docTR `v0.7.1`. |
| `tf-py3.11.8-cpu-2024-10` | TensorFlow version `3.11.8` with docTR from latest commit on `main` in `2024-10`. |
| `torch-py3.11.8-gpu-2024-10`| PyTorch version `3.11.8` with GPU support from latest commit on `main` in `2024-10`. |
| `tf-py3.10.13-v0.11.0` | TensorFlow version `3.10.13` with docTR `v0.11.0`. |
| `torch-viz-html-contrib-py3.11.8-2024-10` | Torch with extra dependencies version `3.11.8` from latest commit on `main` in `2024-10`. |
| `torch-py3.11.8-2024-10`| PyTorch version `3.11.8` from latest commit on `main` in `2024-10`. |

#### Building Docker Images Locally

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ dependencies = [
[project.optional-dependencies]
tf = [
# cf. https://github.com/mindee/doctr/pull/1461
"tensorflow>=2.15.0,<3.0.0",
"tensorflow[and-cuda]>=2.15.0,<3.0.0",
"tf-keras>=2.15.0,<3.0.0", # Keep keras 2 compatibility
"tf2onnx>=1.16.0,<2.0.0", # cf. https://github.com/onnx/tensorflow-onnx/releases/tag/v1.16.0
]
Expand Down Expand Up @@ -97,7 +97,7 @@ docs = [
dev = [
# Tensorflow
# cf. https://github.com/mindee/doctr/pull/1461
"tensorflow>=2.15.0,<3.0.0",
"tensorflow[and-cuda]>=2.15.0,<3.0.0",
"tf-keras>=2.15.0,<3.0.0", # Keep keras 2 compatibility
"tf2onnx>=1.16.0,<2.0.0", # cf. https://github.com/onnx/tensorflow-onnx/releases/tag/v1.16.0
# PyTorch
Expand Down

0 comments on commit 638d4f4

Please sign in to comment.