From 266d64da5bcb0a534912bc6c39dd5c5a410036b6 Mon Sep 17 00:00:00 2001 From: Marco Acierno Date: Sat, 20 Jun 2026 21:47:19 +0200 Subject: [PATCH] ci: speed up backend image build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Move the backend build cache from the GitHub Actions cache backend to the ECR registry, and drop the unused QEMU setup step. The 12-minute backend builds were dominated by exporting the build cache to GitHub Actions (~7 min, mode=max re-uploading every layer of every stage to a throttled backend). Pointing the cache at the same ECR repo lets the image push and cache export share one content-addressed store, so the heavy .venv layer uploads once instead of twice, and ECR is not rate-limited like the GHA cache backend. image-manifest=true,oci-mediatypes=true are required: ECR rejects buildkit's legacy cache-manifest format. mode=max is kept on purpose — this is a multi-stage build and min would stop caching the intermediate uv sync / pnpm build stages, which would re-run on every ephemeral CI runner. QEMU is removed because the runner is ubuntu-24.04-arm building linux/arm64 natively, so no emulation is needed. Co-Authored-By: Claude Opus 4.8 (1M context) --- .github/workflows/build-backend.yml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build-backend.yml b/.github/workflows/build-backend.yml index 0d87969d3c..79ea430e39 100644 --- a/.github/workflows/build-backend.yml +++ b/.github/workflows/build-backend.yml @@ -20,8 +20,6 @@ jobs: aws-access-key-id: ${{ secrets.aws_access_key_id }} aws-secret-access-key: ${{ secrets.aws_secret_access_key }} aws-region: eu-central-1 - - name: Set up QEMU dependency - uses: docker/setup-qemu-action@v3 - name: Login to Amazon ECR uses: aws-actions/amazon-ecr-login@v2 - name: Set up Docker Buildx @@ -36,6 +34,6 @@ jobs: provenance: false push: true tags: ${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pycon-backend:arm-${{ inputs.githash }} - cache-from: type=gha - cache-to: type=gha,mode=max + cache-from: type=registry,ref=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pycon-backend:buildcache + cache-to: type=registry,ref=${{ secrets.AWS_ACCOUNT_ID }}.dkr.ecr.eu-central-1.amazonaws.com/pythonit/pycon-backend:buildcache,mode=max,image-manifest=true,oci-mediatypes=true platforms: linux/arm64