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

Check if Docker installed via Snap Package Manager #11088

Merged
merged 2 commits into from
Apr 14, 2021

Conversation

spowelljr
Copy link
Member

@spowelljr spowelljr commented Apr 13, 2021

Closes #10772

The root of the issue is that packages installed via Snap have their own tmp folder and can't actually access /tmp. minikube writes a memory asset to the /tmp folder that Docker later copies, but if installed via Snap fails due to having different tmp dirs. We added code to check if minikube is installed via Snap, and if it is, we write the memory asset to the users home dir instead.

However, the issue is if Docker is installed via Snap and minikube is not, because we only check if minikube is installed via Snap, we write the memory asset to the /tmp dir, but Docker can't access /tmp so it fails.

I added a check to see if Docker is installed via Snap, and if minikube or Docker is installed via Snap, writes the memory asset to the users home dir instead.

@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 13, 2021
@minikube-bot
Copy link
Collaborator

Can one of the admins verify this patch?

@medyagh
Copy link
Member

medyagh commented Apr 13, 2021

/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 13, 2021
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube start: 53.0s 48.0s 51.8s 48.6s 50.5s
Average time for minikube start: 50.4s

Times for minikube ingress: 36.3s 34.2s 37.4s 34.4s 34.3s
Average time for minikube ingress: 35.3s

Times for minikube (PR 11088) start: 52.4s 47.1s 46.9s 47.3s 49.7s
Average time for minikube (PR 11088) start: 48.7s

Times for minikube (PR 11088) ingress: 36.3s 37.3s 33.8s 34.2s 36.7s
Average time for minikube (PR 11088) ingress: 35.7s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 11088) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.19.0 on Debian               | 0.0s     | 0.0s                |
| 9.13 (kvm/amd64)                           |          |                     |
|   - MINIKUBE_LOCATION=11088                | 0.0s     | 0.0s                |
| * Using the kvm2 driver based              | 0.0s     |                     |
| on existing profile                        |          |                     |
| * Starting control plane node              | 0.0s     | 0.0s                |
| minikube in cluster minikube               |          |                     |
| * Creating kvm2 VM (CPUs=2,                | 30.9s    | 29.9s               |
| Memory=6000MB, Disk=20000MB)               |          |                     |
| ...                                        |          |                     |
| * Preparing Kubernetes v1.20.2             | 7.9s     | 7.7s                |
| on Docker 20.10.4 ...                      |          |                     |
|   - Generating certificates                | 1.8s     | 1.5s                |
| and keys ...                               |          |                     |
|   - Booting up control plane               | 7.2s     | 7.2s                |
| ...                                        |          |                     |
|   - Configuring RBAC rules ...             | 1.3s     | 1.3s                |
| * Verifying Kubernetes                     | 0.0s     | 0.0s                |
| components...                              |          |                     |
|   - Using image                            | 1.1s     | 0.9s                |
| gcr.io/k8s-minikube/storage-provisioner:v5 |          |                     |
| * Enabled addons:                          | 0.2s     | 0.1s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

docker Driver
Times for minikube start: 23.7s 21.8s 22.0s 22.1s 22.5s
Average time for minikube start: 22.4s

Times for minikube ingress: 30.0s 29.0s 37.0s 29.5s 29.0s
Average time for minikube ingress: 30.9s

Times for minikube (PR 11088) ingress: 29.5s 28.0s 29.5s 31.5s 30.5s
Average time for minikube (PR 11088) ingress: 29.8s

Times for minikube (PR 11088) start: 21.8s 21.4s 21.4s 22.0s 21.7s
Average time for minikube (PR 11088) start: 21.7s

Averages Time Per Log

+--------------------------------------------+----------+---------------------+
|                    LOG                     | MINIKUBE | MINIKUBE (PR 11088) |
+--------------------------------------------+----------+---------------------+
| * minikube v1.19.0 on Debian               | 0.0s     | 0.0s                |
| 9.13 (kvm/amd64)                           |          |                     |
|   - MINIKUBE_LOCATION=11088                | 0.1s     | 0.1s                |
| * Using the docker driver                  | 0.1s     |                     |
| based on existing profile                  |          |                     |
| * Starting control plane node              | 0.1s     | 0.1s                |
| minikube in cluster minikube               |          |                     |
| * Creating docker container                | 6.7s     | 6.5s                |
| (CPUs=2, Memory=8000MB) ...                |          |                     |
| * Preparing Kubernetes v1.20.2             | 6.6s     | 6.4s                |
| on Docker 20.10.5 ...                      |          |                     |
|   - Generating certificates                | 1.7s     | 1.4s                |
| and keys ...                               |          |                     |
|   - Booting up control plane               | 5.4s     | 5.3s                |
| ...                                        |          |                     |
|   - Configuring RBAC rules ...             | 1.1s     | 1.1s                |
| * Verifying Kubernetes                     | 0.1s     | 0.0s                |
| components...                              |          |                     |
|   - Using image                            | 0.5s     | 0.5s                |
| gcr.io/k8s-minikube/storage-provisioner:v5 |          |                     |
| * Enabled addons:                          | 0.0s     | 0.0s                |
| storage-provisioner,                       |          |                     |
| default-storageclass                       |          |                     |
| * Done! kubectl is now                     | 0.0s     | 0.0s                |
| configured to use "minikube"               |          |                     |
| cluster and "default"                      |          |                     |
| namespace by default                       |          |                     |
+--------------------------------------------+----------+---------------------+

@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 13, 2021
pkg/minikube/command/kic_runner.go Outdated Show resolved Hide resolved
@k8s-ci-robot k8s-ci-robot removed the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Apr 13, 2021
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: medyagh, spowelljr

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 13, 2021
@minikube-pr-bot
Copy link

kvm2 Driver

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11088) |
+----------------+----------+---------------------+
| minikube start | 49.0s    | 48.8s               |
| enable ingress | 43.4s    | 37.7s               |
+----------------+----------+---------------------+

Times for minikube start: 49.7s 48.0s 49.2s 48.4s 49.6s
Times for minikube (PR 11088) start: 48.1s 49.8s 49.1s 48.0s 49.3s

Times for minikube ingress: 43.3s 43.3s 42.9s 43.9s 43.8s
Times for minikube (PR 11088) ingress: 36.4s 35.4s 37.4s 36.7s 42.7s

docker Driver

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 11088) |
+----------------+----------+---------------------+
| minikube start | 22.3s    | 21.8s               |
| enable ingress | 36.4s    | 37.1s               |
+----------------+----------+---------------------+

Times for minikube start: 24.2s 22.5s 21.4s 21.2s 22.0s
Times for minikube (PR 11088) start: 21.7s 22.3s 21.3s 22.1s 21.5s

Times for minikube ingress: 36.0s 38.0s 33.5s 37.0s 37.5s
Times for minikube (PR 11088) ingress: 34.0s 41.0s 41.5s 34.5s 34.5s

@medyagh medyagh merged commit 241112f into kubernetes:master Apr 14, 2021
@spowelljr spowelljr deleted the fixSnapDocker branch June 28, 2021 17:43
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/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix no such file or directory error when Docker installed via Snap
5 participants