-
Notifications
You must be signed in to change notification settings - Fork 469
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: Publish main branch images and charts #10540
release: Publish main branch images and charts #10540
Conversation
.goreleaser-main.yaml
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think I'm leaning towards using envsubst and setting the [changelog,release].enabled=false in a single goreleaser config file to avoid drift between the configs, but wanted to get consensus on either approach. See https://github.com/orgs/goreleaser/discussions/3042 for how to do the former.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So the envsubst
approach would be:
- keep a single ~
.goreleaser.yaml.tmpl
file - nightly cron will envsubst in false for
[changelog,release]
-> .goreleaser.yaml - kick off the release make target with newly build yaml file
is that accurate?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pivoted away from the envsubst approach in favor of publishing a v0.0.0-main tag instead of dynamically setting the changelog and release enabled flags. The prerelease: auto
flag treats the v0.0.0-main tag as a prerelease build, so I didn't see a need to maintain two different config files or dynamically render any YAML template files.
branches: | ||
- main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The alternative is cron schedule expression that fires daily if we're concerned with the free org limits for ghcr.io. In either case, we can figure out the best approach over time. This PR effectively tests whether the release pipeline is working without publishing a real tag.
HELM_PACKAGE_ARGS ?= --version $(VERSION) | ||
package-kgateway-chart: ## Package the new kgateway helm chart for testing | ||
mkdir -p $(TEST_ASSET_DIR) | ||
helm package --version $(VERSION) --destination $(TEST_ASSET_DIR) install/helm/kgateway | ||
helm repo index $(TEST_ASSET_DIR) | ||
mkdir -p $(TEST_ASSET_DIR); \ | ||
helm package $(HELM_PACKAGE_ARGS) --destination $(TEST_ASSET_DIR) install/helm/kgateway; \ | ||
helm repo index $(TEST_ASSET_DIR); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Technically a no-op right now. I was exploring whether I could unset the helm package --version CLI flag, which has validation logic that checks whether --version is a valid semver (i.e. main or latest would fail that versioning), but the issue is that the default Chart.yaml version is hardcoded to v0.0.1 when you package a chart w/o this --version flag set.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it's ok to have the version be something like 0.0.0-<GIT HASH>
given that this is a nightly release
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nvm - that might mean that the oci storage will grow unbounded
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we'd run into the same unbounded growth with this approach too as we're setting VERSION to be VERSION="${GIT_TAG}-${GIT_SHA}"
anytime a new PR merges to main. one option that was discussed was using a third party action to periodically purge ghcr storage (e.g. https://github.com/snok/container-retention-policy).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just to clarify too -- we're still planning on mirroring quay's retention policy / auto-pruning images with a label as a follow-up once the release pipeline is fully built out and validated it works.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ended up going with the v0.0.0-main tagging convention to appease helm validation. Seems a bit wonky but sufficient for now.
This modifies the release.yaml workflow and adds the main branch push trigger to publish main branch images and the latest helm chart to ghcr.io. Signed-off-by: timflannagan <[email protected]>
c519493
to
eea329f
Compare
GORELEASER ?= go run github.com/goreleaser/goreleaser/[email protected] | ||
GORELEASER_ARGS ?= --snapshot --clean | ||
GORELEASER_CURRENT_TAG ?= $(VERSION) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Needed as goreleaser will use the v1.18.x tag by default and we want the v0.0.0-main tag to be used for main branch triggers.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See https://goreleaser.com/cookbooks/set-a-custom-git-tag/ for that documentation.
@@ -4,6 +4,9 @@ on: | |||
push: | |||
tags: | |||
- 'v*' | |||
- '!v0.0.0-main' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Skip the v0.0.0-main tag that the main branch trigger will pump out to avoid running the release pipeline twice.
Description
This modifies the release.yaml workflow and adds the main branch push trigger to publish main branch images and the latest helm chart to ghcr.io.
Related to #10510.
Checklist: