Add simultaneous unpack support#2918
Conversation
5990b7f to
31cc342
Compare
Codecov Report
@@ Coverage Diff @@
## master #2918 +/- ##
==========================================
- Coverage 42.29% 41.41% -0.88%
==========================================
Files 126 70 -56
Lines 13871 9457 -4414
==========================================
- Hits 5867 3917 -1950
+ Misses 7118 4979 -2139
+ Partials 886 561 -325
Continue to review full report at Codecov.
|
pull.go
Outdated
There was a problem hiding this comment.
how about return NewImageWithPlatform(c, img, pullCtx.PlatformMatcher), nil
pull.go
Outdated
There was a problem hiding this comment.
it seems that it doesn't consider the manifest list(index) case, for example, pull hello-world:latest with --all-platform, if my understanding is correct
There was a problem hiding this comment.
Pull only supports one platform, see https://github.com/containerd/containerd/blob/master/client.go#L377.
I can add a comment to explain this.
31cc342 to
92538f7
Compare
92538f7 to
e5c4dca
Compare
pull.go
Outdated
There was a problem hiding this comment.
how about ctx.Err() instead of errors.New("context cancelled")? it might be closed by deadline.
pull.go
Outdated
There was a problem hiding this comment.
could we filter by the mediatype? it is easy to break if dependence on the order.
e5c4dca to
ec09808
Compare
|
needs rebase |
|
Any update? |
|
needs rebase |
f581cc6 to
94d0a60
Compare
|
Build succeeded.
|
94d0a60 to
b96e746
Compare
|
Build succeeded.
|
b96e746 to
0081ba4
Compare
|
Build succeeded.
|
0081ba4 to
570c195
Compare
|
Build succeeded.
|
unpacker.go
Outdated
There was a problem hiding this comment.
There should be some check here that the image and chain ID are aligned. I think my preference would be that instead of just returning the chain, return a combination of chain and config, then use the config directly from there.
There was a problem hiding this comment.
I think the problem is that we don't have config for schema1 until convert is done.
There was a problem hiding this comment.
Added validation.
This is bitter sweet to me. I hate the code structure, but to support schema1 I have to do it in this way. :(
Added a TODO for the cleanup after schema1 support removal.
2fdfa51 to
10c756b
Compare
|
Build succeeded.
|
|
Build succeeded.
|
unpacker.go
Outdated
There was a problem hiding this comment.
I think we can do nothing for manifest list instead of sending invalid layer.
There was a problem hiding this comment.
We can skip the manifest list.
10c756b to
8ece078
Compare
|
@dmcgowan Removed schema 1 support, and cleaned up the code. |
8ece078 to
f6f56bf
Compare
|
Build succeeded.
|
pull.go
Outdated
There was a problem hiding this comment.
The target shouldn't have this media type. Instead is there a way to just see if the simultaneous unpacker didn't perform any unpacks, then try and do it synchronously
There was a problem hiding this comment.
Oops, the image was converted already. My bad.
Let me see.
There was a problem hiding this comment.
You can use an atomic counter on the number of unpack calls
There was a problem hiding this comment.
Done. Added an atomic int unpacks.
Signed-off-by: Lantao Liu <lantaol@google.com>
Signed-off-by: Lantao Liu <lantaol@google.com>
f6f56bf to
03aafaa
Compare
|
Build succeeded.
|
|
LGTM I had to make some changes to ctr to test it there. There needs to be more thought to getting this working correctly in ctr as well as supporting multiple platforms. We can focus on this for 1.4. |
|
LGTM |
|
Thanks for reviewing! |
|
What are the basic conditions needed to use this feature? Thank you so much. @Random-Liu |
For #2886.
Time consumed to pull k8s.gcr.io/kube-cross:v1.10.3-1 on my machine: