Skip to content

[edpm_build_images] Detect bootc Containerfile for downstream - #4153

Merged
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
rabi:edpm_build_images/bootc-containerfile-detection
Sep 7, 2026
Merged

[edpm_build_images] Detect bootc Containerfile for downstream#4153
openshift-merge-bot[bot] merged 1 commit into
openstack-k8s-operators:mainfrom
rabi:edpm_build_images/bootc-containerfile-detection

Conversation

@rabi

@rabi rabi commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

The bootc build hardcoded -f ./Containerfile, which matches the upstream edpm-image-builder layout. The downstream RPM (built from the Gerrit tree) ships bootc/Containerfile.centos9 instead, so builds with cifmw_edpm_build_images_via_rpm: true failed with buildah rc 125: stat .../bootc/Containerfile: no such file or directory.

jira: OSPCIX-1481

@qodo-code-review

Copy link
Copy Markdown

PR Summary by Qodo

Detect downstream bootc Containerfiles for image builds

🐞 Bug fix 🕐 10-20 Minutes

Grey Divider

AI Description

• Detects version-specific CentOS or RHEL Containerfiles before falling back to the upstream layout.
• Fails early with actionable guidance when installed bootc content is unavailable.
• Builds bootc images using the selected Containerfile across source and RPM layouts.
Diagram

graph TD
  A["Base image"] --> B["Extract version"] --> C["Probe Containerfiles"] --> D{"File found?"}
  D -- "Yes" --> E["Select first match"] --> F["Build bootc image"]
  D -- "No" --> G["Fail with guidance"]
Loading
High-Level Assessment

The ordered remote-file probing is appropriate because it supports downstream CentOS and RHEL package layouts while preserving the generic upstream fallback. A controller-side first-found lookup or unrestricted directory search would be less suitable because the files reside on the managed host and explicit precedence is required.

Files changed (1) +31 / -1

Bug fix (1) +31 / -1
bootc.ymlDetect and select the installed bootc Containerfile +31/-1

Detect and select the installed bootc Containerfile

• Extracts the base-image version and checks versioned CentOS, versioned RHEL, then generic Containerfile names in priority order. It fails with actionable guidance when none exist and supplies the selected file to Buildah instead of hardcoding 'Containerfile'.

roles/edpm_build_images/tasks/bootc.yml

@qodo-code-review

qodo-code-review Bot commented Sep 2, 2026

Copy link
Copy Markdown

Code Review by Qodo

🐞 Bugs (1) 📘 Rule violations (0) 📜 Skill insights (0)

Grey Divider


Action required

1. bootc detection lacks Molecule coverage ✗ Dismissed 📘 Rule violation ☼ Reliability
Description
The new Containerfile selection and missing-file failure paths have no Molecule coverage. The
existing scenario disables cifmw_edpm_build_images_bootc, so this changed behavior is never
exercised.
Code

roles/edpm_build_images/tasks/bootc.yml[R7-10]

+- name: Check bootc Containerfile
+  ansible.builtin.stat:
+    path: "{{ cifmw_edpm_build_images_bootc_repo_path }}/{{ item }}"
+  loop:
Evidence
Compliance rule 10 requires changed role behavior to have Molecule coverage. The changed task
introduces Containerfile discovery, while the existing Molecule converge configuration disables
bootc and therefore cannot exercise it.

AGENTS.md: Ansible Roles Must Have Passing Molecule Tests
roles/edpm_build_images/tasks/bootc.yml[2-30]
roles/edpm_build_images/molecule/default/converge.yml[18-24]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The new bootc Containerfile detection behavior is not covered by the role's Molecule scenario.

## Issue Context
The existing scenario sets `cifmw_edpm_build_images_bootc: false`, so it does not validate selection of CentOS, RHEL, or fallback Containerfiles, nor the missing-file failure path.

## Fix Focus Areas
- roles/edpm_build_images/tasks/bootc.yml[2-30]
- roles/edpm_build_images/molecule/default/converge.yml[18-24]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

2. Registry digits corrupt version detection 🐞 Bug ≡ Correctness
Description
regex_search('\d+') takes the first digit sequence anywhere in the image reference, so a valid
mirror such as registry2.example/centos-bootc:stream9 searches for Containerfile.centos2 instead
of Containerfile.centos9. Because the downstream RPM lacks the generic Containerfile, the role
then fails despite the correct versioned file being installed.
Code

