-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
cache add: load images to all profiles & skip previously cached images #5987
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: medyagh The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
Codecov Report
@@ Coverage Diff @@
## master #5987 +/- ##
==========================================
- Coverage 36.18% 36.15% -0.03%
==========================================
Files 110 110
Lines 8214 8281 +67
==========================================
+ Hits 2972 2994 +22
- Misses 4851 4886 +35
- Partials 391 401 +10
|
The fix works as tested on local machine. |
/ok-to-test |
Error: running mkcmp: exit status 1 |
All Times Minikube (PR 5987): [ 146.077671 145.244935 146.165283] Average minikube: 145.157383 Averages Time Per Log
|
it seems that the expensive part is getting the image sha from the User Host. but I believe this will be needed for iterative development, if users that build same image name and tag and wanna add that to minikube here is logs from minikube 1.5.2 cache add ubuntu medya@~/workspace/minikube (cache_fix2) $ time minikube cache add ubuntu --alsologtostderr I1209 16:25:28.663164 73421 cache_images.go:296] CacheImage: ubuntu -> /Users/medya/.minikube/cache/images/ubuntu I1209 16:25:28.663195 73421 cache_images.go:302] /Users/medya/.minikube/cache/images/ubuntu exists I1209 16:25:28.663208 73421 cache_images.go:298] CacheImage: ubuntu -> /Users/medya/.minikube/cache/images/ubuntu completed in 77.063µs I1209 16:25:28.663220 73421 cache_images.go:83] CacheImage ubuntu -> /Users/medya/.minikube/cache/images/ubuntu succeeded I1209 16:25:28.663230 73421 cache_images.go:90] Successfully cached all images. I1209 16:25:28.663826 73421 main.go:110] libmachine: Found binary path at /Users/medya/.minikube/bin/docker-machine-driver-hyperkit I1209 16:25:28.663940 73421 main.go:110] libmachine: Launching plugin server for driver hyperkit I1209 16:25:28.685149 73421 main.go:110] libmachine: Plugin server listening at address 127.0.0.1:50965 I1209 16:25:28.685850 73421 main.go:110] libmachine: () Calling .GetVersion I1209 16:25:28.686520 73421 main.go:110] libmachine: Using API Version 1 I1209 16:25:28.686545 73421 main.go:110] libmachine: () Calling .SetConfigRaw I1209 16:25:28.686939 73421 main.go:110] libmachine: () Calling .GetMachineName I1209 16:25:28.687097 73421 main.go:110] libmachine: (minikube) Calling .DriverName I1209 16:25:28.687238 73421 main.go:110] libmachine: (minikube) Calling .GetSSHHostname I1209 16:25:28.687372 73421 main.go:110] libmachine: (minikube) Calling .GetSSHPort I1209 16:25:28.687484 73421 main.go:110] libmachine: (minikube) Calling .GetSSHKeyPath I1209 16:25:28.687606 73421 main.go:110] libmachine: (minikube) Calling .GetSSHUsername I1209 16:25:28.734769 73421 cache_images.go:96] LoadImages start: [ubuntu] I1209 16:25:28.735219 73421 cache_images.go:211] Loading image from cache: /Users/medya/.minikube/cache/images/ubuntu I1209 16:25:28.736645 73421 ssh_runner.go:160] Transferring 29619712 bytes to /var/lib/minikube/images/ubuntu I1209 16:25:28.938606 73421 ssh_runner.go:179] ubuntu: copied 29619712 bytes I1209 16:25:28.942601 73421 docker.go:107] Loading image: /var/lib/minikube/images/ubuntu I1209 16:25:28.942812 73421 ssh_runner.go:96] (SSHRunner) Run: docker load -i /var/lib/minikube/images/ubuntu I1209 16:25:29.072987 73421 cache_images.go:237] Successfully loaded image /Users/medya/.minikube/cache/images/ubuntu from cache I1209 16:25:29.073025 73421 cache_images.go:120] Successfully loaded all cached images. I1209 16:25:29.073030 73421 cache_images.go:121] LoadImages end I1209 16:25:29.073081 73421 main.go:110] libmachine: Making call to close driver server I1209 16:25:29.073095 73421 main.go:110] libmachine: (minikube) Calling .Close I1209 16:25:29.073413 73421 main.go:110] libmachine: (minikube) DBG | Closing plugin on server side I1209 16:25:29.073448 73421 main.go:110] libmachine: Successfully made call to close driver server I1209 16:25:29.073468 73421 main.go:110] libmachine: Making call to close connection to plugin binary and logs fro my PR medya@~/workspace/minikube (cache_fix2) $ time ./out/minikube cache add ubuntu --alsologtostderr I1209 16:25:40.872715 73447 cache_images.go:335] CacheImage: ubuntu -> /Users/medya/.minikube/cache/images/ubuntu I1209 16:25:40.872739 73447 cache_images.go:341] /Users/medya/.minikube/cache/images/ubuntu exists I1209 16:25:40.872745 73447 cache_images.go:337] CacheImage: ubuntu -> /Users/medya/.minikube/cache/images/ubuntu completed in 55.642µs I1209 16:25:40.872757 73447 cache_images.go:85] CacheImage ubuntu -> /Users/medya/.minikube/cache/images/ubuntu succeeded I1209 16:25:40.872768 73447 cache_images.go:92] Successfully cached all images. I1209 16:25:40.873531 73447 main.go:110] libmachine: Found binary path at /Users/medya/.minikube/bin/docker-machine-driver-hyperkit I1209 16:25:40.873595 73447 main.go:110] libmachine: Launching plugin server for driver hyperkit I1209 16:25:40.891326 73447 main.go:110] libmachine: Plugin server listening at address 127.0.0.1:50975 I1209 16:25:40.892515 73447 main.go:110] libmachine: () Calling .GetVersion I1209 16:25:40.893647 73447 main.go:110] libmachine: Using API Version 1 I1209 16:25:40.893674 73447 main.go:110] libmachine: () Calling .SetConfigRaw I1209 16:25:40.894065 73447 main.go:110] libmachine: () Calling .GetMachineName I1209 16:25:40.894413 73447 main.go:110] libmachine: (minikube) Calling .GetState I1209 16:25:40.894678 73447 main.go:110] libmachine: (minikube) DBG | exe=/Users/medya/.minikube/bin/docker-machine-driver-hyperkit uid=0 I1209 16:25:40.895206 73447 main.go:110] libmachine: (minikube) DBG | hyperkit pid from json: 71959 I1209 16:25:40.897253 73447 main.go:110] libmachine: Found binary path at /Users/medya/.minikube/bin/docker-machine-driver-hyperkit I1209 16:25:40.897314 73447 main.go:110] libmachine: Launching plugin server for driver hyperkit I1209 16:25:40.913314 73447 main.go:110] libmachine: Plugin server listening at address 127.0.0.1:50981 I1209 16:25:40.914393 73447 main.go:110] libmachine: () Calling .GetVersion I1209 16:25:40.914984 73447 main.go:110] libmachine: Using API Version 1 I1209 16:25:40.915005 73447 main.go:110] libmachine: () Calling .SetConfigRaw I1209 16:25:40.915324 73447 main.go:110] libmachine: () Calling .GetMachineName I1209 16:25:40.915443 73447 main.go:110] libmachine: (minikube) Calling .DriverName I1209 16:25:40.915586 73447 main.go:110] libmachine: (minikube) Calling .GetSSHHostname I1209 16:25:40.915702 73447 main.go:110] libmachine: (minikube) Calling .GetSSHPort I1209 16:25:40.915795 73447 main.go:110] libmachine: (minikube) Calling .GetSSHKeyPath I1209 16:25:40.915920 73447 main.go:110] libmachine: (minikube) Calling .GetSSHUsername I1209 16:25:40.961382 73447 cache_images.go:98] LoadImages start: [ubuntu] I1209 16:25:40.961456 73447 cache_images.go:396] retrieving image: index.docker.io/library/ubuntu:latest I1209 16:25:42.608673 73447 cache_images.go:399] found index.docker.io/library/ubuntu:latest locally; caching I1209 16:25:44.493066 73447 ssh_runner.go:102] Run: docker inspect --format='{{.Id}}' ubuntu I1209 16:25:44.517507 73447 cache_images.go:248] skipping re-loading image "ubuntu" because sha "775349758637aff77bf85e2ff0597e86e3e859183ef0baba8b3e8fc8d3cba51c" already exists I1209 16:25:44.517534 73447 cache_images.go:114] Successfully loaded all cached images. I1209 16:25:44.517538 73447 cache_images.go:115] LoadImages end I1209 16:25:44.517563 73447 main.go:110] libmachine: Making call to close driver server I1209 16:25:44.517572 73447 main.go:110] libmachine: (minikube) Calling .Close I1209 16:25:44.517787 73447 main.go:110] libmachine: (minikube) DBG | Closing plugin on server side I1209 16:25:44.517816 73447 main.go:110] libmachine: Successfully made call to close driver server I1209 16:25:44.517829 73447 main.go:110] libmachine: Making call to close connection to plugin binary I1209 16:25:44.517839 73447 main.go:110] libmachine: Making call to close driver server I1209 16:25:44.517865 73447 main.go:110] libmachine: (minikube) Calling .Close I1209 16:25:44.518032 73447 main.go:110] libmachine: (minikube) DBG | Closing plugin on server side I1209 16:25:44.518073 73447 main.go:110] libmachine: Successfully made call to close driver server I1209 16:25:44.518093 73447 main.go:110] libmachine: Making call to close connection to plugin binary real 0m3.765s user 0m2.222s sys 0m0.785s |
All Times minikube: [ 145.500571 146.254375 145.847824] Average minikube: 145.867590 Averages Time Per Log
|
Update: I believe I fixed the performance issue of getting image sha. there is still room for 3s improvement on cache, if we use docker cli, I created an issue here google/go-containerregistry#627
|
All Times minikube: [ 151.845473 153.206847 150.546376] Average minikube: 151.866232 Averages Time Per Log
|
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.
Please change the title to mention the behavioral change, as it will show up in the release notes.
All Times minikube: [ 153.221096 151.958725 157.419655] Average minikube: 154.199825 Averages Time Per Log
|
before this PR as described in this bug: #5974
minikube cache add
would only load images into the current profile (minikube) and other profiles had to be restarted to pick up the cache.Future PRs: