Skip to content

feat(docker): Consolidate per-arch manylinux/musllinux dependency images into multi-arch images.#2357

Open
jackluo923 wants to merge 3 commits into
mainfrom
feat/multiarch-linux
Open

feat(docker): Consolidate per-arch manylinux/musllinux dependency images into multi-arch images.#2357
jackluo923 wants to merge 3 commits into
mainfrom
feat/multiarch-linux

Conversation

@jackluo923

@jackluo923 jackluo923 commented Jun 26, 2026

Copy link
Copy Markdown
Member

Description

Consolidates the four architecture-specific base-image directories (clp-env-base-{manylinux_2_28,musllinux_1_2}-{aarch64,x86_64}) into two multi-arch directories that select the target architecture via Docker buildx --platform (locally through a PLATFORM env var in build.sh). Both architectures now share a single Dockerfile/build.sh per image family.

The dependency images are published as multi-arch manifests on main: each architecture is built natively on its matching runner and published under an arch-suffixed tag (e.g. :main-amd64), then a single deps-image-merge matrix job combines the per-arch tags into one multi-arch :main manifest. Consumers pull :main and Docker auto-selects the host architecture. On PRs the images are still consumed as local tar artifacts (no publish/merge), so the merge job is gated to push-to-main only; each leg is gated on its own deps-image matrix result so a failure or skip of one OS doesn't block the other.

Other changes:

  • clp-core-build-containers and run-on-image composite actions gain an arch input to carry the architecture through arch-suffixed tags/artifacts.
  • packaging/build.sh builds the consolidated base image via PLATFORM and the three downstream binary/wheel jobs now need the merged deps-image-merge matrix job.
  • Dev docs updated (pull commands, paths, workflow diagram, job descriptions).
  • Fixes a Python 3.6 regression in the shared deb/rpm builder image: dnf install dpkg pulls in AlmaLinux's python3-3.6, which wins the /usr/bin/python3 alternative and is too old for the auto-parallelism script (build-and-run-unit-tests.py --compute-max-parallel-jobs) invoked by the packaging task. Re-registers the manylinux python3.12 at a higher alternatives priority to restore it as the default python3.

Migration note: the published ghcr repository name changes from separate per-arch repos (clp-core-dependencies-{aarch64,x86}-{manylinux_2_28,musllinux_1_2}) to a single multi-arch repo per family (clp-core-dependencies-{manylinux_2_28,musllinux_1_2}). The old per-arch ghcr repos will no longer receive :main updates; any external consumers pulling the old per-arch repo names should switch to the new :main multi-arch tag. No in-repo consumers reference the old names.

Scope note: ubuntu-jammy and centos-stream-9 dependency images are intentionally left on the legacy per-arch model (out of scope for this PR).

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

  • Built both consolidated base images locally — clp-env-base-manylinux_2_28 and clp-env-base-musllinux_1_2 — for amd64 and arm64 (via PLATFORM).
  • Built clp-s end-to-end inside the new manylinux image.
  • Built deb, rpm, and apk packages for aarch64 using packaging/build.sh --format all --arch aarch64; verified each package installs and clp-s --help runs in emulated arm64 containers (debian:bookworm, almalinux:9, alpine:3.20).
  • Verified the Python 3.6 fix: in the rebuilt deb/rpm builder image, python3 --version reports 3.12.13 (was 3.6.8) and the taskfile auto-parallelism command (build-and-run-unit-tests.py --compute-max-parallel-jobs) runs successfully (previously failed with a SyntaxError).
  • Validated the workflow YAML parses and traced needs/if skip-propagation across event scenarios (PR image-only, PR clp-only, push-to-main, schedule).
  • Swept the repo for stale references to the deleted per-arch directories / image names / job names; none remain (only two still-accurate usage comments in packaging Dockerfiles that cite the preserved local tag name).

Summary by CodeRabbit

  • New Features

    • Added multi-arch support for dependency container builds and image loading, including optional architecture selection for local builds and published image pulls.
    • Consolidated Linux dependency images into shared amd64/arm64 variants with automatic architecture selection on pull.
  • Documentation

    • Updated container and workflow docs to reflect the new multi-arch image names, build paths, and cross-build guidance.

@jackluo923 jackluo923 requested a review from a team as a code owner June 26, 2026 23:06
@coderabbitai

coderabbitai Bot commented Jun 26, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

The PR updates container build and consumption paths for multi-architecture dependency images. It adds arch-aware naming to build and run actions, switches the dependency base images and build scripts to multi-arch targets, rewires the workflow to build and merge per-arch images, and updates related docs.

Changes

Multi-arch dependency image pipeline

