Skip to content

feat(ci): Add arm64 build support for clp-package Docker image.#1830

Open
junhaoliao wants to merge 9 commits intoy-scope:mainfrom
junhaoliao:multi-arch-docker
Open

feat(ci): Add arm64 build support for clp-package Docker image.#1830
junhaoliao wants to merge 9 commits intoy-scope:mainfrom
junhaoliao:multi-arch-docker

Conversation

@junhaoliao
Copy link
Member

@junhaoliao junhaoliao commented Dec 26, 2025

Description

Add multi-architecture (amd64 and arm64) support for the clp-package Docker image build and push workflow.

Changes:

  1. .github/actions/clp-build-runtime-image/action.yaml:

    • Add arch input parameter to specify target architecture (default: amd64)
    • Update docker/build-push-action to use platforms: "linux/${{inputs.arch}}"
    • Add provenance: false to create simple images instead of manifest lists, enabling docker manifest create to combine per-arch images
    • Append architecture suffix to image tags (e.g., clp-package:main-amd64)
  2. .github/workflows/clp-artifact-build.yaml:

    • Rename DEPS_IMAGE_NAME_PREFIX to DEPS_IMAGE_NAME_PREFIX_AMD64
    • Add DEPS_IMAGE_NAME_PREFIX_ARM64: "clp-core-dependencies-arm64-"
    • Rename ubuntu-jammy-deps-image to ubuntu-jammy-amd64-deps-image for consistency
    • Add ubuntu-jammy-arm64-deps-image job that builds deps on arm64 runners
    • Modify package-image job to use matrix strategy for ["amd64", "arm64"]
    • Add package-image-multiarch-manifest job that creates and pushes a combined multi-arch manifest

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

  • Workflow ran successfully: https://github.com/junhaoliao/clp/actions/runs/20521459673
    • Verified provenance: false resolves the "is a manifest list" error when creating multi-arch manifests
  • Tested on a Dell XPS 9345 (Snapdragon X Elite X1E-80-100, ARMv8 compatible):
     > docker run --rm ghcr.io/junhaoliao/clp/clp-package:main clp-s --help
     Usage: clp-s [OPTIONS] COMMAND [COMMAND ARGUMENTS]
     COMMAND is one of:
       c - compress
       x - decompress
       s - search
     
     Try  c --help OR x --help OR s --help for command-specific details.
     
     General options:
       -h [ --help ]          Print help
     
     > docker run --rm ghcr.io/junhaoliao/clp/clp-package:main uname -p -i
     aarch64 aarch64

Summary by CodeRabbit

Release Notes

  • New Features

    • Added ARM64 image build support alongside AMD64.
    • Automated creation and publishing of multi-architecture Docker manifests for package images.
  • Chores

    • Build pipelines updated to handle architecture-specific image names, build and publish flows, and per-architecture packaging.

✏️ Tip: You can customize this high-level summary in your review settings.


@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 26, 2025

Walkthrough

Adds multi-architecture (amd64, arm64) build support across GitHub Action and workflow: action input arch, per-arch image build/push steps and naming, architecture-specific deps image jobs, matrixed package-image builds, and a job to create and push a multi-arch docker manifest.

Changes

Cohort / File(s) Summary
Runtime Image Action
.github/actions/clp-build-runtime-image/action.yaml
Added public arch input (default "amd64", optional). Build-and-push step now sets platforms: "linux/${{inputs.arch}}", provenance: false, and appends -${{inputs.arch}} to generated image tags.
Artifact Build Workflow (main)
.github/workflows/clp-artifact-build.yaml
Added DEPS_IMAGE_NAME_PREFIX_AMD64 and DEPS_IMAGE_NAME_PREFIX_ARM64. Split/renamed deps-image jobs into amd64/arm64 variants (ubuntu-jammy-amd64-deps-image, ubuntu-jammy-arm64-deps-image), converted many jobs/runners to be arch-aware, and updated image naming to select prefix by arch.
Package Image & Manifest Jobs
.github/workflows/clp-artifact-build.yaml
Introduced package-image as a matrix over amd64/arm64, added package-image-multiarch-manifest job to log in, sanitize repo name, create a docker manifest referencing amd64+arm64 images, and push the multi-arch manifest.
Per-arch Build Steps
.github/workflows/clp-artifact-build.yaml
Added explicit amd64 and arm64 build/run steps and contexts for ubuntu-jammy images and related binaries; many image build/deploy steps now branch on arch and use appropriate prefix/paths.

Sequence Diagram(s)

sequenceDiagram
    participant Trigger as Workflow Trigger
    participant AMD64 as AMD64 Build Jobs
    participant ARM64 as ARM64 Build Jobs
    participant Registry as Container Registry
    participant Manifest as Manifest Job

    Trigger->>AMD64: Start `ubuntu-jammy-amd64-deps-image` and other amd64 jobs
    Trigger->>ARM64: Start `ubuntu-jammy-arm64-deps-image` and other arm64 jobs

    par Parallel push
      AMD64->>Registry: Build & push image tags with `-amd64`
      ARM64->>Registry: Build & push image tags with `-arm64`
    end

    Trigger->>Manifest: Start `package-image-multiarch-manifest`
    Manifest->>Registry: Create manifest list referencing `-amd64` & `-arm64`
    Manifest->>Registry: Push multi-arch manifest
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main change: adding ARM64 build support for the clp-package Docker image, which aligns with the substantial modifications to CI workflows for multi-architecture support.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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 and usage tips.

@junhaoliao junhaoliao changed the title Multi arch docker feat(ci): Add arm64 build support for clp-package Docker image. Dec 26, 2025
@junhaoliao junhaoliao marked this pull request as ready for review December 26, 2025 12:08
@junhaoliao junhaoliao requested a review from a team as a code owner December 26, 2025 12:08
@junhaoliao junhaoliao changed the title feat(ci): Add arm64 build support for clp-package Docker image. feat(ci): Add arm64 build support for clp-package Docker image Dec 26, 2025
@junhaoliao junhaoliao changed the title feat(ci): Add arm64 build support for clp-package Docker image feat(ci): Add arm64 build support for clp-package Docker image. Dec 26, 2025
jackluo923
jackluo923 previously approved these changes Jan 6, 2026

package-image-multiarch-manifest:
name: "package-image-multiarch-manifest"
if: "github.event_name != 'pull_request' && github.ref == 'refs/heads/main'"
Copy link
Member

Choose a reason for hiding this comment

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

I think we should also check for package-image should be successful
&& needs.package-image.result == 'success'

@junhaoliao junhaoliao modified the milestones: Backlog, February 2026 Jan 19, 2026
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.

2 participants