Repository navigation
Conversation
rdark
marked this pull request as ready for review
October 19, 2026 15:32
rdark
force-pushed
the
richard/pla-2603-helm-deploy-multi-deploy
branch
2 times, most recently
from
October 20, 2026 07:46
c286b80 to
ab3e11c
Compare
helm_deploy so rules_img's multi_deploy can push a charthelm_oci_manifest so rules_img's multi_deploy can push a chart
Contributor
Author
|
CI failures are 429's from ECR |
`helm_push` cannot provide `DeployInfo`, so a chart could not be one of a `multi_deploy`'s operations. `helm_oci_manifest` in the new helm/rules_img.bzl describes the chart as the OCI artifact `helm push` creates: an `image_manifest` with the Helm config media type, the chart .tgz as its only layer, the annotations `helm push` writes, and a push spec for `<registry_url>/<chart name>:<chart version>`. The pushed manifest differs from the `helm push` one only by the top-level `mediaType` that rules_img always writes, so its digest differs from `helm_oci_digest`'s. Move the chart-reading and annotation code from oci_digest into a shared ociartifact package, add an oci_parts tool for the rules_img inputs, and make rules_img a non-dev dependency at 0.3.18.
rdark
marked this pull request as draft
October 24, 2026 16:59
rdark
force-pushed
the
richard/pla-2603-helm-deploy-multi-deploy
branch
from
October 24, 2026 16:59
ab3e11c to
197c5e9
Compare
Contributor
Author
|
@abrisco I moved back into draft status - I think it would be better to wait on a rules_img release with rules_img#805 in, then we have byte-identical manifests from day 1. Will move back out of draft when that happens |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #276.
multi_deploypushes many images from onebazel run(concurrently in later versions), but each chart still needs its ownbazel runofhelm_push.helm_pushcannot provideDeployInfo, becauseDeployInfodescribes an image push or load, not a command to run. This PR describes the chart as the OCI artifacthelm pushcreates, and letsrules_imgpush that.Digest
The pushed manifest is byte-identical to the one helm push creates.
Usage
The target is an
image_manifestwith the Helm config media type, the chart.tgzas its only layer, the annotationshelm pushwrites, and animage_push_specfor<registry_url>/<chart name>:<chart version>(+in the version becomes_, as Helm does). It is built fromrules_img's public rules only.helm_chartdoes not create it; it is opt-in through the newhelm/rules_img.bzl.Not supported, and documented in the macro:
push_cmdand plugins such ascm-push,HELM_REGISTRY_USERNAME/HELM_REGISTRY_PASSWORDlogin (credentials come fromrules_img's Docker config and credential helpers),include_images, and charts fromhelm_import(their metadata has nocreatedvalue).Two issues a user might otherwise hit:
rules_imgexpands Go templates in annotation values, so{{in chart metadata is escaped; and the manifest setssoci = "disabled", since a SOCI index would add an annotationhelm pushdoes not write.Dependency change
rules_imgis now a non-dev dependency at 0.3.18. 0.3.14 is the first version that readsannotations_fileas a JSON object with values verbatim; earlier versions splitKEY=VALUElines and trim them. 0.3.18 addsmulti_deploy --sink, which the offline test uses, so it is also the version this repository tests.omit_platform(0.3.21) is not needed: it changes only the manifest descriptor, and the pushed bytes on 0.3.23 are identical with and without it.This has a cost for consumers who never load
helm/rules_img.bzl. In a throwaway consumer module with onehelm_chart, built from an empty repository cache, the change addedrules_img+(about 0.9 MB of source),hermetic_launcher+(128 KB) and theimg_toolchainhub repo (20 KB) to the fetched repositories, because both modules register toolchains. Noimgtool binaries were fetched. Module resolution also raisesrules_imgto at least 0.3.18,bazel_featuresto 1.47.0 andpackage_metadatato 0.0.10.Moving to 0.3.17 or later broke
tests/with_image_deps_imgon Linux, becauseimg_pullstarted making:imagean alias. Base PR #304 fixes that.Implementation
The chart-reading and annotation code moves out of
oci_digest.gointohelm/private/oci_digest/ociartifact, unchanged.oci_digestkeeps its output (thesimpleandcreateddigest goldens pass unchanged), and a newoci_partstool writes the config blob, annotations, tag and destination forrules_img.Testing
tests/helm_oci_manifestruns eachmulti_deploywith--sink oci:<dir>, offline, and checks the Helm config and layer media types, that the layer is the chart.tgz, that the config blob and manifest equal goldens from a realhelm push, that the manifest is that manifest plus the top-levelmediaTypeand nothing else (the check that flips when the field can be omitted), that the rest matcheshelm_oci_digest, the reference for a trailing-slashregistry_urland forregistry_url_file, a{{description and a+version. It also passes with SOCI forced on.ociartifactandoci_parts.bazel test //...and--config=stricton macOS with Bazel 9.3.0 and 7.7.1: 66 pass, 3 skipped (the Linux-onlywith_image_deps_imgtests).helm pull,helm show chartandhelm templateaccept the charts with Helm 3.16.3 and 4.2.0, and the pulled.tgzis byte-identical to the built one.with_image_deps_imgforlinux_arm64and checked its patterns by hand, but did not run the tests), Helm 3.17.3, Flux pulling a chart, and registries that need credentials.