-
Notifications
You must be signed in to change notification settings - Fork 19
[DRAFT-only-for-discussion] QRMI packaging #68
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
e5cc4d3
d428f3b
b10486f
240442c
c9099f4
c33c5df
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| --- | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # (C) Copyright IBM Corporation 2026 | ||
| # This reusable workflow creates the source code tarball and the vendor tarball. | ||
| # It is intended to be called before packaging jobs (RPM, .deb) so that tarballs | ||
| # are built once and shared across all packaging jobs via the qrmi-dist artifact. | ||
| # | ||
| # Workflow inputs: | ||
| # - None | ||
| # | ||
| # Workflow artifacts produced: | ||
| # - [uploaded] qrmi-dist (qrmi-{version}.tar.gz, qrmi-{version}-vendor.tar.gz) | ||
| # | ||
| # Workflow dependencies: | ||
| # - None. It does not depend on any other workflow. | ||
| name: Create source and vendor tarballs | ||
| on: | ||
| workflow_call: | ||
| jobs: | ||
| dist: | ||
| runs-on: ubuntu-24.04 | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
|
||
| - name: Create source and vendor tarballs | ||
| run: make dist | ||
|
|
||
| - name: Upload tarballs | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: qrmi-dist | ||
| path: /tmp/qrmi-*.tar.gz | ||
| if-no-files-found: error | ||
| retention-days: 1 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,98 @@ | ||
| --- | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # (C) Copyright IBM Corporation 2026 | ||
| # This reusable workflow builds Debian packages for a given Linux distribution and version. | ||
| # It is intended to be called on release/tag events, not on pull requests. | ||
| # | ||
| # It produces: | ||
| # - libqrmi .deb (libqrmi.so) | ||
| # - libqrmi-dev .deb (libqrmi.a + qrmi.h) | ||
| # | ||
| # The QRMI version is read from Cargo.toml (single source of truth) and used | ||
| # to update packaging/debian/changelog before building. | ||
| # | ||
| # Workflow inputs: | ||
| # - [required] distro: short distro name used in artifact names (e.g. debian, ubuntu) | ||
| # - [required] distro-version: OS version name or number (e.g. bookworm, 24.04) | ||
| # - [required] container-image: full container image reference (e.g. debian:bookworm, ubuntu:24.04) | ||
| # | ||
| # Workflow artifacts produced: | ||
| # - [uploaded] qrmi-debs-{distro}{distro-version} (*.deb) | ||
| # | ||
| # Workflow dependencies: | ||
| # - None. It does not depend on any other workflow. | ||
| # | ||
| # Example caller (release workflow): | ||
| # | ||
| # package-debian-bookworm: | ||
| # uses: ./.github/workflows/package-deb.yml | ||
| # with: | ||
| # distro: debian | ||
| # distro-version: bookworm | ||
| # container-image: debian:bookworm | ||
| # | ||
| # package-ubuntu-2404: | ||
| # uses: ./.github/workflows/package-deb.yml | ||
| # with: | ||
| # distro: ubuntu | ||
| # distro-version: "24.04" | ||
| # container-image: ubuntu:24.04 | ||
| name: Package .deb for Debian and Ubuntu | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| distro: | ||
| description: >- | ||
| Short distro name used in artifact names (e.g. debian, ubuntu) | ||
| type: string | ||
| required: true | ||
| distro-version: | ||
| description: >- | ||
| OS version name or number (e.g. bookworm, 24.04) | ||
| type: string | ||
| required: true | ||
| container-image: | ||
| description: >- | ||
| Full container image reference (e.g. debian:bookworm, ubuntu:24.04) | ||
| type: string | ||
| required: true | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| DEBIAN_FRONTEND: noninteractive | ||
| jobs: | ||
| package: | ||
| runs-on: ubuntu-24.04 | ||
| container: | ||
| image: ${{ inputs.container-image }} | ||
| steps: | ||
| - name: Install minimal bootstrap dependencies | ||
| run: | | ||
| apt-get update -y | ||
| apt-get install -y \ | ||
| curl \ | ||
| git \ | ||
| devscripts \ | ||
| equivs | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Use debian/control as the single source of truth for build dependencies. | ||
| # This ensures the CI environment always matches what dpkg-buildpackage requires. | ||
| - name: Install build dependencies from debian/control | ||
| run: mk-build-deps --install --remove --tool "apt-get -y" packaging/debian/control | ||
|
|
||
| - name: Setup Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
|
||
| - name: Build Debian packages | ||
| run: make deb | ||
|
|
||
| - name: Upload .deb packages | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ success() }} | ||
| with: | ||
| name: qrmi-debs-${{ inputs.distro }}${{ inputs.distro-version }} | ||
| path: ../*.deb | ||
| if-no-files-found: error | ||
| retention-days: 30 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,125 @@ | ||
| --- | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # (C) Copyright IBM Corporation 2026 | ||
| # This reusable workflow builds RPM packages for a given Linux distribution and version. | ||
| # It is intended to be called on release/tag events, not on pull requests. | ||
| # For building the project on pull requests, use build-rpm.yml instead. | ||
| # | ||
| # It produces: | ||
| # - qrmi RPM (libqrmi.so) | ||
| # - qrmi-devel RPM (libqrmi.a + qrmi.h) | ||
| # | ||
| # The QRMI version is read from Cargo.toml (single source of truth) and passed | ||
| # to rpmbuild via --define so the generated RPM metadata matches exactly. | ||
| # | ||
| # Workflow inputs: | ||
| # - [required] distro: short distro name used in artifact names (e.g. almalinux, rockylinux, centos) | ||
| # - [required] distro-version: OS major version (e.g. 8, 9) | ||
| # - [required] container-image: full container image reference (e.g. almalinux:8, quay.io/centos/centos:stream9) | ||
| # | ||
| # Workflow artifacts produced: | ||
| # - [uploaded] qrmi-rpms-{distro}{distro-version} (*.rpm) | ||
| # | ||
| # Workflow dependencies: | ||
| # - None. It does not depend on any other workflow. | ||
| # | ||
| # Example caller (release workflow): | ||
| # | ||
| # package-almalinux8: | ||
| # uses: ./.github/workflows/package-rpm.yml | ||
| # with: | ||
| # distro: almalinux | ||
| # distro-version: "8" | ||
| # container-image: almalinux:8 | ||
| # | ||
| # package-centos9: | ||
| # uses: ./.github/workflows/package-rpm.yml | ||
| # with: | ||
| # distro: centos | ||
| # distro-version: "9" | ||
| # container-image: quay.io/centos/centos:stream9 | ||
| name: Package RPMs for AlmaLinux, Rocky Linux and CentOS | ||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| distro: | ||
| description: >- | ||
| Short distro name used in artifact names (e.g. almalinux, rockylinux, centos) | ||
| type: string | ||
| required: true | ||
| distro-version: | ||
| description: >- | ||
| Major OS version to build for (e.g. 8, 9) | ||
| type: string | ||
| required: true | ||
| container-image: | ||
| description: >- | ||
| Full container image reference (e.g. almalinux:8, quay.io/centos/centos:stream9) | ||
| type: string | ||
| required: true | ||
| env: | ||
| CARGO_TERM_COLOR: always | ||
| jobs: | ||
| package: | ||
| runs-on: ubuntu-24.04 | ||
| container: | ||
| image: ${{ inputs.container-image }} | ||
| steps: | ||
| - name: Install minimal bootstrap dependencies | ||
| run: | | ||
| dnf install -y \ | ||
| curl \ | ||
| git \ | ||
| rpm-build | ||
|
|
||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| # Use the spec file as the single source of truth for build dependencies. | ||
| # This ensures the CI environment always matches what rpmbuild requires. | ||
| - name: Install RPM build dependencies from qrmi.spec | ||
| run: dnf builddep -y packaging/rpm/qrmi.spec | ||
|
|
||
| - name: Setup Rust toolchain | ||
| uses: actions-rust-lang/setup-rust-toolchain@v1 | ||
|
|
||
| # Extract the version from Cargo.toml so that Cargo.toml is the single | ||
| # source of truth for the QRMI version used in the RPM metadata. | ||
| - name: Extract QRMI version from Cargo.toml | ||
| id: qrmi-version | ||
| run: | | ||
| VERSION=$(grep -m1 '^version' Cargo.toml | sed 's/.*"\(.*\)".*/\1/') | ||
| echo "value=${VERSION}" >> "${GITHUB_OUTPUT}" | ||
|
|
||
| - name: Download source and vendor tarballs | ||
| uses: actions/download-artifact@v4 | ||
| with: | ||
| name: qrmi-dist | ||
| path: /tmp | ||
|
|
||
| - name: Set up rpmbuild tree | ||
| env: | ||
| QRMI_VERSION: ${{ steps.qrmi-version.outputs.value }} | ||
| run: | | ||
| set -e | ||
| mkdir -p ~/rpmbuild/{BUILD,BUILDROOT,RPMS,SOURCES,SPECS,SRPMS} | ||
| cp /tmp/qrmi-${QRMI_VERSION}.tar.gz ~/rpmbuild/SOURCES/ | ||
| cp /tmp/qrmi-${QRMI_VERSION}-vendor.tar.gz ~/rpmbuild/SOURCES/ | ||
| cp packaging/rpm/qrmi.spec ~/rpmbuild/SPECS/ | ||
|
|
||
| - name: Build RPMs | ||
| run: | | ||
| . "$HOME/.cargo/env" | ||
| rpmbuild -ba \ | ||
| --define "version ${{ steps.qrmi-version.outputs.value }}" \ | ||
| --define "dist .el${{ inputs.distro-version }}" \ | ||
| ~/rpmbuild/SPECS/qrmi.spec | ||
|
|
||
| - name: Upload RPMs | ||
| uses: actions/upload-artifact@v4 | ||
| if: ${{ success() }} | ||
| with: | ||
| name: qrmi-rpms-${{ inputs.distro }}${{ inputs.distro-version }} | ||
| path: ~/rpmbuild/RPMS/**/*.rpm | ||
| if-no-files-found: error | ||
| retention-days: 30 | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,103 @@ | ||
| --- | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
| # (C) Copyright IBM Corporation 2026 | ||
| # This workflow builds and publishes RPM and Debian packages on release/tag events. | ||
| # | ||
| # Workflow inputs: | ||
| # - None (triggered by tag push matching v*.*.*) | ||
| # | ||
| # Workflow artifacts produced: | ||
| # - qrmi-dist source and vendor tarballs | ||
| # - qrmi-rpms-* artifacts for each RPM-based distro/version combination | ||
| # - qrmi-debs-* artifacts for each Debian-based distro/version combination | ||
| name: Release | ||
| on: | ||
| push: | ||
| tags: | ||
| - "v*.*.*" | ||
| jobs: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. package-rhel8, package-rhel9 and package-rhel10 are missing. At least, we need to provide packages for rhel8 and 9 because most of HPC data center uses.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. How do we build libqrmi.so with RHEL8 compiler/linker ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
That depends:
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
OK, I will add RHEL 8 9 and 10 |
||
| dist: | ||
| name: Create source and vendor tarballs | ||
| uses: ./.github/workflows/dist.yml | ||
|
|
||
| package-almalinux8: | ||
| name: Package RPMs for AlmaLinux 8 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: almalinux | ||
| distro-version: "8" | ||
| container-image: almalinux:8 | ||
|
|
||
| package-almalinux9: | ||
| name: Package RPMs for AlmaLinux 9 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: almalinux | ||
| distro-version: "9" | ||
| container-image: almalinux:9 | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. almalinux10 is not supported ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @awennersteen I can add almalinux10 |
||
| package-rockylinux8: | ||
| name: Package RPMs for Rocky Linux 8 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: rockylinux | ||
| distro-version: "8" | ||
| container-image: rockylinux:8 | ||
|
|
||
| package-rockylinux9: | ||
| name: Package RPMs for Rocky Linux 9 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: rockylinux | ||
| distro-version: "9" | ||
| container-image: rockylinux:9 | ||
|
|
||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. rockylinux 10 is not supported ?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can add rockylinux 10 |
||
| package-centos8: | ||
| name: Package RPMs for CentOS Stream 8 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: centos | ||
| distro-version: "8" | ||
| container-image: quay.io/centos/centos:stream8 | ||
|
|
||
| package-centos9: | ||
| name: Package RPMs for CentOS Stream 9 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-rpm.yml | ||
| with: | ||
| distro: centos | ||
| distro-version: "9" | ||
| container-image: quay.io/centos/centos:stream9 | ||
|
|
||
| package-debian-bookworm: | ||
| name: Package .deb for Debian Bookworm | ||
| needs: dist | ||
| uses: ./.github/workflows/package-deb.yml | ||
| with: | ||
| distro: debian | ||
| distro-version: bookworm | ||
| container-image: debian:bookworm | ||
|
|
||
| package-ubuntu-2204: | ||
| name: Package .deb for Ubuntu 22.04 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-deb.yml | ||
| with: | ||
| distro: ubuntu | ||
| distro-version: "22.04" | ||
| container-image: ubuntu:22.04 | ||
|
|
||
| package-ubuntu-2404: | ||
| name: Package .deb for Ubuntu 24.04 | ||
| needs: dist | ||
| uses: ./.github/workflows/package-deb.yml | ||
| with: | ||
| distro: ubuntu | ||
| distro-version: "24.04" | ||
| container-image: ubuntu:24.04 | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suppose multiple developers share the same system — for example, the login nodes or pre/post nodes on an HPC cluster. If Developer-A needs a specific version of libqrmi.so/qrmi.h for his/her development, while Developer-B needs a different version, I think RPM/Deb‑based distribution will not allow installing multiple versions simultaneously.
In addition, wouldn’t installation require admin privileges?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you please consider to support a simple tarball distribution, which contains libqrmi.so, libqrmi.a and qrmi.h ?