Skip to content

add cli option to download all manifests#3127

Closed
erain wants to merge 2 commits intocontainerd:masterfrom
erain:issues/3126
Closed

add cli option to download all manifests#3127
erain wants to merge 2 commits intocontainerd:masterfrom
erain:issues/3126

Conversation

@erain
Copy link
Copy Markdown
Contributor

@erain erain commented Mar 25, 2019

  • Add all-manifests option to both ctr content fetch and ctr images pull. By default it is false.
  • TheAppendDistributionSourceLabel in RemoteContext will only works when this option is set.

Fixes #3126

Signed-off-by: Yu Yi [email protected]

- Add `all-manifests` option to both `ctr content fetch` and `ctr
  images pull`. By default it is false.
- This option ties to `AppendDistributionSourceLabel` in client.

Signed-off-by: Yu Yi <[email protected]>
@estesp
Copy link
Copy Markdown
Member

estesp commented Mar 25, 2019

If we agree to change default behavior, then this test would also have to be modified:

--- FAIL: TestImagePullSomePlatforms (0.31s)
    client_test.go:285: content digest sha256:c84b0a3a07b628bc4d62e5047d0f8dff80f7c00979e1e28a821a033ecda8fe53: not found

Comment thread cmd/ctr/commands/content/fetch.go Outdated
Usage: "pull content from all platforms",
},
cli.BoolFlag{
Name: "all-manifests",
Copy link
Copy Markdown
Contributor

@alculquicondor alculquicondor Mar 25, 2019

Choose a reason for hiding this comment

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

if the only use of downloading all the manifests is AppendDistributionSourceLabel, we can have the flag with a more related name, like store-distribution-source.
Otherwise, does it make sense to add distribution source without having all the manifests? If so, can they have independent flags that can somehow be combined?

@dmcgowan what's your recommendation?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I don't have strong opinion on this and will hold on for the suggestion of @dmcgowan

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Flags are tricky, we don't actually support these so it isn't hugely important we get it right the first time. There are a few different "abilities" to keep in mind around pulling: single images vs all images and pulling layers vs shallow pulling metadata. It would be nice if the flag when used on fetch could handle the "shallow" case, that is don't pull tar blobs for any platform but pull all metadata (manifests/configs).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback!

So my understanding right now:

  1. for ctr content fetch when all-manifests is used, containerd downloads all manifests/configs but not layers.
  2. for ctr images pull when all-manifests is used, containerds downloads all manifests/configs + the layers for the matched platform.

Did I miss anything? If not I will have a new commit to implement the mentioned behavior.

Comment thread cmd/ctr/commands/images/pull.go Outdated
@erain
Copy link
Copy Markdown
Contributor Author

erain commented Mar 25, 2019

@estesp Thanks for the reminder and this is my first PR so that I was not aware some tests would not run without root. Sorry about that!

I've reverted the behavior in:506b815#diff-51565ad50d7426213c2f33579f6f0e71 and the test passes now.

Comment thread pull.go
// Filter manifests by platforms but allow to handle manifest
// and configuration for not-target platforms
childrenHandler = remotes.FilterManifestByPlatformHandler(childrenHandler, rCtx.PlatformMatcher)
if rCtx.AppendDistributionSourceLabel {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I think this is worthy of a new option for all manifests or all image metadata. We haven't finalized cross repository push so it is possible we want to append the distribution labels without pulling each manifest.

@erain
Copy link
Copy Markdown
Contributor Author

erain commented Mar 26, 2019

Had an offline discussion with @alculquicondor and it seems we need two flags here:

  1. all-manifests: for ctr content fetch and ctr images pull, containerd downloads all manifests/configs, but not layers.
  2. store-distribution-source: containerd downloads all manifests/configs + the target platform's layers.

@dmcgowan Do you think my understanding is right?

@dmcgowan
Copy link
Copy Markdown
Member

carried

@dmcgowan dmcgowan closed this Aug 23, 2019
crosbymichael added a commit that referenced this pull request Aug 26, 2019
[carry #3127] Update pull default to skip all platform manifests
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.

Manifests and configs downloaded for all platforms by default

4 participants