-
Notifications
You must be signed in to change notification settings - Fork 18.9k
c8d/pull: Add CRI-compatible annotation of pulled content #44810
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
Conversation
|
cc @ktock |
d3d9281 to
c38f186
Compare
|
Thanks for this work! |
|
Thanks for the work! |
vendor.mod
Outdated
| github.com/containerd/containerd v1.6.15 | ||
| github.com/containerd/continuity v0.3.0 | ||
| github.com/containerd/fifo v1.0.0 | ||
| github.com/containerd/nydus-snapshotter v0.3.0 |
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.
Better to upgrade to v0.5.0.
|
If we were to instead support a user-specified containerd snapshotter, wouldn't we get similar benefits but without pulling in additional dependencies / code surface we have to maintain over time? In other words, what specific benefits do we gain by explicitly supporting (and thus maintaining over time) these directly instead of supporting them implicitly via containerd's existing support? |
Also curious about that part; if possible it would be good that we wouldn't have to make changes for every possible snapshotter out there. Not sure what exactly is needed on our side for that. Otherwise we'd continue to play catch-up every time a new snapshotter comes to existence/ |
The lazy snapshotters need the image handlers, they add metadata so that the snapshotter knows later what’s what and be able to pull the layers on demand. A user-defined snapshotter will only work if that snapshotter doesn’t need any custom image handlers on pull I only added the snapshotters that are subprojects of the containerd project, I don’t think there will be new ones popping up every week. |
To rephrase my other comment: without this code these two snapshotters don’t work at all, containerd’s client doesn’t support them by default. Maybe this will change in the future with the Transport service they are making but I’m not sure |
Right, but the bar for becoming a non-core project is fairly low, so even if it doesn't happen often, it also doesn't really tell us anything about the support or longevity of the project (and thus whether it makes sense for us to commit to supporting; see the saga around several of our log drivers for a painful example of this 😔). |
|
The snapshotter-specific code just appends labels, so it is easier to maintain compared to logging drivers. If this is still a burden to get the PR merged, I guess we can move the snapshot-specific labeling part to |
If these are well-known (fixed) labels, perhaps they can be set without having to introduce the dependencies (see docker/buildx#1549 (comment) for a similar discussion). Configurable through FWIW; if we only need the dependency for the labels, I'm not so much concerned about the dependency itself (which would then be mostly "dead code" (still not ideal)), but also the ripple effect those dependencies may cause (indirect dependencies, versions of those), which becomes more problematic if we're an actual go module. |
The labels these two snapshotters set don't seem to be well-known, I'm not sure we want to implement a whole logic around adding different labels to different media-types with specific values. This would really mean we are maintaining lazy snapshotters but in a completely different way the original snapshotter does.
FYI we already had stargz-snapshotter as a dependency because buildkit handles it and we will also depend on nydus once we update buildkit |
|
It was observed today in the maintainer's call that containerd itself does not import these snapshotters, and supports them just fine. It appears that more-or-less the same code being imported and called here is built into the CRI: Can we see if we can incorporate this code directly, and raise a PR against containerd that hoists it out of the CRI and to an exported package? Then we can add a FIXME to use the newly exported method when we eventually pick up the change in containerd. |
|
@neersighted Thank you for the suggestion! Yes, using As of now,
I'm willing to working on following-up PRs. |
I can do that 👍 |
|
Thanks @ktock for the work, we will update nydus snapshotter once containerd/containerd#8036 is merged and released. |
neersighted
left a comment
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.
Adding my review as a blocker until the new "don't import the snapshotters directly" approach can be implemented.
|
nydus snapshotter has integrated containerd/containerd#8036 |
neersighted
left a comment
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.
This can be rebased in terms of #44982 once that PR is merged; we can also bump to containerd 1.7 if desired after that PR is merged.
c38f186 to
baf111b
Compare
Co-authored-by: Paweł Gronowski <[email protected]> Signed-off-by: Bjorn Neergaard <[email protected]>
baf111b to
782a369
Compare
Own-code review
|
Can't approve my own PR but 👍 LGTM |
|
Bringing this in; and I'm really happy to see how we came together across projects to improve this for the ecosystem 🎉 |
- What I did
Invoke containerd's
AppendInfoHandlerWrapperto add CRI-compatible annotations in the form of labels to pulled content, in order to enable remote snapshotters such as nydus, stargz, and more.Upstreams: