diff --git a/test/bin/ci_phase_iso_build.sh b/test/bin/ci_phase_iso_build.sh index 0d064ee8e1..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/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 -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 @@ -132,17 +132,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 +154,11 @@ 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}/layer2-presubmit" - $(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer3-periodic" - 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/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 } diff --git a/test/bin/pyutils/build_bootc_images.py b/test/bin/pyutils/build_bootc_images.py index b6a3b523fb..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.") + 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,8 +600,12 @@ 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 + # 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 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) @@ -672,11 +676,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: + 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) 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