Layer / File(s) Summary
Arch-aware image naming
.github/actions/clp-core-build-containers/action.yaml, .github/actions/run-on-image/action.yaml
Adds optional arch inputs and updates image property computation, artifact names, tarball paths, and local image loading to use arch-suffixed names for single-architecture builds.
Multi-arch base image builds
components/core/tools/docker-images/clp-env-base-manylinux_2_28/..., components/core/tools/docker-images/clp-env-base-musllinux_1_2/...
Switches the dependency image Dockerfiles to multi-arch bases and adds build scripts that derive the target platform, tag per-arch images, set up proxy/CA handling, and invoke docker buildx build.
Packaging base-image wiring
components/core/tools/packaging/build.sh, components/core/tools/packaging/universal-deb/Dockerfile, docs/src/dev-docs/tooling-containers.md
Makes packaging build the consolidated base-image script with PLATFORM, restores python3 to the manylinux python3.12, and updates the container docs to describe the shared multi-arch dependency images and build commands.
Deps-image matrix builds
.github/workflows/clp-artifact-build.yaml, docs/src/dev-docs/tooling-gh-workflows.md
Replaces arch-specific deps-image jobs and filters with OS-level matrix jobs, adds manifest merge jobs for main, and updates the workflow documentation to match the new DAG and job list.
Downstream image consumers
.github/workflows/clp-artifact-build.yaml
Updates the x86_64 binaries and python-wheel jobs to wait on the new deps-image and merge jobs, use the arch-less image prefix, set arch: "amd64", and gate use_published_image on the OS-level change outputs.

Sequence Diagram(s)

sequenceDiagram
  participant clp_artifact_build
  participant manylinux_2_28_deps_image
  participant musllinux_1_2_deps_image
  participant deps_image_merge
  participant manylinux_2_28_x86_64_binaries
  participant musllinux_1_2_x86_64_binaries
  clp_artifact_build->>manylinux_2_28_deps_image: build amd64 and arm64 images
  clp_artifact_build->>musllinux_1_2_deps_image: build amd64 and arm64 images
  manylinux_2_28_deps_image->>deps_image_merge: publish main-amd64 and main-arm64 tags
  musllinux_1_2_deps_image->>deps_image_merge: publish main-amd64 and main-arm64 tags
  deps_image_merge->>manylinux_2_28_x86_64_binaries: expose multi-arch :main manifest
  deps_image_merge->>musllinux_1_2_x86_64_binaries: expose multi-arch :main manifest
Loading

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Suggested reviewers

  • junhaoliao
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the main change: consolidating per-arch dependency images into multi-arch images.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feat/multiarch-linux

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 changed the title feat(docker): Consolidate per-arch manylinux/musllinux dependency images into multi-arch images feat(docker): Consolidate per-arch manylinux/musllinux dependency images into multi-arch images. Jun 26, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 178-220: The deps-image merge logic is incorrectly shared across
OS matrix values, but jobs.<job_id>.if cannot reliably use matrix so this job
will not run as intended. Split deps-image-merge into two separate jobs named
manylinux_2_28-deps-image-merge and musllinux_1_2-deps-image-merge, each with
its own fixed needs on the matching OS build job, and keep the manifest creation
steps scoped to that OS’s image base. Then update any downstream dependencies
that currently reference deps-image-merge to point to the corresponding per-OS
merge job.

In `@components/core/tools/docker-images/clp-env-base-manylinux_2_28/Dockerfile`:
- Around line 3-5: The Dockerfile base image reference is unpinned, so builds
can drift when the upstream tag changes. Update the FROM instruction in the
manylinux base image Dockerfile to use an explicit version tag or a sha256
digest for quay.io/pypa/manylinux_2_28, and keep the multi-arch build flow
intact so build.sh and DOCKER_PULL still control when the base image is
refreshed.

In `@components/core/tools/docker-images/clp-env-base-musllinux_1_2/Dockerfile`:
- Around line 3-5: Pin the base image used by the Dockerfile so builds are
reproducible; the current FROM quay.io/pypa/musllinux_1_2 in
clp-env-base-musllinux_1_2 resolves to latest and can drift. Update the image
reference in the Dockerfile to an explicit version tag or a sha256 digest,
matching the pinning approach used by the corresponding manylinux base image.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: f4ef5897-65a1-46fe-a1c6-a6c80566ee8a

📥 Commits

Reviewing files that changed from the base of the PR and between 277fba9 and e2e7f61.

📒 Files selected for processing (17)
  • .github/actions/clp-core-build-containers/action.yaml
  • .github/actions/run-on-image/action.yaml
  • .github/workflows/clp-artifact-build.yaml
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2/build.sh
  • components/core/tools/packaging/build.sh
  • components/core/tools/packaging/universal-deb/Dockerfile
  • docs/src/dev-docs/tooling-containers.md
  • docs/src/dev-docs/tooling-gh-workflows.md
