From 33c54828cc75a57ac4e5e68c3483785aff89261e Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Mon, 21 Sep 2026 20:26:14 +0200 Subject: [PATCH] perf(images): cap concurrent build steps at the runner's CPU count Every distro builds both platforms in one job, so up to ten builds share one builder on a four-vCPU runner, half of them under emulation. BuildKit runs build steps without a parallelism limit unless max-parallelism is set. The job now reads nproc and hands it to the builder's buildkitd.toml, so steps beyond the CPU count wait instead of overcommitting the runner. Co-Authored-By: Claude Opus 5 (1M context) --- .github/workflows/call-images-build-ci.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/call-images-build-ci.yml b/.github/workflows/call-images-build-ci.yml index f553621ea7..a6f9b064c2 100644 --- a/.github/workflows/call-images-build-ci.yml +++ b/.github/workflows/call-images-build-ci.yml @@ -132,10 +132,18 @@ jobs: shell: bash run: docker run --privileged --rm "${{ steps.binfmt.outputs.ref }}" --install all + - name: 🧮 Count the runner's CPUs + id: cpus + shell: bash + run: echo "count=$(nproc)" >> "$GITHUB_OUTPUT" + - name: 🔧 Set up Docker Buildx uses: docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c # v4.2.0 with: driver-opts: image=${{ steps.buildkit.outputs.ref }} + buildkitd-config-inline: | + [worker.oci] + max-parallelism = ${{ steps.cpus.outputs.count }} - name: 🔑 Login to GHCR uses: docker/login-action@af1e73f918a031802d376d3c8bbc3fe56130a9b0 # v4.4.0