refactor(build): install Helm from CGW mirror instead of vendoring source - #284
Conversation
…urce Replace vendor/helm source tree and go-toolset compile stage with prebuilt Helm v4.2.3 Linux binaries from mirror.openshift.com/pub/cgw/helm/. Hermetic Konflux builds prefetch tarballs via artifacts.lock.yaml and the Hermeto generic fetcher; the upstream Containerfile downloads by TARGETARCH. Adds hack/update-helm-lockfile.sh for version bumps and points local-setup helm downloads at the same CGW mirror. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Extract CGW helm install into a dedicated helm-builder stage (swappable with go-toolset + vendor/helm if CGW lacks a newer release). Add hack/install-helm-cgw-binary.sh for shared platform detection from TARGETPLATFORM or uname; container builds require linux binaries. Makefile local-setup downloads helm-$(OS)-$(ARCH) from CGW so darwin/arm64 dev machines get the correct binary. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Add helm-cgw-available.sh to probe mirror tarballs (per-platform or linux-amd64/arm64 for lockfiles). install-helm-local.sh downloads from CGW when available, otherwise builds from vendor/helm via go. make vendor refreshes artifacts.lock.yaml or vendors helm source; helm-lockfile-update errors with guidance when CGW is missing. Restore helm support in update-vendor.sh for the source path. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
- Rename helm-cgw-available.sh to check-helm-binary-available.sh - Rename install-helm-cgw-binary.sh to install-helm-binary.sh - Label CGW helm-builder as Stage 2a; add commented Stage 2b for vendored go-toolset + vendor/helm when CGW lacks a release - Clarify update-vendor.sh helm fallback comment https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
CGW helm tarballs contain helm-linux-amd64 at the archive root, not linux-amd64/helm. Fixes Konflux prefetch --prefetch install and local CGW download. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
HELM_ARCHIVE_DIR used $(OS)/$(ARCH) before those variables were assigned, producing bin/helm-4.2.3--/helm and breaking E2E local-setup on CI. Also accept normalized amd64 in install-helm-local.sh. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
|
passed downstream in https://gitlab.cee.redhat.com/rhidp/rhdh/-/merge_requests/697 -> https://konflux-ui.apps.stone-prod-p02.hjvn.p1.openshiftapps.com/ns/rhdh-tenant/applications/rhdh-2/pipelineruns/rhdh-must-gather-2-on-pull-wlhhv now just need to make the tests cooperate |
|
PR images are available (for 1 week):
|
E2E standalone deploy on main still fetched the chart tarball from GitHub Releases, which failed intermittently with EOF in CI. Unify native Helm install and standalone helm template to use oci://quay.io/rhdh/chart with an auto-resolved X.Y-N-CI tag from Quay (sort -V so build numbers compare correctly). https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
ShellCheck SC2034 flagged HELM_CHART_OCI_REF as unused because it was only referenced from run-e2e-tests.sh after sourcing. Derive HELM_CHART_SKOPEO_REF from it for skopeo list-tags calls so the constant is used in-file and chart URLs stay in one place. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Branch E2E values on resolved chart major (1.x vs 2.x) instead of git branch name. Wait for install-dynamic-plugins init to finish, then check backstage-backend for CreateContainerConfigError (not container [0] during PodInitializing). Standalone deploys use quay.io/fedora/postgresql-15 on Kind without registry.redhat.io pull secrets. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
Helm 4 prints "Pulled:" and "Digest:" to stdout when templating oci:// charts. Standalone E2E deploy pipes helm template output directly to kubectl apply, which then fails validation with "apiVersion not set, kind not set". Add helm_template_yaml() to filter those status lines before apply. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
|
PR images are available (for 1 week):
|
|
/agentic_review |
Code Review by Qodo
1.
|
|
Hey @nickboldt, just flagging the dependency chain across the PRs on this initiative (RHIDP-16046):
Your PR supersedes the Helm-related parts of both 178 and 218. Once this lands, I'll rebase my 218 to reconcile with your CGW binary approach instead of the |
Fortune-Ndlovu
left a comment
There was a problem hiding this comment.
thanks for pushing the PR @nickboldt added a few nits
Address Qodo and review nits on the CGW binary install path: verify curl downloads against artifacts.lock.yaml (or CGW sha256sum.txt), parse TARGETPLATFORM arch as field 2 for BuildKit variants like linux/arm64/v8, absolutize local OUTPUT_PATH before vendor go build, and tolerate transient kubectl failures in the misconfigured-pod wait loop under set -o pipefail. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
UBI minimal already ships coreutils-single (provides sha256sum). Installing coreutils conflicts with it and fails the image build. https://redhat.atlassian.net/browse/RHIDP-16046 Generated-by: cursor Co-authored-by: Cursor <cursoragent@cursor.com>
|
PR images are available (for 1 week):
|
Summary
Build (Helm CGW binary)
vendor/helm/source tree (~50k lines) and the go-toolset compile stageartifacts.lock.yaml+ Hermeto generic fetcher (Konflux) or curl byTARGETARCH(upstream Containerfile)hack/update-helm-lockfile.sh,hack/check-helm-binary-available.sh,hack/install-helm-binary.sh, andmake helm-lockfile-updatefor version bumpshelm-linux-amd64at archive root, notlinux-amd64/helm)OS/ARCHordering beforeHELM_ARCHIVE_DIR(broken E2E local-setup path on CI)Supersedes the source-vendoring approach in draft PR #282.
Downstream
E2E fixes (Helm 4 + RHDH 2.x chart on Kind)
GitHub E2E failed after the Helm 4 upgrade for reasons unrelated to the CGW lockfile itself. Fixes on this branch:
oci://quay.io/rhdh/charton all branches (auto-pick latestX.Y-N-CIviasort -V; drop flaky GitHub Releases tarball fetch)install-dynamic-pluginsinit to finish, then checkbackstage-backendfor expectedCreateContainerConfigError(notcontainerStatuses[0]duringPodInitializing)quay.io/fedora/postgresql-15on Kind (noregistry.redhat.iopull secret)Pulled:/Digest:on stdout): addhelm_template_yaml()sohelm template | kubectl applyvalidatestests/e2e-chart-version.bats)Related
rhdh-must-gather-helm-bump)Test plan
make testpasses (unit + ShellCheck)make image-buildlocally (optional; CI image job covers this)Ref: https://redhat.atlassian.net/browse/RHIDP-16046
Generated-by: cursor