-
Notifications
You must be signed in to change notification settings - Fork 8
refactor(ci): implement digest-based publishing with artifact coordination #310
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
base: main
Are you sure you want to change the base?
Conversation
…ation Modernize workflows by eliminating duplicate builds and fixing tag versioning. Images are built once in ci-docker.yml and pushed by digest to GHCR. Digest and ref metadata artifacts enable publish.yml to create multi-arch manifests and distribute to both registries efficiently. Key Changes: - ci-docker.yml: Push by digest, export artifacts (digests + ref metadata) - publish.yml: Download artifacts, create manifests, use type=raw tags - Fix workflow_run context issue by passing ref metadata via artifacts - Tag v1.2.3 now correctly creates 1.2.3 + latest image tags - Performance: GHA cache used (no rebuild) - Backward compatible: No configuration changes required Documentation: - New file: CI_QUICKSTART.md with configuration guide Signed-off-by: Reza Rajan <28660160+rezarajan@users.noreply.github.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Tip 📝 Customizable high-level summaries are now available in beta!You can now customize how CodeRabbit generates the high-level summary in your pull requests — including its content, structure, tone, and formatting.
Example instruction:
Note: This feature is currently in beta for Pro-tier users, and pricing will be announced later. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
This is a pretty invasive change set. For one, it publishes build artifacts for all CI builds, which we don't want. CI doesn't push. There's now an implicit dependency between ci-docker and publish which wasn't there before. It strips the revisions which are specific to our releases and the architecture tags, which are useful. This also diverges significantly from our standardized builds, without any prior discussion. I would suggest creating an issue describing the exact problems you're trying to solve, why you think removing existing tags is a good idea, and what you think should be implemented. |
|
I understand, it is a large change which warrants much needed discussion and alignment on proposed changes. I'll create an issue detailing the existing workflow problems, with reasoning for suggested solutions. ClarificationsPerhaps a brief discussion of the currently proposed changes will help to iron some things out before creating the issue. Mostly I would like to ensure that my understanding of some of your statements are correct @wolf31o2, and to address them where I think appropriate. 1. Publishing CI Builds
These changes do not affect the existing modes of operation of the workflow; in other words CI does not push for all workflows, only ones triggered by a push (to the main branch, and via pattern-matched tags), while workflows triggered by a pull request will only result in a build and cache (isolated from upstream build caches). As an example, you'll notice that the CI job for this PR only builds the image, and does not push (see here). On the other hand, a push to the fork's main branch does trigger a push to the repository (see here). This is achieved by using conditionals on the outputs of the docker build-push-action step:
These changes were made in alignment with the Docker Docs for Multi-Platform Builds on GHA. 2. Release and Image Tags
While the proposed version does indeed strip architecture tags (but retains the multi-platform manifest), it does not behave any different than the current implementation for releases, except that it also pushes pre-release images. If I have misinterpreted your statement, I would appreciate it if you may clarify what you mean - this may help in detailing the issue. Please see my overview below: Current Implementation If I understand correctly, the current implementation foregoes registry pushes which include
, but does include them as a GH pre-release
This means any tag associated with the main branch, and which matches the trigger pattern New Implementation Similarly, this is also done in the proposed implementation, with added patterns typically associated with pre-releases: docker-cardano-node/.github/workflows/publish.yml Lines 257 to 262 in 0804c78
The metadata step also ensures the same image naming convention (excluding the 'v' in the tag), and omits associating 'latest' with pre-releases. docker-cardano-node/.github/workflows/publish.yml Lines 144 to 150 in 0804c78
The GitHub release also properly sets the pre-release field:
Again, if I have misunderstood anything, please let me know. I'll also just note here, for reference, that these changes follow the prior cache changes discussed in #304 |
|
I don't understand what benefit there is in upheaving all of this, especially with the loss of the tagging we currently use. We currently use the architecture-specific tags. We also do not use "-pre" versioning, but we do use our own release revision tags, since we do not control the upstream versioning. I want to preserve these. This code changes the entire system without understanding why much of it is done. Break these changes up into smaller pieces, not giant refactors which can potentially break desired behaviors. While there's room for improvements, CI that needs its own README is definitely overkill. |
Summary
This refactor introduces a few key changes to the current CI/CD workflow. Namely, they are focused on addressing the current inefficiencies around double-builds (ci-docker and publish workflows both build, and currently do not share any cache), as well as requiring two runners for simple OCI manifest work. Broadly speaking, this refactor streamlines workflows into two sequential steps: build (ci-docker) and distribute (publish).
Key Changes
ci-docker.yml: Build artifacts, caches them, push by digest, export artifacts (digests + ref metadata)publish.yml: Download artifacts fromci-docker, create multi-arch manifests from digests, use type=raw tags to properly set image tags-amd64and-arm64v8suffixes which clutter repositories, but rather publish digests and create a multi-arch manifest which embeds both architectures. Downstream consumers need only concern themselves with the base image tag names, letting the runtime select the appropriate platform.Notes
Summary by cubic
Streamlined container CI/CD to build once, push by digest, and publish multi-arch manifests. Removes duplicate builds and fixes tag handling (e.g., v1.2.3 -> 1.2.3 and latest for non-prereleases).
Refactors
Migration
Written for commit 0804c78. Summary will update automatically on new commits.