Skip to content
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

Bind mount the cache directory on Linux KIC #14033

Closed
wants to merge 6 commits into from

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Apr 24, 2022

Mount the image cache as a docker volume, instead of using scp

Avoids the copy step, but only useful when doing host bind mounts

For #14032

Needs a check, if the driver is actually using a local engine on Linux

(if it is a remote DOCKER_HOST, then this trick should not be used)


Example:

$ minikube --alsologtostderr image load python
$ minikube ssh sudo crictl images python
IMAGE               TAG                 IMAGE ID            SIZE
python              latest              2b7ca628da40d       920MB

BEFORE

I0424 14:31:51.457312  272425 cache_images.go:286] Loading image from: /home/anders/.minikube/cache/images/amd64/python
I0424 14:31:51.457380  272425 ssh_runner.go:195] Run: stat -c "%s %y" /var/lib/minikube/images/python
I0424 14:31:51.459372  272425 ssh_runner.go:352] existence check for /var/lib/minikube/images/python: stat -c "%s %y" /var/lib/minikube/images/python: Process exited with status 1
stdout:

stderr:
stat: cannot stat '/var/lib/minikube/images/python': No such file or directory
I0424 14:31:51.459399  272425 ssh_runner.go:362] scp /home/anders/.minikube/cache/images/amd64/python --> /var/lib/minikube/images/python (393211392 bytes)
I0424 14:31:51.934622  272425 docker.go:254] Loading image: /var/lib/minikube/images/python
I0424 14:31:51.934643  272425 ssh_runner.go:195] Run: /bin/bash -c "sudo cat /var/lib/minikube/images/python | docker load"
I0424 14:32:05.565830  272425 ssh_runner.go:235] Completed: /bin/bash -c "sudo cat /var/lib/minikube/images/python | docker load": (13.631171169s)

AFTER

I0424 14:30:43.761855  271891 cache_images.go:346] Loading image from: /home/anders/.minikube/cache/images/amd64/python
I0424 14:30:43.761885  271891 docker.go:258] Loading image: /cache/python
I0424 14:30:43.761896  271891 ssh_runner.go:195] Run: /bin/bash -c "sudo cat /cache/python | docker load"
I0424 14:30:54.344900  271891 ssh_runner.go:235] Completed: /bin/bash -c "sudo cat /cache/python | docker load": (10.582986885s)

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 24, 2022
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: afbjorklund

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 24, 2022
@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Apr 24, 2022
@medyagh
Copy link
Member

medyagh commented Apr 26, 2022

/ok-to-test

@k8s-ci-robot k8s-ci-robot added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label Apr 26, 2022
@minikube-pr-bot
Copy link

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14033) |
+----------------+----------+---------------------+
| minikube start | 51.8s    | 51.9s               |
| enable ingress | 27.6s    | 29.3s               |
+----------------+----------+---------------------+

Times for minikube start: 52.9s 51.4s 51.6s 51.7s 51.4s
Times for minikube (PR 14033) start: 52.2s 51.2s 52.1s 52.1s 51.8s

Times for minikube ingress: 26.1s 26.1s 27.1s 30.1s 28.6s
Times for minikube (PR 14033) ingress: 29.1s 29.6s 29.6s 28.6s 29.6s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 14033) |
+----------------+----------+---------------------+
| minikube start | 24.9s    | 25.3s               |
| enable ingress | 23.0s    | 22.5s               |
+----------------+----------+---------------------+

Times for minikube start: 25.8s 24.6s 24.4s 25.2s 24.6s
Times for minikube (PR 14033) start: 26.0s 24.5s 25.0s 25.3s 25.7s

Times for minikube ingress: 22.9s 22.9s 23.0s 21.9s 24.4s
Times for minikube (PR 14033) ingress: 21.9s 21.9s 22.5s 23.4s 23.0s

docker driver with containerd runtime

+-------------------+----------+---------------------+
|      COMMAND      | MINIKUBE | MINIKUBE (PR 14033) |
+-------------------+----------+---------------------+
| ⚠️  minikube start | 36.9s    | 44.1s ⚠️             |
| enable ingress    | 29.2s    | 18.1s               |
+-------------------+----------+---------------------+

Times for minikube ingress: 27.9s 31.9s 22.4s 32.4s 31.4s
Times for minikube (PR 14033) ingress: 18.0s 17.9s 18.9s 17.9s 18.0s

Times for minikube (PR 14033) start: 44.8s 43.1s 43.9s 44.1s 44.5s
Times for minikube start: 33.9s 40.4s 29.1s 40.6s 40.4s

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label May 11, 2022
@spowelljr
Copy link
Member

Based on #14115 I believe that hasCPUCfsPeriod& hasCPUCfsQuota should be moved to cgroups_linux.go.

@k8s-ci-robot k8s-ci-robot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jun 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants