From 5b239a4907edee0ad4ee3f46e6504f7430251cb1 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Mon, 23 Mar 2026 10:58:14 +0000 Subject: [PATCH 1/9] Modify build_bootc_images.py to accept multiple layer directories --- test/bin/pyutils/build_bootc_images.py | 41 ++++++++++++++++---------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index b6a3b523fb..91666a5362 100644 --- a/test/bin/pyutils/build_bootc_images.py +++ b/test/bin/pyutils/build_bootc_images.py @@ -348,11 +348,10 @@ def should_skip(file): # Run template command on the input file bf_outfile = os.path.join(BOOTC_IMAGE_DIR, bootcfile) run_template_cmd(bf_path, bf_outfile, dry_run) - # Templating may generate an empty file - if not dry_run: - if not common.file_has_valid_lines(bf_outfile): - common.print_msg(f"Skipping an empty {bootcfile} file") - return + # Templating may generate an empty file or in dry-run mode the file may not exist + if not os.path.exists(bf_outfile) or (not dry_run and not common.file_has_valid_lines(bf_outfile)): + common.print_msg(f"Skipping {bootcfile} file (not created or empty)") + return common.print_msg(f"Processing {bootcfile} with logs in {bf_logfile}") start_process_bootc_image = time.time() @@ -462,6 +461,10 @@ def ostree_rev_in_registry(ce_imgref): # Run template command on the input file ce_outfile = os.path.join(BOOTC_IMAGE_DIR, containerfile) run_template_cmd(ce_path, ce_outfile, dry_run) + # Templating may generate an empty file or in dry-run mode the file may not exist + if not os.path.exists(ce_outfile) or (not dry_run and not common.file_has_valid_lines(ce_outfile)): + common.print_msg(f"Skipping {containerfile} file (not created or empty)") + return common.print_msg(f"Processing {containerfile} with logs in {ce_logfile}") start_process_container_encapsulate = time.time() @@ -581,7 +584,7 @@ def main(): choices=["image-bootc", "containerfile", "container-encapsulate"], help="Only build images of the specified type.") dirgroup = parser.add_mutually_exclusive_group(required=False) - dirgroup.add_argument("-l", "--layer-dir", type=str, help="Path to the layer directory to process.") + dirgroup.add_argument("-l", "--layer-dir", type=str, help="Path to the layer directory to process. Accepts comma-separated list of directories.") dirgroup.add_argument("-g", "--group-dir", type=str, help="Path to the group directory to process.") dirgroup.add_argument("-t", "--template", type=str, help="Path to a template to build. Allows glob patterns (requires double qoutes).") @@ -600,13 +603,19 @@ def main(): args.group_dir = os.path.abspath(args.group_dir) dir2process = args.group_dir if args.layer_dir: - args.layer_dir = os.path.abspath(args.layer_dir) - dir2process = args.layer_dir + # Handle comma-separated layer directories + layer_dirs = [d.strip() for d in args.layer_dir.split(",")] + args.layer_dir = ",".join([os.path.abspath(d) for d in layer_dirs]) + # Validate each layer directory exists + for layer_dir in layer_dirs: + abs_layer_dir = os.path.abspath(layer_dir) + if not os.path.isdir(abs_layer_dir): + raise Exception(f"The layer directory '{abs_layer_dir}' does not exist") if args.template: args.template = os.path.abspath(args.template) dir2process = os.path.dirname(args.template) pattern = os.path.basename(args.template) - # Make sure the input directory exists (only if specified) + # Make sure the input directory exists (only if specified for group_dir) if dir2process and not os.path.isdir(dir2process): raise Exception(f"The input directory '{dir2process}' does not exist") # Make sure the local RPM repository exists @@ -650,7 +659,8 @@ def main(): if BREW_NIGHTLY_RELEASE_VERSION: extract_container_images(BREW_NIGHTLY_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) # Sort the images list, only leaving unique entries - common.sort_uniq_file(CONTAINER_LIST) + if os.path.exists(CONTAINER_LIST): + common.sort_uniq_file(CONTAINER_LIST) # Process package source templates ipkgdir = f"{SCRIPTDIR}/../package-sources-bootc" for ifile in os.listdir(ipkgdir): @@ -672,11 +682,12 @@ def main(): PULL_SECRET = opull_secret # Process layer directory contents sorted by length and then alphabetically if args.layer_dir: - for item in sorted(os.listdir(args.layer_dir), key=lambda i: (len(i), i)): - item_path = os.path.join(args.layer_dir, item) - # Check if this item is a directory - if os.path.isdir(item_path): - process_group(item_path, args.build_type, dry_run=args.dry_run) + for layer_dir in args.layer_dir.split(","): + for item in sorted(os.listdir(layer_dir), key=lambda i: (len(i), i)): + item_path = os.path.join(layer_dir, item) + # Check if this item is a directory + if os.path.isdir(item_path): + process_group(item_path, args.build_type, dry_run=args.dry_run) else: # Process individual group directory or template process_group(dir2process, args.build_type, pattern, args.dry_run) From 0f03440b717c5e60f5dafd27fd368fccf697f799 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 1 Apr 2026 07:21:17 +0000 Subject: [PATCH 2/9] Reorganize image blueprints --- test/bin/ci_phase_iso_build.sh | 16 +++++++++++----- .../group1/rhel102-test-agent.containerfile | 0 .../rhel102-bootc-crel-isolated.containerfile | 0 .../rhel102-bootc-crel-optionals.containerfile | 0 .../group2/rhel102-bootc-crel.containerfile | 0 .../layer1-base/group2/rhel102-bootc.image-bootc | 0 ...hel102-bootc-brew-lrel-optional.containerfile | 0 ...ootc-brew-nightly-with-optional.containerfile | 0 .../group1/rhel102-bootc-brew.containerfile | 0 .../rhel102-bootc-brew-lrel-fips.containerfile | 0 .../rhel102-bootc-brew-lrel-optional.image-bootc | 0 .../rhel102-bootc-brew-lrel-tuned.containerfile | 0 .../group1/rhel96-test-agent.containerfile | 0 .../group1/rhel98-test-agent.containerfile | 0 .../group2/rhel96-bootc-prel.containerfile | 0 .../group2/rhel96-bootc-yminus2.containerfile | 0 .../layer1-base/group2/rhel96-bootc.image-bootc | 0 .../rhel98-bootc-crel-isolated.containerfile | 0 .../rhel98-bootc-crel-optionals.containerfile | 0 .../group2/rhel98-bootc-crel.containerfile | 0 .../layer1-base/group2/rhel98-bootc.image-bootc | 0 ...l96-bootc-brew-y1-with-optional.containerfile | 0 ...l96-bootc-brew-y2-with-optional.containerfile | 0 ...rhel98-bootc-brew-lrel-optional.containerfile | 0 ...ootc-brew-nightly-with-optional.containerfile | 0 .../rhel98-bootc-brew-lrel-fips.containerfile | 0 .../rhel98-bootc-brew-lrel-optional.image-bootc | 0 .../rhel98-bootc-brew-lrel-tuned.containerfile | 0 28 files changed, 11 insertions(+), 5 deletions(-) rename test/image-blueprints-bootc/{ => el10}/layer1-base/group1/rhel102-test-agent.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer1-base/group2/rhel102-bootc-crel.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer1-base/group2/rhel102-bootc.image-bootc (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group1/rhel102-bootc-brew.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc (100%) rename test/image-blueprints-bootc/{ => el10}/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group1/rhel96-test-agent.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group1/rhel98-test-agent.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel96-bootc-prel.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel96-bootc-yminus2.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel96-bootc.image-bootc (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel98-bootc-crel.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer1-base/group2/rhel98-bootc.image-bootc (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc (100%) rename test/image-blueprints-bootc/{ => el9}/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile (100%) diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index 0d064ee8e1..ecb866ce23 100755 --- a/test/bin/ci_phase_iso_build.sh +++ b/test/bin/ci_phase_iso_build.sh @@ -70,8 +70,10 @@ update_build_cache() { # Build templates $(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints-bootc/templates # Build the bootc base layer and brew RPMs to be cached - $(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/layer4-release + #$(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/layer4-release + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base,./image-blueprints-bootc/el10/layer1-base + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release,./image-blueprints-bootc/el10/layer4-release # Prepare for the cache upload by stopping composer services and cleaning # temporary artifacts @@ -132,17 +134,21 @@ run_bootc_image_build() { if [[ "${os}" == "el9" || "${os}" == "el10" ]]; then - $(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/${os}/layer1-base" $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer2-presubmit" if [[ "${os}" == "el10" ]]; then # 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 fi if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer3-periodic" fi + if [[ "${CI_JOB_NAME}" =~ .*release.* ]]; then + $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer4-release" + fi fi # Build upstream images @@ -150,13 +156,13 @@ run_bootc_image_build() { $(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 # Full build for all OS versions for os_ver in el9 el10; do + $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer1-base" $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer2-presubmit" $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer3-periodic" + $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer4-release" done - $(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/upstream fi } diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel102-test-agent.containerfile b/test/image-blueprints-bootc/el10/layer1-base/group1/rhel102-test-agent.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group1/rhel102-test-agent.containerfile rename to test/image-blueprints-bootc/el10/layer1-base/group1/rhel102-test-agent.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile b/test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile rename to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile b/test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile rename to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel.containerfile b/test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel.containerfile rename to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc.image-bootc b/test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc.image-bootc rename to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc.image-bootc diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile b/test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile rename to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile b/test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile rename to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew.containerfile b/test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew.containerfile rename to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile b/test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile rename to test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-fips.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc b/test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc rename to test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-optional.image-bootc diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile b/test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile rename to test/image-blueprints-bootc/el10/layer4-release/group2/rhel102-bootc-brew-lrel-tuned.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group1/rhel96-test-agent.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group1/rhel96-test-agent.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group1/rhel96-test-agent.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group1/rhel98-test-agent.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group1/rhel98-test-agent.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group1/rhel98-test-agent.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group1/rhel98-test-agent.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-prel.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-prel.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-prel.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-prel.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-yminus2.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-yminus2.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc-yminus2.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc-yminus2.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc.image-bootc b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel96-bootc.image-bootc rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel96-bootc.image-bootc diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-isolated.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel-optionals.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel.containerfile b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc-crel.containerfile rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc-crel.containerfile diff --git a/test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc.image-bootc b/test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer1-base/group2/rhel98-bootc.image-bootc rename to test/image-blueprints-bootc/el9/layer1-base/group2/rhel98-bootc.image-bootc diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y1-with-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group1/rhel96-bootc-brew-y2-with-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-lrel-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group1/rhel98-bootc-brew-nightly-with-optional.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-fips.containerfile diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc b/test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc rename to test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-optional.image-bootc diff --git a/test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile b/test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile similarity index 100% rename from test/image-blueprints-bootc/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile rename to test/image-blueprints-bootc/el9/layer4-release/group2/rhel98-bootc-brew-lrel-tuned.containerfile From c89a91173e8f9755472683eccf580cf947e58f64 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Fri, 10 Apr 2026 10:21:09 +0000 Subject: [PATCH 3/9] Parallel builds --- test/bin/ci_phase_iso_build.sh | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index ecb866ce23..3fd5e0c042 100755 --- a/test/bin/ci_phase_iso_build.sh +++ b/test/bin/ci_phase_iso_build.sh @@ -157,12 +157,10 @@ run_bootc_image_build() { fi else # Full build for all OS versions - for os_ver in el9 el10; do - $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer1-base" - $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer2-presubmit" - $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer3-periodic" - $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer4-release" - done + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base,./image-blueprints-bootc/el10/layer1-base + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit,./image-blueprints-bootc/el10/layer2-presubmit + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic,./image-blueprints-bootc/el10/layer3-periodic + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release,./image-blueprints-bootc/el10/layer4-release $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream fi } From 068b61afae4ec622c22237724863a77df34e86f3 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Fri, 10 Apr 2026 10:31:51 +0000 Subject: [PATCH 4/9] S3 test bucket ref --- test/bin/manage_build_cache.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/bin/manage_build_cache.sh b/test/bin/manage_build_cache.sh index edfa245310..79aa3a883d 100755 --- a/test/bin/manage_build_cache.sh +++ b/test/bin/manage_build_cache.sh @@ -7,7 +7,8 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=test/bin/common.sh source "${SCRIPTDIR}/common.sh" -AWS_BUCKET_NAME="${AWS_BUCKET_NAME:-microshift-build-cache}" +# AWS_BUCKET_NAME="${AWS_BUCKET_NAME:-microshift-build-cache}" +AWS_BUCKET_NAME="thalenar-test-cache-us-west-2" BCH_SUBDIR= TAG_SUBDIR= ARCH_SUBDIR="${UNAME_M}" From 767dc591949d4c967539c50abb24cc6881085eb5 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Fri, 10 Apr 2026 12:06:17 +0000 Subject: [PATCH 5/9] Revert changes to dry run --- test/bin/pyutils/build_bootc_images.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index 91666a5362..a2d18f063a 100644 --- a/test/bin/pyutils/build_bootc_images.py +++ b/test/bin/pyutils/build_bootc_images.py @@ -348,10 +348,11 @@ def should_skip(file): # Run template command on the input file bf_outfile = os.path.join(BOOTC_IMAGE_DIR, bootcfile) run_template_cmd(bf_path, bf_outfile, dry_run) - # Templating may generate an empty file or in dry-run mode the file may not exist - if not os.path.exists(bf_outfile) or (not dry_run and not common.file_has_valid_lines(bf_outfile)): - common.print_msg(f"Skipping {bootcfile} file (not created or empty)") - return + # Templating may generate an empty file + if not dry_run: + if not common.file_has_valid_lines(bf_outfile): + common.print_msg(f"Skipping an empty {bootcfile} file") + return common.print_msg(f"Processing {bootcfile} with logs in {bf_logfile}") start_process_bootc_image = time.time() @@ -461,10 +462,6 @@ def ostree_rev_in_registry(ce_imgref): # Run template command on the input file ce_outfile = os.path.join(BOOTC_IMAGE_DIR, containerfile) run_template_cmd(ce_path, ce_outfile, dry_run) - # Templating may generate an empty file or in dry-run mode the file may not exist - if not os.path.exists(ce_outfile) or (not dry_run and not common.file_has_valid_lines(ce_outfile)): - common.print_msg(f"Skipping {containerfile} file (not created or empty)") - return common.print_msg(f"Processing {containerfile} with logs in {ce_logfile}") start_process_container_encapsulate = time.time() @@ -615,7 +612,7 @@ def main(): args.template = os.path.abspath(args.template) dir2process = os.path.dirname(args.template) pattern = os.path.basename(args.template) - # Make sure the input directory exists (only if specified for group_dir) + # Make sure the input directory exists (only if specified) if dir2process and not os.path.isdir(dir2process): raise Exception(f"The input directory '{dir2process}' does not exist") # Make sure the local RPM repository exists @@ -659,8 +656,8 @@ def main(): if BREW_NIGHTLY_RELEASE_VERSION: extract_container_images(BREW_NIGHTLY_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) # Sort the images list, only leaving unique entries - if os.path.exists(CONTAINER_LIST): - common.sort_uniq_file(CONTAINER_LIST) + common.sort_uniq_file(CONTAINER_LIST) + # Process package source templates ipkgdir = f"{SCRIPTDIR}/../package-sources-bootc" for ifile in os.listdir(ipkgdir): From 4bc7f1c04d20f913d9fedd9e791845468a75485f Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Fri, 10 Apr 2026 12:07:03 +0000 Subject: [PATCH 6/9] Remove empty line --- test/bin/pyutils/build_bootc_images.py | 1 - 1 file changed, 1 deletion(-) diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index a2d18f063a..7363560b08 100644 --- a/test/bin/pyutils/build_bootc_images.py +++ b/test/bin/pyutils/build_bootc_images.py @@ -657,7 +657,6 @@ def main(): extract_container_images(BREW_NIGHTLY_RELEASE_VERSION, BREW_REPO, CONTAINER_LIST, args.dry_run) # Sort the images list, only leaving unique entries common.sort_uniq_file(CONTAINER_LIST) - # Process package source templates ipkgdir = f"{SCRIPTDIR}/../package-sources-bootc" for ifile in os.listdir(ipkgdir): From 194e259907bc0b63a61d4c2c0b0bd927c0a98a90 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Mon, 13 Apr 2026 14:52:54 +0000 Subject: [PATCH 7/9] Review ready --- test/bin/ci_phase_iso_build.sh | 2 -- test/bin/manage_build_cache.sh | 3 +-- 2 files changed, 1 insertion(+), 4 deletions(-) diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index 3fd5e0c042..3d06af266d 100755 --- a/test/bin/ci_phase_iso_build.sh +++ b/test/bin/ci_phase_iso_build.sh @@ -70,8 +70,6 @@ update_build_cache() { # Build templates $(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints-bootc/templates # Build the bootc base layer and brew RPMs to be cached - #$(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/layer4-release $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base,./image-blueprints-bootc/el10/layer1-base $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release,./image-blueprints-bootc/el10/layer4-release diff --git a/test/bin/manage_build_cache.sh b/test/bin/manage_build_cache.sh index 79aa3a883d..edfa245310 100755 --- a/test/bin/manage_build_cache.sh +++ b/test/bin/manage_build_cache.sh @@ -7,8 +7,7 @@ SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" # shellcheck source=test/bin/common.sh source "${SCRIPTDIR}/common.sh" -# AWS_BUCKET_NAME="${AWS_BUCKET_NAME:-microshift-build-cache}" -AWS_BUCKET_NAME="thalenar-test-cache-us-west-2" +AWS_BUCKET_NAME="${AWS_BUCKET_NAME:-microshift-build-cache}" BCH_SUBDIR= TAG_SUBDIR= ARCH_SUBDIR="${UNAME_M}" From 81e1434958c6fa3426c83300ce26b752eae5c57d Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 15 Apr 2026 09:28:39 +0000 Subject: [PATCH 8/9] Rework to use action=append --- test/bin/pyutils/build_bootc_images.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index 7363560b08..86dc556aba 100644 --- a/test/bin/pyutils/build_bootc_images.py +++ b/test/bin/pyutils/build_bootc_images.py @@ -581,7 +581,7 @@ def main(): choices=["image-bootc", "containerfile", "container-encapsulate"], help="Only build images of the specified type.") dirgroup = parser.add_mutually_exclusive_group(required=False) - dirgroup.add_argument("-l", "--layer-dir", type=str, help="Path to the layer directory to process. Accepts comma-separated list of directories.") + dirgroup.add_argument("-l", "--layer-dir", action="append", default=[], help="Path to the layer directory to process. Can be specified multiple times.") dirgroup.add_argument("-g", "--group-dir", type=str, help="Path to the group directory to process.") dirgroup.add_argument("-t", "--template", type=str, help="Path to a template to build. Allows glob patterns (requires double qoutes).") @@ -600,14 +600,12 @@ def main(): args.group_dir = os.path.abspath(args.group_dir) dir2process = args.group_dir if args.layer_dir: - # Handle comma-separated layer directories - layer_dirs = [d.strip() for d in args.layer_dir.split(",")] - args.layer_dir = ",".join([os.path.abspath(d) for d in layer_dirs]) + # Convert input layer directories to absolute paths + args.layer_dir = [os.path.abspath(d) for d in args.layer_dir] # Validate each layer directory exists - for layer_dir in layer_dirs: - abs_layer_dir = os.path.abspath(layer_dir) - if not os.path.isdir(abs_layer_dir): - raise Exception(f"The layer directory '{abs_layer_dir}' does not exist") + for layer_dir in args.layer_dir: + if not os.path.isdir(layer_dir): + raise Exception(f"The layer directory '{layer_dir}' does not exist") if args.template: args.template = os.path.abspath(args.template) dir2process = os.path.dirname(args.template) @@ -678,7 +676,7 @@ def main(): PULL_SECRET = opull_secret # Process layer directory contents sorted by length and then alphabetically if args.layer_dir: - for layer_dir in args.layer_dir.split(","): + for layer_dir in args.layer_dir: for item in sorted(os.listdir(layer_dir), key=lambda i: (len(i), i)): item_path = os.path.join(layer_dir, item) # Check if this item is a directory From 9b00c4dd5744c05d3ad6b7ccb982d16a44ab49d4 Mon Sep 17 00:00:00 2001 From: vanhalenar Date: Wed, 15 Apr 2026 09:33:29 +0000 Subject: [PATCH 9/9] Switch from comma separating to multiple args in iso build --- test/bin/ci_phase_iso_build.sh | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index 3d06af266d..c47f91232f 100755 --- a/test/bin/ci_phase_iso_build.sh +++ b/test/bin/ci_phase_iso_build.sh @@ -70,8 +70,8 @@ update_build_cache() { # Build templates $(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints-bootc/templates # Build the bootc base layer and brew RPMs to be cached - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base,./image-blueprints-bootc/el10/layer1-base - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release,./image-blueprints-bootc/el10/layer4-release + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release # Prepare for the cache upload by stopping composer services and cleaning # temporary artifacts @@ -155,10 +155,10 @@ run_bootc_image_build() { fi else # Full build for all OS versions - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base,./image-blueprints-bootc/el10/layer1-base - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit,./image-blueprints-bootc/el10/layer2-presubmit - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic,./image-blueprints-bootc/el10/layer3-periodic - $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release,./image-blueprints-bootc/el10/layer4-release + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit -l ./image-blueprints-bootc/el10/layer2-presubmit + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic -l ./image-blueprints-bootc/el10/layer3-periodic + $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release $(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream fi }