roles/edpm_build_images/tasks/bootc.yml[R4-5]

+    cifmw_edpm_build_images_bootc_base_version: >-
+      {{ cifmw_edpm_build_images_bootc_base_image | regex_search('\d+') | default('') }}
Evidence
The role documents the base image as a configurable string at
roles/edpm_build_images/README.md:23-26. The changed code searches its complete value for the
first digits and directly interpolates that result into the only versioned Containerfile candidates
before failing when none exist.

roles/edpm_build_images/README.md[23-26]
roles/edpm_build_images/tasks/bootc.yml[2-13]
roles/edpm_build_images/tasks/bootc.yml[16-30]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

## Issue description
The bootc base version is extracted from the entire OCI image reference, allowing digits in a registry hostname, port, or repository path to override the actual release in the image tag.

## Issue Context
`cifmw_edpm_build_images_bootc_base_image` is a configurable image reference. The extracted value determines which versioned downstream Containerfile is selected, and downstream installations may not provide the generic fallback.

## Fix Focus Areas
- roles/edpm_build_images/tasks/bootc.yml[2-13]
- roles/edpm_build_images/molecule/default/converge.yml[1-40]

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Context sources
⚠️ Tickets: not configured — ticket URL found in PR but could not be fetched — check ticket provider credentials
Review mode: ⚖️ Balanced: This localized Ansible behavior change affects the bootc image build path and file-selection logic, so it carries meaningful runtime risk despite having only two edit sites.

Grey Divider

Tip of the day
💡 Did you know, you can turn on the rule miner and Qodo learns your standards from review history

More tips ↗ | Customize Qodo ↗ | Qodo docs ↗

Grey Divider

Qodo Logo

Comment thread roles/edpm_build_images/tasks/bootc.yml Outdated
Comment thread roles/edpm_build_images/tasks/bootc.yml Outdated
@rabi
rabi force-pushed the edpm_build_images/bootc-containerfile-detection branch from 3430de8 to cccb84d Compare September 2, 2026 02:53
@rabi
rabi force-pushed the edpm_build_images/bootc-containerfile-detection branch from cccb84d to 71baa33 Compare September 2, 2026 06:05
slagle
slagle previously approved these changes Sep 2, 2026
@rabi

rabi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

@evallesp @nemarjan Can we please merge this to fix the periodic job?

Comment thread roles/edpm_build_images/tasks/bootc_containerfile.yml Outdated
…dcoding

The bootc build hardcoded `-f ./Containerfile`, which matches the upstream
edpm-image-builder layout. The downstream RPM (built from the Gerrit tree)
ships `bootc/Containerfile.centos9` instead, so builds with
`cifmw_edpm_build_images_via_rpm: true` failed with buildah rc 125:
`stat .../bootc/Containerfile: no such file or directory`.

Signed-off-by: rabi <ramishra@redhat.com>
@rabi
rabi force-pushed the edpm_build_images/bootc-containerfile-detection branch from 71baa33 to d34ff3b Compare September 3, 2026 07:27
@evallesp

evallesp commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

/lgtm
/approve

@nemarjan nemarjan left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

/approve

@openshift-ci

openshift-ci Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: evallesp, nemarjan

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/137238177ded4caba7e6df09cf36f0e4

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 49m 34s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 53m 03s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 2h 00m 59s
✔️ cifmw-crc-podified-edpm-baremetal-minor-update SUCCESS in 2h 35m 54s
✔️ cifmw-pod-zuul-files SUCCESS in 4m 39s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 3h 04m 48s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 2h 08m 31s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 10m 00s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 44s
cifmw-content-provider-build-images TIMED_OUT in 45m 58s
✔️ cifmw-edpm-build-images SUCCESS in 30m 05s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 18m 53s
✔️ cifmw-molecule-edpm_build_images SUCCESS in 7m 14s

@rabi

rabi commented Sep 3, 2026

Copy link
Copy Markdown
Contributor Author

recheck maybe we've to increase timeout for cifmw-content-provider-build-images job.

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/098f0a7ab1434c51b3771a238eeb7109

✔️ openstack-k8s-operators-content-provider SUCCESS in 1h 57m 09s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 37m 19s
cifmw-crc-podified-edpm-baremetal FAILURE in 42m 21s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 44m 37s
✔️ cifmw-pod-zuul-files SUCCESS in 7m 04s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 3h 28m 51s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 56m 56s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 11m 08s
✔️ cifmw-pod-pre-commit SUCCESS in 11m 13s
cifmw-content-provider-build-images TIMED_OUT in 46m 15s
✔️ cifmw-edpm-build-images SUCCESS in 30m 13s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 13m 51s
✔️ cifmw-molecule-edpm_build_images SUCCESS in 5m 36s

@rabi

rabi commented Sep 4, 2026

Copy link
Copy Markdown
Contributor Author

recheck

task path: /home/zuul/src/github.com/openstack-k8s-operators/install_yamls/devsetup/roles/download_tools/tasks/main.yaml:293
fatal: [localhost]: FAILED! => 
    changed: false
    dest: /tmp/go1.26.3.linux-amd64.tar.gz
    elapsed: 0
    msg: Request failed
    response: 'HTTP Error 503: Service Unavailable'
    status_code: 503
    url: https://golang.org/dl/go1.26.3.linux-amd64.tar.gz

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/f10a57c471d240deaacd63aa5ea5d523

✔️ openstack-k8s-operators-content-provider SUCCESS in 2h 39m 10s
✔️ podified-multinode-edpm-deployment-crc SUCCESS in 1h 26m 28s
✔️ cifmw-crc-podified-edpm-baremetal SUCCESS in 2h 23m 12s
cifmw-crc-podified-edpm-baremetal-minor-update FAILURE in 56m 59s
✔️ cifmw-pod-zuul-files SUCCESS in 5m 59s
✔️ openstack-k8s-operators-content-provider-bootc SUCCESS in 2h 38m 40s
✔️ cifmw-crc-podified-edpm-baremetal-bootc SUCCESS in 1h 50m 11s
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 9m 43s
✔️ cifmw-pod-pre-commit SUCCESS in 9m 39s
cifmw-content-provider-build-images TIMED_OUT in 46m 00s
✔️ cifmw-edpm-build-images SUCCESS in 25m 59s
✔️ ci-framework-openstack-meta-content-provider SUCCESS in 20m 09s
✔️ cifmw-molecule-edpm_build_images SUCCESS in 5m 38s

@rabi

rabi commented Sep 6, 2026

Copy link
Copy Markdown
Contributor Author

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed (check pipeline). Post recheck (without leading slash)
to rerun all jobs. Make sure the failure cause has been resolved before
you rerun jobs.

https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/rdoproject.org/buildset/138dc93f99934d41921ee8f919344139

openstack-k8s-operators-content-provider NODE_FAILURE Node(set) request 100-0000193418 failed in 0s
⚠️ podified-multinode-edpm-deployment-crc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
⚠️ cifmw-crc-podified-edpm-baremetal-minor-update SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider
✔️ cifmw-pod-zuul-files SUCCESS in 4m 53s
openstack-k8s-operators-content-provider-bootc NODE_FAILURE Node(set) request 100-0000193420 failed in 0s
⚠️ cifmw-crc-podified-edpm-baremetal-bootc SKIPPED Skipped due to failed job openstack-k8s-operators-content-provider-bootc
✔️ noop SUCCESS in 0s
✔️ cifmw-pod-ansible-test SUCCESS in 8m 27s
✔️ cifmw-pod-pre-commit SUCCESS in 8m 31s
cifmw-content-provider-build-images NODE_FAILURE Node(set) request 100-0000193423 failed in 0s
cifmw-edpm-build-images NODE_FAILURE Node(set) request 100-0000193424 failed in 0s
ci-framework-openstack-meta-content-provider NODE_FAILURE Node(set) request 100-0000193425 failed in 0s
cifmw-molecule-edpm_build_images NODE_FAILURE Node(set) request 100-0000193426 failed in 0s

@rabi

rabi commented Sep 7, 2026

Copy link
Copy Markdown
Contributor Author

recheck NODE_FAILURE

@openshift-merge-bot
openshift-merge-bot Bot merged commit 6119f67 into openstack-k8s-operators:main Sep 7, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants