Skip to content

Commit ea757c8

Browse files
Merge pull request #6211 from ggiguash/host-network-bootc-builds
USHIFT-6517: Use host network for bootc image builds for proxy access
2 parents f8cfc23 + b8be0d3 commit ea757c8

File tree

3 files changed

+10
-4
lines changed

3 files changed

+10
-4
lines changed

test/bin/common.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ get_vm_bridge_ip() {
187187
VM_BRIDGE_IP="$(get_vm_bridge_ip "default")"
188188

189189
# Web server port number
190-
WEB_SERVER_PORT=8080
190+
export WEB_SERVER_PORT=8080
191191

192192
# Web server URL using VM bridge IP with fallback to host name
193193
# shellcheck disable=SC2034 # used elsewhere

test/bin/pyutils/build_bootc_images.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -284,11 +284,15 @@ def should_skip(image, cached):
284284
# Note:
285285
# - The pull secret is necessary in some builds for pulling embedded
286286
# container images referenced in release-info RPMs
287+
# - The host network usage is required to access the RPM repository
288+
# proxy server using the localhost URL to make generated builds
289+
# reusable from cache on other hosts.
287290
# - The explicit push-to-mirror sets the 'latest' tag as all the build
288291
# layers are in the mirror due to 'cache-to' option
289292
build_args = [
290293
"sudo", "podman", "build",
291294
"--authfile", PULL_SECRET,
295+
"--network", "host",
292296
"--secret", f"id=pullsecret,src={PULL_SECRET}",
293297
"--cache-to", f"{MIRROR_REGISTRY}/{cf_outname}",
294298
"--cache-from", f"{MIRROR_REGISTRY}/{cf_outname}",
@@ -373,7 +377,8 @@ def should_skip(file):
373377
# cached but not fetched from the mirror registry.
374378
pull_args = [
375379
"sudo", "podman", "pull",
376-
"--authfile", PULL_SECRET, bf_imgref
380+
"--authfile", PULL_SECRET,
381+
bf_imgref
377382
]
378383
start = time.time()
379384
common.retry_on_exception(3, common.run_command_in_shell, pull_args, dry_run, logfile, logfile)
@@ -384,6 +389,7 @@ def should_skip(file):
384389
build_args = [
385390
"sudo", "podman", "run",
386391
"--rm", "-i", "--privileged",
392+
"--network", "host",
387393
"--pull=newer",
388394
"--security-opt", "label=type:unconfined_t",
389395
"-v", f"{bf_outdir}:/output",

test/package-sources-bootc/rhel98-mirror.repo

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
[rhel-9.8-appstream]
22
name = rhel-9.8-appstream
33

4-
baseurl = {{ .Env.WEB_SERVER_URL }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-appstream
4+
baseurl = http://localhost:{{ .Env.WEB_SERVER_PORT }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-appstream
55
enabled = 1
66
sslverify = false
77
gpgcheck = 0
88
skip_if_unavailable = false
99

1010
[rhel-9.8-baseos]
1111
name = rhel-9.8-baseos
12-
baseurl = {{ .Env.WEB_SERVER_URL }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-baseos
12+
baseurl = http://localhost:{{ .Env.WEB_SERVER_PORT }}/ocp-mirror/reposync/4.22{{ if eq .Env.UNAME_M "aarch64" }}_aarch64{{ end }}/rhel-98-baseos
1313
enabled = 1
1414
sslverify = false
1515
gpgcheck = 0

0 commit comments

Comments
 (0)