-
Notifications
You must be signed in to change notification settings - Fork 249
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
chunked: estargz support #1001
chunked: estargz support #1001
Conversation
8f9b29b
to
e75b31b
Compare
@ktock 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.
Thank you for this PR. Overall LGTM and works with docker.io.
off-topic: chunked pull doesn't seems work on ghcr.io with the following error? (can be addressed in the following-up PRs)
DEBU[0004] Failed to retrieve partial blob: invalid status code returned when fetching blob 200 (OK)
e75b31b
to
9861129
Compare
yes, I saw that failure as well. I need to handle the 200 return code differently (it seems that ghcr.io turns the partial request into a 200 when requesting too much of the original file) |
8daefc0
to
8ff2f26
Compare
I cannot see this issue anymore, as ghcr.io returns the correct 206 status code. Could you please give it another try and see if something changed for you as well? |
pkg/chunked/compressor/compressor.go
Outdated
compressionLevel = *c.compressionLevel | ||
} | ||
|
||
blob, err := estargz.Build(sr, estargz.WithCompressionLevel(compressionLevel)) |
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.
estargz changes DiffID(uncompressed digest) of the layer because it adds TOC entry. Could we propagate the converted digest to the callers?
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.
It’s an extensive assumption of the current c/image/copy structure that compression/decompression/encryption/… doesn’t change DiffID values. Propagating this isn’t impossible but it will touch a large part of the public API, probably triggering discussions about hiding some of the API, and so on…
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.
In particular we definitely don’t want to add c/image/types.BlobInfo.DiffID
; that historical abuse of the transport API for internal needs of the copy implementation needs to stop at some point, so let’s stop now.
Thank you for fixing this. Chunked pull works with ghcr.io now. |
I've not done anything :) I could still see the behavior though for some layers, I am working on a fix for containers/image to handle a 200 status. |
do you think it could be helpful to add another annotation (like zstd:chunked does) to store the ToC offset so to avoid a round trip to read it? |
Yes I do :) |
8ff2f26
to
f621b5d
Compare
ready for review |
It seems to create wrong $ skopeo copy -f oci --dest-compress-format gzip:estargz docker://ghcr.io/stargz-containers/alpine:3.10.2-org docker://ghcr.io/ktock/myalpine:3.10.2-esgz
$ skopeo inspect --raw docker://ghcr.io/ktock/myalpine:3.10.2-esgz | jq
{
"schemaVersion": 2,
"config": {
"mediaType": "application/vnd.oci.image.config.v1+json",
"digest": "sha256:1f97f0559cbddbff6c872039e93f18c1abdc279cbe82e0eb40258c28f4c30bfd",
"size": 585
},
"layers": [
{
"mediaType": "application/vnd.oci.image.layer.v1.tar+gzip",
"digest": "sha256:09f11a52de5e1e41b8b7f226170df3a9b32881f13e1a330a3dcc344b576911c0",
"size": 2803990,
"annotations": {
"containerd.io/snapshot/stargz/toc.digest": "sha256:2a5b40d9dac53b0ba42c6995648c5a3bb9d71d376c66123facc25d5a7b31957f",
"io.containers.estargz.uncompressed-size": "5935104"
}
}
]
}
$ skopeo inspect --config --raw docker://ghcr.io/ktock/myalpine:3.10.2-esgz | jq '.rootfs.diff_ids'
[
"sha256:03901b4a2ea88eeaad62dbe59b072b28b6efa00491962b8741081c5df50c65e0"
]
$ crane blob ghcr.io/ktock/myalpine:3.10.2-esgz@sha256:09f11a52de5e1e41b8b7f226170df3a9b32881f13e1a330a3dcc344b576911c0 | gunzip | sha256sum
b880ce78f96e260a9e030fe94a8c9070199bb7a20d5e86c221ceeea2c999e00b -
|
@rhatdan @vrothberg @mtrmac any suggestions on how can we solve the issue above? Should we drop the estargz build part for now? |
Well, build that capability? In addition to the API overhaul ~implied above, personally I’d say it’s mostly blocked on building tests for c/image/copy, the codebase is growing in size and especially special cases so much that it’s becoming untenable without tests; I’m working on them as time allows but that hasn’t been very fast recently.
Splitting the feature into two is an option, sure. |
f621b5d
to
1e06673
Compare
I've dropped the compressor part until we figure out how it must be supported. |
@ktock thanks for the review. Addressed the comments |
1e06673
to
ba3fe74
Compare
in addition to zstd:chunked, add support for the estargz format. estargz is maintained at github.com/containerd/stargz-snapshotter Images using estargz can be used on old clients and registries that have no support for the zstd compression algorithm. Signed-off-by: Giuseppe Scrivano <gscrivan@redhat.com>
ba3fe74
to
2855d17
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.
Thank you! LGTM
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
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.
Just a few belated stylistic suggestions, ACK overall.
in addition to zstd:chunked, add support for the estargz format.
estargz is maintained at github.com/containerd/stargz-snapshotter
Images using estargz can be used on old clients and registries that have no support for the zstd compression algorithm.
Signed-off-by: Giuseppe Scrivano gscrivan@redhat.com