diff --git a/.github/workflows/build_wheels_linux_arm.yml b/.github/workflows/build_wheels_linux_arm.yml deleted file mode 100644 index 1dda358a..00000000 --- a/.github/workflows/build_wheels_linux_arm.yml +++ /dev/null @@ -1,189 +0,0 @@ -name: Linux ARM64 - -on: - pull_request: - branches: - - 4.x - - 5.x - paths-ignore: - - '.github/workflows/build_wheels_linux.yml' - - '.github/workflows/build_wheels_windows*' - - '.github/workflows/build_wheels_macos*' - release: - types: [published, edited] - schedule: - - cron: '0 3 * * 6' - workflow_dispatch: - - -jobs: - Build: - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - python-version: ['3.9'] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - REPO_DIR: . - PROJECT_SPEC: opencv-python - MB_PYTHON_VERSION: ${{ matrix.python-version }} - TRAVIS_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - MB_ML_VER: 2014 - TRAVIS_BUILD_DIR: ${{ github.workspace }} - CONFIG_PATH: travis_config.sh - DOCKER_IMAGE: quay.io/opencv-ci/opencv-python-manylinux2014-aarch64:20250630 - USE_CCACHE: 0 - UNICODE_WIDTH: 32 - SDIST: ${{ matrix.build_sdist || 0 }} - ENABLE_HEADLESS: ${{ matrix.without_gui }} - ENABLE_CONTRIB: ${{ matrix.with_contrib }} - steps: - - name: Cleanup - run: find . -mindepth 1 -delete - working-directory: ${{ github.workspace }} - - name: Setup environment - run: | - if [[ "${{ github.event_name }}" == "schedule" || "${{ github.event_name }}" == "workflow_dispatch" ]]; then - echo "ENABLE_ROLLING=1" >> $GITHUB_ENV - fi - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: false - fetch-depth: 0 - - name: Build a package - run: source scripts/build.sh - - name: Saving a wheel accordingly to matrix - uses: actions/upload-artifact@v4 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} - path: wheelhouse/opencv*.whl - - Test: - needs: [Build] - runs-on: opencv-cn-lin-arm64 - defaults: - run: - shell: bash - strategy: - fail-fast: false - matrix: - python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12', '3.13'] - platform: [x64] - with_contrib: [0, 1] - without_gui: [0, 1] - build_sdist: [0] - env: - ACTIONS_ALLOW_UNSECURE_COMMANDS: true - MB_PYTHON_VERSION: ${{ matrix.python-version }} - PLAT: aarch64 - NP_TEST_DEP: numpy==1.19.4 - NP_TEST_DEP_LATEST: numpy==2.2.6 - CONFIG_PATH: travis_config.sh - DOCKER_TEST_IMAGE: quay.io/opencv-ci/multibuild-focal_arm64v8:2025-11-13 - UNICODE_WIDTH: 32 - steps: - - name: Cleanup - run: find . -mindepth 1 -delete - working-directory: ${{ github.workspace }} - - name: Checkout - uses: actions/checkout@v3 - with: - submodules: true - fetch-depth: 0 - - name: Setup Environment variables - run: if [ "3.10" == "${{ matrix.python-version }}" -o "3.11" == "${{ matrix.python-version }}" -o "3.12" == "${{ matrix.python-version }}" -o "3.13" == "${{ matrix.python-version }}" ]; then echo "TEST_DEPENDS=$(echo $NP_TEST_DEP_LATEST)" >> $GITHUB_ENV; else echo "TEST_DEPENDS=$(echo $NP_TEST_DEP)" >> $GITHUB_ENV; fi - - name: Download a wheel accordingly to matrix - uses: actions/download-artifact@v4 - with: - name: wheel-${{ matrix.with_contrib }}-${{ matrix.without_gui }}-${{ matrix.build_sdist }} - path: wheelhouse/ - - name: Package installation and run tests - run: source scripts/install.sh - - Release_rolling: - if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: opencv-python-rolling-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload wheels for opencv_python_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_rolling-* - - name: Upload wheels for opencv_contrib_python_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_rolling-* - - name: Upload wheels for opencv_python_headless_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless_rolling-* - - name: Upload wheels for opencv_contrib_python_headless_rolling - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_ROLLING_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless_rolling-* - - Pre-release: - if: github.event_name == 'release' && github.event.release.prerelease - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: test-opencv-python-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload all wheels - run: | - python -m pip install twine - python -m twine upload --repository testpypi -u ${{ secrets.PYPI_USERNAME }} -p ${{ secrets.PYPI_PASSWORD }} --skip-existing wheelhouse/opencv_* - - Release: - if: github.event_name == 'release' && !github.event.release.prerelease - needs: [Build, Test] - runs-on: ubuntu-22.04 - environment: opencv-python-release - defaults: - run: - shell: bash - steps: - - uses: actions/download-artifact@v4 - with: - name: wheels - path: wheelhouse/ - - name: Upload wheels for opencv_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_python-* - - name: Upload wheels for opencv_contrib_python - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python-* - - name: Upload wheels for opencv_python_headless - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_python_headless-* - - name: Upload wheels for opencv_contrib_python_headless - run: | - python -m pip install twine - python -m twine upload -u ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_USERNAME }} -p ${{ secrets.OPENCV_CONTRIB_PYTHON_HEADLESS_PASSWORD }} --skip-existing wheelhouse/opencv_contrib_python_headless-* diff --git a/.github/workflows/build_wheels_macos.yml b/.github/workflows/build_wheels_macos.yml index 6a84bda0..106b10cc 100644 --- a/.github/workflows/build_wheels_macos.yml +++ b/.github/workflows/build_wheels_macos.yml @@ -6,7 +6,7 @@ on: - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos_m1.yml' release: diff --git a/.github/workflows/build_wheels_macos_m1.yml b/.github/workflows/build_wheels_macos_m1.yml index 875efbf7..e38d286f 100644 --- a/.github/workflows/build_wheels_macos_m1.yml +++ b/.github/workflows/build_wheels_macos_m1.yml @@ -6,7 +6,7 @@ on: - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos.yml' release: diff --git a/.github/workflows/build_wheels_linux.yml b/.github/workflows/build_wheels_manylinux.yml similarity index 99% rename from .github/workflows/build_wheels_linux.yml rename to .github/workflows/build_wheels_manylinux.yml index 0293d82f..b8e47334 100644 --- a/.github/workflows/build_wheels_linux.yml +++ b/.github/workflows/build_wheels_manylinux.yml @@ -1,4 +1,4 @@ -name: Linux x86_64 +name: Manylinux on: pull_request: @@ -6,7 +6,6 @@ on: - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux_arm.yml' - '.github/workflows/build_wheels_windows*' - '.github/workflows/build_wheels_macos*' release: @@ -76,7 +75,7 @@ jobs: with: submodules: false fetch-depth: 0 - + - name: Build a package run: source scripts/build.sh - name: Saving a wheel accordingly to matrix diff --git a/.github/workflows/build_wheels_windows.yml b/.github/workflows/build_wheels_windows.yml index 1ee786a9..580bdd57 100644 --- a/.github/workflows/build_wheels_windows.yml +++ b/.github/workflows/build_wheels_windows.yml @@ -6,7 +6,7 @@ on: - 4.x - 5.x paths-ignore: - - '.github/workflows/build_wheels_linux*' + - '.github/workflows/build_wheels_manylinux*' - '.github/workflows/build_wheels_macos*' release: types: [published, edited] diff --git a/docker/musllinux_1_2/Dockerfile_aarch64 b/docker/musllinux_1_2/Dockerfile_aarch64 new file mode 100644 index 00000000..ceb02adf --- /dev/null +++ b/docker/musllinux_1_2/Dockerfile_aarch64 @@ -0,0 +1,166 @@ +# version: 20251211 +# Image name: quay.io/opencv-ci/opencv-python-musllinux_1_2-aarch64 +FROM quay.io/pypa/musllinux_1_2_aarch64:latest + +ARG CCACHE_VERSION=3.7.9 +ARG FFMPEG_VERSION=6.1.1 +ARG FREETYPE_VERSION=2.13.3 +ARG LIBPNG_VERSION=1.6.48 +ARG VPX_VERSION=v1.15.1 +ARG NASM_VERSION=2.15.04 +ARG OPENSSL_VERSION=1_1_1w +ARG YASM_VERSION=1.3.0 +ARG AOM_VERSION=v3.12.1 +ARG AVIF_VERSION=v1.3.0 + +ENV LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH + +RUN apk add --no-cache \ + build-base \ + diffutils \ + cmake \ + bash \ + git \ + curl \ + wget \ + tar \ + xz \ + zlib-dev \ + xz-dev \ + nasm \ + yasm \ + pkgconfig \ + openssl-dev \ + libjpeg-turbo-dev \ + fontconfig-dev \ + freetype-dev \ + expat-dev \ + libpng-dev \ + alsa-lib-dev \ + musl-dev \ + ttf-dejavu \ + linux-headers \ + perl + +RUN apk del libpng-dev + +### libpng +RUN mkdir ~/libpng_sources && \ + cd ~/libpng_sources && \ + curl -O -L https://download.sourceforge.net/libpng/libpng-${LIBPNG_VERSION}.tar.gz && \ + tar -xf libpng-${LIBPNG_VERSION}.tar.gz && \ + cd libpng-${LIBPNG_VERSION} && \ + ./configure --prefix=/usr/local && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/libpng_sources + +### freetype +RUN mkdir ~/freetype_sources && \ + cd ~/freetype_sources && \ + curl -O -L https://download.savannah.gnu.org/releases/freetype/freetype-${FREETYPE_VERSION}.tar.gz && \ + tar -xf freetype-${FREETYPE_VERSION}.tar.gz && \ + cd freetype-${FREETYPE_VERSION} && \ + ./configure --prefix="/ffmpeg_build" --enable-freetype-config && \ + make && \ + make install && \ + cd .. && \ + rm -rf ~/freetype_sources + +### OpenSSL +RUN mkdir ~/openssl_sources && \ + cd ~/openssl_sources && \ + curl -O -L https://github.com/openssl/openssl/archive/OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + tar -xf OpenSSL_${OPENSSL_VERSION}.tar.gz && \ + cd openssl-OpenSSL_${OPENSSL_VERSION} && \ + ./config --prefix="/ffmpeg_build" --openssldir="/ffmpeg_build" no-pinshared shared zlib && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install_sw && \ + cd .. && \ + rm -rf ~/openssl_build ~/openssl_sources + +### libvpx +RUN mkdir ~/libvpx_sources && \ + cd ~/libvpx_sources && \ + git clone --depth 1 -b ${VPX_VERSION} https://chromium.googlesource.com/webm/libvpx.git && \ + cd libvpx && \ + ./configure --prefix="/ffmpeg_build" --disable-examples --disable-unit-tests --enable-vp9-highbitdepth --as=yasm --enable-pic --enable-shared && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/libvpx_sources + + +### aom +RUN mkdir -p /tmp/aom_sources && \ + cd /tmp/aom_sources && \ + git clone --depth 1 -b ${AOM_VERSION} https://aomedia.googlesource.com/aom && \ + mkdir build && cd build && \ + cmake \ + -DCMAKE_C_COMPILER=$(dirname $(which g++))/gcc \ + -DCMAKE_INSTALL_PREFIX=/usr \ + -DBUILD_SHARED_LIBS=ON \ + -DENABLE_TESTS=OFF \ + -DENABLE_EXAMPLES=OFF \ + ../aom && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install +### avif +RUN mkdir ~/avif_sources && \ + cd ~/avif_sources && \ + git clone -b ${AVIF_VERSION} https://github.com/AOMediaCodec/libavif.git && \ + mkdir build && cd build && \ + cmake -DCMAKE_INSTALL_PREFIX=/usr -DAVIF_CODEC_AOM=SYSTEM -DAVIF_LIBYUV=LOCAL -DAVIF_BUILD_APPS=OFF ../libavif && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ~/avif_sources + +### ffmpeg +RUN mkdir -p /ffmpeg_sources && \ + cd /ffmpeg_sources && \ + curl -LO https://ffmpeg.org/releases/ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + tar -xf ffmpeg-${FFMPEG_VERSION}.tar.gz && \ + cd ffmpeg-${FFMPEG_VERSION} && \ + PKG_CONFIG_PATH="/ffmpeg_build/lib/pkgconfig" ./configure \ + --prefix="/ffmpeg_build" \ + --extra-cflags="-I/ffmpeg_build/include" \ + --extra-ldflags="-L/ffmpeg_build/lib" \ + --enable-openssl \ + --enable-libvpx \ + --enable-shared \ + --enable-pic \ + --disable-indev=v4l2 \ + --disable-outdev=v4l2 && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + rm -rf /ffmpeg_sources + +### ccache +RUN curl -O -L https://github.com/ccache/ccache/releases/download/v${CCACHE_VERSION}/ccache-${CCACHE_VERSION}.tar.gz && \ + tar -xf ccache-${CCACHE_VERSION}.tar.gz && \ + cd ccache-${CCACHE_VERSION} && \ + ./configure && \ + make -j$(getconf _NPROCESSORS_ONLN) && \ + make install && \ + cd .. && \ + rm -rf ccache-${CCACHE_VERSION}.tar.gz + +# Self-hosted runner UID is 1004 +RUN useradd ci -m -s /bin/bash -G users --uid=1004 && \ + mkdir /io && \ + chown -R ci:ci /io && \ + # This needs to find ffmpeg packages from ci user + chown -R ci:ci /ffmpeg_build && \ + # This calls in mutlibuild scripts and cannot be run without permissions + chown -R ci:ci /opt/_internal/pipx/venvs/auditwheel + +USER ci + +RUN git config --global --add safe.directory /io +ENV PATH="/ffmpeg_build/bin:$PATH" +ENV PKG_CONFIG_PATH /usr/local/lib/pkgconfig:/ffmpeg_build/lib/pkgconfig +ENV LDFLAGS -L/ffmpeg_build/lib +ENV PATH "$HOME/bin:$PATH" +ENV LD_LIBRARY_PATH="/ffmpeg_build/lib:$LD_LIBRARY_PATH" diff --git a/docker/musllinux/Dockerfile_x86_64 b/docker/musllinux_1_2/Dockerfile_x86_64 similarity index 98% rename from docker/musllinux/Dockerfile_x86_64 rename to docker/musllinux_1_2/Dockerfile_x86_64 index aba27d0f..babdf95f 100644 --- a/docker/musllinux/Dockerfile_x86_64 +++ b/docker/musllinux_1_2/Dockerfile_x86_64 @@ -1,4 +1,5 @@ -# +# version: 20251211 +# Image name: quay.io/opencv-ci/opencv-python-musllinux_1_2-x86-64 FROM quay.io/pypa/musllinux_1_2_x86_64:latest ARG CCACHE_VERSION=3.7.9