Skip to content

[PLAT-5019] Split multi-arch php-laravel builds across native runners#134

Merged
bbooth merged 1 commit into
mainfrom
plat-5019_split_multi_arch_ci_runners
Jun 22, 2026
Merged

[PLAT-5019] Split multi-arch php-laravel builds across native runners#134
bbooth merged 1 commit into
mainfrom
plat-5019_split_multi_arch_ci_runners

Conversation

@bbooth

@bbooth bbooth commented Jun 18, 2026

Copy link
Copy Markdown
Contributor

Jira

https://revolutionparts.atlassian.net/browse/PLAT-5019

Summary

  • When platforms includes both linux/amd64 and linux/arm64, build each architecture on a native GitHub Actions runner in parallel instead of QEMU on a single amd64 runner
  • Push per-arch tags (e.g. cli-v0.24.0-amd64, cli-v0.24.0-arm64) with per-arch registry cache keys (buildcache-cli-amd64, buildcache-cli-arm64)
  • Merge into final multi-arch tags via docker buildx imagetools create (cli-TAG, cli-latest, etc.)
  • Single-platform builds (linux/amd64 default) unchanged

Motivation

Listings merge-main multi-arch CLI builds took ~62 minutes because arm64 PHP extension compilation ran under QEMU on ubuntu-latest. Native arm64 runners should cut that to roughly the slowest single-arch build.

Pipeline (after this change)

Example: Listings merge-main (CLI-only multi-arch).

flowchart TB
  subgraph listings["listings — Merge Main Workflow"]
    tag["Calculate Build Tag<br/>ubuntu-latest · ~9s"]
    tag --> build["build-and-push-images<br/>calls encodium/.github<br/>php-laravel-build-push.yaml"]
    build --> prerelease["Prerelease + GH release"]
    build --> deploy["Deploy to staging EKS"]
  end

  subgraph shared["encodium/.github — php-laravel-build-push.yaml"]
    direction TB

    subgraph cli_amd64["Build + Push CLI Image (amd64)"]
      direction TB
      a1["ubuntu-latest"]
      a2["composer install + artisan cache"]
      a3["docker buildx push<br/>platform: linux/amd64"]
      a4["tag: cli-vX.Y.Z-amd64<br/>cache: buildcache-cli-amd64"]
      a1 --> a2 --> a3 --> a4
    end

    subgraph cli_arm64["Build + Push CLI Image (arm64)"]
      direction TB
      b1["ubuntu-24.04-arm<br/>native Graviton runner"]
      b2["composer install + artisan cache"]
      b3["docker buildx push<br/>platform: linux/arm64"]
      b4["tag: cli-vX.Y.Z-arm64<br/>cache: buildcache-cli-arm64"]
      b1 --> b2 --> b3 --> b4
    end

    merge["Merge CLI Image Manifest<br/>ubuntu-latest"]
    merge_step["docker buildx imagetools create<br/>→ cli-vX.Y.Z + cli-latest<br/>multi-arch manifest"]

    build --> cli_amd64
    build --> cli_arm64
    cli_amd64 --> merge
    cli_arm64 --> merge
    merge --> merge_step
  end

  merge_step --> ghcr["GHCR<br/>ghcr.io/encodium/listings:cli-TAG"]
Loading

Before vs after (CLI image build)

flowchart LR
  subgraph before["Before PLAT-5019"]
    direction TB
    old["ubuntu-latest only"]
    qemu["Single buildx job<br/>platforms: amd64 + arm64"]
    qemu_arm["arm64 layers via QEMU<br/>~59 min PHP ext compile"]
    old --> qemu --> qemu_arm
  end

  subgraph after["After PLAT-5019"]
    direction TB
    par["Parallel native builds"]
    amd["amd64 · ubuntu-latest · ~36s"]
    arm["arm64 · ubuntu-24.04-arm · native"]
    m["imagetools merge · ~30s"]
    par --> amd
    par --> arm
    amd --> m
    arm --> m
  end
Loading

When all three image types are enabled (app + webserver + CLI), each image type follows the same pattern: 2 parallel arch jobs + 1 merge job → final tags (TAG/latest, webserver-TAG/webserver-latest, cli-TAG/cli-latest). Those three families still run in parallel with each other.

Test plan

  • Merge this PR
  • Trigger Listings merge-main (or wait for next main push) and confirm:
    • Parallel amd64 + arm64 CLI build jobs on correct runners
    • Final cli-TAG manifest lists both architectures
    • Total image build time < 15 min with warm per-arch cache

Build amd64 and arm64 on ubuntu-latest and ubuntu-24.04-arm in parallel,
use per-arch registry cache keys, and merge manifests with buildx imagetools.
Keeps single-platform builds unchanged for repos on linux/amd64 only.

PLAT-5019

Co-authored-by: Cursor <cursoragent@cursor.com>
@bbooth bbooth marked this pull request as ready for review June 18, 2026 21:21
@bbooth bbooth requested a review from a team as a code owner June 18, 2026 21:21
@bbooth bbooth requested a review from jcardenasRP June 18, 2026 21:21
@bbooth bbooth merged commit 6ca5f96 into main Jun 22, 2026
3 checks passed
@bbooth bbooth deleted the plat-5019_split_multi_arch_ci_runners branch June 22, 2026 19:22
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.

3 participants