💤 Files with no reviewable changes (6)
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh

Comment thread .github/workflows/clp-artifact-build.yaml Outdated
@jackluo923 jackluo923 force-pushed the feat/multiarch-linux branch from e2e7f61 to 1f60651 Compare June 27, 2026 00:28
…ges into multi-arch images

Replace the four architecture-specific base-image directories
(clp-env-base-{manylinux_2_28,musllinux_1_2}-{aarch64,x86_64}) with two
multi-arch directories that select the target architecture via Docker
buildx `--platform` (locally through the `PLATFORM` env var in build.sh).
Both architectures now share a single Dockerfile/build.sh per image family.

Publish the dependency images as multi-arch manifests on `main`: each
architecture is built natively on its matching runner and published under an
arch-suffixed tag (e.g. `:main-amd64`), then per-OS `*-deps-image-merge` jobs
combine the per-arch tags into a single multi-arch `:main` manifest. Consumers
pull `:main` and Docker auto-selects the host architecture. On PRs the images
are still consumed as local tar artifacts (no publish/merge).

Update the `clp-core-build-containers` and `run-on-image` composite actions
with an `arch` input to carry the architecture through arch-suffixed
tags/artifacts, update `packaging/build.sh` to build the consolidated base
image via `PLATFORM`, and refresh the dev docs (pull commands, paths, and the
workflow diagram).

Also fix a Python 3.6 regression in the shared deb/rpm builder image:
`dnf install dpkg` pulls in AlmaLinux's python3-3.6, which wins the
`/usr/bin/python3` alternative and is too old for the auto-parallelism script
invoked by the packaging task. Re-register the manylinux python3.12 at a
higher alternatives priority to restore it as the default `python3`.
@jackluo923 jackluo923 force-pushed the feat/multiarch-linux branch from 1f60651 to bb00596 Compare June 27, 2026 00:28

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
.github/workflows/clp-artifact-build.yaml (1)

387-413: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Allow image-only PR changes through the consumer jobs. manylinux_2_28-deps-image-merge and musllinux_1_2-deps-image-merge are skipped on PRs, but these downstream jobs still need them and only reopen the skipped path for clp_changed/yscope_clp_core_changed. A PR that changes only the manylinux or musllinux dependency image will skip the binaries/wheels validation instead of running against the rebuilt local tarball. Add the image-changed PR case to these ifs, or split the PR/main dependency chains.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/clp-artifact-build.yaml around lines 387 - 413, The
downstream consumer jobs are still gated out when only the dependency image
changes, so image-only PRs skip validation instead of running against the
rebuilt local tarball. Update the job conditions in the workflow entries that
consume the manylinux/musllinux images (including the manylinux_2_28-x86_64
linked-bins job and the corresponding image-dependent jobs) to also reopen the
path when the relevant image-changed PR outputs are true, or otherwise split the
PR/main dependency gating so image rebuilds flow into the consumer jobs.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Outside diff comments:
In @.github/workflows/clp-artifact-build.yaml:
- Around line 387-413: The downstream consumer jobs are still gated out when
only the dependency image changes, so image-only PRs skip validation instead of
running against the rebuilt local tarball. Update the job conditions in the
workflow entries that consume the manylinux/musllinux images (including the
manylinux_2_28-x86_64 linked-bins job and the corresponding image-dependent
jobs) to also reopen the path when the relevant image-changed PR outputs are
true, or otherwise split the PR/main dependency gating so image rebuilds flow
into the consumer jobs.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: ASSERTIVE

Plan: Pro

Run ID: af76fa27-b879-46be-b632-03ed3b1bb6ce

📥 Commits

Reviewing files that changed from the base of the PR and between e2e7f61 and bb00596.

📒 Files selected for processing (17)
  • .github/actions/clp-core-build-containers/action.yaml
  • .github/actions/run-on-image/action.yaml
  • .github/workflows/clp-artifact-build.yaml
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2/build.sh
  • components/core/tools/packaging/build.sh
  • components/core/tools/packaging/universal-deb/Dockerfile
  • docs/src/dev-docs/tooling-containers.md
  • docs/src/dev-docs/tooling-gh-workflows.md
💤 Files with no reviewable changes (6)
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/build.sh
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-aarch64/build.sh
  • components/core/tools/docker-images/clp-env-base-musllinux_1_2-x86_64/Dockerfile
  • components/core/tools/docker-images/clp-env-base-manylinux_2_28-x86_64/build.sh

@jackluo923 jackluo923 requested a review from junhaoliao July 9, 2026 08:30
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