Skip to content

[CICD] Add RPM packaging support for RHEL/Rocky/OpenEuler#476

Merged
MC952-arch merged 18 commits into
flagos-ai:mainfrom
shiptux:pr/rpm-packaging-clean
Jun 22, 2026
Merged

[CICD] Add RPM packaging support for RHEL/Rocky/OpenEuler#476
MC952-arch merged 18 commits into
flagos-ai:mainfrom
shiptux:pr/rpm-packaging-clean

Conversation

@shiptux

@shiptux shiptux commented May 21, 2026

Copy link
Copy Markdown
Contributor

PR Category

CICD

PR Types

New Features

PR Description

Adds RPM packaging support for FlagCX targeting RHEL / Rocky / OpenEuler
distributions, mirroring the existing Debian packaging path. Pair to
existing PR #393 (Ascend DEB) — this is the RPM-only sibling, freshly
rebased onto current main so the diff is reviewable.

Background: original PR #394 has been open since 2026-02-26 with
no review and the branch has drifted 78 commits / 304 files behind
upstream main, making the diff unreadable. This PR is a clean replay
of the same packaging work (3 commits / 5 files) onto current main.
#394 can be closed in favor of this one, or the branch on #394 can be
force-pushed to match this clean state — at the reviewer's preference.

Produced binaries (built locally per backend):

For each of nvidia / metax / ascend:

  • libflagcx-<backend>-0.8.0-1.x86_64.rpm — runtime shared library
  • libflagcx-<backend>-devel-0.8.0-1.x86_64.rpm — headers + .so symlink

6 binary RPMs per release (3 backends × {runtime, -devel}), one
backend-specific docker image per build.

What changed (all under packaging/rpm/, no DEB or source changes):

  • rpm/specs/flagcx.spec — Parameterized spec using %{backend}
    macro to generate per-backend package names. Conditional sub-package
    declaration; SONAME + RPATH handling via patchelf for
    /usr/lib relocation.
  • rpm/dockerfiles/Dockerfile.rpm — Unified Dockerfile with
    BASE_IMAGE + BACKEND build args. Three backends share one
    Dockerfile, picking distinct vendor SDK base images:
    • nvidia: rockylinux:8 + CUDA RPM repo
    • metax: rockylinux:8 + MACA SDK yum repo
    • ascend: openeuler:24.03 + Huawei CANN
  • rpm/build-flagcx-rpm.sh — Parameterized entry point:
    ./packaging/rpm/build-flagcx-rpm.sh <backend>.
  • .github/workflows/build-rpm.yml — CI matrix building all three
    backends on push and PR. Mirrors build-deb.yml from [CICD] add Ascend NPU backend support for Debian packages #393.

How it was tested:

bash packaging/rpm/build-flagcx-rpm.sh nvidia produces
libflagcx-nvidia + libflagcx-nvidia-devel RPMs cleanly in a
rockylinux:8 container. Same flow for metax / ascend with their
respective base images.

Companion DEB packaging (PR #393) and central distribution pipeline
(https://github.com/shiptux/flagos-packaging) are unaffected by this
PR — they were validated separately and continue to work.

Known limitations

  • MetaX SDK repo (Dockerfile.rpm for BACKEND=metax): gpgcheck=0. The MetaX upstream APT/YUM repo currently ships unsigned packages and does not publish a GPG public key; enabling gpgcheck=1 would just fail. Documented inline as TODO; please flag in this review if a stable MetaX GPG key has appeared since.
  • libnccl lower bound: Requires: libnccl >= 2.10 (group-call API minimum). FlagCX's NCCL adaptor may rely on ncclConfig (2.14+) in some code paths but we have not confirmed; if you spot one, please ask us to bump.
  • Dockerfile.metax-apt (RPM) is not part of this PR; the apt-based MetaX wheel-builder path lives in the sibling flagcx-packaging repo and is tracked separately.

@shiptux shiptux marked this pull request as draft May 21, 2026 12:39
@shiptux shiptux marked this pull request as ready for review May 21, 2026 15:09
@shiptux shiptux marked this pull request as draft May 21, 2026 16:48
@shiptux shiptux marked this pull request as ready for review May 22, 2026 13:48
Comment thread packaging/debian/control
Comment thread packaging/rpm/dockerfiles/Dockerfile.rpm Outdated
@MC952-arch

Copy link
Copy Markdown
Collaborator

Please rebase your code to pass CI tests

Comment thread .github/workflows/build-rpm.yml
@MC952-arch

Copy link
Copy Markdown
Collaborator
  1. Please rebase your changes on top of the latest code to incorporate the fix for the GPU waiting issue in the perf-test workflow.
  2. Please refer to PR 495 for guidance on reducing C++17 dependencies to C++11, which we adopted to support RPM packaging on NVIDIA and MetaX platforms.

@MC952-arch

Copy link
Copy Markdown
Collaborator

@shiptux Please rebase your code

shiptux added 18 commits June 16, 2026 21:49
Add complete RPM packaging infrastructure:
- RPM spec file with conditional backend builds (nvidia, metax, ascend)
- Dockerfiles for NVIDIA (Rocky Linux 8) and Ascend (OpenEuler 24.03)
- Parameterized build script (build-flagcx-rpm.sh)
- GitHub Actions workflow for automated RPM builds
- Proper SONAME and RPATH handling via patchelf
- ASL 2.0 license identifier for RPM compliance
… backend

- Rewrite flagcx.spec to use %{backend} dynamic package names,
  reducing 222 lines to ~90 lines and eliminating empty sub-packages
- Merge three per-backend Dockerfiles into unified Dockerfile.rpm
  with BASE_IMAGE and BACKEND build args
- Add MetaX RPM support via Rocky Linux 8 + MACA SDK yum repo
- Extract version from spec via grep instead of hardcoding in Dockerfiles
- Add --network=host to docker build for DNS reliability
- Add PR-REVIEW-ISSUES.md for tracking remaining items
The Docker Buildx setup step was removed from the GitHub Actions workflow for building RPM packages. This suggests that the RPM build process no longer requires Docker Buildx capabilities, potentially simplifying the build environment or moving to a different build approach.
Upload built RPMs to flagos-yum-hosted from within the build-rpm job on
the same self-hosted runner, gated on v* tags. h20 reaches the internal
Nexus but not codeload/api.github.com reliably, so avoid the cross-workflow
artifact round-trip that the deb upload-nexus flow depends on.
…sh to tag-only job

Move the RPM build off the internal h20 runner onto GitHub-hosted runners
so PR checks no longer depend on h20's flaky public egress (Docker Hub /
github.com). The build is host-agnostic since RPMs are produced inside
backend-specific Docker images from public registries; ascend builds on an
arm64 runner to match its aarch64 target, nvidia/metax on x86_64.

Nexus publishing is split into a separate tag-only job that stays on h20
(the only runner that can reach the internal Nexus) and never runs on
pull_request, so fork PRs are never handed the Nexus credentials.
@shiptux shiptux force-pushed the pr/rpm-packaging-clean branch from 499342b to 98f2711 Compare June 16, 2026 12:50
@shiptux

shiptux commented Jun 16, 2026

Copy link
Copy Markdown
Contributor Author

@shiptux Please rebase your code

done

@MC952-arch MC952-arch merged commit de06640 into flagos-ai:main Jun 22, 2026
15 of 16 checks passed
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