]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-build.git/commitdiff
ceph-iscsi: Support building for el10 2624/head
authorDavid Galloway <david.galloway@ibm.com>
Mon, 22 Jun 2026 14:51:16 +0000 (10:51 -0400)
committerDavid Galloway <david.galloway@ibm.com>
Mon, 22 Jun 2026 14:51:16 +0000 (10:51 -0400)
Signed-off-by: David Galloway <david.galloway@ibm.com>
ceph-iscsi/build/build_rpm
ceph-iscsi/config/definitions/ceph-iscsi.yml
scripts/build_utils.sh

index db272ff8cabbcee4768bfc590df4c63aea8c4b29..5dcf854d745a33f43d3903b35c52ffe4f635d4dc 100644 (file)
@@ -5,16 +5,27 @@ PROJECT=ceph-iscsi
 BRANCH=`branch_slash_filter $BRANCH`
 
 # Only do actual work when we are an RPM distro
-if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel"; then
+if test "$DISTRO" != "fedora" -a "$DISTRO" != "centos" -a "$DISTRO" != "rhel" -a "$DISTRO" != "rocky"; then
     exit 0
 fi
 
-# Install the dependencies
-sudo yum install -y mock
+# Determine the target distro/release.  rocky10 has no dedicated builders, so
+# it is built inside a rockylinux:10 container running on a centos9 host (see
+# the combination-filter in config/definitions/ceph-iscsi.yml).  In that case
+# derive the target from $DIST rather than the host's /etc/os-release.
+CONTAINER_IMAGE=""
+if [ "$DIST" = "rocky10" ]; then
+    DISTRO=rocky
+    RELEASE=10
+    CONTAINER_IMAGE=docker.io/rockylinux/rockylinux:10
+else
+    # Install the dependencies
+    sudo yum install -y mock
+    get_rpm_dist
+fi
 
 ## Get some basic information about the system and the repository
 # Get version
-get_rpm_dist
 VERSION="$(git describe --abbrev=0 --tags HEAD)"
 REVISION="$(git describe --tags HEAD | cut -d - -f 2- | sed 's/-/./')"
 if [ "$VERSION" = "$REVISION" ]; then
@@ -38,21 +49,48 @@ sed -i "s/version=\"[^\"]*\"/version=\"${VERSION}\"/g" $WORKSPACE/setup.py
 # for debugging
 cat $WORKSPACE/setup.py
 
