From 36185f770317706a1b8ff14490efca65ec21dc23 Mon Sep 17 00:00:00 2001 From: Olivier Dulcy Date: Fri, 15 Nov 2024 14:17:27 +0100 Subject: [PATCH] bump --- .github/workflows/public_docker_images.yml | 5 +--- Dockerfile | 33 ++-------------------- README.md | 19 ++++++------- pyproject.toml | 4 +-- 4 files changed, 14 insertions(+), 47 deletions(-) diff --git a/.github/workflows/public_docker_images.yml b/.github/workflows/public_docker_images.yml index 2b29a4b661..66a7322886 100644 --- a/.github/workflows/public_docker_images.yml +++ b/.github/workflows/public_docker_images.yml @@ -24,7 +24,6 @@ jobs: # Must match version at https://www.python.org/ftp/python/ python: ["3.10.13", "3.11.8", "3.12.7"] 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: @@ -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 @@ -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 @@ -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 diff --git a/Dockerfile b/Dockerfile index 3f9fea8aba..fd89c849f8 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 @@ -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 diff --git a/README.md b/README.md index a7805448d0..c735f8789f 100644 --- a/README.md +++ b/README.md @@ -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: `-py--`. Here's a breakdown of the tag structure: +The Docker images for docTR follow a specific tag nomenclature: `-py-`. Here's a breakdown of the tag structure: -- ``: `tf` (TensorFlow) or `torch` (PyTorch). +- ``: `tf`, `torch`, `tf-viz-html-contrib` or `torch-viz-html-contrib`. - ``: `3.9.18`, `3.10.13` or `3.11.8`. -- ``: `cpu` or `gpu` -- ``: a tag >= `v0.7.1` +- ``: a tag >= `v0.11.0` - ``: 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 diff --git a/pyproject.toml b/pyproject.toml index 763e966187..3be3ca8700 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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 ] @@ -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