Skip to content

WIP - Skip empty layers during image download [specific ci=Group1-Docker-Commands]#8024

Open
jzt wants to merge 1 commit intovmware:masterfrom
jzt:emptylayer
Open

WIP - Skip empty layers during image download [specific ci=Group1-Docker-Commands]#8024
jzt wants to merge 1 commit intovmware:masterfrom
jzt:emptylayer

Conversation

@jzt
Copy link
Copy Markdown
Contributor

@jzt jzt commented Jun 4, 2018

This change to the image pull path adds functionality to skip empty layers during download. The metadata for each empty layer is stored in the image config, and VMDKs are not created for empty layers. This provides a substantial time reduction when pulling images containing one or more instances of the empty layer.

Examples:

nginx - VIC 1.4.0 - 1 minute 16 seconds

zach@devbox:~/vic/1.4.0$ time docker -H 10.160.129.199:2376 --tls pull nginx
Using default tag: latest
latest: Pulling from library/nginx
f2aa67a397c4: Pull complete
a3ed95caeb02: Pull complete
3c091c23e29d: Pull complete
4a99993b8636: Pull complete
Digest: sha256:e4f0474a75c510f40b37b6b7dc2516241ffa8bde5a442bde3d372c9519c84d90
Status: Downloaded newer image for library/nginx:latest

real    1m16.313s
user    0m0.087s
sys     0m0.024s

nginx - HEAD - 30 seconds

zach@devbox:~/go/src/github.com/vmware/vic (emptylayer *$%)$ time docker -H 10.160.152.54:2376 --tls pull nginx
Using default tag: latest
latest: Pulling from library/nginx
f2aa67a397c4: Pull complete
3c091c23e29d: Pull complete
4a99993b8636: Pull complete
Digest: sha256:e4f0474a75c510f40b37b6b7dc2516241ffa8bde5a442bde3d372c9519c84d90
Status: Downloaded newer image for library/nginx:latest

real    0m30.279s
user    0m0.075s
sys     0m0.014s

tomcat - VIC 1.4.0 - 3 minutes, 59 seconds

zach@devbox:~/vic/1.4.0$ time docker -H 10.160.129.199:2376 --tls pull tomcat
Using default tag: latest
latest: Pulling from library/tomcat
cc1a78bfd46b: Pull complete
a3ed95caeb02: Pull complete
6861473222a6: Pull complete
7e0b9c3b5ae0: Pull complete
ae14ee39877a: Pull complete
8085c1b536f0: Pull complete
6e1431e84c0c: Pull complete
ca0e3df5a1fd: Pull complete
d2cb611ced6c: Pull complete
268dc3e43e66: Pull complete
79a7e8d254c7: Pull complete
5c848af92738: Pull complete
789b92e37607: Pull complete
Digest: sha256:8238fb3b0f8e15219399069a4aa78e88cbbce28834de5f1e55749067b82d14dc
Status: Downloaded newer image for library/tomcat:latest

real    3m58.785s
user    0m0.114s
sys     0m0.084s

tomcat - HEAD - 1 minute 40 seconds

zach@devbox:~/go/src/github.com/vmware/vic (emptylayer $%)$ time docker -H 10.160.152.54:2376 --tls pull tomcat
Using default tag: latest
latest: Pulling from library/tomcat
cc1a78bfd46b: Pull complete
6861473222a6: Pull complete
7e0b9c3b5ae0: Pull complete
ae14ee39877a: Pull complete
8085c1b536f0: Pull complete
6e1431e84c0c: Pull complete
ca0e3df5a1fd: Pull complete
d2cb611ced6c: Pull complete
268dc3e43e66: Pull complete
79a7e8d254c7: Pull complete
5c848af92738: Pull complete
789b92e37607: Pull complete
Digest: sha256:8238fb3b0f8e15219399069a4aa78e88cbbce28834de5f1e55749067b82d14dc
Status: Downloaded newer image for library/tomcat:latest

real    1m40.479s
user    0m0.103s
sys     0m0.062s

Fixes #4168

[specific ci=Group1-Docker-Commands]

@jzt jzt requested a review from hickeng June 4, 2018 20:29
@jzt jzt requested a review from cgtexmex June 4, 2018 20:52
@jzt jzt changed the title Skip empty layers during image download [specific ci=Group1-Docker-Commands] WIP - Skip empty layers during image download [specific ci=Group1-Docker-Commands] Jun 4, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants