Repository: fedora-iot/greenboot
Pull request #208: ci: add rhel-10 and cs-10 support
Author: login: yih-redhat
Created: 2025-03-06T04:33:28Z | Merged: 2025-03-11T03:28:20Z

Run test cases on CS10 and RHEL10 in greenboot CI.


Diff:
diff --git a/.github/workflows/greenboot-ci.yaml b/.github/workflows/greenboot-ci.yaml
index 9af099c..b5b5cbd 100644
--- a/.github/workflows/greenboot-ci.yaml
+++ b/.github/workflows/greenboot-ci.yaml
@@ -57,9 +57,14 @@ jobs:
           tmt_context: "arch=x86_64;distro=fedora-41"
           tmt_plan_regex: bootc
           tf_scope: private
-          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
           variables: "ARCH=x86_64"
           timeout: 90
+          secrets: |
+            QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
+            QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
+            STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
+            STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
+            DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
 
   # Fedora-rawhide-bootc:
   #   needs: check-pull-request
@@ -99,9 +104,40 @@ jobs:
           tmt_context: "arch=x86_64;distro=cs-9"
           tmt_plan_regex: bootc
           tf_scope: private
-          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
           variables: "ARCH=x86_64"
           timeout: 90
+          secrets: |
+            QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
+            QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
+            STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
+            STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
+            DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
+
+  Centos-stream-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: CentOS-Stream-10
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=cs-10"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          variables: "ARCH=x86_64"
+          timeout: 90
+          secrets: |
+            QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
+            QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
+            STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
+            STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
+            DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
 
   RHEL-96-bootc:
     needs: check-pull-request
@@ -120,6 +156,37 @@ jobs:
           tmt_context: "arch=x86_64;distro=rhel-9-6"
           tmt_plan_regex: bootc
           tf_scope: private
-          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
           variables: "ARCH=x86_64"
           timeout: 90
+          secrets: |
+            QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
+            QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
+            STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
+            STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
+            DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
+
+  RHEL-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: RHEL-10.0-Nightly
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=rhel-10-0"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          variables: "ARCH=x86_64"
+          timeout: 90
+          secrets: |
+            QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
+            QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
+            STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
+            STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
+            DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
diff --git a/tests/files/rhel-10-0.repo b/tests/files/rhel-10-0.repo
new file mode 100644
index 0000000..c44779f
--- /dev/null
+++ b/tests/files/rhel-10-0.repo
@@ -0,0 +1,10 @@
+[RHEL-10-NIGHTLY-BaseOS]
+name=baseos
+baseurl=http://REPLACE_ME_HERE/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/BaseOS/x86_64/os
+enabled=1
+gpgcheck=0
+[RHEL-10-NIGHTLY-AppStream]
+name=appstream
+baseurl=http://REPLACE_ME_HERE/rhel-10/nightly/RHEL-10/latest-RHEL-10.0/compose/AppStream/x86_64/os/
+enabled=1
+gpgcheck=0
diff --git a/tests/greenboot-bootc-anaconda-iso.sh b/tests/greenboot-bootc-anaconda-iso.sh
index 025a47c..7248c75 100755
--- a/tests/greenboot-bootc-anaconda-iso.sh
+++ b/tests/greenboot-bootc-anaconda-iso.sh
@@ -50,6 +50,13 @@ case "${ID}-${VERSION_ID}" in
         BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
         BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
         ;;
+    "centos-10")
+        OS_VARIANT="centos-stream9"
+        BASE_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream10"
+        #BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
+        BIB_URL="quay.io/redhat-user-workloads/centos-bootc-tenant/bootc-image-builder/bootc-image-builder@sha256:58885c4bec997686868bc238eb5007b137f1b32d2995bfb689dc74ca329d0cd9"
+        BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
+        ;;
     "rhel-9.6")
         OS_VARIANT="rhel9-unknown"
         BASE_IMAGE_URL="registry.stage.redhat.io/rhel9/rhel-bootc:9.6"
@@ -57,6 +64,13 @@ case "${ID}-${VERSION_ID}" in
         BOOT_ARGS="uefi"
         sed -i "s/REPLACE_ME_HERE/${DOWNLOAD_NODE}/g" files/rhel-9-6.repo
         ;;
+    "rhel-10.0")
+        OS_VARIANT="rhel10-unknown"
+        BASE_IMAGE_URL="registry.stage.redhat.io/rhel10/rhel-bootc:10.0"
+        BIB_URL="registry.stage.redhat.io/rhel10/bootc-image-builder:10.0"
+        BOOT_ARGS="uefi"
+        sed -i "s/REPLACE_ME_HERE/${DOWNLOAD_NODE}/g" files/rhel-10-0.repo
+        ;;
     *)
         echo "unsupported distro: ${ID}-${VERSION_ID}"
         exit 1;;
@@ -194,12 +208,18 @@ RUN dnf install -y \
 RUN rm -f /tmp/greenboot-*.rpm
 EOF
 
-if [[ "$ID" == "rhel" ]]; then
+if [[ "${ID}-${VERSION_ID}" == "rhel-9.6" ]]; then
     tee -a Containerfile >> /dev/null << EOF
 COPY files/rhel-9-6.repo /etc/yum.repos.d/rhel-9-6.repo
 EOF
 fi
 
+if [[ "${ID}-${VERSION_ID}" == "rhel-10.0" ]]; then
+    tee -a Containerfile >> /dev/null << EOF
+COPY files/rhel-10-0.repo /etc/yum.repos.d/rhel-10-0.repo
+EOF
+fi
+
 podman build  --retry=5 --retry-delay=10s -t quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID} -f Containerfile .
 greenprint "Pushing greenboot-bootc container to quay.io"
 podman push quay.io/${QUAY_USERNAME}/greenboot-bootc:${TEST_UUID}
diff --git a/tests/greenboot-bootc-qcow2.sh b/tests/greenboot-bootc-qcow2.sh
index 0cc1721..2a1ea40 100755
--- a/tests/greenboot-bootc-qcow2.sh
+++ b/tests/greenboot-bootc-qcow2.sh
@@ -50,12 +50,24 @@ case "${ID}-${VERSION_ID}" in
         BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
         BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
         ;;
+    "centos-10")
+        OS_VARIANT="centos-stream9"
+        BASE_IMAGE_URL="quay.io/centos-bootc/centos-bootc:stream10"
+        BIB_URL="quay.io/centos-bootc/bootc-image-builder:latest"
+        BOOT_ARGS="uefi,firmware.feature0.name=secure-boot,firmware.feature0.enabled=no"
+        ;;
     "rhel-9.6")
         OS_VARIANT="rhel9-unknown"
         BASE_IMAGE_URL="registry.stage.redhat.io/rhel9/rhel-bootc:9.6"
         BIB_URL="registry.stage.redhat.io/rhel9/bootc-image-builder:9.6"
         BOOT_ARGS="uefi"
         ;;
+    "rhel-10.0")
+        OS_VARIANT="rhel10-unknown"
+        BASE_IMAGE_URL="registry.stage.redhat.io/rhel10/rhel-bootc:10.0"
+        BIB_URL="registry.stage.redhat.io/rhel10/bootc-image-builder:10.0"
+        BOOT_ARGS="uefi"
+        ;;
     *)
         echo "unsupported distro: ${ID}-${VERSION_ID}"
         exit 1;;
diff --git a/tests/greenboot-bootc.yaml b/tests/greenboot-bootc.yaml
index 53a6a56..a2100c1 100644
--- a/tests/greenboot-bootc.yaml
+++ b/tests/greenboot-bootc.yaml
@@ -57,7 +57,9 @@
         - name: failed count + 1
           set_fact:
             failed_counter: "{{ failed_counter | int + 1 }}"
-      when: ansible_facts['distribution'] == 'Fedora'
+      when: (ansible_facts['distribution'] == 'Fedora') or
+            (ansible_facts['distribution'] == 'CentOS' and ansible_facts ['distribution_version'] is version('10', '==')) or
+            (ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('10.0', '=='))
 
     # case: check greenboot* services
     - name: a list of greenboot* service should be enabled
@@ -78,7 +80,8 @@
         - name: failed count + 1
           set_fact:
             failed_counter: "{{ failed_counter | int + 1 }}"
-      when: ansible_facts['distribution'] != 'Fedora'
+      when: (ansible_facts['distribution'] == 'CentOS' and ansible_facts ['distribution_version'] is version('9', '==')) or
+            (ansible_facts['distribution'] == 'RedHat' and ansible_facts ['distribution_version'] is version('9.6', '=='))
 
     # case: check greenboot fall back log
     - name: fallback log should be found here


