From a25e8470624938ccc1da0bcdf83e98888842adbd Mon Sep 17 00:00:00 2001 From: Eugene Morozov Date: Sat, 25 Jan 2025 09:59:16 +0200 Subject: [PATCH] Bump unit to 1.34.1 and move to matrix --- .gitea/workflows/build.yml | 379 +++++-------------------------------- Dockerfile.python3.10 | 4 +- Dockerfile.python3.11 | 4 +- Dockerfile.python3.12 | 4 +- Dockerfile.python3.13 | 4 +- 5 files changed, 56 insertions(+), 339 deletions(-) diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml index e659ee34..21d4142e 100644 --- a/.gitea/workflows/build.yml +++ b/.gitea/workflows/build.yml @@ -5,17 +5,22 @@ on: - main schedule: - cron: '@monthly' - jobs: - build-3-10-amd64: + build-amd64: runs-on: linux_amd - name: Build Python 3.10 AMD64 + name: Build AMD64 container: image: catthehacker/ubuntu:act-latest env: RUNNER_TOOL_CACHE: /toolcache + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] outputs: - digest: ${{ steps.build-docker.outputs.digest }} + digest-3-10: ${{ steps.digest.outputs.DIGEST_3_10 }} + digest-3-11: ${{ steps.digest.outputs.DIGEST_3_11 }} + digest-3-12: ${{ steps.digest.outputs.DIGEST_3_12 }} + digest-3-13: ${{ steps.digest.outputs.DIGEST_3_13 }} steps: - name: Checkout uses: actions/checkout@v4 @@ -40,21 +45,33 @@ jobs: uses: docker/build-push-action@v5 with: context: . - file: Dockerfile.python3.10 + file: Dockerfile.python${{ matrix.python-version }} platforms: linux/amd64 push: true provenance: false outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + - name: Summarize the Docker digest + id: digest + run: | + PY_VERSION=${{ matrix.python-version }} + PY_VERSION_MOD=$(echo $PY_VERSION | sed 's/\./_/g') + echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT - build-3-10-arm64: + build-arm64: runs-on: ubuntu-latest - name: Build Python 3.10 ARM64 + name: Build ARM64 container: image: catthehacker/ubuntu:act-latest env: RUNNER_TOOL_CACHE: /toolcache + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] outputs: - digest: ${{ steps.build-docker.outputs.digest }} + digest-3-10: ${{ steps.digest.outputs.DIGEST_3_10 }} + digest-3-11: ${{ steps.digest.outputs.DIGEST_3_11 }} + digest-3-12: ${{ steps.digest.outputs.DIGEST_3_12 }} + digest-3-13: ${{ steps.digest.outputs.DIGEST_3_13 }} steps: - name: Checkout uses: actions/checkout@v4 @@ -79,16 +96,27 @@ jobs: uses: docker/build-push-action@v6 with: context: . - file: Dockerfile.python3.10 + file: Dockerfile.python${{ matrix.python-version }} platforms: linux/arm64 push: true provenance: false outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true + - name: Summarize the Docker digest + id: digest + run: | + PY_VERSION=${{ matrix.python-version }} + PY_VERSION_MOD=$(echo $PY_VERSION | sed 's/\./_/g') + echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" + echo DIGEST_${PY_VERSION_MOD}="${{ steps.build-docker.outputs.digest }}" >> $GITHUB_OUTPUT + - create-manifest-3-10: - needs: [build-3-10-arm64, build-3-10-amd64] + create-manifest: + needs: [build-arm64, build-amd64] runs-on: ubuntu-latest - name: Create Python 3.10 Manifest + name: Create Multi-arch Manifest + strategy: + matrix: + python-version: ['3.10', '3.11', '3.12', '3.13'] steps: - name: Login to Docker Registry uses: docker/login-action@v3 @@ -96,333 +124,22 @@ jobs: registry: gitea.technocloud.ee username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} + - name: Set up Docker BuildX uses: docker/setup-buildx-action@v3 with: driver: docker-container + - name: Get Repository Metadata id: meta run: | echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT + echo "PY_VERSION=digest-$(echo ${{ matrix.python-version }} | sed 's/\./-/g')" >> $GITHUB_OUTPUT + - name: Create and Push Multi-arch Manifest run: | - IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.10 - docker manifest create $IMAGE_NAME \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-10-arm64.outputs.digest }} \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-10-amd64.outputs.digest }} + ARM_DIGEST=${{ needs.build-arm64.outputs[steps.meta.outputs.PY_VERSION] }} + AMD_DIGEST=${{ needs.build-amd64.outputs[steps.meta.outputs.PY_VERSION] }} + IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python${{ matrix.python-version }} + docker manifest create $IMAGE_NAME --amend ${{ steps.meta.outputs.PACKAGE }}@${ARM_DIGEST} --amend ${{ steps.meta.outputs.PACKAGE }}@${AMD_DIGEST} docker manifest push $IMAGE_NAME - - build-3-11-amd64: - runs-on: linux_amd - name: Build Python 3.11 AMD64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push AMD64 - id: build-docker - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.python3.11 - platforms: linux/amd64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - build-3-11-arm64: - runs-on: ubuntu-latest - name: Build Python 3.11 ARM64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/arm64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push ARM64 - id: build-docker - uses: docker/build-push-action@v6 - with: - context: . - file: Dockerfile.python3.11 - platforms: linux/arm64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - create-manifest-3-11: - needs: [build-3-11-arm64, build-3-11-amd64] - runs-on: ubuntu-latest - name: Create Python 3.11 Manifest - steps: - - name: Login to Docker Registry - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - name: Get Repository Metadata - id: meta - run: | - echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Create and Push Multi-arch Manifest - run: | - IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.11 - docker manifest create $IMAGE_NAME \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-11-arm64.outputs.digest }} \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-11-amd64.outputs.digest }} - docker manifest push $IMAGE_NAME - - build-3-12-amd64: - runs-on: linux_amd - name: Build Python 3.12 AMD64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push AMD64 - id: build-docker - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.python3.12 - platforms: linux/amd64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - build-3-12-arm64: - runs-on: ubuntu-latest - name: Build Python 3.12 ARM64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/arm64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push ARM64 - id: build-docker - uses: docker/build-push-action@v6 - with: - context: . - file: Dockerfile.python3.12 - platforms: linux/arm64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - create-manifest-3-12: - needs: [build-3-12-arm64, build-3-12-amd64] - runs-on: ubuntu-latest - name: Create Python 3.12 Manifest - steps: - - name: Login to Docker Registry - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - name: Get Repository Metadata - id: meta - run: | - echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Create and Push Multi-arch Manifest - run: | - IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.12 - docker manifest create $IMAGE_NAME \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-12-arm64.outputs.digest }} \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-12-amd64.outputs.digest }} - docker manifest push $IMAGE_NAME - - build-3-13-amd64: - runs-on: linux_amd - name: Build Python 3.13 AMD64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/amd64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push AMD64 - id: build-docker - uses: docker/build-push-action@v5 - with: - context: . - file: Dockerfile.python3.13 - platforms: linux/amd64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - build-3-13-arm64: - runs-on: ubuntu-latest - name: Build Python 3.13 ARM64 - container: - image: catthehacker/ubuntu:act-latest - env: - RUNNER_TOOL_CACHE: /toolcache - outputs: - digest: ${{ steps.build-docker.outputs.digest }} - steps: - - name: Checkout - uses: actions/checkout@v4 - with: - github-server-url: https://gitea.technocloud.ee - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - platforms: linux/arm64 - - name: Login to DockerHub - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Get Meta - id: meta - run: | - echo "REPO_NAME=${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Build and Push ARM64 - id: build-docker - uses: docker/build-push-action@v6 - with: - context: . - file: Dockerfile.python3.13 - platforms: linux/arm64 - push: true - provenance: false - outputs: type=image,name=gitea.technocloud.ee/${{ steps.meta.outputs.REPO_NAME }},push-by-digest=true - - create-manifest-3-13: - needs: [build-3-13-arm64, build-3-13-amd64] - runs-on: ubuntu-latest - name: Create Python 3.13 Manifest - steps: - - name: Login to Docker Registry - uses: docker/login-action@v3 - with: - registry: gitea.technocloud.ee - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - - name: Set up Docker BuildX - uses: docker/setup-buildx-action@v3 - with: - driver: docker-container - - name: Get Repository Metadata - id: meta - run: | - echo "PACKAGE=gitea.technocloud.ee/${GITHUB_REPOSITORY}" >> $GITHUB_OUTPUT - - name: Create and Push Multi-arch Manifest - run: | - IMAGE_NAME=${{ steps.meta.outputs.PACKAGE }}:python3.13 - docker manifest create $IMAGE_NAME \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-13-arm64.outputs.digest }} \ - --amend ${{ steps.meta.outputs.PACKAGE }}@${{ needs.build-3-13-amd64.outputs.digest }} - docker manifest push $IMAGE_NAME \ No newline at end of file diff --git a/Dockerfile.python3.10 b/Dockerfile.python3.10 index e9cea2b4..f0ab3651 100644 --- a/Dockerfile.python3.10 +++ b/Dockerfile.python3.10 @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://unit.nginx.org" LABEL org.opencontainers.image.source="https://github.com/nginx/unit" LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images" LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers " -LABEL org.opencontainers.image.version="1.34.0" +LABEL org.opencontainers.image.version="1.34.1" RUN set -ex \ && savedAptMark="$(apt-mark showmanual)" \ @@ -35,7 +35,7 @@ RUN set -ex \ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \ && mkdir -p /usr/src/unit \ && cd /usr/src/unit \ - && git clone --depth 1 -b 1.34.0-1 https://github.com/nginx/unit \ + && git clone --depth 1 -b 1.34.1-1 https://github.com/nginx/unit \ && cd unit \ && NCPU="$(getconf _NPROCESSORS_ONLN)" \ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \ diff --git a/Dockerfile.python3.11 b/Dockerfile.python3.11 index 307daf7b..89e969e5 100644 --- a/Dockerfile.python3.11 +++ b/Dockerfile.python3.11 @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://unit.nginx.org" LABEL org.opencontainers.image.source="https://github.com/nginx/unit" LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images" LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers " -LABEL org.opencontainers.image.version="1.34.0" +LABEL org.opencontainers.image.version="1.34.1" RUN set -ex \ && savedAptMark="$(apt-mark showmanual)" \ @@ -35,7 +35,7 @@ RUN set -ex \ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \ && mkdir -p /usr/src/unit \ && cd /usr/src/unit \ - && git clone --depth 1 -b 1.34.0-1 https://github.com/nginx/unit \ + && git clone --depth 1 -b 1.34.1-1 https://github.com/nginx/unit \ && cd unit \ && NCPU="$(getconf _NPROCESSORS_ONLN)" \ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \ diff --git a/Dockerfile.python3.12 b/Dockerfile.python3.12 index 18a8df95..863791b8 100644 --- a/Dockerfile.python3.12 +++ b/Dockerfile.python3.12 @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://unit.nginx.org" LABEL org.opencontainers.image.source="https://github.com/nginx/unit" LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images" LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers " -LABEL org.opencontainers.image.version="1.34.0" +LABEL org.opencontainers.image.version="1.34.1" RUN set -ex \ && savedAptMark="$(apt-mark showmanual)" \ @@ -35,7 +35,7 @@ RUN set -ex \ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \ && mkdir -p /usr/src/unit \ && cd /usr/src/unit \ - && git clone --depth 1 -b 1.34.0-1 https://github.com/nginx/unit \ + && git clone --depth 1 -b 1.34.1-1 https://github.com/nginx/unit \ && cd unit \ && NCPU="$(getconf _NPROCESSORS_ONLN)" \ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \ diff --git a/Dockerfile.python3.13 b/Dockerfile.python3.13 index 56ae6d2b..dd4d033a 100644 --- a/Dockerfile.python3.13 +++ b/Dockerfile.python3.13 @@ -6,7 +6,7 @@ LABEL org.opencontainers.image.url="https://unit.nginx.org" LABEL org.opencontainers.image.source="https://github.com/nginx/unit" LABEL org.opencontainers.image.documentation="https://unit.nginx.org/installation/#docker-images" LABEL org.opencontainers.image.vendor="NGINX Docker Maintainers " -LABEL org.opencontainers.image.version="1.34.0" +LABEL org.opencontainers.image.version="1.34.1" RUN set -ex \ && savedAptMark="$(apt-mark showmanual)" \ @@ -35,7 +35,7 @@ RUN set -ex \ && mkdir -p /usr/lib/unit/modules /usr/lib/unit/debug-modules \ && mkdir -p /usr/src/unit \ && cd /usr/src/unit \ - && git clone --depth 1 -b 1.34.0-1 https://github.com/nginx/unit \ + && git clone --depth 1 -b 1.34.1-1 https://github.com/nginx/unit \ && cd unit \ && NCPU="$(getconf _NPROCESSORS_ONLN)" \ && DEB_HOST_MULTIARCH="$(dpkg-architecture -q DEB_HOST_MULTIARCH)" \