Conversation
TODO: Revendor with containers/container-libs#757 - go.podman.io/storage@main - go.podman.io/image/v5@main - go.podman.io/common@main Signed-off-by: Jan Rodák <hony.com@seznam.cz>
mtrmac
left a comment
There was a problem hiding this comment.
Thanks for the follow-up!
I’m not sure about the wantFirstAvailableAlgo code. Will it be used?
- It is non-deterministic (iterating over the noted algorithms in a Go-determined order)
- What will Buildah use? Due to containers/buildah#6660 , I think Buildah would not want to randomly use Zstd.
- If we ever build the complex “any pre-existing layer” (with dependence on the destination manifest and users’
copy.Options) discussed in #731 (review) , I think a natural way to obtain that would be to callNewBlobCachewithoutWithCompressAlgorithm. If we now define that call to be “first available without more conditions”, we would later need to add aWithSmartCompressSelection()to opt into the better behavior. That would not be much of a problem, but if we can’t see any current user ofwantFirstAvailableAlgo, maybe it would be better to drop that (and continue conservatively using Gzip as in the previous version).
(Non-blocking: The commit split is not correct; the branch does not compile at one of the commits.)
image/pkg/blobcache/src.go
Outdated
| logrus.Debugf("suggesting cached blob with digest %q, type %q (decompress) in place of blob with digest %q", replaceDigest.String(), info.MediaType, info.Digest.String()) | ||
| info.CompressionOperation = s.reference.compress |
There was a problem hiding this comment.
(In #731 (comment) I meant primarily
| logrus.Debugf("suggesting cached blob with digest %q, type %q (decompress) in place of blob with digest %q", replaceDigest.String(), info.MediaType, info.Digest.String()) | |
| info.CompressionOperation = s.reference.compress | |
| logrus.Debugf("suggesting cached blob with digest %q, type %q (decompress) in place of blob with digest %q", replaceDigest.String(), info.MediaType, info.Digest.String()) | |
| info.CompressionOperation = types.Decompress |
but you’re right that the debug log does not need to include the %q either.)
You're right, I have an idea for a simple solution: let's change the requested algorithm parameter to an array. This would allow callers to specify multiple acceptable compressions, and we would return the first match. Since they already know the destination, they can make the choice from there. They can use |
|
Structurally, the BlobCache use is: i.e. the options governing the copy are not yet available in I.e. the caller would need to duplicate a bunch of that logic (now that isn’t exposed, If you want all of this resolved now and perfectly, passing the relevant data to a new I think I’d prefer dropping that part from this PR and fixing primarily the |
7dec204 to
8a56004
Compare
|
Thanks for the explanation. I've addressed all the nits, and I think it's ready to merge. |
8ac3fdc to
d422c55
Compare
|
Packit jobs failed. @containers/packit-build please check. |
… check Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Signed-off-by: Jan Rodák <hony.com@seznam.cz>
Use types.Compress and types.Decompress literals instead of s.reference.compress. Fix panic format in test helper. Signed-off-by: Jan Rodák <hony.com@seznam.cz>
d422c55 to
c4f0f43
Compare
I made some improvements based on the review by @mtrmac.