Skip to content

Support Blob Mounts#3045

Closed
simonferquel wants to merge 2 commits intocontainerd:masterfrom
simonferquel:blob-mounts
Closed

Support Blob Mounts#3045
simonferquel wants to merge 2 commits intocontainerd:masterfrom
simonferquel:blob-mounts

Conversation

@simonferquel
Copy link
Copy Markdown

Containerd has a fantastic support for manipulating images in a registry (manifest walkers in particular are very powerful). This is why we chose to use it in github.com/docker/cnab-to-oci.

However, it is missing a very important feature for our use case: mounting blobs from one repository to another.

This PR adds support for a blob-mount operation in the remotes/docker package.
It also fixes support for multiple token scopes in the same request (which was currently broken, but not used).

Client code that uses containerd to manipulate images in a registry are
missing this very important feature (mounting blobs from another
repository). This also opens the door to leverage that when we'll track layers
origin in the local store, to avoid duplicating layers in the registry
(and make Push more efficient).

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

estesp commented Feb 25, 2019

Looks like maybe a rebase on current master should be done; doesn't show up in your diff, but there is a more recent use of strings in master that requires the import to remain:

remotes/docker/authorizer.go:205:3: undefined: strings

This looks great, especially since I would need this feature to rebase manifest-tool on containerd imports instead of Docker imports. :)

@dmcgowan
Copy link
Copy Markdown
Member

I wish I would have broken up #2697, I didn't feel it was ready and didn't have time to clean it up for merge. There is a different way to add the authorizations I should have PR'ed separately. Additionally we want to avoid interface changes whenever possible, the blob mounting shouldn't need to look different from any other Push, the Docker code should just be able to use additional information to perform the operation.

@simonferquel
Copy link
Copy Markdown
Author

@dmcgowan do you want me to split the PR ? (one for fixing the multi-scope thing, and the other for supporting mounts).

Also for not introducting a new interface on top of the resolver, is it ok if I add a field OriginResolver in ResolverOptions of type type OriginResolver func(descriptor Descriptor) []string and leverage it in Push to use mounts if there is a repo with the same domain name in the returned list ?

@simonferquel
Copy link
Copy Markdown
Author

First part of the split: #3052

@simonferquel
Copy link
Copy Markdown
Author

Closing in favor of #3053

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.

3 participants