Skip to content
Closed
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
55 changes: 40 additions & 15 deletions test/bin/ci_phase_iso_build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -115,28 +115,53 @@ run_image_build() {
run_bootc_image_build() {
make -C "${ROOTDIR}" verify-containers

# Build templates first
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/templates

if [ -v CI_JOB_NAME ] ; then
# Skip all image builds for release testing CI jobs because all the images are fetched from the cache.
if [[ "${CI_JOB_NAME}" =~ .*release(-arm)?$ ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -X
return
# Build el9 images
if [[ "${CI_JOB_NAME}" =~ .*el9.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit

if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic
fi
if [[ "${CI_JOB_NAME}" =~ .*release.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release
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.

Let's not duplicate the code. Deternine the ${os} variable and let's have the same build command sequence.

fi
fi

$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer2-presubmit

if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer3-periodic
# Build el10 images
if [[ "${CI_JOB_NAME}" =~ .*el10.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer2-presubmit

# Build el9 images for upgrade tests
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit

if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer3-periodic
fi
if [[ "${CI_JOB_NAME}" =~ .*release.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el10/layer4-release
fi
fi

# Build upstream images
if [[ "${CI_JOB_NAME}" =~ .*upstream.* ]]; then
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer5-upstream
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
fi
else
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer2-presubmit
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer3-periodic
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer4-release
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer5-upstream
# Full build for all OS versions
for os in el9 el10; do
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/${os}/layer1-base
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/${os}/layer2-presubmit
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/${os}/layer3-periodic
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/${os}/layer4-release
done
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
fi
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
FROM localhost/rhel102-bootc-source:latest

# The qemu-guest-agent is used in offline tests
RUN dnf install -y qemu-guest-agent && \
systemctl enable qemu-guest-agent && \
dnf clean all

# Override the default qemu-ga service configuration on the guest to allow all RPCs.
# BLOCK_RPCS is a deny-list of qemu-guest-agent RPCs to block, such as file read/write, process execution, etc. By
# default, all RPCs are blocked.
# FREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟡 Minor

Minor typo in comment.

Comment says "FREEZE_HOOK_PATHNAME" but the actual variable written on line 18 is "FSFREEZE_HOOK_PATHNAME".

✏️ Suggested fix
-# FREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
+# FSFREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
# FREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
# FSFREEZE_HOOK_PATHNAME is the dir-path containing hook scripts. This override does not change the default value.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@test/image-blueprints-bootc/el10/layer3-periodic/group1/rhel102-bootc-source-isolated.containerfile`
at line 11, The comment contains a typo: it refers to FREEZE_HOOK_PATHNAME but
the actual variable name in the file is FSFREEZE_HOOK_PATHNAME; update the
comment text to read FSFREEZE_HOOK_PATHNAME so it matches the variable used
(referenced symbol: FSFREEZE_HOOK_PATHNAME).

# These scripts are executed before or after guest image snapshot ops ("freezing" and "thawing" in libvirt speak).
# No hooks are installed by default.
RUN printf '\
\# This is a systemd environment file, not a shell script.\n\
\# It provides settings for "/lib/systemd/system/qemu-guest-agent.service".\n\
BLOCK_RPCS=\n\
FSFREEZE_HOOK_PATHNAME=/etc/qemu-ga/fsfreeze-hook\n' > /etc/sysconfig/qemu-ga

# Embed images based on contents of release-info RPMs
COPY --chmod=755 ./bootc-images/microshift-copy-images.sh /usr/bin/microshift-copy-images
RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
images="$(jq -r ".images[]" /usr/share/microshift/release/release-"$(uname -m)".json)" ; \
images="${images} quay.io/microshift/busybox:1.36" ; \
IMAGE_PULL_LIST="${images}" /usr/bin/microshift-copy-images pull
Comment on lines +22 to +25
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
/bin/sh -c 'images=$(false); printf "assignment_status=%s\n" "$?"; images="${images} quay.io/microshift/busybox:1.36"; printf "continued=%s\n" "$images"; true'

Repository: openshift/microshift

Length of output: 126


Use && instead of ; to fail the build if the release JSON lookup breaks.

With ;, a failed jq command does not stop the shell; the build continues with only busybox, producing a broken "isolated" image while appearing successful.

Suggested fix
 RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
-    images="$(jq -r ".images[]" /usr/share/microshift/release/release-"$(uname -m)".json)" ; \
-    images="${images} quay.io/microshift/busybox:1.36" ; \
+    images="$(jq -r '.images[]' "/usr/share/microshift/release/release-$(uname -m).json")" && \
+    images="${images} quay.io/microshift/busybox:1.36" && \
     IMAGE_PULL_LIST="${images}" /usr/bin/microshift-copy-images pull
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
images="$(jq -r ".images[]" /usr/share/microshift/release/release-"$(uname -m)".json)" ; \
images="${images} quay.io/microshift/busybox:1.36" ; \
IMAGE_PULL_LIST="${images}" /usr/bin/microshift-copy-images pull
RUN --mount=type=secret,id=pullsecret,dst=/run/secrets/pull-secret.json \
images="$(jq -r '.images[]' "/usr/share/microshift/release/release-$(uname -m).json")" && \
images="${images} quay.io/microshift/busybox:1.36" && \
IMAGE_PULL_LIST="${images}" /usr/bin/microshift-copy-images pull
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In
`@test/image-blueprints-bootc/el10/layer3-periodic/group1/rhel102-bootc-source-isolated.containerfile`
around lines 22 - 25, The RUN line that builds the IMAGE_PULL_LIST uses ";" so a
failing jq call won't stop the build; change the command chaining to use "&&"
(or set "-e" / add "|| exit 1") so that the jq invocation that populates the
images variable must succeed before appending "quay.io/microshift/busybox:1.36"
and calling IMAGE_PULL_LIST=... /usr/bin/microshift-copy-images pull;
specifically update the RUN invocation that uses jq -r ".images[]"
/usr/share/microshift/release/release-"$(uname -m)".json, the images="${images}
quay.io/microshift/busybox:1.36" assignment, and the IMAGE_PULL_LIST ...
/usr/bin/microshift-copy-images pull invocation to be chained with && (or fail
immediately) instead of ";" so the build fails when the release JSON lookup
fails.


# Install a systemd drop-in unit to address the problem with image upgrades
# overwriting the container images in additional store. The workaround is to
# copy the images from the pre-loaded to the main container storage.
# In this case, it is not necessary to update /etc/containers/storage.conf with
# the additional store path.
# See https://issues.redhat.com/browse/RHEL-75827
RUN mkdir -p /usr/lib/systemd/system/microshift.service.d
COPY --chmod=644 ./bootc-images/microshift-copy-images.conf /usr/lib/systemd/system/microshift.service.d/microshift-copy-images.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
localhost/rhel102-bootc-source-isolated:latest
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Keep the rhel98 artifact mapped to a 9.8 image.

Line 1 points a rhel98-bootc-source-isolated file at rhel102-bootc-source-isolated. That would collapse the intended 9.8 → 10.2 coverage into 10.2 → 10.2 unless the artifact is renamed to match.

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

In
`@test/image-blueprints-bootc/el10/layer3-periodic/group2/rhel98-bootc-source-isolated.image-bootc`
at line 1, The file rhel98-bootc-source-isolated is incorrectly pointing to
localhost/rhel102-bootc-source-isolated:latest which collapses the intended
9.8→10.2 mapping; update the artifact mapping in rhel98-bootc-source-isolated
(or rename the artifact) so it references the correct 9.8 image (e.g., change
the line to localhost/rhel98-bootc-source-isolated:latest) or rename the file to
rhel102-... to keep the mapping consistent between rhel98-bootc-source-isolated
and rhel102-bootc-source-isolated.

Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{{- if env.Getenv "BREW_LREL_RELEASE_VERSION" "" -}}
localhost/rhel102-bootc-brew-lrel-optional:latest
{{- end }}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel100-bootc-brew-lrel-optional"
start_image="rhel102-bootc-brew-lrel-optional"

scenario_create_vms() {
if ! does_image_exist "${start_image}"; then
Expand All @@ -11,7 +11,7 @@ scenario_create_vms() {
fi

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm --boot_blueprint rhel100-bootc --vm_disksize 30 --vm_vcpus 4
launch_vm --boot_blueprint rhel102-bootc --vm_disksize 30 --vm_vcpus 4
}

scenario_remove_vms() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ VM_BRIDGE_IP="$(get_vm_bridge_ip "${VM_MULTUS_NETWORK}")"
# shellcheck disable=SC2034 # used elsewhere
WEB_SERVER_URL="http://${VM_BRIDGE_IP}:${WEB_SERVER_PORT}"

start_image="rhel100-bootc-brew-lrel-optional"
start_image="rhel102-bootc-brew-lrel-optional"

scenario_create_vms() {
exit_if_image_not_found "${start_image}"
Expand All @@ -21,7 +21,7 @@ scenario_create_vms() {

LVM_SYSROOT_SIZE=20480 prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
# Three nics - one for sriov, one for macvlan, another for ipvlan (they cannot enslave the same interface)
launch_vm --boot_blueprint rhel100-bootc --network "${networks}" --vm_disksize 25 --vm_vcpus 4
launch_vm --boot_blueprint rhel102-bootc --network "${networks}" --vm_disksize 25 --vm_vcpus 4
}

scenario_remove_vms() {
Expand All @@ -38,6 +38,8 @@ scenario_run_tests() {
if [[ "${UNAME_M}" =~ aarch64 ]]; then
skip_args="--skip sriov"
fi
# Skip generic device plugin on RHEL 10 until we can get the correct kernel-devel package.
skip_args+=" --skip generic-device-plugin"
# shellcheck disable=SC2086
run_tests host1 \
--variable "PROMETHEUS_HOST:$(hostname)" \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel100-bootc-brew-lrel-optional"
start_image="rhel102-bootc-brew-lrel-optional"

scenario_create_vms() {
if ! does_image_exist "${start_image}"; then
Expand All @@ -11,7 +11,7 @@ scenario_create_vms() {
fi

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm --boot_blueprint rhel100-bootc --vm_vcpus 4
launch_vm --boot_blueprint rhel102-bootc --vm_vcpus 4
}

scenario_remove_vms() {
Expand All @@ -30,6 +30,6 @@ scenario_run_tests() {
fi

run_tests host1 \
--variable "EXPECTED_OS_VERSION:10.0" \
--variable "EXPECTED_OS_VERSION:10.2" \
suites/standard1/
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Sourced from scenario.sh and uses functions defined there.

start_image="rhel100-bootc-brew-lrel-optional"
start_image="rhel102-bootc-brew-lrel-optional"

scenario_create_vms() {
if ! does_image_exist "${start_image}"; then
Expand All @@ -11,7 +11,7 @@ scenario_create_vms() {
fi

prepare_kickstart host1 kickstart-bootc.ks.template "${start_image}"
launch_vm --boot_blueprint rhel100-bootc --vm_vcpus 4
launch_vm --boot_blueprint rhel102-bootc --vm_vcpus 4
}

scenario_remove_vms() {
Expand Down