Repository navigation
feat(ci): build must-gather image hermetically in upstream repo [RHIDP-14412] - #218
Conversation
PR Summary by QodoHermetic CI build for must-gather image via Hermeto + locked dependencies
AI Description
Diagram
High-Level Assessment
Files changed (17)
|
Code Review by Qodo
1.
|
|
/agentic_review |
|
FYI I will be resolving conflicts soon.... |
0759b41 to
8fca11e
Compare
|
/agentic_review |
Code Review by Qodo
1. Arm builds lack matching packages
|
d9b130d to
4a82cf8
Compare
|
PR images are available (for 1 week):
|
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit 59a5e2d |
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
have you prepared the downstream changes that will be needed to absorb this, once we get rid of the duplicate Containerfile in both the root and in .rhdh/docker/ ? (Aside: new convention is a folder called "containerfiles", rather than docker. |
|
/hold |
|
/unhold |
|
/agentic_review |
|
Code review by qodo was updated up to the latest commit c48e2a0 |
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
/cherrypick release-2.1 |
|
@rm3l: once the present PR merges, I will cherry-pick it on top of DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Wire PR and main/release CI to Hermeto (gomod + rpm) via the Konflux Containerfile, aligned with rhdh-operator hermetic builds. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
Run the go-builder stage as root and set GOCACHE outside the prefetched gomod tree so buildah builds match Konflux/rhdh-operator behavior. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…14412] Wire make hermetic-build and local-hermeto-build.sh to use the same version string as make image-build instead of hardcoding 0.0.0-local. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…14412] Read HERMETO_IMAGE from the Makefile in both CI and the local script so the tags cannot drift, and explain why the go-builder stage runs as root. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
cf0c233 to
f91bb00
Compare
|
PR images are available (for 1 week):
|
| -v "${local_cache_dir}:/cachi2:z" \ | ||
| -w /source \ | ||
| "${HERMETO_IMAGE}" \ | ||
| inject-files /cachi2/output |
There was a problem hiding this comment.
| inject-files /cachi2/output | |
| inject-files /cachi2/output | |
| # Match Konflux: make cachi2 content accessible to any UID inside the build | |
| chmod -R a+rwX "${local_cache_dir}" |
Maybe the script could chmod the cache dir here to avoid having to set USER 0 in the Makefile?
Another reason to avoid USER 0 in the Makefile: cleaning the cache between runs cannot be done easily via a simple rm -rf if a previous build with USER 0 wrote root-owned files into the volume. Not a big deal but still weird for rootless podman user namespaces IMO.
There was a problem hiding this comment.
Added chmod -R a+rwX on the local cache after inject-files (CI already does chown+chmod before buildah).
I kept USER 0 on the go-builder stage for now: it matches rhdh-operator’s builder stage, and we still set GOCACHE=/tmp/go-build-cache so compile artifacts do not land in the prefetched gomod tree. Happy to try dropping USER 0 in a follow-up if we confirm chmod alone is enough with rootless podman on all platforms.
There was a problem hiding this comment.
Follow-up: USER 0 is removed in 95c8b5b — chmod on the cache is enough for non-root go-builder (same as midstream). See the reply on the Containerfile thread.
There was a problem hiding this comment.
Great, thanks for following up on this. Yeah, this means we can also improve this on the operator repo.
Also chmod the local hermeto cache after inject-files so it matches CI and Konflux expectations for rootless builds. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
…DP-14412] Drop USER 0 now that Hermeto cache dirs are chmodded for CI and local hermetic builds, matching midstream/Konflux practice. Signed-off-by: Fortune-Ndlovu <fndlovu@redhat.com>
|
PR images are available (for 1 week):
|
|
PR images are available (for 1 week):
|
|
@rm3l: new pull request created: #415 DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. |
Description
Build the must-gather image hermetically in upstream CI using Hermeto, aligned with rhdh-operator #3359.
After the Go rewrite, the Konflux image only needs rpm + gomod prefetch (no pip, cargo, helm generic, or vendored binaries). CI and release workflows use a reusable
docker-buildcomposite action that:rpm+gomodat repo root)/tmp/hermeto-cache/rhdh-must-gather(outside the git tree).rhdh/docker/Containerfilewith--network=noneThis matches downstream Konflux builds and catches hermetic breakages (e.g.
go.mod,rpms.lock.yaml, Konflux Containerfile changes) in PR CI before merge.Also adds
scripts/local-hermeto-build.sh,make hermetic-build, and CONTRIBUTING notes. The rootContainerfilestays for quick non-hermetic local builds (make image-build).Which issue(s) does this PR fix or relate to
How to test changes
Local hermetic build (recommended)
Requires podman and network access for the initial Hermeto prefetch only; the image build itself is offline.
Cache-only (no image):
./scripts/local-hermeto-build.sh -d . --no-imageRebuild image from an existing cache:
./scripts/local-hermeto-build.sh -d . -i localhost/rhdh-must-gather:hermetic-test --no-cacheNon-hermetic local build (unchanged)
CI-built PR image
After PR Build succeeds, PR Push publishes (when configured) to Quay, for example:
quay.io/rhdh-community/rhdh-must-gather:pr-218Replace
218with this PR number. Fork PRs may require loading thepr-imageartifact from the PR Build workflow instead of pulling from Quay.PR acceptance criteria