Skip to content

[TASK] Optimize BuildKit cache scopes and PHP compilation - #586

Merged
Kanti merged 5 commits into
webdevops:masterfrom
andersundsehr:perf/build-cache-parallel-php
Oct 21, 2026
Merged

Kanti merged 5 commits into
webdevops:masterfrom
andersundsehr:perf/build-cache-parallel-php

Conversation

@Kanti

@Kanti Kanti commented Oct 21, 2026 •

Copy link
Copy Markdown
Collaborator

Prevent image builds from overwriting each other's BuildKit caches and speed up ICU/PHP-extension compilation on the existing runners.

  • Use stable type=gha scopes per image/tag and architecture across regular builds, parent-OCI builds, and OCI exports. Scopes remain reusable across commits and branches, without a cache-age window.
  • Compile ICU and PHP extensions with -j"$(nproc)" on Debian and Alpine. Preserve installation order, extensions, and versions; installation commands remain sequential.
  • Disable caching for scheduled runs and all workflow reruns:
    ${{ github.event_name == 'schedule' || github.run_attempt > 1 }}
  • Support Re-run all jobs for a fresh build of the complete image chain. Replace parent OCI artifacts on reruns; child builds consume those artifacts, and OCI exports reuse the tested local result. Rerunning only failed jobs retains artifacts from successful parent jobs.
  • Rebase onto master after PHP 8.1 removal and regenerate the workflow and eight PHP 8.2–8.5 Dockerfiles.

Validation:

  • make provision, ci/console github:generate-ci, PHP syntax checks, and git diff --check passed.
  • Local validation covered 148 BuildKit configurations, 120 image/architecture combinations, parent-artifact handling, and removal of PHP 8.1 jobs.
  • Verified that generated Dockerfile changes contain only parallel compilation flags, with existing tests, runners, dependencies, and publishing behavior preserved.
  • A focused Debian smoke build compiled and verified ICU 73.1, bcmath, and intl. Full local image samples were blocked by the environment's proxy CA trust and Alpine repository HTTP 403 responses.

Expected improvements: fewer cache collisions and better CPU utilization during compilation. Downloads and PECL installs retain their existing behavior. GitHub cache quotas, eviction, and branch access rules still apply. No additional infrastructure, runner changes, concurrency changes, or publishing changes.

@Kanti Kanti changed the title Optimize BuildKit cache scopes and PHP compilation [TASK] Optimize BuildKit cache scopes and PHP compilation Oct 21, 2026
@Kanti
Kanti force-pushed the perf/build-cache-parallel-php branch from 40e728a to 6947551 Compare October 21, 2026 14:17
@Kanti
Kanti force-pushed the perf/build-cache-parallel-php branch from 6947551 to f5d7106 Compare October 21, 2026 15:25
@sonarqubecloud

Copy link
Copy Markdown

@Kanti
Kanti marked this pull request as ready for review October 21, 2026 15:50
@Kanti
Kanti merged commit ff573ad into webdevops:master Oct 21, 2026
183 checks passed
@Kanti
Kanti deleted the perf/build-cache-parallel-php branch October 21, 2026 15:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant