Skip to content

USHIFT-6812: Optimize bootc image building for upgrade tests#6540

Draft
vanhalenar wants to merge 10 commits intoopenshift:mainfrom
vanhalenar:upgrade-test-symlinks
Draft

USHIFT-6812: Optimize bootc image building for upgrade tests#6540
vanhalenar wants to merge 10 commits intoopenshift:mainfrom
vanhalenar:upgrade-test-symlinks

Conversation

@vanhalenar
Copy link
Copy Markdown
Contributor

@vanhalenar vanhalenar commented Apr 20, 2026

Contains changes from this PR, should be merged after.

This PR introduces a new el10 bootc image layer called layer5-upgrade, which contains symbolic links to el9 images required for upgrade scenarios. This allows us to not build all el9 images in el10 jobs, but only the required ones, thus saving time.

Summary by CodeRabbit

  • Chores

    • Updated bootc image build CI process to support per-OS blueprint paths and combined multi-OS build invocations.
    • Enhanced layer directory processing to support multiple directories in a single run with validation.
  • Tests

    • Added new test configuration references for EL10 upgrade layer.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Apr 20, 2026
@openshift-ci-robot
Copy link
Copy Markdown

openshift-ci-robot commented Apr 20, 2026

@vanhalenar: This pull request references USHIFT-6812 which is a valid jira issue.

Warning: The referenced jira issue has an invalid target version for the target branch this PR targets: expected the task to target the "5.0.0" version, but no target version was set.

Details

In response to this:

Contains changes from this PR, should be merged after.

This PR introduces a new el10 bootc image layer called layer5-upgrade, which contains symbolic links to el9 images required for upgrade scenarios. This allows us to not build all el9 images in el10 jobs, but only the required ones, thus saving time.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository.

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Apr 20, 2026
@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 20, 2026

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@coderabbitai
Copy link
Copy Markdown

coderabbitai bot commented Apr 20, 2026

Walkthrough

This PR restructures bootc image build infrastructure to support per-OS blueprint paths and multi-layer builds. Changes include updating CI phase script to build layer1-base and layer4-release for both el9 and el10, refactoring the Python build utility to accept multiple layer directories, and adding el10 layer5-upgrade blueprint files that reference el9 content.

Changes

Cohort / File(s) Summary
CI Build Orchestration
test/bin/ci_phase_iso_build.sh, test/bin/pyutils/build_bootc_images.py
Updated CI build orchestration to use per-OS blueprint paths, support multi-OS builds (el9/el10) for layers 1, 2, 3, and 4, and refactored Python utility to handle multiple layer directories via repeatable --layer-dir arguments with per-directory validation.
el10 Layer5-Upgrade Blueprint References
test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel96-bootc.image-bootc, test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel96-test-agent.containerfile, test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel98-bootc.image-bootc, test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel98-test-agent.containerfile, test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel96-bootc-prel.containerfile, test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel96-bootc-yminus2.containerfile, test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel98-bootc-source.containerfile
Added reference files pointing to corresponding el9 layer1-base and el2-presubmit content, establishing blueprint reuse across OS versions.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 9 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (9 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically summarizes the main change: optimizing bootc image building for upgrade tests by introducing layer5-upgrade with symlinks to el9 images.
Stable And Deterministic Test Names ✅ Passed PR contains no Ginkgo test files, only shell scripts, Python utilities, and image blueprint configs.
Test Structure And Quality ✅ Passed This pull request does not contain any Ginkgo test code. The modified files consist entirely of shell scripts, Python utility scripts, and image blueprint reference files. Since the custom check targets Ginkgo test quality requirements and no Ginkgo tests are present or modified in this PR, the check is not applicable.
Microshift Test Compatibility ✅ Passed PR contains no new Ginkgo e2e tests; only shell script, Python utility, and symlinks to existing blueprints.
Single Node Openshift (Sno) Test Compatibility ✅ Passed PR does not introduce new Ginkgo e2e tests; modified files are shell scripts and Python utilities, not Go test code.
Topology-Aware Scheduling Compatibility ✅ Passed PR contains only CI/test infrastructure changes with no Kubernetes deployment manifests, operator code, controllers, or scheduling constraints.
Ote Binary Stdout Contract ✅ Passed The OTE Binary Stdout Contract applies to Go test files and binary implementations that communicate via JSON to openshift-tests. This PR contains only shell scripts and Python utilities with no Go test files or OTE binary code.
Ipv6 And Disconnected Network Test Compatibility ✅ Passed This PR does not add any new Ginkgo e2e tests. Changes consist of shell scripts, Python build utilities, and symlink references. No IPv4 assumptions or external connectivity requirements detected.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Comment @coderabbitai help to get the list of available commands and usage tips.

@openshift-ci
Copy link
Copy Markdown
Contributor

openshift-ci bot commented Apr 20, 2026

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: vanhalenar
Once this PR has been reviewed and has the lgtm label, please assign jogeo for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found 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

Copy link
Copy Markdown

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

🧹 Nitpick comments (2)
test/bin/pyutils/build_bootc_images.py (1)

603-608: De-duplicate repeated layer dirs before processing.

If the same -l is passed more than once, the same groups are rebuilt multiple times. A small normalization step avoids accidental duplicate work.

♻️ Proposed fix
-            args.layer_dir = [os.path.abspath(d) for d in args.layer_dir]
+            args.layer_dir = list(dict.fromkeys(os.path.abspath(d) for d in args.layer_dir))

Also applies to: 679-684

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bin/pyutils/build_bootc_images.py` around lines 603 - 608, The code
currently converts args.layer_dir to absolute paths and then iterates them, but
does not remove duplicates so repeated -l entries cause redundant rebuilds;
before validating and processing, normalize args.layer_dir by deduplicating
while preserving order (e.g., replace args.layer_dir with a list of unique
absolute paths derived from args.layer_dir) and then continue with the existing
isdir check and downstream processing (apply the same deduplication step in the
other identical block that handles args.layer_dir later around the second
occurrence).
test/bin/ci_phase_iso_build.sh (1)

140-140: Inconsistent path quoting.

Other paths in this function use double quotes (e.g., lines 135, 136, 144, 147), but this one doesn't. While it works since it's a literal path, consider quoting for consistency.

Suggested fix
-                $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer5-upgrade
+                $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/el10/layer5-upgrade"
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@test/bin/ci_phase_iso_build.sh` at line 140, The call to launch
build_bootc_images.sh uses an unquoted path argument ($(dry_run) bash -x
./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer5-upgrade)
which is inconsistent with other invocations; update the invocation to quote the
path argument (for example -l "./image-blueprints-bootc/el10/layer5-upgrade") so
it matches the quoting style used on surrounding lines and prevents
word-splitting if the path ever contains spaces.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@test/bin/ci_phase_iso_build.sh`:
- Line 140: The call to launch build_bootc_images.sh uses an unquoted path
argument ($(dry_run) bash -x ./bin/build_bootc_images.sh -l
./image-blueprints-bootc/el10/layer5-upgrade) which is inconsistent with other
invocations; update the invocation to quote the path argument (for example -l
"./image-blueprints-bootc/el10/layer5-upgrade") so it matches the quoting style
used on surrounding lines and prevents word-splitting if the path ever contains
spaces.

In `@test/bin/pyutils/build_bootc_images.py`:
- Around line 603-608: The code currently converts args.layer_dir to absolute
paths and then iterates them, but does not remove duplicates so repeated -l
entries cause redundant rebuilds; before validating and processing, normalize
args.layer_dir by deduplicating while preserving order (e.g., replace
args.layer_dir with a list of unique absolute paths derived from args.layer_dir)
and then continue with the existing isdir check and downstream processing (apply
the same deduplication step in the other identical block that handles
args.layer_dir later around the second occurrence).

ℹ️ Review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: cbe2fa57-d081-4dba-9491-d52ac2bb15fe

📥 Commits

Reviewing files that changed from the base of the PR and between fe29d2a and 7ba71ee.

📒 Files selected for processing (36)
  • test/bin/ci_phase_iso_build.sh
  • test/bin/pyutils/build_bootc_images.py
  • test/image-blueprints-bootc/el10/layer1-base/group1/rhel102-test-agent.containerfile
  • test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile
  • test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile
  • test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel.containerfile
  • test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc.image-bootc
  • test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile
  • test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile
  • test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew.containerfile
  • test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile
  • test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc
  • test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile
  • test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel96-bootc.image-bootc
  • test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel96-test-agent.containerfile
  • test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel98-bootc.image-bootc
  • test/image-blueprints-bootc/el10/layer5-upgrade/group1/rhel98-test-agent.containerfile
  • test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel96-bootc-prel.containerfile
  • test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel96-bootc-yminus2.containerfile
  • test/image-blueprints-bootc/el10/layer5-upgrade/group2/rhel98-bootc-source.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group1/rhel96-test-agent.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group1/rhel98-test-agent.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-prel.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-yminus2.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc.image-bootc
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel.containerfile
  • test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc.image-bootc
  • test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile
  • test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile
  • test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile
  • test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile
  • test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile
  • test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc
  • test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants