Skip to content

ci: Build and publish multi-arch (x86-64 and ARM64) container images and also run Rust tests on ARM64 runners. - #428

Open
jackluo923 wants to merge 2 commits into
y-scope:mainfrom
jackluo923:ci/multi-arch-images
Open

ci: Build and publish multi-arch (x86-64 and ARM64) container images and also run Rust tests on ARM64 runners.#428
jackluo923 wants to merge 2 commits into
y-scope:mainfrom
jackluo923:ci/multi-arch-images

Conversation

@jackluo923

@jackluo923 jackluo923 commented Aug 6, 2026

Copy link
Copy Markdown
Member

Description

The published container images (storage, scheduler, worker) are x86-64 only, so they can't run on ARM64 hosts. This publishes multi-arch manifests instead, and adds ARM64 legs to huntsman-tests so that ARM64 breakage in the Rust implementation surfaces in review instead of after publishing.

spider-image-build:

  • Each service/arch pair builds on a native runner (ubuntu-24.04 / ubuntu-24.04-arm) rather than under QEMU, since emulating the Rust build would be roughly an order of magnitude slower.
  • Outside of pull requests, each arch is pushed to GHCR by digest, and a new merge-manifests job combines the per-arch digests into one multi-arch manifest per service.
  • Pushing by digest keeps the per-arch images untagged. merge-manifests then stamps every tag that docker/metadata-action generates (branch, tag, sha) onto the one index, so no tag has to be enumerated in the merge step and no arch-suffixed tags reach the registry.
  • provenance is disabled so that each arch is pushed as a plain image manifest. Buildx otherwise wraps each build in a single-entry manifest list to carry the attestation, and docker buildx imagetools create cannot nest one index inside another.
  • Pull requests still build both arches (type=cacheonly) and push nothing.

tests:

  • huntsman-tests also runs on ubuntu-22.04-arm and ubuntu-24.04-arm.
  • wolf-tests is left unchanged. The C++ implementation is unofficially deprecated and will be removed soon, so ARM64 coverage for it isn't worth adding.

Checklist

  • The PR satisfies the contribution guidelines.
  • This is a breaking change and that has been indicated in the PR title, OR this isn't a breaking change.
  • Necessary docs have been updated, OR no docs need to be updated.

Validation performed