-## Create the source rpm
-echo "Building SRPM"
-rpmbuild \
-    --define "_sourcedir $WORKSPACE/dist" \
-    --define "_specdir $WORKSPACE/dist" \
-    --define "_builddir $WORKSPACE/dist" \
-    --define "_srcrpmdir $WORKSPACE/dist/SRPMS" \
-    --define "_rpmdir $WORKSPACE/dist/RPMS" \
-    --nodeps -bs $WORKSPACE/${PROJECT}.spec
-SRPM=$(readlink -f $WORKSPACE/dist/SRPMS/*.src.rpm)
+if [ -n "$CONTAINER_IMAGE" ]; then
+    ## Build the binaries inside a container of the target distro
+    echo "Building RPMs in $CONTAINER_IMAGE"
+    # Generate the build steps as a script so it can run inside the container
+    # with the workspace bind-mounted.  Rootless podman maps the container
+    # root to the host build user, so the resulting RPMs are owned by us.
+    cat > $WORKSPACE/dist/container_build.sh <<PODMAN_EOF
+#!/bin/bash
+set -ex
+dnf install -y epel-release dnf-plugins-core rpm-build
+dnf config-manager --set-enabled crb || true
+dnf builddep -y $WORKSPACE/${PROJECT}.spec
+rpmbuild \\
+    --define "_sourcedir $WORKSPACE/dist" \\
+    --define "_specdir $WORKSPACE/dist" \\
+    --define "_builddir $WORKSPACE/dist" \\
+    --define "_srcrpmdir $WORKSPACE/dist/SRPMS" \\
+    --define "_rpmdir $WORKSPACE/dist/RPMS" \\
+    -bb $WORKSPACE/${PROJECT}.spec
+PODMAN_EOF
+    podman run --rm \
+        -v "$WORKSPACE":"$WORKSPACE":Z \
+        -w "$WORKSPACE" \
+        "$CONTAINER_IMAGE" \
+        /bin/bash -ex $WORKSPACE/dist/container_build.sh
+else
+    ## Create the source rpm
+    echo "Building SRPM"
+    rpmbuild \
+        --define "_sourcedir $WORKSPACE/dist" \
+        --define "_specdir $WORKSPACE/dist" \
+        --define "_builddir $WORKSPACE/dist" \
+        --define "_srcrpmdir $WORKSPACE/dist/SRPMS" \
+        --define "_rpmdir $WORKSPACE/dist/RPMS" \
+        --nodeps -bs $WORKSPACE/${PROJECT}.spec
+    SRPM=$(readlink -f $WORKSPACE/dist/SRPMS/*.src.rpm)
 
-## Build the binaries with mock
-echo "Building RPMs"
-sudo mock --verbose -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --scrub=all
-sudo mock --verbose -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --resultdir=$WORKSPACE/dist/RPMS/ ${SRPM} || ( tail -n +1 $WORKSPACE/dist/RPMS/{root,build}.log && exit 1 )
+    ## Build the binaries with mock
+    echo "Building RPMs"
+    sudo mock --verbose -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --scrub=all
+    sudo mock --verbose -r ${MOCK_TARGET}-${RELEASE}-${ARCH} --resultdir=$WORKSPACE/dist/RPMS/ ${SRPM} || ( tail -n +1 $WORKSPACE/dist/RPMS/{root,build}.log && exit 1 )
+fi
 
 ## Upload the created RPMs to chacra
 chacra_endpoint="${PROJECT}/${BRANCH}/${GIT_COMMIT}/${DISTRO}/${RELEASE}"
index 6c791bc8f707a2a36e7e9a899ad4156992e6a899..2026bc4fb00377716c843f68dbe9e3e12dc4a661 100644 (file)
@@ -14,8 +14,8 @@
 
       - string:
           name: DISTROS
-          description: "A list of distros to build for. Available options are: centos7, centos8, centos9"
-          default: "centos7 centos8 centos9"
+          description: "A list of distros to build for. Available options are: centos7, centos8, centos9, rocky10"
+          default: "centos7 centos8 centos9 rocky10"
 
       - string:
           name: ARCHS
@@ -35,8 +35,12 @@ If this is checked, then the binaries will be built and pushed to chacra even if
           default: "/tmp/"
 
     execution-strategy:
+       # rocky10 has no dedicated builders; it is built in a rockylinux:10
+       # container on a centos9 builder (see build/build_rpm), so route that
+       # DIST onto the centos9 node label instead of a matching AVAILABLE_DIST.
        combination-filter: |
-         DIST == AVAILABLE_DIST && ARCH == AVAILABLE_ARCH &&
+         ARCH == AVAILABLE_ARCH &&
+         ((DIST == AVAILABLE_DIST && DIST != "rocky10") || (DIST == "rocky10" && AVAILABLE_DIST == "centos9")) &&
          (ARCH == "x86_64" || (ARCH == "arm64" && ["centos7", "centos8", "centos9"].contains(DIST)))
     axes:
       - axis:
index b8d173698f9606b35e89b7f228f7621605cef2e7..b9ba8911b6cfc2359b9f637a8004ba697adffbfd 100755 (executable)
@@ -437,6 +437,10 @@ get_distro_and_target() {
             DISTRO="rhel"
             MOCK_TARGET="epel"
             ;;
+        rocky*)
+            DISTRO="rocky"
+            MOCK_TARGET="rocky+epel"
+            ;;
         fedora*)
             DISTRO="fedora"
             MOCK_TARGET="fedora"