Skip to content
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

Make blob reuse choices manifest-format-sensitive, and allow conversions when writing to format-agnostic transports #2213

Merged
merged 9 commits into from
Feb 5, 2024

Conversation

mtrmac
Copy link
Collaborator

@mtrmac mtrmac commented Dec 6, 2023

Fixes #2205

@rhatdan
Copy link
Member

rhatdan commented Dec 6, 2023

LGTM

@mtrmac mtrmac force-pushed the zstd-blob-reuse-choice branch 2 times, most recently from e0eaafa to e76fe04 Compare January 30, 2024 23:46
@mtrmac mtrmac changed the title WIP: Make blob reuse choices manifest-format-sensitive, and allow conversions when writing to format-agnostic transports Make blob reuse choices manifest-format-sensitive, and allow conversions when writing to format-agnostic transports Jan 30, 2024
@mtrmac mtrmac marked this pull request as ready for review January 30, 2024 23:47
@mtrmac
Copy link
Collaborator Author

mtrmac commented Jan 30, 2024

Now tested (with #2205 (comment) ), and I fixed some of the debug log data.

Ready for review/merging.

@mtrmac mtrmac added the kind/bug A defect in an existing functionality (or a PR fixing it) label Jan 30, 2024
@mtrmac mtrmac force-pushed the zstd-blob-reuse-choice branch 2 times, most recently from 37c4657 to f7f0248 Compare February 1, 2024 20:30
We might want to trigger a conversion to OCI if the source is not
OCI, but the destination already contains a Zstd version of a layer.

We can do that for destinations that express a restricted list of
manifest formats, so it is unexpected that completely unrestricted
destinations can't trigger a conversion, and just fail (right now),
or perhaps don't fail but unnecessarily upload (in the future), in that case.

Signed-off-by: Miloslav Trmač <[email protected]>
Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... to be a bit more similar to PutBlobOptions,
to be consistent with the constructor, and to start
with identification before parameters.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
We will need to access it from copyLayer.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... to allow adding more conditions

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
…BlobOptions

... because we will add more reasons to reject a match.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
There's no reason not to, and we will need it in other cases
as well.

Signed-off-by: Miloslav Trmač <[email protected]>
... and eliminate incorrectly named requiredCompression variables
by using it.

Should not change behavior.

Signed-off-by: Miloslav Trmač <[email protected]>
... so that we limit blob reuse to acceptable conversion formats,
based on possible manifest formats.

Implement it in CandidateMatchesTryReusingBlobOptions, covering all
(in-tree) implementations.

We still _try_ converting to schema2/schema1 (and upload the schema1
empty layer to the destination registry) before succeeding with OCI.

Signed-off-by: Miloslav Trmač <[email protected]>
@rhatdan
Copy link
Member

rhatdan commented Feb 4, 2024

@giuseppe PTAL

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@giuseppe
Copy link
Member

giuseppe commented Feb 5, 2024

@mtrmac can we merge it?

@rhatdan rhatdan merged commit dd3d3eb into containers:main Feb 5, 2024
10 checks passed
@mtrmac mtrmac deleted the zstd-blob-reuse-choice branch February 5, 2024 17:35
atmosphere-ci bot pushed a commit to vexxhost/atmosphere that referenced this pull request Apr 21, 2024
…1114)

This PR contains the following updates:



Package
Change
Age
Adoption
Passing
Confidence




github.com/containers/image/v5
v5.29.2 -> v5.30.0








WarningSome dependencies could not be looked up. Check the warning logs for more information.


Release Notes

containers/image (github.com/containers/image/v5)
v5.30.0
Compare Source
What's Changed
A fair number of improvements when working with zstd and zstd:chunked-compressed images.
Note that make install now installs policy.json and registries.d/default.yaml.

Refuse compression to zstd when using schema1 by @​mtrmac in containers/image#2196
Don't expose local account details in oci-archive tar files by @​mtrmac in containers/image#2202
Trigger a conversion to OCI when compressing to Zstd by @​mtrmac in containers/image#2204
Add buildtags to avoid fulcio and rekor dependencies by @​siretart in containers/image#2180
copy: do not fail if digest mismatches by @​giuseppe in containers/image#1980
Moving policy.json and default.yaml from containers/skopeo by @​rahilarious in containers/image#2215
Embrace codespell: config, workflow (to alert when new typos added) and get typos fixed by @​yarikoptic in containers/image#2214
Fix raspberry pi zero cpu variant recognition by @​lstolcman in containers/image#2086
storage: validate images converted to zstd:chunked by @​giuseppe in containers/image#2243
Make blob reuse choices manifest-format-sensitive, and allow conversions when writing to format-agnostic transports by @​mtrmac in containers/image#2213
Edit the manifest when pushing uncompressed data from c/storage by @​mtrmac in containers/image#2273
Random storage-related cleanups by @​mtrmac in containers/image#2287
Improve storage transport documentation, primarily about locking by @​mtrmac in containers/image#2291
Fix c/storage destination with partial pulls by @​mtrmac in containers/image#2288
Fix manifest updates when we match a layer by TOC digest by @​mtrmac in containers/image#2294
Cleanly fail when trying to obtain a DiffID of a non-OCI image by @​mtrmac in containers/image#2295
Beautify TOC-related parts of storageImageSource by @​mtrmac in containers/image#2296
storage: use the new ApplyStagedLayer interface by @​giuseppe in containers/image#2301
Also annotate image instances using zstd:chunked as using zstd by @​mtrmac in containers/image#2302
Support editing ArtifactType, preserve it in lists by @​nalind in containers/image#2304
Provide data to correctly report throughput on partial pulls by @​mtrmac in containers/image#2308
Add validation error to digesting reader by @​saschagrunert in containers/image#2312
Fix handling of errors when fetching layers by URLs by @​mtrmac in containers/image#2310
Improve handling of zstd vs. zstd:chunked matching by @​mtrmac in containers/image#2317

New Contributors

@​rahilarious made their first contribution in containers/image#2215
@​yarikoptic made their first contribution in containers/image#2214
@​lstolcman made their first contribution in containers/image#2086
@​bainsy88 made their first contribution in containers/image#2260

Full Changelog: containers/[email protected]


Configuration
📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).
🚦 Automerge: Disabled by config. Please merge this manually once you are satisfied.
♻ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.
🔕 Ignore: Close this PR and you won't be reminded about this update again.


 If you want to rebase/retry this PR, check this box


This PR has been generated by Mend Renovate. View repository job log here.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A defect in an existing functionality (or a PR fixing it)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Blob reuse decisions do not take into account manifest support
3 participants