Repository navigation
ci: publish every merge to main as a 0.0.0-main build - #1167
Merged
Merged
Conversation
railgrid-dev should run what is on main, not what was last tagged. Until now a merge to main published nothing deployable: provider images and charts only went out on release tags, and helm-images.yaml pushed a 0.0.0-<sha> hub chart whose image was never built. main-builds.yaml publishes, for each component whose build context changed, the image as sha-<commit> and the chart at the fixed version 0.0.0-main with that tag as its appVersion. Flux follows the one chart tag by digest; because the image tag is immutable, every build changes the pod spec and rolls the workload, which a mutable :latest image would not. 0.0.0-main is a prerelease, so the release ranges production follows never match it. Selection (hack/ci/main_builds.py) compares HEAD with the commit each published chart was built from rather than with the previous push, so a failed or superseded run is made up for by the next one. Runs are serialized so an older build cannot overwrite a newer one. amd64 only. helm-images.yaml now publishes on v* tags only.
Contributor
Author
|
/approve |
Contributor
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: mjudeikis The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
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.
railgrid-dev is moving from following release tags to running what is on main. Today a merge to main publishes nothing deployable: provider images and charts go out only on release tags, and
helm-images.yamlpushes a0.0.0-<sha>hub chart whose image is never built.What this adds
main-builds.yamlruns on every push to main. For each component with a chart (hub, agent, every provider) whose build context changed, it publishes:ghcr.io/railgrid/<image>:sha-<commit>oci://ghcr.io/railgrid/charts/<chart>, version0.0.0-main, appVersionsha-<commit>Flux follows the one chart tag by digest. Because the chart's appVersion (the default
image.tag) names an immutable image, each build changes the pod spec and rolls the workload. A mutable image tag such as:latestwould not: nothing in the Deployment changes, so nothing restarts. A chart version per commit does not work either, since commit hashes do not sort by time.0.0.0-mainis a semver prerelease, so the release ranges production follows never match it. Releases themselves are untouched.Selection
hack/ci/main_builds.pycompares HEAD with the commit each component's published0.0.0-mainchart was built from (its appVersion), not with the previous push. A failed run, or a queued run dropped in favour of a newer one, is made up for by the next push, and a component that has never been published is built the first time the workflow runs. So the first run after this merges builds all nine.matrices.jsoninputs changed.providers/and the documentation changed.matrices.jsonrebuilds everything, as does a manual run withall.Runs are serialized (
concurrency: main-builds) so an older build cannot overwrite0.0.0-mainafter a newer one.Other changes
helm-images.yamlpublishes onv*tags only; its per-merge0.0.0-<sha>chart is replaced by the above.make verify-workflowslints the new workflow;hack/ci/README.mddocuments it.Limits
:latest, the last release).Testing
make verify-ci-selection(48 tests, 15 new intest_main_builds.py) andmake verify-workflowspass locally.--version 0.0.0-main --app-version sha-…and confirmed the rendered image is…:sha-….The railgrid-dev side is a PR in railgrid/ops, to be merged after the first run here has published.