Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build-qrmi-bins.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
---
# SPDX-License-Identifier: Apache-2.0
# (C) Copyright IBM Corporation 2026
# This reusable workflow builds the QRMI binaries.
#
# Workflow inputs:
Expand All @@ -25,9 +27,6 @@ jobs:
- name: Setup Rust toolchain
uses: actions-rust-lang/setup-rust-toolchain@v1

- name: Build task_runner
run: cargo build --bin task_runner --release --features="build-binary"

- name: Build stubgen
run: cargo build --bin stubgen --release --features="pyo3"
- name: Build task_runner and stubgen
run: make build-bins

38 changes: 38 additions & 0 deletions .github/workflows/dist.yml
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
98 changes: 98 additions & 0 deletions .github/workflows/package-deb.yml
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
125 changes: 125 additions & 0 deletions .github/workflows/package-rpm.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
---
# SPDX-License-Identifier: Apache-2.0
Copy link
Collaborator

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?

Copy link
Collaborator

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 ?

# (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
103 changes: 103 additions & 0 deletions .github/workflows/release.yml
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:
Copy link
Collaborator

Choose a reason for hiding this comment

The 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.

Copy link
Collaborator

Choose a reason for hiding this comment

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

How do we build libqrmi.so with RHEL8 compiler/linker ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

How do we build libqrmi.so with RHEL8 compiler/linker ?

That depends:

  • for the CI we just need to add one more job in the release.yaml for each RHEL version we want
  • for users via cmdline, they would need to run make build inside a container. We could create a Dockerfile (docker native) or Containerfile (podman native)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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.

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

almalinux10 is not supported ?

Copy link
Collaborator Author

@cclaudio cclaudio Mar 2, 2026

Choose a reason for hiding this comment

The 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

Copy link
Collaborator

Choose a reason for hiding this comment

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

rockylinux 10 is not supported ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The 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

Loading