Both workflows were run on a fork (jackluo923/spider):

  • spider-image-build: all 6 build legs and all 3 merge-manifests legs passed. The Inspect multi-arch manifest step confirms that each service resolves to an OCI image index with linux/amd64 and linux/arm64 children.
  • tests: the ARM64 legs of huntsman-tests passed, so the Rust suite builds and runs natively on ARM64 with no changes to the dependency install scripts. The run also covered ARM64 legs of wolf-tests that this PR no longer adds.
  • yamllint --strict (using the repo's shared config) and actionlint are clean on both files.

@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The image workflow builds services on native amd64 and arm64 runners, then publishes multi-architecture manifests for non-pull-request events. The huntsman test matrix now includes Ubuntu ARM runners.

Changes

Native multi-architecture CI

Layer / File(s) Summary
Per-architecture image builds
.github/workflows/spider-image-build.yaml
The workflow builds each service on native amd64 and arm64 runners. Pull requests use cache-only output. Other events export architecture-specific digests and disable provenance.
Manifest assembly and inspection
.github/workflows/spider-image-build.yaml
The merge-manifests job downloads architecture digests, authenticates to GHCR, creates tagged multi-architecture manifests, and inspects them.
ARM test matrix coverage
.github/workflows/tests.yaml
The huntsman-tests matrix includes Ubuntu 22.04 and 24.04 ARM runners.

Estimated code review effort: 4 (Complex) | ~45 minutes

Sequence Diagram(s)

sequenceDiagram
  participant GitHubActions
  participant NativeRunners
  participant ArtifactStorage
  participant GHCR
  participant Buildx
  GitHubActions->>NativeRunners: Build each service for amd64 and arm64
  NativeRunners->>ArtifactStorage: Upload architecture-specific digests
  GitHubActions->>ArtifactStorage: Download digests
  GitHubActions->>GHCR: Authenticate
  GitHubActions->>Buildx: Create tagged multi-architecture manifests
  Buildx->>GHCR: Publish manifests
  GitHubActions->>GHCR: Inspect the resulting manifest
Loading

Possibly related PRs

  • y-scope/spider#376: Introduces the image workflow that this change updates for native multi-architecture publishing.

Suggested reviewers: sitaowang1998, linzhihao-723

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the multi-architecture image changes and ARM64 test runner updates.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@jackluo923
jackluo923 force-pushed the ci/multi-arch-images branch from 245ddd0 to 7e5483c Compare August 6, 2026 07:28
…d arm64 test legs.

Builds each service on a native runner per arch, pushes each arch by digest, and merges the
per-arch digests into one multi-arch manifest per service.
@jackluo923
jackluo923 force-pushed the ci/multi-arch-images branch from 7e5483c to 1f7aa1e Compare August 6, 2026 07:29
@jackluo923
jackluo923 marked this pull request as ready for review August 6, 2026 07:34
@jackluo923
jackluo923 requested review from a team and sitaowang1998 as code owners August 6, 2026 07:34
@jackluo923
jackluo923 requested a review from 20001020ycx August 6, 2026 07:34
Comment thread .github/workflows/tests.yaml Outdated
…or `huntsman-tests`.

The C++ implementation is unofficially deprecated and slated for removal, so
there's no value in adding ARM64 coverage for it. `wolf-tests` is restored to
match `main` exactly, which also makes the `rm --force` workaround unnecessary
since the job no longer runs on ARM64 runners.

`huntsman-tests` keeps its ARM64 legs: the Rust suite builds and runs natively
on ARM64 with no changes to the dependency install scripts.
@jackluo923 jackluo923 changed the title ci: Build and publish multi-arch (x86-64 and ARM64) container images; Run tests on ARM64 runners. ci: Build and publish multi-arch (x86-64 and ARM64) container images; Run Rust tests on ARM64 runners. Aug 6, 2026
@jackluo923 jackluo923 changed the title ci: Build and publish multi-arch (x86-64 and ARM64) container images; Run Rust tests on ARM64 runners. ci: Build and publish multi-arch (x86-64 and ARM64) container images and run Rust tests on ARM64 runners. Aug 6, 2026
@jackluo923 jackluo923 changed the title ci: Build and publish multi-arch (x86-64 and ARM64) container images and run Rust tests on ARM64 runners. ci: Build and publish multi-arch (x86-64 and ARM64) container images and also run Rust tests on ARM64 runners. Aug 6, 2026
@jackluo923
jackluo923 force-pushed the ci/multi-arch-images branch from 0c4fd4e to 1cfb0a3 Compare August 6, 2026 16:55
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@jackluo923 jackluo923 closed this Aug 7, 2026
@jackluo923 jackluo923 reopened this Aug 7, 2026

@junhaoliao junhaoliao left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Comment on lines +42 to +43
# Each arch is built on a native runner rather than through QEMU emulation, since
# emulating the Rust build would be an order of magnitude slower.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this design decision may not need to live in the workflow; i think we can just document only what the matrix mapping does

Suggested change
# Each arch is built on a native runner rather than through QEMU emulation, since
# emulating the Rust build would be an order of magnitude slower.
# Map each architecture to its native runner.


- name: "Upload digest"
if: "github.event_name != 'pull_request'"
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: "actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f" # v6.0.0
uses: "actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a" # v7.0.1

echo "name=${GITHUB_REPOSITORY,,}" >> "$GITHUB_OUTPUT"

- name: "Download digests"
uses: "actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53" # v6.0.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
uses: "actions/download-artifact@018cc2cf5baa6db3ef3c5f8a56943fffe632ef53" # v6.0.0
uses: "actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c" # v8.0.1

pattern: "digests-${{matrix.service}}-*"
merge-multiple: true

- uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0
- uses: "docker/setup-buildx-action@bb05f3f5519dd87d3ba754cc423b652a5edd6d2c" # v4.2.0


- uses: "docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2" # v3.10.0

- uses: "docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121" # v4.1.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: "docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121" # v4.1.0
- uses: "docker/login-action@dbcb813823bdd20940b903addbd779551569679f" # v4.6.0

username: "${{github.actor}}"
password: "${{secrets.GITHUB_TOKEN}}"

- uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804" # v5.7.0

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
- uses: "docker/metadata-action@902fa8ec7d6ecbf8d84d538b9b233a880e428804" # v5.7.0
- uses: "docker/metadata-action@dc802804100637a589fabce1cb79ff13a1411302" # v6.2.0

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