Skip to content

Commit e2d7416

Browse files
Merge pull request #6489 from vanhalenar/build_bootc_upgrades
USHIFT-6715: Enable building multiple bootc blueprint layers in parallel
2 parents 652f9af + 9b00c4d commit e2d7416

29 files changed

Lines changed: 24 additions & 17 deletions

test/bin/ci_phase_iso_build.sh

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -70,8 +70,8 @@ update_build_cache() {
7070
# Build templates
7171
$(dry_run) bash -x ./bin/build_bootc_images.sh -g ./image-blueprints-bootc/templates
7272
# Build the bootc base layer and brew RPMs to be cached
73-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
74-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer4-release
73+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base
74+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release
7575

7676
# Prepare for the cache upload by stopping composer services and cleaning
7777
# temporary artifacts
@@ -132,31 +132,33 @@ run_bootc_image_build() {
132132

133133
if [[ "${os}" == "el9" || "${os}" == "el10" ]]; then
134134

135-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
135+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer1-base"
136136
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer2-presubmit"
137137

138138
if [[ "${os}" == "el10" ]]; then
139139
# Build el9 images for upgrade tests
140+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base
140141
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit
141142
fi
142143

143144
if [[ "${CI_JOB_NAME}" =~ .*periodic.* ]]; then
144145
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer3-periodic"
145146
fi
147+
if [[ "${CI_JOB_NAME}" =~ .*release.* ]]; then
148+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os}/layer4-release"
149+
fi
146150
fi
147151

148152
# Build upstream images
149153
if [[ "${CI_JOB_NAME}" =~ .*upstream.* ]]; then
150154
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
151155
fi
152156
else
153-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer1-base
154157
# Full build for all OS versions
155-
for os_ver in el9 el10; do
156-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer2-presubmit"
157-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l "./image-blueprints-bootc/${os_ver}/layer3-periodic"
158-
done
159-
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/layer4-release
158+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer1-base -l ./image-blueprints-bootc/el10/layer1-base
159+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer2-presubmit -l ./image-blueprints-bootc/el10/layer2-presubmit
160+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer3-periodic -l ./image-blueprints-bootc/el10/layer3-periodic
161+
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/el9/layer4-release -l ./image-blueprints-bootc/el10/layer4-release
160162
$(dry_run) bash -x ./bin/build_bootc_images.sh -l ./image-blueprints-bootc/upstream
161163
fi
162164
}

test/bin/pyutils/build_bootc_images.py

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -605,7 +605,7 @@ def main():
605605
choices=["image-bootc", "containerfile", "container-encapsulate"],
606606
help="Only build images of the specified type.")
607607
dirgroup = parser.add_mutually_exclusive_group(required=False)
608-
dirgroup.add_argument("-l", "--layer-dir", type=str, help="Path to the layer directory to process.")
608+
dirgroup.add_argument("-l", "--layer-dir", action="append", default=[], help="Path to the layer directory to process. Can be specified multiple times.")
609609
dirgroup.add_argument("-g", "--group-dir", type=str, help="Path to the group directory to process.")
610610
dirgroup.add_argument("-t", "--template", type=str, help="Path to a template to build. Allows glob patterns (requires double qoutes).")
611611

@@ -624,8 +624,12 @@ def main():
624624
args.group_dir = os.path.abspath(args.group_dir)
625625
dir2process = args.group_dir
626626
if args.layer_dir:
627-
args.layer_dir = os.path.abspath(args.layer_dir)
628-
dir2process = args.layer_dir
627+
# Convert input layer directories to absolute paths
628+
args.layer_dir = [os.path.abspath(d) for d in args.layer_dir]
629+
# Validate each layer directory exists
630+
for layer_dir in args.layer_dir:
631+
if not os.path.isdir(layer_dir):
632+
raise Exception(f"The layer directory '{layer_dir}' does not exist")
629633
if args.template:
630634
args.template = os.path.abspath(args.template)
631635
dir2process = os.path.dirname(args.template)
@@ -699,11 +703,12 @@ def main():
699703
PULL_SECRET = opull_secret
700704
# Process layer directory contents sorted by length and then alphabetically
701705
if args.layer_dir:
702-
for item in sorted(os.listdir(args.layer_dir), key=lambda i: (len(i), i)):
703-
item_path = os.path.join(args.layer_dir, item)
704-
# Check if this item is a directory
705-
if os.path.isdir(item_path):
706-
process_group(item_path, args.build_type, dry_run=args.dry_run)
706+
for layer_dir in args.layer_dir:
707+
for item in sorted(os.listdir(layer_dir), key=lambda i: (len(i), i)):
708+
item_path = os.path.join(layer_dir, item)
709+
# Check if this item is a directory
710+
if os.path.isdir(item_path):
711+
process_group(item_path, args.build_type, dry_run=args.dry_run)
707712
else:
708713
# Process individual group directory or template
709714
process_group(dir2process, args.build_type, pattern, args.dry_run)

test/image-blueprints-bootc/layer1-base/group1/rhel102-test-agent.containerfile renamed to test/image-blueprints-bootc/el10/layer1-base/group1/rhel102-test-agent.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile renamed to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-isolated.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile renamed to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel-optionals.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc-crel.containerfile renamed to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc-crel.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer1-base/group2/rhel102-bootc.image-bootc renamed to test/image-blueprints-bootc/el10/layer1-base/group2/rhel102-bootc.image-bootc

File renamed without changes.

test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile renamed to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-lrel-optional.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile renamed to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew-nightly-with-optional.containerfile

File renamed without changes.

test/image-blueprints-bootc/layer4-release/group1/rhel102-bootc-brew.containerfile renamed to test/image-blueprints-bootc/el10/layer4-release/group1/rhel102-bootc-brew.containerfile

File renamed without changes.

0 commit comments

Comments
 (0)