Skip to content
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

Add GH actions to assemble a multiarch manifest for amd64 rocks #4

Conversation

addyess
Copy link
Contributor

@addyess addyess commented Jan 26, 2024

This PR adds a gh action job which will build each rocks in this repository for each architecture it supports (currently only amd64) and generates a multiarch manifest for each rock annotated with the supported architecture.

The images are pushed on every build, but the multiarch manifests are pubilshed to ghcr.io on merges to main

Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good overall, I see trivy detection is running but we are missing information under the Security tab is there something we need to do more? I also would love to listen to a small explanation on how the caching works in the workflow.

@addyess
Copy link
Contributor Author

addyess commented Jan 26, 2024

TLDR on caching: github-actions allows you to cache anything from the worker machine, and import that cache later. The strategy here is to store into the cache on push to main. When the push occurs, we build the rocks and store the build state from lxd into the cache. The next branch that comes along derived from main, can restore that cache. If one rock changes, but the other does not -- we get the benefit of the cache to not wait for the rebuild of the unchanged one

The key to the cache is based off the name of the rock and filehash of the directory containing the rockcraft.yaml

All of this was inheritted from the operator-workflow version of build-rocks since i couldn't get the merges in there.

I imagine as a TODO -- we'd like these actions to become a workflow that can be reused on other k8s projects (dns, localpv, etc...)

Copy link
Member

@berkayoz berkayoz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, we might want to figure out why Trivy results are not showing up under the Security tab but that's already out of scope for this card.

One small comment we can address later, it might be nice to have an 1.14.5 tag that points to the latest 1.14.5-ck* image?

@ktsakalozos ktsakalozos merged commit 86fc53d into main Jan 29, 2024
5 checks passed
@addyess addyess deleted the KU-52-reuse-gh-actions-from-canonical-to-build-amd-64-rocks-and-push-to-ghcr branch January 31, 2024 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants