From 6ded1869a9404ce7c1a8993789f4da148acd511b Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 24 Feb 2025 11:49:15 +0100 Subject: [PATCH 01/25] bump: update Ubuntu & drop python 2.x --- .github/workflows/docker-builds.yml | 39 ++++++++--------------------- .pre-commit-config.yaml | 2 +- README.md | 6 ++--- cpu/Dockerfile | 10 +++----- gpu/Dockerfile | 9 +++---- 5 files changed, 21 insertions(+), 45 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index 6e8ed18..f701393 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -17,37 +17,20 @@ jobs: strategy: fail-fast: false matrix: - ubuntu_version: ["20.04"] - python_version: ["2.7", "3.6", "3.7", "3.8", "3.9"] + ubuntu_version: ["22.04"] + python_version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] opencv_version: ["4.10.0"] device: ["cpu", "gpu"] - cuda_version: ["11.8.0"] + cuda_version: ["12.4.1"] include: - - { ubuntu_version: "22.04", python_version: "3.10", opencv_version: "4.10.0", device: "cpu" } - - { ubuntu_version: "22.04", python_version: "3.11", opencv_version: "4.10.0", device: "cpu" } - # fixme: python 3.12 install fails due to wring public keys to deadsnakes - # - { ubuntu_version: "22.04", python_version: "3.12", opencv_version: "4.10.0", device: "cpu" } - - { - ubuntu_version: "22.04", - python_version: "3.10", - opencv_version: "4.10.0", - device: "gpu", - cuda_version: "12.5.0", - } - - { - ubuntu_version: "22.04", - python_version: "3.11", - opencv_version: "4.10.0", - device: "gpu", - cuda_version: "12.5.0", - } - - { - ubuntu_version: "22.04", - python_version: "3.12", - opencv_version: "4.10.0", - device: "gpu", - cuda_version: "12.5.0", - } + - { ubuntu_version: "24.04", python_version: "3.10", opencv_version: "4.10.0", device: "cpu" } + - { ubuntu_version: "24.04", python_version: "3.11", opencv_version: "4.10.0", device: "cpu" } + - { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "cpu" } + - { ubuntu_version: "24.04", python_version: "3.13", opencv_version: "4.10.0", device: "cpu" } + - { ubuntu_version: "24.04", python_version: "3.10", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } + - { ubuntu_version: "24.04", python_version: "3.11", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } + - { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } + - { ubuntu_version: "24.04", python_version: "3.13", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } steps: - name: Checkout uses: actions/checkout@v4 diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index e3f343b..92d778a 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -41,4 +41,4 @@ repos: - id: prettier files: \.(json|yml|yaml|toml) # https://prettier.io/docs/en/options.html#print-width - args: ["--print-width=120"] + args: ["--print-width=140"] diff --git a/README.md b/README.md index 4a09b32..d59fa75 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,11 @@ # Docker: Python-OpenCV-FFmpeg(-CUDA) -Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python2/3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 22.04 LTS. +Repository for clean Dockerfile containing [FFmpeg](https://www.ffmpeg.org/), [OpenCV4](https://opencv.org/) and [Python3](https://www.python.org/), based on [Ubuntu](https://www.ubuntu.com/) 24.04 LTS. ## Tags -- `:cpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.10.x, FFmpeg -- `:gpu-pyX.y-cvX.y.z` for Python 2.x/3.x, OpenCV 4.10.x, FFmpeg with CUDA 11.4 support +- `:cpu-pyX.y-cvX.y.z` for Python 3.x, OpenCV 4.10.x, FFmpeg +- `:gpu-pyX.y-cvX.y.z` for Python 3.x, OpenCV 4.10.x, FFmpeg with CUDA 12.x support ## Build diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 3ae91fd..277a517 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -21,7 +21,7 @@ RUN \ # add sources for older pythons apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.12)$ ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(3.7|3.12)$ ]]; then \ add-apt-repository ppa:deadsnakes/ppa ; \ fi && \ apt-add-repository universe && \ @@ -41,12 +41,8 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" || "$PYTHON_VERSION" == "3.7" ]]; then \ - PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py" ; \ - else \ - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ - PIP_URL="https://bootstrap.pypa.io/get-pip.py" ; \ - fi && \ + apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ + PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 6243e78..9d67ccc 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,7 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(2.7|3.6|3.7|3.12)$ ]]; then \ + if [[ "$PYTHON_VERSION" =~ ^(3.7|3.12)$ ]]; then \ add-apt-repository ppa:deadsnakes/ppa ; \ fi && \ apt-add-repository universe && \ @@ -47,11 +47,8 @@ RUN \ # install python dependencies # sysctl -w net.ipv4.ip_forward=1 ; \ - if [[ "$PYTHON_VERSION" == "2.7" || "$PYTHON_VERSION" == "3.6" || "$PYTHON_VERSION" == "3.7" ]]; then \ - PIP_URL="https://bootstrap.pypa.io/pip/$PYTHON_VERSION/get-pip.py" ; \ - else \ - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils ; \ - PIP_URL="https://bootstrap.pypa.io/get-pip.py" ; \ + apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ + PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ fi && \ curl $PIP_URL | python From 899dd6cf502b189744cdf491e34c7450239237a9 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Mon, 24 Feb 2025 12:03:37 +0100 Subject: [PATCH 02/25] update --- cpu/Dockerfile | 9 +++------ gpu/Dockerfile | 11 ++++------- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 277a517..d4787f1 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -21,9 +21,7 @@ RUN \ # add sources for older pythons apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(3.7|3.12)$ ]]; then \ - add-apt-repository ppa:deadsnakes/ppa ; \ - fi && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ @@ -54,7 +52,6 @@ RUN \ unzip \ cmake \ ffmpeg \ - $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ @@ -110,8 +107,8 @@ RUN \ -D BUILD_TESTS=OFF \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \ - -D BUILD_opencv_python3=$( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "ON" || echo "OFF" ) \ - -D BUILD_opencv_python2=$( [ ${PYTHON_VERSION%%.*} -lt 3 ] && echo "ON" || echo "OFF" ) \ + -D BUILD_opencv_python3=ON \ + -D BUILD_opencv_python2=OFF \ -D PYTHON${PYTHON_VERSION%%.*}_EXECUTABLE=$(which python${PYTHON_VERSION}) \ -D PYTHON_DEFAULT_EXECUTABLE=$(which python${PYTHON_VERSION}) \ -D BUILD_EXAMPLES=OFF \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 9d67ccc..f064c41 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,15 +27,13 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - if [[ "$PYTHON_VERSION" =~ ^(3.7|3.12)$ ]]; then \ - add-apt-repository ppa:deadsnakes/ppa ; \ - fi && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ - $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ + python${PYTHON_VERSION}-distutils \ curl \ wget \ && \ @@ -67,7 +65,6 @@ RUN \ unzip \ cmake \ ffmpeg \ - $( [ "$UBUNTU_VERSION" = "20.04" ] && libtbb2 || libtbb12 ) \ gfortran \ apt-utils \ pkg-config \ @@ -123,8 +120,8 @@ RUN \ -D BUILD_TESTS=OFF \ -D CMAKE_INSTALL_PREFIX=/usr/local \ -D OPENCV_EXTRA_MODULES_PATH=/opencv_contrib/modules \ - -D BUILD_opencv_python3=$( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "ON" || echo "OFF" ) \ - -D BUILD_opencv_python2=$( [ ${PYTHON_VERSION%%.*} -lt 3 ] && echo "ON" || echo "OFF" ) \ + -D BUILD_opencv_python3=ON \ + -D BUILD_opencv_python2=OFF \ -D PYTHON${PYTHON_VERSION%%.*}_EXECUTABLE=$(which python${PYTHON_VERSION}) \ -D PYTHON_DEFAULT_EXECUTABLE=$(which python${PYTHON_VERSION}) \ -D BUILD_EXAMPLES=OFF \ From f57c9fe2fab6c4e5e8f16997af0c2c1e42f1871c Mon Sep 17 00:00:00 2001 From: Jirka B Date: Tue, 11 Mar 2025 14:20:06 +0100 Subject: [PATCH 03/25] deadsnakes --- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index d4787f1..4aef2f0 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -21,7 +21,7 @@ RUN \ # add sources for older pythons apt-get update -q --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa && \ + # add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index f064c41..d9d4335 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -27,7 +27,7 @@ RUN \ # add sources for older pythons apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - add-apt-repository ppa:deadsnakes/ppa && \ + # add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ From 1ece63517021d6db035b3e4f0f59eecbcca00e33 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 14:12:01 +0100 Subject: [PATCH 04/25] update --- cpu/Dockerfile | 14 +++++++------- gpu/Dockerfile | 11 +++++------ 2 files changed, 12 insertions(+), 13 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 4aef2f0..96b914a 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -27,7 +27,7 @@ RUN \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ - $( [ ${PYTHON_VERSION%%.*} -ge 3 ] && echo "python${PYTHON_VERSION}-distutils" ) \ + python${PYTHON_VERSION}-distutils \ curl \ wget \ && \ @@ -86,17 +86,17 @@ RUN \ && \ pip install numpy && \ -# Install OpenCV + # Install OpenCV wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv.zip && \ - mv /opencv-${OPENCV_VERSION} /opencv && \ + mv /opencv-$OPENCV_VERSION /opencv && \ rm opencv.zip && \ wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv_contrib.zip && \ - mv /opencv_contrib-${OPENCV_VERSION} /opencv_contrib && \ + mv /opencv_contrib-$OPENCV_VERSION /opencv_contrib && \ rm opencv_contrib.zip && \ -# Prepare build + # Prepare build mkdir /opencv/build && \ cd /opencv/build && \ cmake \ @@ -126,13 +126,13 @@ RUN \ .. \ && \ -# Build, Test and Install + # Build, Test and Install cd /opencv/build && \ make -j$(nproc) && \ make install && \ ldconfig && \ -# cleaning + # cleaning apt-get -y remove \ unzip \ cmake \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index d9d4335..5c75e7c 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -47,7 +47,6 @@ RUN \ # sysctl -w net.ipv4.ip_forward=1 ; \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - fi && \ curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" @@ -59,7 +58,7 @@ RUN \ echo "$CUDA_PATH/compat" >> /etc/ld.so.conf.d/${CUDA/./-}.conf && \ ldconfig && \ -# Install all dependencies for OpenCV + # Install all dependencies for OpenCV apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ unzip \ @@ -99,7 +98,7 @@ RUN \ && \ pip install numpy && \ -# Install OpenCV + # Install OpenCV wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip -O opencv.zip --progress=bar:force:noscroll && \ unzip -q opencv.zip && \ mv /opencv-$OPENCV_VERSION /opencv && \ @@ -109,7 +108,7 @@ RUN \ mv /opencv_contrib-$OPENCV_VERSION /opencv_contrib && \ rm opencv_contrib.zip && \ -# Prepare build + # Prepare build mkdir /opencv/build && \ cd /opencv/build && \ cmake \ @@ -150,13 +149,13 @@ RUN \ .. \ && \ -# Build, Test and Install + # Build, Test and Install cd /opencv/build && \ make -j$(nproc) && \ make install && \ ldconfig && \ -# cleaning + # cleaning apt-get -y remove \ unzip \ cmake \ From 62bc1062062e22cbad23cde276bf9cc96c8b98d5 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 14:44:21 +0100 Subject: [PATCH 05/25] ppa:deadsnakes/ppa --- cpu/Dockerfile | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 96b914a..492aff4 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -19,9 +19,9 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ # add sources for older pythons - apt-get update -q --fix-missing && \ + apt-get update -qq --fix-missing && \ apt-get install -y --no-install-recommends software-properties-common && \ - # add-apt-repository ppa:deadsnakes/ppa && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ @@ -32,13 +32,10 @@ RUN \ wget \ && \ rm -rf /var/lib/apt/lists/* && \ - # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python dependencies - # sysctl -w net.ipv4.ip_forward=1 ; \ apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ curl $PIP_URL | python From 0b9c0c1e27e506f5db55e7ee84550c96e00e6cdc Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 14:51:02 +0100 Subject: [PATCH 06/25] update --- cpu/Dockerfile | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 492aff4..d877b4a 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -18,9 +18,11 @@ ENV DEBIAN_FRONTEND=noninteractive \ RUN \ - # add sources for older pythons apt-get update -qq --fix-missing && \ - apt-get install -y --no-install-recommends software-properties-common && \ + apt-get install -y --no-install-recommends \ + software-properties-common \ + dirmngr \ + gnupg && \ add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ @@ -29,8 +31,7 @@ RUN \ python${PYTHON_VERSION}-dev \ python${PYTHON_VERSION}-distutils \ curl \ - wget \ - && \ + wget && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ From 72d9f3bc395b132dd38fdb5e6b10c2ac58e5b2d3 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:00:25 +0100 Subject: [PATCH 07/25] update --- gpu/Dockerfile | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 5c75e7c..941d79f 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -24,10 +24,12 @@ ENV DEBIAN_FRONTEND=noninteractive \ # ENV LD_LIBRARY_PATH /usr/local/${CUDA}/compat:$LD_LIBRARY_PATH RUN \ - # add sources for older pythons apt-get update -qq --fix-missing && \ - apt-get install -y --no-install-recommends software-properties-common && \ - # add-apt-repository ppa:deadsnakes/ppa && \ + apt-get install -y --no-install-recommends \ + software-properties-common \ + dirmngr \ + gnupg && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ @@ -35,8 +37,7 @@ RUN \ python${PYTHON_VERSION}-dev \ python${PYTHON_VERSION}-distutils \ curl \ - wget \ - && \ + wget && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages From db50708200c6015c772114a570b4557068b6f48a Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:07:16 +0100 Subject: [PATCH 08/25] distutils --- cpu/Dockerfile | 1 - gpu/Dockerfile | 1 - 2 files changed, 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index d877b4a..bd08f0f 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -29,7 +29,6 @@ RUN \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-distutils \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 941d79f..c718a4f 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -35,7 +35,6 @@ RUN \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ - python${PYTHON_VERSION}-distutils \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ From efbdf799c6711f803b5bee959ec450988ad227c3 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:14:08 +0100 Subject: [PATCH 09/25] update --- cpu/Dockerfile | 17 +++++------------ 1 file changed, 5 insertions(+), 12 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index bd08f0f..1ae5775 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -79,20 +79,17 @@ RUN \ zlib1g-dev \ libsm6 \ libxext6 \ - libxrender1 \ - && \ + libxrender1 && \ pip install numpy && \ - # Install OpenCV wget https://github.com/opencv/opencv/archive/${OPENCV_VERSION}.zip -O opencv.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv.zip && \ - mv /opencv-$OPENCV_VERSION /opencv && \ + mv opencv-${OPENCV_VERSION} /opencv && \ rm opencv.zip && \ wget https://github.com/opencv/opencv_contrib/archive/${OPENCV_VERSION}.zip -O opencv_contrib.zip --progress=bar:force:noscroll --no-check-certificate && \ unzip -q opencv_contrib.zip && \ - mv /opencv_contrib-$OPENCV_VERSION /opencv_contrib && \ + mv opencv_contrib-${OPENCV_VERSION} /opencv_contrib && \ rm opencv_contrib.zip && \ - # Prepare build mkdir /opencv/build && \ cd /opencv/build && \ @@ -120,15 +117,12 @@ RUN \ -D WITH_LAPACK=ON \ #-D WITH_HPX=ON \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ - .. \ - && \ - + .. && \ # Build, Test and Install cd /opencv/build && \ make -j$(nproc) && \ make install && \ ldconfig && \ - # cleaning apt-get -y remove \ unzip \ @@ -155,8 +149,7 @@ RUN \ libglew-dev \ libpostproc-dev \ libeigen3-dev \ - zlib1g-dev \ - && \ + zlib1g-dev && \ apt-get autoremove -y && \ apt-get clean && \ rm -rf /opencv /opencv_contrib /var/lib/apt/lists/* From 7b8173910c05342e14b0257575a5ca727ca8b9cc Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:19:21 +0100 Subject: [PATCH 10/25] update --- cpu/Dockerfile | 1 - gpu/Dockerfile | 2 -- 2 files changed, 3 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 1ae5775..7dee4c4 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -36,7 +36,6 @@ RUN \ update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ curl $PIP_URL | python diff --git a/gpu/Dockerfile b/gpu/Dockerfile index c718a4f..4dcab54 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -44,8 +44,6 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies - # sysctl -w net.ipv4.ip_forward=1 ; \ - apt-get -y install --no-install-recommends python${PYTHON_VERSION}-distutils && \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ curl $PIP_URL | python From 75ef97b76ce46a5a86a003095a02b9a8673e23d5 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:30:00 +0100 Subject: [PATCH 11/25] distutils --- cpu/Dockerfile | 1 + gpu/Dockerfile | 1 + 2 files changed, 2 insertions(+) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 7dee4c4..1300e2b 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -29,6 +29,7 @@ RUN \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ + $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 4dcab54..adde14b 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -35,6 +35,7 @@ RUN \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ + $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ From 4addd29667d8fabea6f43af64ccbca8949662cff Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:32:35 +0100 Subject: [PATCH 12/25] libopenblas-dev --- gpu/Dockerfile | 2 -- 1 file changed, 2 deletions(-) diff --git a/gpu/Dockerfile b/gpu/Dockerfile index adde14b..c2cd123 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -70,7 +70,6 @@ RUN \ qtbase5-dev qt5-qmake \ build-essential \ libopenblas-base \ - libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ libavcodec-dev \ @@ -163,7 +162,6 @@ RUN \ pkg-config \ checkinstall \ build-essential \ - libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ libavcodec-dev \ From 8821dc606d3f2e9d79047dfe3ca7f57b97786881 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 15:35:16 +0100 Subject: [PATCH 13/25] libopenblas --- cpu/Dockerfile | 3 --- gpu/Dockerfile | 3 +-- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 1300e2b..39286b1 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -55,8 +55,6 @@ RUN \ checkinstall \ qtbase5-dev qt5-qmake \ build-essential \ - libopenblas-base \ - libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ libavcodec-dev \ @@ -132,7 +130,6 @@ RUN \ pkg-config \ checkinstall \ build-essential \ - libopenblas-dev \ liblapack-dev \ libatlas-base-dev \ libavcodec-dev \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index c2cd123..1960fcb 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -69,7 +69,6 @@ RUN \ checkinstall \ qtbase5-dev qt5-qmake \ build-essential \ - libopenblas-base \ liblapack-dev \ libatlas-base-dev \ libavcodec-dev \ @@ -139,7 +138,7 @@ RUN \ # https://stackoverflow.com/questions/28010399/build-opencv-with-cuda-support -D CUDA_ARCH_BIN="5.3 6.1 7.0 7.5" \ -D CUDA_ARCH_PTX="" \ - -D WITH_CUBLAS=ON \ + #-D WITH_CUBLAS=ON \ -D WITH_NVCUVID=ON \ -D ENABLE_FAST_MATH=1 \ -D CUDA_FAST_MATH=1 \ From e8b9043a9eac2421382eb187a874dbaf78a54716 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 16:17:55 +0100 Subject: [PATCH 14/25] full --- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 39286b1..10434fe 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -28,7 +28,7 @@ RUN \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ + python${PYTHON_VERSION}-full \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 1960fcb..1ee4d35 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -34,7 +34,7 @@ RUN \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-dev \ + python${PYTHON_VERSION}-full \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ From 0c264864050b5263cab881e010947fbf74b9cb03 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 16:23:55 +0100 Subject: [PATCH 15/25] Revert "full" This reverts commit e8b9043a9eac2421382eb187a874dbaf78a54716. --- cpu/Dockerfile | 2 +- gpu/Dockerfile | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 10434fe..39286b1 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -28,7 +28,7 @@ RUN \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-full \ + python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 1ee4d35..1960fcb 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -34,7 +34,7 @@ RUN \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ python${PYTHON_VERSION} \ - python${PYTHON_VERSION}-full \ + python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ curl \ wget && \ From c94adf78e596d2c96b46bed4794bf47e72e7026e Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 16:33:38 +0100 Subject: [PATCH 16/25] ppa:deadsnakes/ppa --- cpu/Dockerfile | 4 +++- gpu/Dockerfile | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 39286b1..65bd915 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -23,7 +23,9 @@ RUN \ software-properties-common \ dirmngr \ gnupg && \ - add-apt-repository ppa:deadsnakes/ppa && \ + if [[ "${PYTHON_VERSION%%.*}" -eq 3 && "${PYTHON_VERSION#*.}" -lt 10 ]]; then \ + add-apt-repository ppa:deadsnakes/ppa ; \ + fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 1960fcb..da7a9f1 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -29,7 +29,9 @@ RUN \ software-properties-common \ dirmngr \ gnupg && \ - add-apt-repository ppa:deadsnakes/ppa && \ + if [[ "${PYTHON_VERSION%%.*}" -eq 3 && "${PYTHON_VERSION#*.}" -lt 10 ]]; then \ + add-apt-repository ppa:deadsnakes/ppa ; \ + fi && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ From ffece67f4c65b7522b769dbce0b23586f1aa0167 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 17:17:59 +0100 Subject: [PATCH 17/25] Revert "ppa:deadsnakes/ppa" This reverts commit c94adf78e596d2c96b46bed4794bf47e72e7026e. --- cpu/Dockerfile | 4 +--- gpu/Dockerfile | 4 +--- 2 files changed, 2 insertions(+), 6 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 65bd915..39286b1 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -23,9 +23,7 @@ RUN \ software-properties-common \ dirmngr \ gnupg && \ - if [[ "${PYTHON_VERSION%%.*}" -eq 3 && "${PYTHON_VERSION#*.}" -lt 10 ]]; then \ - add-apt-repository ppa:deadsnakes/ppa ; \ - fi && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ diff --git a/gpu/Dockerfile b/gpu/Dockerfile index da7a9f1..1960fcb 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -29,9 +29,7 @@ RUN \ software-properties-common \ dirmngr \ gnupg && \ - if [[ "${PYTHON_VERSION%%.*}" -eq 3 && "${PYTHON_VERSION#*.}" -lt 10 ]]; then \ - add-apt-repository ppa:deadsnakes/ppa ; \ - fi && \ + add-apt-repository ppa:deadsnakes/ppa && \ apt-add-repository universe && \ apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ From eb07bbfc151ec4bfbb3e1e89e1e34b8792f755f1 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:20:54 +0100 Subject: [PATCH 18/25] python${PYTHON_VERSION}-pip --- cpu/Dockerfile | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 39286b1..c2772c9 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -30,15 +30,13 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ + python${PYTHON_VERSION}-pip \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python dependencies - PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - curl $PIP_URL | python + update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From a1863ccc3edfd7fa759183799bfec2f050f51cd6 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:26:45 +0100 Subject: [PATCH 19/25] Revert "python${PYTHON_VERSION}-pip" This reverts commit eb07bbfc151ec4bfbb3e1e89e1e34b8792f755f1. --- cpu/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index c2772c9..39286b1 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -30,13 +30,15 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ - python${PYTHON_VERSION}-pip \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ - update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 + update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ + # install python dependencies + PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ + curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From 3f732596f94790c287a241f34383a6217c95a70d Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:33:55 +0100 Subject: [PATCH 20/25] ensurepip --- cpu/Dockerfile | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 39286b1..9c29892 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -36,9 +36,8 @@ RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python dependencies - PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - curl $PIP_URL | python + # install python ecosystem + python -m ensurepip --upgrade ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From 128e68ce54cf0fad6a52faa35956e0aed804463f Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:42:01 +0100 Subject: [PATCH 21/25] python3-pip --- cpu/Dockerfile | 6 ++++-- gpu/Dockerfile | 7 ------- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index 9c29892..e13d586 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -30,14 +30,16 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ + $( if [ "${PYTHON_VERSION}" -eq "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python ecosystem - python -m ensurepip --upgrade + # install python dependencies + PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ + curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 1960fcb..43e329e 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -39,11 +39,9 @@ RUN \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ - # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python dependencies PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ curl $PIP_URL | python @@ -56,7 +54,6 @@ RUN \ CUDA=`basename $CUDA_PATH` && \ echo "$CUDA_PATH/compat" >> /etc/ld.so.conf.d/${CUDA/./-}.conf && \ ldconfig && \ - # Install all dependencies for OpenCV apt-get -y update -qq --fix-missing && \ apt-get -y install --no-install-recommends \ @@ -94,7 +91,6 @@ RUN \ libxrender1 \ && \ pip install numpy && \ - # Install OpenCV wget https://github.com/opencv/opencv/archive/$OPENCV_VERSION.zip -O opencv.zip --progress=bar:force:noscroll && \ unzip -q opencv.zip && \ @@ -104,7 +100,6 @@ RUN \ unzip -q opencv_contrib.zip && \ mv /opencv_contrib-$OPENCV_VERSION /opencv_contrib && \ rm opencv_contrib.zip && \ - # Prepare build mkdir /opencv/build && \ cd /opencv/build && \ @@ -145,13 +140,11 @@ RUN \ -D ENABLE_PRECOMPILED_HEADERS=OFF \ .. \ && \ - # Build, Test and Install cd /opencv/build && \ make -j$(nproc) && \ make install && \ ldconfig && \ - # cleaning apt-get -y remove \ unzip \ From 56c1dd52b646a2471610c7f8a17e9b55c838dd21 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:49:09 +0100 Subject: [PATCH 22/25] pip --- cpu/Dockerfile | 6 ++++-- gpu/Dockerfile | 5 ++++- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index e13d586..b1a9f59 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -37,9 +37,11 @@ RUN \ # Set the default python and install PIP packages update-alternatives --install /usr/bin/python${PYTHON_VERSION%%.*} python${PYTHON_VERSION%%.*} /usr/bin/python${PYTHON_VERSION} 1 && \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ - # install python dependencies + # install python dependencies \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - curl $PIP_URL | python + if [ "${PYTHON_VERSION}" -ne "3.12" ]; then \ + curl $PIP_URL | python ; \ + fi ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index 43e329e..ce06412 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -36,6 +36,7 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ + $( if [ "${PYTHON_VERSION}" -eq "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ @@ -44,7 +45,9 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - curl $PIP_URL | python + if [ "${PYTHON_VERSION}" -ne "3.12" ]; then \ + curl $PIP_URL | python ; \ + fi ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From b3ecf2edf034f78ae91f29a86b192304771ab6a6 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 18:56:26 +0100 Subject: [PATCH 23/25] != --- cpu/Dockerfile | 4 ++-- gpu/Dockerfile | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/cpu/Dockerfile b/cpu/Dockerfile index b1a9f59..bc2b029 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -30,7 +30,7 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ - $( if [ "${PYTHON_VERSION}" -eq "3.12" ]; then echo "python3-pip"; fi ) \ + $( if [ "${PYTHON_VERSION}" == "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ @@ -39,7 +39,7 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - if [ "${PYTHON_VERSION}" -ne "3.12" ]; then \ + if [ "${PYTHON_VERSION}" != "3.12" ]; then \ curl $PIP_URL | python ; \ fi diff --git a/gpu/Dockerfile b/gpu/Dockerfile index ce06412..a912be1 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -36,7 +36,7 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ - $( if [ "${PYTHON_VERSION}" -eq "3.12" ]; then echo "python3-pip"; fi ) \ + $( if [ "${PYTHON_VERSION}" == "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ @@ -45,7 +45,7 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - if [ "${PYTHON_VERSION}" -ne "3.12" ]; then \ + if [ "${PYTHON_VERSION}" != "3.12" ]; then \ curl $PIP_URL | python ; \ fi From 7266541ad7a7f74612e86db715d0099bd8e88065 Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 19:03:50 +0100 Subject: [PATCH 24/25] skip 3.12 --- .github/workflows/docker-builds.yml | 4 ++-- cpu/Dockerfile | 5 +---- gpu/Dockerfile | 5 +---- 3 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.github/workflows/docker-builds.yml b/.github/workflows/docker-builds.yml index f701393..4103fa7 100644 --- a/.github/workflows/docker-builds.yml +++ b/.github/workflows/docker-builds.yml @@ -25,11 +25,11 @@ jobs: include: - { ubuntu_version: "24.04", python_version: "3.10", opencv_version: "4.10.0", device: "cpu" } - { ubuntu_version: "24.04", python_version: "3.11", opencv_version: "4.10.0", device: "cpu" } - - { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "cpu" } + #- { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "cpu" } - { ubuntu_version: "24.04", python_version: "3.13", opencv_version: "4.10.0", device: "cpu" } - { ubuntu_version: "24.04", python_version: "3.10", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } - { ubuntu_version: "24.04", python_version: "3.11", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } - - { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } + #- { ubuntu_version: "24.04", python_version: "3.12", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } - { ubuntu_version: "24.04", python_version: "3.13", opencv_version: "4.10.0", device: "gpu", cuda_version: "12.8.0" } steps: - name: Checkout diff --git a/cpu/Dockerfile b/cpu/Dockerfile index bc2b029..ca8891f 100644 --- a/cpu/Dockerfile +++ b/cpu/Dockerfile @@ -30,7 +30,6 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ - $( if [ "${PYTHON_VERSION}" == "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ @@ -39,9 +38,7 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies \ PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - if [ "${PYTHON_VERSION}" != "3.12" ]; then \ - curl $PIP_URL | python ; \ - fi + curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" diff --git a/gpu/Dockerfile b/gpu/Dockerfile index a912be1..43e329e 100644 --- a/gpu/Dockerfile +++ b/gpu/Dockerfile @@ -36,7 +36,6 @@ RUN \ python${PYTHON_VERSION} \ python${PYTHON_VERSION}-dev \ $( if [ "${PYTHON_VERSION%%.*}" -eq 3 ] && [ "${PYTHON_VERSION#*.}" -lt 10 ]; then echo "python${PYTHON_VERSION}-distutils"; fi ) \ - $( if [ "${PYTHON_VERSION}" == "3.12" ]; then echo "python3-pip"; fi ) \ curl \ wget && \ rm -rf /var/lib/apt/lists/* && \ @@ -45,9 +44,7 @@ RUN \ update-alternatives --install /usr/bin/python python /usr/bin/python${PYTHON_VERSION} 1 && \ # install python dependencies PIP_URL="https://bootstrap.pypa.io/get-pip.py" && \ - if [ "${PYTHON_VERSION}" != "3.12" ]; then \ - curl $PIP_URL | python ; \ - fi + curl $PIP_URL | python ENV PYTHONPATH="/usr/lib/python${PYTHON_VERSION}/site-packages:/usr/local/lib/python${PYTHON_VERSION}/site-packages" From e8e65e13ad56f2eb5f7a5a4c9eeccb985fea610d Mon Sep 17 00:00:00 2001 From: Jirka B Date: Wed, 19 Mar 2025 19:09:18 +0100 Subject: [PATCH 25/25] linter --- .github/ISSUE_TEMPLATE/bug_report.md | 4 ++-- .pre-commit-config.yaml | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 15cdcc8..7d8e918 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -15,8 +15,8 @@ assignees: '' Steps to reproduce the behavior: 1. Go to '...' -1. Run '....' -1. See error +2. Run '....' +3. See error diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 92d778a..36d301d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,3 +1,6 @@ +default_language_version: + python: python3 + ci: autofix_prs: true autoupdate_commit_msg: "[pre-commit.ci] pre-commit suggestions" @@ -23,9 +26,10 @@ repos: - id: codespell - repo: https://github.com/executablebooks/mdformat - rev: 0.7.16 + rev: 0.7.17 hooks: - id: mdformat + args: ["--number"] additional_dependencies: - mdformat-gfm - mdformat_frontmatter