-
Notifications
You must be signed in to change notification settings - Fork 378
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
copy: implement instanceCopyClone
for zstd
compression
#1987
Conversation
35a0a29
to
805cb83
Compare
@mtrmac WDYT about this, Could you PTAL. |
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.
We are getting close, but it I think we need to build two more bits of infrastructure first. Also maybe revisit the original #1875 for a list of concerns to handle.
- We need to add the
internalManifest.OCI1InstanceAnnotationCompressionZSTD
annotation even for non-…CopyClone
copies (e.g. when users use the existingDestinationCtx.CompressionFormat
option). (And that should not be hard-coded in the generic copy code, but something the image and/or manifest format handlers help with.) That will probably also make the new…CopyClone
path simpler. - We need a way for
copySingleImage
to create a Zstd variant even if the destination contains a gzip one; right now theTryReusingBlob
path would just use the gzip blobs.
copy/multiple.go
Outdated
@@ -39,8 +42,15 @@ func prepareInstanceCopies(instanceDigests []digest.Digest, options *Options) [] | |||
logrus.Debugf("Skipping instance %s (%d/%d)", instanceDigest, i+1, len(instanceDigests)) | |||
continue | |||
} | |||
operation := instanceCopyCopy | |||
forceZstd := false | |||
if _, ok := options.EnsureCompressionVariantExists["zstd"]; ok { |
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.
Some code somewhere, maybe here, needs to reject requests for any formats that we don’t currently support.
We also should fail if this is set while copying a non-index image; or, eventually, implement that. (Notably that matters for podman build && podman push
.)
5e1499b
to
31c95ce
Compare
|
I think the immediate next step is to ensure that I imagine (without having done the work) that would require some changes to the interface of The next bit of infrastructure before actually triggering the copy is to ensure that layer reuse only reuses blobs with the desired compression algorithm, per #1987 (comment) . (and perhaps to expose that as an user option, per some of the Buildah bug reports — that could well be separate later.) That’s also somewhere around Once those pieces of infrastructure are built, I think the remaining part would really be the top-level caller in As to whether to do that in this PR, or in the original #1875, I think if we identify a separate concern that can be implemented and discussed mostly independently, it’s a bit more convenient to file a fresh PR so that there isn’t a history of a previous discussion (and GitHub “Load more” placeholders) to wade through. So I’d very weakly prefer all work to happen in PRs other than #1875, and for #1875 to be used more or less just as a tracker of identified issues / concerns — but I don‘t feel strongly about that at all. |
SGTM I think then I'll keep this PR seperate than #1875 and will open new ones for other tasks its easier to review that way. |
31c95ce
to
97d07ec
Compare
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
67260a5
to
0ce8697
Compare
@mtrmac PTAL, I am using this PR directly in draft/POC PR of buildah and its working correctly for me: containers/buildah#4912 |
0ce8697
to
e96cf0f
Compare
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.
Thanks! One last nit?
03fe2ca
to
ea4b49e
Compare
@containers/image-maintainers Could you merge me pls. |
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.
LGTM
* copy.Options now contains a new field `EnsureCompressionVariantExists map[string]int` which allows users to specify if they want to clone images with specified `compression`. Signed-off-by: Aditya R <[email protected]>
Signed-off-by: Aditya R <[email protected]>
Implement `instanceCopyClone` for multiple compression. Signed-off-by: Aditya R <[email protected]>
While performing copy, set a custom compression passed generated from prepareInstanceCopies. Signed-off-by: Aditya R <[email protected]>
Following option does not provides a way to detect and exclude compression if it already exists, this feature may be implemented in future. See: containers#1987 (comment) Signed-off-by: Aditya R <[email protected]>
After implementing `instanceCopyClone` now instance to be copied can exceed the original number of instances in the source, so amend report message to make it more meaningful. Signed-off-by: Aditya R <[email protected]>
Signed-off-by: Aditya R <[email protected]>
Signed-off-by: Aditya R <[email protected]>
* test multiple copy requests of same compression Signed-off-by: Aditya R <[email protected]>
Signed-off-by: Aditya R <[email protected]>
EnsureCompressionVariantsExist is only valid when working with a manifest list. Signed-off-by: Aditya R <[email protected]>
ea4b49e
to
74e7265
Compare
Thank you so much, again! |
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
…gorithmNames There is a need to read annotations of a particular instance to get its compression. Expose `Annotations` as a read-only field. Needed By: containers#1987 Signed-off-by: Aditya R <[email protected]>
Following option does not provides a way to detect and exclude compression if it already exists, this feature may be implemented in future. See: containers#1987 (comment) Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
…gorithmNames There is a need to read annotations of a particular instance to get its compression. Expose `Annotations` as a read-only field. Needed By: containers#1987 Signed-off-by: Aditya R <[email protected]>
Following option does not provides a way to detect and exclude compression if it already exists, this feature may be implemented in future. See: containers#1987 (comment) Signed-off-by: Aditya R <[email protected]>
`c/image` uses `Instance(` API to get the required details of an instance while performing replication `Platform` of instance is needed hence `ListUpdate` must include platform. Needed by: containers#1987 Signed-off-by: Aditya R <[email protected]>
…gorithmNames There is a need to read annotations of a particular instance to get its compression. Expose `Annotations` as a read-only field. Needed By: containers#1987 Signed-off-by: Aditya R <[email protected]>
Following option does not provides a way to detect and exclude compression if it already exists, this feature may be implemented in future. See: containers#1987 (comment) Signed-off-by: Aditya R <[email protected]>
copy.Options
now contains a new fieldEnsureCompressionVariantExists map[string]int
which allows users to specify if they want to clone images with specifiedcompression
.copyMultipleImages
now implementsinstanceCopyClone
and extends function specifically forzstd
compression.