Build sim image multi-arch (amd64 + arm64) for Apple Silicon#31
Merged
Conversation
Mac users on Apple Silicon (M1+) need a linux/arm64 image to run the sim container natively under Docker Desktop. Publishing a multi-arch manifest is invisible to users: ``docker pull`` resolves the right variant for the runner's arch automatically — Apple Silicon picks arm64, x86 hosts pick amd64. Workflow restructure (.github/workflows/build-sim-image.yml): * Matrix-with-merge pattern from the docker/build-push-action docs: https://docs.docker.com/build/ci/github-actions/multi-platform/ * Each platform builds natively on its own GHA runner — ubuntu-latest for amd64, ubuntu-24.04-arm (free for public repos since Jan 2025) for arm64. Avoids QEMU emulation, which on a C++ build like ASTRA-Sim blows the compile from ~5-7 min to ~30-60 min and risks the GHA 6-hour budget. * Per-platform job pushes by digest only (no tag). The merge job collects digests via actions/upload-artifact and assembles them into a tagged manifest list via ``docker buildx imagetools create``. * PRs verify each platform builds but skip both publish and the merge step. * BuildKit cache scoped per platform (``cache-from/-to ... scope=<key>``) so different archs don't trample each other's cache. Also adds ``.dockerignore`` to the trigger path filter so future tweaks to it rebuild the image.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Publishes
ghcr.io/psal-postech/llmservingsimspec/sim:latestas a multi-arch manifest covering bothlinux/amd64(x86 hosts, x86 CI) andlinux/arm64(Apple Silicon Macs, ARM servers). Apple Silicon users get the native arm64 variant automatically when they rundocker pull.Why multi-arch and not just a separate Mac image
docker pull <ref>resolves the manifest list to the runner's arch. One ref, one tag, everyone gets the right binary. Mac users don't have to know to pull a different tag.Native runners, no QEMU
ASTRA-Sim is a C++ build via cmake. Under x86 + QEMU arm64 emulation that compile balloons from ~5-7 min to ~30-60 min and crowds the GHA 6-hour budget. GitHub now ships free
ubuntu-24.04-armrunners for public repos (since Jan 2025), so we build natively on each platform in parallel and combine the digests afterwards.Workflow shape
Standard matrix-with-merge pattern from the docker/build-push-action docs:
buildmatrix — one row per platform on its own native runner.merge— collects per-platform digests, runsdocker buildx imagetools createwith the human-readable tags (latest,sha-<short>, branch name) pointing at the union of those digests.PRs skip the merge job since no digests were published.
BuildKit cache is scoped per platform so amd64 and arm64 don't trample each other's cache.
Other tweaks
.dockerignoreadded to the trigger path filter — future tweaks to it rebuild the image.Test plan
build (linux/amd64)andbuild (linux/arm64)to green. The merge job is skipped for PRs (intentional).:latestmanifest. Verify withdocker buildx imagetools inspect ghcr.io/psal-postech/llmservingsimspec/sim:latest— should list bothlinux/amd64andlinux/arm64.docker run --rm ghcr.io/psal-postech/llmservingsimspec/sim:latest uname -m→aarch64.x86_64.Notes
ubuntu-24.04-armrunners are free for public repos. If this repo turns private later, that runner becomes paid (per-minute billing); falling back to QEMU onubuntu-latestwould be the alternative at the cost of ~5× longer arm64 builds.scripts/sim.Dockerfile— no Dockerfile changes needed. ASTRA-Sim's cmake build is portable.Generated by Claude Code