Add new snapshots command in ctr for getting an image's snapshot layer mounts#4797
Add new snapshots command in ctr for getting an image's snapshot layer mounts#4797katiewasnothere wants to merge 1 commit intocontainerd:masterfrom
Conversation
|
Hi @katiewasnothere. Thanks for your PR. I'm waiting for a containerd member to verify that this patch is reasonable to test. If it is, they should reply with Once the patch is verified, the new status will be reflected by the I understand the commands that are listed here. 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. |
|
Build succeeded.
|
df14d6d to
5dcc015
Compare
|
Build succeeded.
|
|
I think having two commands with such similar names but different purpose can be confusing and also doesn't follow the convention. For example, with ctr snapshotter |
|
Agree here, |
5dcc015 to
33a0aea
Compare
|
Build succeeded.
|
33a0aea to
d4a1e80
Compare
|
Build succeeded.
|
d4a1e80 to
7703068
Compare
|
Build succeeded.
|
7703068 to
8dba036
Compare
|
@ambarve @cpuguy83 I reworked this PR to instead make a new command in the list of |
|
Build succeeded.
|
There was a problem hiding this comment.
I think it might be okay to make this a required parameter just like the prepare command. Unless there is a specific use case where we don't care about the key with which the snapshot is created.
There was a problem hiding this comment.
Yeah that might be a good idea so that we can make sure people know what key to remove later
There was a problem hiding this comment.
I think we should provide the option of creating a read-only (View) snapshot too. We can add a --read-only flag for the command.
Signed-off-by: Kathryn Baldauf <[email protected]>
8dba036 to
42eb81a
Compare
|
Build succeeded.
|
| ArgsUsage: "[flags] <key> <image name>", | ||
| Description: `Creates a new snapshot from a specified image. | ||
|
|
||
| When you're done, use the remove command. |
There was a problem hiding this comment.
We already have prepareCommand and viewCommand for creating snapshots. Would it make sense to extend those instead? This one seems like does the same, but offers more CLI flags.
I thought about that too, but I'm not sure how much we're okay with changing the expectations for those commands. The goal of this new command is really to take an image name, like "docker.io/library/alpine:latest", and get a new snapshot created with the mounts printed to stdout. |
|
My thinking is that the proposed function is basically a superset of pull + prepare/view. Pull already fetches/unpacks the image with respect to platform, the only missing piece is |
|
@mxpv that sounds reasonable to me. In that case, I'll close this PR and open a new one with the suggested change instead. |
This PR adds a new command to ctr's
snapshotcommands for retrieving the snapshot mounts of an image from a given snapshotter on a given platform. Adding this utility to thesnapshotcommands makes it clear what the purpose is and what the caller's responsibilities are (iow cleaning up the snapshot).This new command is helpful for functional/unit tests in shims because it allows users to retrieve the layer mounts that would be used for creating a new container. Users can then manipulate or use these layer mounts as needed to test specific scenarios.
As an example, in https://github.com/microsoft/hcsshim we have a functional tests package for unit testing here. However, in order for us to unit test our shim, we must manually start a container or VM with an image's layer mounts. We're currently relying on an older docker command as seen here to retrieve those. This PR would replace the out of date docker command.
Signed-off-by: Kathryn Baldauf [email protected]