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

Bump the Kit metadata label version, bundle krane with Twoliter #387

Merged
merged 4 commits into from
Oct 8, 2024

Conversation

cbgbt
Copy link
Contributor

@cbgbt cbgbt commented Oct 7, 2024

Issue number:

Closes #362
Closes #352

Description of changes:
The Kit metadata version bump is motivated by #384, which will begin to introduce application inventory that includes an RPM packages "Epoch" value and refrain from special-casing bottlerocket-core-kit. This change will cause unexpected advisory evaluation behavior for downstream workspaces which depend on core-kit but use an older version of Twoliter when core-kit bumps the epoch of all packages.

When introducing the version bump, Twoliter's integration tests began to fail because they depend on existing published kits, so this PR additionally:

  • Bundles the krane tool with Twoliter, obviating the need to use system-provided OCI tooling
  • Rewrites the integration tests to build and publish kits to a local registry

Testing done:

  • Provided unit and integration tests pass
  • If I try to build bottlerocket-os/bottlerocket with this change directly, I get the following message:
...
[2024-10-07T06:43:37Z INFO  twoliter::project::lock::image] Resolving dependency image dependency '[email protected]/bottlerocket/bottlerocket-core-kit:v2.8.4'.
Error: kit appears to be built with metadata version 'v1', possibly by an older version of twoliter with unsupported incompatibilities. This version of twoliter supports metadata version 'v2'.
  • If I build my own core-kit, then proceed to build bottlerocket, the build proceeds as usual.
  • If I try to build with this new core-kit, but the previous Twoliter, I get the following:
[2024-10-07T07:21:39Z INFO  twoliter::project::lock::image] Resolving dependency image dependency '[email protected]/bottlerocket/bottlerocket-core-kit:v2.8.5 (overridden-to: public.ecr.aws/seankell/bottlerocket-core-kit:v2.8.5)'.
Error: no metadata stored on image, this image appears to not be a kit

Terms of contribution:

By submitting this pull request, I agree that this contribution is dual-licensed under the terms of both the Apache License, version 2.0, and the MIT license.

@cbgbt cbgbt force-pushed the bundle-krane branch 2 times, most recently from 569115f to b64a8f2 Compare October 7, 2024 07:26
@@ -0,0 +1 @@
SHA512 (go-containerregistry-v0.20.1.tar.gz) = c323c5b78c35fb7af67641fa4ef1802b944f8bd908163ff40a952a0c190e2dd210100efba1fbc2064495cff28a60d5bc7ee98e510ec116522c7897539b02fad8
Copy link
Contributor

Choose a reason for hiding this comment

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

It'd be nice to have a URL in a comment above this, so it's easy to double-check hashes. Also in this case, there's both the GitHub-generated archive and a release artifact of the sources, so the URL would help indicate which one is used.

@cbgbt
Copy link
Contributor Author

cbgbt commented Oct 8, 2024

^ force push to address comment from @bcressey

@cbgbt
Copy link
Contributor Author

cbgbt commented Oct 8, 2024

^ force push to rebase

cbgbt and others added 4 commits October 8, 2024 17:55
With support for krane bundled with twoliter, these codepaths are at
risk of succumbing to bitrot. We will remove them in favor of providing
the functionality ourselves.
Copy link
Contributor

@sam-berning sam-berning left a comment

Choose a reason for hiding this comment

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

Nice, this looks good!

Now that krane is bundled in to twoliter, there's some cleanup that we can do on oci-cli-wrapper (or maybe we can just eliminate it) because we needed to provide an interface that worked for both docker and krane and they didn't play nice in some cases. Not a problem for this PR though, we can just open an issue.

@cbgbt
Copy link
Contributor Author

cbgbt commented Oct 8, 2024

Now that krane is bundled in to twoliter, there's some cleanup that we can do on oci-cli-wrapper (or maybe we can just eliminate it) because we needed to provide an interface that worked for both docker and krane and they didn't play nice in some cases

I was thinking about this too. For now I've opted to keep the interface in case we regret the decision to use krane or want to shop around, or re-introduce the ability to override it at runtime.

I'm definitely open to removing it or favoring a more pleasant API in the future though!

@cbgbt cbgbt merged commit 3d54323 into bottlerocket-os:develop Oct 8, 2024
1 check passed
@cbgbt cbgbt deleted the bundle-krane branch October 8, 2024 21:44
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.

CI: Add integration tests for Twoliter.override Bundle crane with twoliter
4 participants