Reviews:
user: login: say-paul
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T07:46:26Z
user: login: say-paul
state: COMMENTED
author_association: MEMBER
submitted_at: 2025-03-06T07:48:28Z
user: login: yih-redhat
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T08:51:59Z
user: login: yih-redhat
state: COMMENTED
author_association: COLLABORATOR
submitted_at: 2025-03-06T08:52:07Z

Review comments:
diff_hunk: @@ -103,6 +103,27 @@ jobs:
           variables: "ARCH=x86_64"
           timeout: 90
 
+  Centos-stream-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: CentOS-Stream-10
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=cs-10"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
path: .github/workflows/greenboot-ci.yaml
user: login: say-paul
body: nitpick- for better readability:
```
secrets: |
    QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};
    QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};
    STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};
    STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};
    DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }};
```
created_at: 2025-03-06T07:46:26Z
author_association: MEMBER
diff_hunk: @@ -123,3 +144,24 @@ jobs:
           secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
           variables: "ARCH=x86_64"
           timeout: 90
+
+  RHEL-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: RHEL-10.0-Nightly
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=rhel-10-0"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
path: .github/workflows/greenboot-ci.yaml
user: login: say-paul
body: same here.
created_at: 2025-03-06T07:48:27Z
author_association: MEMBER
diff_hunk: @@ -103,6 +103,27 @@ jobs:
           variables: "ARCH=x86_64"
           timeout: 90
 
+  Centos-stream-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: CentOS-Stream-10
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=cs-10"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
path: .github/workflows/greenboot-ci.yaml
user: login: yih-redhat
body: Thanks, fixed.
created_at: 2025-03-06T08:51:59Z
author_association: COLLABORATOR
diff_hunk: @@ -123,3 +144,24 @@ jobs:
           secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
           variables: "ARCH=x86_64"
           timeout: 90
+
+  RHEL-10-bootc:
+    needs: check-pull-request
+    if: ${{ needs.check-pull-request.outputs.allowed_user == 'true' }}
+    continue-on-error: true
+    runs-on: ubuntu-latest
+
+    steps:
+      - name: Run the tests
+        uses: sclorg/testing-farm-as-github-action@v3.1.2
+        with:
+          compose: RHEL-10.0-Nightly
+          api_key: ${{ secrets.TF_API_KEY }}
+          git_url: ${{ needs.check-pull-request.outputs.repo_url }}
+          git_ref: ${{ needs.check-pull-request.outputs.ref }}
+          tmt_context: "arch=x86_64;distro=rhel-10-0"
+          tmt_plan_regex: bootc
+          tf_scope: private
+          secrets: "QUAY_USERNAME=${{ secrets.QUAY_USERNAME }};QUAY_PASSWORD=${{ secrets.QUAY_PASSWORD }};STAGE_REDHAT_IO_USERNAME=${{ secrets.STAGE_REDHAT_IO_USERNAME }};STAGE_REDHAT_IO_TOKEN=${{ secrets.STAGE_REDHAT_IO_TOKEN }};DOWNLOAD_NODE=${{ secrets.DOWNLOAD_NODE }}"
path: .github/workflows/greenboot-ci.yaml
user: login: yih-redhat
body: fixed.
created_at: 2025-03-06T08:52:07Z
author_association: COLLABORATOR

PR comments:
user: login: say-paul
created_at: 2025-03-06T07:51:31Z
body: overall lgtm, 
One question: do we need to upload logs incase of any failure, or its handled with testing-farm itself?
author_association: MEMBER
user: login: yih-redhat
created_at: 2025-03-06T08:36:41Z
body: > overall lgtm, One question: do we need to upload logs incase of any failure, or its handled with testing-farm itself?

I think when we check result and click on that failed testing-farm job, we can see all the logs there. 
author_association: COLLABORATOR
user: login: say-paul
created_at: 2025-03-06T12:50:58Z
body: @yih-redhat I assume that the added test should appear in  CI too, but its not there.
author_association: MEMBER
user: login: yih-redhat
created_at: 2025-03-06T13:46:10Z
body: > @yih-redhat I assume that the added test should appear in CI too, but its not there.

The added test will appear in CI after it get merged into main branch. CI only run against main branch.
author_association: COLLABORATOR
user: login: yih-redhat
created_at: 2025-03-11T03:28:04Z
body: Test case cs9-bootc-anaconda failed due to issue https://github.com/osbuild/bootc-image-builder/issues/856, I will merge this PR now.
author_association: COLLABORATOR