-
Notifications
You must be signed in to change notification settings - Fork 3.8k
CRI: "Fix" imageFSPath behavior #9216
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
|
Skipping CI for Draft Pull Request. |
|
This might be related to #9214 (comment) |
|
Yep! Thanks for pointing me to that thread. We've been seeing this for quite a bit now apparently but finally looked into it, I think it's definitely more pronounced for remote sn's but all of the built in linux snapshotters allow you to point wherever you want also. Edit: As Derek mentioned in that issue there's more to be done for the CRI call there, especially if we want to take into account the experimental multi snapshotter support, but this is a good start I think. |
|
I wonder if this type of static metadata is better suited for the introspection API rather than a dedicated endpoint. If the data is stateful or dynamic, then such a call probably makes more sense. We do need to figure out a better way for out of process plugins to set their plugin metadata though, it might just have to be done through the proxy plugin config for now. |
Not a bad idea from looking, I honestly have never used it 😆 |
|
Swapping to an introspection approach |
|
I think the metadata in plugin is good enough to get the information.
|
2882e98 to
b9f7f44
Compare
pkg/cri/sbserver/service.go
Outdated
| // Note that if containerd changes directory layout, we also needs to change this. | ||
| func imageFSPath(rootDir, snapshotter string) string { | ||
| return filepath.Join(rootDir, plugin.SnapshotPlugin.String()+"."+snapshotter) | ||
| func imageFSPath(rootDir, snapshotter string, client *containerd.Client) string { |
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.
Would you be able to write a unit test for this?
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.
Possibly.. I'm not sure how I'd effectively use this in a unit test scenario though as it requires the daemon. Let me see if we have any CRI tests that write out a different config to use, I think that'd make the most sense
|
Need a rebase here~ Rethinking about this and it should be backported into supported release. |
|
I still need to write a test for this, trying to find a spare hour 😅 |
|
Approach looks good, you have a few changes to rebase on top of. We should consider defining the export keys in |
|
@dmcgowan Will do |
Some of the snapshotters that allow you to change their root location were already doing this, this just makes all of them follow the same pattern. Signed-off-by: Danny Canter <danny@dcantah.dev>
Currently it didn't take into account that certain snapshots can explicitly have their root directories placed at a different location. This changes it to use the RootPath method of the snapshotter if it implements it. Signed-off-by: Danny Canter <danny@dcantah.dev>
|
Still trying to find time to write a decent test here, sorry for the delay :(. |
|
An indecent test seems fine as well. I wonder if use of the introspection service there makes it trickier. The snapshots are already marked as dependencies, you could just populate the snapshotter->root map quickly with a |
|
@dcantah sorry I just merged one related pull request. It needs you to rebase it. Thanks |
|
PR needs rebase. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
|
I think we’re seeing the same issue: awslabs/soci-snapshotter#1093 I don’t see anything here for out-of-process snapshotters that go through the proxy. Am I just missing something? |
|
@Kern-- Trying to page this back in, but as far as I remember Derek added support to be able to specify exports for proxy plugins, so I'd assume if your proxy plugin defined the "root" export and set it then this change would probably work. I'll try and rebase this shortly, but I remember not being able to find a decent spot to add a test given it needs a containerd config change to effectively test. If anyone has ideas, or @Kern-- if you'd wanna work on it I can give you access to this branch after rebasing so we can try and land sooner |
|
Looking at this a bit deeper, it looks like this was fixed as part of the CRI restructuring in #9152. Maybe this PR should be rebased on top of release/1.7? |
|
Oh that's sweet, if so I'll look to add to 1.7 instead. I likely won't have time this week however. @dmcgowan given you did the cri restructuring, does this change look needed in main anymore? |
|
I think the first commit to make sure all the snapshotters add their root path to the introspection service is still useful in main. @dcantah I'm happy to open new PRs with the cherry-picks/rebases if you'd like. I just don't want to step on your toes :) |
|
If I don't get to it by Friday please feel free 😭. I'd rather this land now that it's affecting a service, I'd found this just digging through logs last year but it wasn't really impacting anything |
|
Cleaning up the labels here and marking this as "cherry-picked". As documented above, this fix was applied for containerd 1.6/1.7 branches; however, the issue was inadvertently fixed in mainline at the time (containerd 2.0+) through CRI restructuring so was not merged here. |
This was spurred by seeing:
in the kubelets logs. This is due to the imageFSPath for the CRI plugin assuming all of the snapshotters are located under the default location that gets passed on plugin initialization. Several of the snapshotters offer the ability to set different root paths and override this however, and afaict for remote snapshotters it's entirely up to them so this location can be wrong in some cases.
This change exports the root path for the remaining built-in snapshotters that allow you to change their location, and then uses the introspection API to grab the path.
Now
ImageFSInfoon my host returns: