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

Add "sudo" to podman calls #7631

Merged
merged 28 commits into from
Apr 29, 2020
Merged

Conversation

afbjorklund
Copy link
Collaborator

@afbjorklund afbjorklund commented Apr 12, 2020

TODO is to replace three hundred places of exec.Command OCIBinary with appropriate "sudo".

To make it easier one could use a dummy wrapper like "env", for the docker commands as well.

Then it could be like: exec.Command(OCIPrefix, OCIBinary, ...)

env docker info

sudo podman info

Instead of having to manipulate arrays during the interpolation ?

For #7480

@afbjorklund afbjorklund requested a review from medyagh April 12, 2020 14:30
@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 12, 2020
@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 12, 2020
@codecov-io
Copy link

codecov-io commented Apr 12, 2020

Codecov Report

Merging #7631 into master will decrease coverage by 0.01%.
The diff coverage is 20.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #7631      +/-   ##
==========================================
- Coverage   35.50%   35.49%   -0.02%     
==========================================
  Files         148      148              
  Lines        9330     9334       +4     
==========================================
  Hits         3313     3313              
- Misses       5620     5624       +4     
  Partials      397      397              
Impacted Files Coverage Δ
cmd/minikube/cmd/delete.go 21.95% <0.00%> (-0.18%) ⬇️
pkg/minikube/command/kic_runner.go 0.00% <0.00%> (ø)
pkg/minikube/driver/driver.go 60.00% <0.00%> (ø)
pkg/minikube/machine/stop.go 29.72% <0.00%> (ø)
pkg/minikube/machine/delete.go 45.28% <66.66%> (ø)
pkg/minikube/config/profile.go 70.92% <100.00%> (ø)

Copy link
Member

@medyagh medyagh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

as part of PR please change this in Jenkins so it does not run with sudo in intergraiton test either. https://github.com/kubernetes/minikube/blob/master/hack/jenkins/linux_integration_tests_podman.sh#L34

@afbjorklund
Copy link
Collaborator Author

as part of PR please change this in Jenkins so it does not run with sudo in intergraiton test either. https://github.com/kubernetes/minikube/blob/master/hack/jenkins/linux_integration_tests_podman.sh#L34

Done.

@afbjorklund afbjorklund mentioned this pull request Apr 13, 2020
@afbjorklund
Copy link
Collaborator Author

Also need to document that user needs to setup password-less sudo for podman.

Otherwise this is going to throw Password: prompts in the middle of minikube...

@k8s-ci-robot k8s-ci-robot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/XS Denotes a PR that changes 0-9 lines, ignoring generated files. labels Apr 13, 2020
@afbjorklund
Copy link
Collaborator Author

Now the API is genuinely horrible, with two strings instead of a class or something.

Also found some places where it is called with the Driver in the place of "ociBin"...

@afbjorklund
Copy link
Collaborator Author

There are some nice little status differences as well:

the created container "minikube" has a running status.

Error: cannot exec into container that is not running: container state improper

So apparently "running" is not enough to be running. :-(

@afbjorklund
Copy link
Collaborator Author

Here is the current startup with podman:

INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
update-alternatives: error: no alternatives for iptables

Here is the matching startup with docker:

INFO: ensuring we can execute /bin/mount even with userns-remap
INFO: detected aufs, calling sync
INFO: remounting /sys read-only
INFO: making mounts shared
INFO: fix cgroup mounts for all subsystems
INFO: clearing and regenerating /etc/machine-id
Initializing machine ID from random generator.
INFO: faking /sys/class/dmi/id/product_name to be "kind"
INFO: faking /sys/class/dmi/id/product_uuid to be random
INFO: faking /sys/devices/virtual/dmi/id/product_uuid as well
INFO: setting iptables to detected mode: legacy
systemd 242 running in system mode. (+PAM +AUDIT +SELINUX +IMA +APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN2 -IDN +PCRE2 default-hierarchy=hybrid)
Detected virtualization docker.
Detected architecture x86-64.

Welcome to Ubuntu 19.10!

That is: the podman start fails (exit 2)

@afbjorklund
Copy link
Collaborator Author

When doing it manually, I get:

$ sudo podman run -it ubuntu:19.10

# apt update
# apt install -y iptables
Setting up iptables (1.8.3-2ubuntu5) ...
update-alternatives: using /usr/sbin/iptables-legacy to provide /usr/sbin/iptables (iptables) in auto mode
update-alternatives: using /usr/sbin/ip6tables-legacy to provide /usr/sbin/ip6tables (ip6tables) in auto mode
update-alternatives: using /usr/sbin/arptables-nft to provide /usr/sbin/arptables (arptables) in auto mode
update-alternatives: using /usr/sbin/ebtables-nft to provide /usr/sbin/ebtables (ebtables) in auto mode

@afbjorklund
Copy link
Collaborator Author

When tracing the entrypoint (<sigh>), it seems it was deleted (in podman):

openat(AT_FDCWD, "/var/lib/dpkg/alternatives/iptables", O_RDONLY) = -1 ENOENT (No such file or directory)
write(2, "update-alternatives: error: ", 28update-alternatives: error: ) = 28
write(2, "no alternatives for iptables", 28no alternatives for iptables
write(2, "\n", 1
)                       = 1

This is something that kind base has, wonder why it works in docker ?

openat(AT_FDCWD, "/var/lib/dpkg/alternatives/iptables", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=287, ...}) = 0
fstat(3, {st_mode=S_IFREG|0644, st_size=287, ...}) = 0
read(3, "auto\n/usr/sbin/iptables\niptables"..., 4096) = 287
stat("/usr/sbin/iptables-legacy", {st_mode=S_IFREG|0755, st_size=99272, ...}) = 0
stat("/usr/sbin/iptables-nft", {st_mode=S_IFREG|0755, st_size=232880, ...}) = 0
close(3)                                = 0

@afbjorklund
Copy link
Collaborator Author

@medyagh:
It is because minikube replaces /var with an empty directory, killing dpkg (and iptables)!

https://github.com/kubernetes/minikube/blob/v1.9.2/pkg/drivers/kic/oci/oci.go#L115_L123

It needs to restore the old contents, after remounting var. Even better, only do /var/lib/minikube ?

Once /var is back, it boots properly in podman as well. Now, there was some sudo missing...

@afbjorklund
Copy link
Collaborator Author

One side-effect of mounting /var properly, is that you cannot delete a machine anymore.

This is because some of the files under ~/.minikube/machines/*/var are now root-owned...

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 13, 2020

Need to volume mount the container runtime directories too, as well as /var/lib/minikube.

Now with everything setup, it starts properly. On my machine it took 38 seconds, not too bad.

@afbjorklund
Copy link
Collaborator Author

I went back to /var - it seems it was the path mount that was causing it

With a regular named mount, the image boots up just fine - no missing files

@k8s-ci-robot k8s-ci-robot added the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Apr 17, 2020
@afbjorklund
Copy link
Collaborator Author

This test result looks a bit odd:

start.go:585] status for podman: {Installed:true Healthy:false Error:exit status 125 Fix:Cant verify mininim required version for podman . See podman website for installation guide. Doc:https://podman.io/getting-started/installation.html}
	
	! 'podman' driver reported an issue: exit status 125
	* Suggestion: Cant verify mininim required version for podman . See podman website for installation guide.
	* Documentation: https://podman.io/getting-started/installation.html
	
	X Failed to validate 'podman' driver

Probably need some better output logging for it:

        // Allow no more than 2 seconds for version command
        ctx, cancel := context.WithTimeout(context.Background(), 2*time.Second)
        defer cancel()

        cmd := exec.CommandContext(ctx, oci.Podman, "version", "-f", "{{.Version}}")
        o, err := cmd.CombinedOutput()
        output := string(o)
        if err != nil {
                return registry.State{Error: err, Installed: true, Healthy: false, Fix: "Cant verify mininim required version for podman . See podman website for installation guide.", Doc: "https://podman.io/getting-started/installation.html"}
        }

@afbjorklund
Copy link
Collaborator Author

One reason could be that it has `podman-remote' installed, but not installed the socket.

See https://www.projectatomic.io/blog/2018/05/podman-varlink/ for some background

That would lead to that exit code, so will check that by adding some output logging...

$ podman version || echo $?
Version:            1.8.2
RemoteAPI Version:  1
Go Version:         go1.13.8
Git Commit:         028e3317eb1494b9b2acba4a0a295df80fae66cc
Built:              Mon Apr 13 15:02:24 2020
OS/Arch:            linux/amd64
$ podman-remote version || echo $?
Error: could not get runtime: dial unix /run/podman/io.podman: connect: permission denied
125

I don't really want to support remote podman, but that's another story...

It seems like remote docker is used (on Mac/Win), even it works so-so.

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 26, 2020

And perhaps obvious but, the current approach will not work for podman-remote...

So it needs to be either of sudo podman (locally) or podman-remote (remotely)

On Mac and Win they just rename "podman-remote" to "podman", confusing everyone.

But that also means that the user is on their own setting up a VM, so more like "generic" ?

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [67.14557861399999 68.41289154500001 66.420285184]
Average time for minikube: 67.32625178100001

Times for Minikube (PR 7631): [64.50086596499999 64.237303096 65.17437080799999]
Average time for Minikube (PR 7631): 64.63751328966667

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.061860 |           0.066174 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.020732 |           0.021684 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003480 |           0.003154 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 42.334765 |          40.539560 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 22.584431 |          21.743340 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.832004 |           1.820210 |
| components...                  |           |                    |
| * Enabled addons:              |  0.386550 |           0.356936 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.099218 |           0.081874 |
| configured to use "minikube"   |           |                    |
|                                |  0.003211 |           0.004581 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [27.010552282000003 27.007975431000002 28.354781372]
Average time for minikube: 27.457769695

Times for Minikube (PR 7631): [25.965244934 26.630567117 26.106601369]
Average time for Minikube (PR 7631): 26.234137806666666

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.076029 |           0.070601 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002451 |           0.003018 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.058638 |           0.056324 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.701852 |           7.714697 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000283 |           0.000199 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 17.829392 |          17.407497 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.716968 |           0.790353 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.002867 |           0.120897 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.065365 |           0.065958 |
| configured to use "minikube"           |           |                    |
|                                        |  0.003926 |           0.004594 |
+----------------------------------------+-----------+--------------------+

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Apr 26, 2020

@medyagh : this branch has now accumulated some bug fixes, in addition to the original feature:

  • Don't download kicbase image to docker daemon when using podman (skip the download)

  • Mounting /var as a named volume instead of as a path, to make it boot again ("iptables" bug)

We still need to fix this if we want the instructions to work but I guess we could look at cherry-picking

https://minikube.sigs.k8s.io/docs/drivers/podman/

Start a cluster using the docker driver:

minikube start --driver=podman

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [65.153987637 66.92789857 67.61851118500002]
Average time for minikube: 66.56679913066667

Times for Minikube (PR 7631): [67.50268481 66.519921533 65.14401095599999]
Average time for Minikube (PR 7631): 66.388872433

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.061906 |           0.062295 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.019979 |           0.024770 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.009152 |           0.005080 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.882312 |          40.748910 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 22.352674 |          23.736490 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.404933 |           1.471550 |
| components...                  |           |                    |
| * Enabled addons:              |  0.737947 |           0.258650 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.093203 |           0.074986 |
| configured to use "minikube"   |           |                    |
|                                |  0.004694 |           0.006140 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [27.252212758 26.280422794000003 28.385454938000002]
Average time for minikube: 27.306030163333332

Times for Minikube (PR 7631): [26.793725358000003 27.499485453000002 27.642983155000003]
Average time for Minikube (PR 7631): 27.312064655333334

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.077041 |           0.077460 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002647 |           0.002622 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.058479 |           0.058314 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.053724 |           7.933465 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000237 |           0.000273 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 17.834117 |          17.814869 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.208625 |           1.197585 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.002798 |           0.159496 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.064374 |           0.062402 |
| configured to use "minikube"           |           |                    |
|                                        |  0.003987 |           0.005578 |
+----------------------------------------+-----------+--------------------+

@afbjorklund
Copy link
Collaborator Author

That would lead to that exit code, so will check that by adding some output logging...

It was a configuration issue, we set the cgroup config for docker but not for podman:

0426 14:09:29.471143    6943 podman.go:85] podman version returned time="2020-04-26T14:09:29-07:00" level=warning msg="The cgroupv2 manager is set to systemd but there is no systemd user session available"

	time="2020-04-26T14:09:29-07:00" level=warning msg="For using systemd, you may need to login using an user session"

	time="2020-04-26T14:09:29-07:00" level=warning msg="Alternatively, you can enable lingering with: `loginctl enable-linger 1004` (possibly as root)"

	time="2020-04-26T14:09:29-07:00" level=warning msg="Falling back to --cgroup-manager=cgroupfs"

The real problem (below it) is however that we don't have any user namespaces:

	cannot clone: Operation not permitted

	user namespaces are not enabled in /proc/sys/kernel/unprivileged_userns_clone

	Error: could not get runtime: cannot re-exec process

So podman (in KIC) needs to be modified, to use cgroup_manager = "cgroupfs"

$ docker info | grep -i driver
 Storage Driver: overlay2
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
WARNING: No swap limit support

And we need to use sudo podman version, was missed when adding the prefix.

Make sure to use "sudo podman version" on Linux
(need user namespace support for "podman version")

And improve error output handling for podman-remote
(when the remote service is not running properly)
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [67.16349951699999 64.274487439 65.557903983]
Average time for minikube: 65.66529697966666

Times for Minikube (PR 7631): [63.18239188700001 66.35834652199999 67.811414446]
Average time for Minikube (PR 7631): 65.78405095166666

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.059306 |           0.065587 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.021698 |           0.021827 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003814 |           0.003695 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.521090 |          40.249925 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 21.639956 |          23.259585 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.650967 |           1.436544 |
| components...                  |           |                    |
| * Enabled addons:              |  0.660475 |           0.670237 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.104676 |           0.072149 |
| configured to use "minikube"   |           |                    |
|                                |  0.003315 |           0.004501 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [26.543564806 25.738160831 26.780105646]
Average time for minikube: 26.353943760999996

Times for Minikube (PR 7631): [26.346822923999998 28.038690560000003 26.53012123]
Average time for Minikube (PR 7631): 26.971878238

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.080918 |           0.077272 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.003171 |           0.002657 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.060490 |           0.057705 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.711991 |           7.555115 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000194 |           0.000214 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 17.497937 |          17.789207 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  0.927556 |           1.415771 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.002937 |           0.003333 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.064670 |           0.065269 |
| configured to use "minikube"           |           |                    |
|                                        |  0.004077 |           0.005333 |
+----------------------------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [67.94754110100001 64.728773339 67.259055174]
Average time for minikube: 66.64512320466666

Times for Minikube (PR 7631): [63.985020524999996 65.06745273099999 64.395266711]
Average time for Minikube (PR 7631): 64.48257998899999

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.059942 |           0.062143 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.022300 |           0.021053 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003811 |           0.005522 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.044099 |          40.564166 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 22.771190 |          21.511480 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.676927 |           1.809588 |
| components...                  |           |                    |
| * Enabled addons:              |  0.984066 |           0.421053 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.079805 |           0.083180 |
| configured to use "minikube"   |           |                    |
|                                |  0.002983 |           0.004395 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [37.304826113000004 27.428692334999997 27.262446737999998]
Average time for minikube: 30.66532172866667

Times for Minikube (PR 7631): [29.816686754000003 27.543520982000004 29.870189872999998]
Average time for Minikube (PR 7631): 29.076799203000004

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.077265 |           0.081276 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.003813 |           0.002479 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061172 |           0.059726 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.899238 |           7.834594 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000230 |           0.000228 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.528441 |          19.563937 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  4.021667 |           1.453909 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.003382 |           0.002823 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.063283 |           0.071949 |
| configured to use "minikube"           |           |                    |
|                                        |  0.006831 |           0.005879 |
+----------------------------------------+-----------+--------------------+

@TravisBuddy
Copy link

Travis tests have failed

Hey @afbjorklund,
Please read the following log in order to understand the failure reason.
It'll be awesome if you fix what's wrong and commit the changes.

TravisBuddy Request Identifier: 83536640-889f-11ea-88d0-3540a036c4cf

@afbjorklund
Copy link
Collaborator Author

@TravisBuddy : Hey "buddy", my code seems OK but we have a flaky test

https://travis-ci.org/github/kubernetes/minikube/jobs/680154938#L684

E0427 15:22:12.840394   11590 out.go:102] [unset errFile]: * 

E0427 15:22:12.840622   11590 out.go:102] [unset errFile]: X Error getting primary control plane: remove /tmp/profile870321857/.minikube/profiles/config.json: no such file or directory

E0427 15:22:12.840639   11590 out.go:102] [unset errFile]: * 

E0427 15:22:12.840649   11590 out.go:102] [unset errFile]: * minikube is exiting due to an error. If the above message is not useful, open an issue:

E0427 15:22:12.840663   11590 out.go:102] [unset errFile]:   - https://github.com/kubernetes/minikube/issues/new/choose

FAIL	k8s.io/minikube/pkg/addons	0.029s

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [65.532784803 63.832255081999996 67.09005757099999]
Average time for minikube: 65.48503248533335

Times for Minikube (PR 7631): [64.19505352700001 65.73467504599998 66.63154032800001]
Average time for Minikube (PR 7631): 65.520422967

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.068000 |           0.059353 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.023576 |           0.021441 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.004383 |           0.008903 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.736393 |          40.652492 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 21.579798 |          22.737891 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.377655 |           1.442285 |
| components...                  |           |                    |
| * Enabled addons:              |  0.593913 |           0.495400 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.098158 |           0.097797 |
| configured to use "minikube"   |           |                    |
|                                |  0.003158 |           0.004861 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [27.549146338 27.468949424 27.178917942]
Average time for minikube: 27.399004568

Times for Minikube (PR 7631): [27.904719327 26.650956044000004 27.638542861999994]
Average time for Minikube (PR 7631): 27.398072744333334

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.076345 |           0.076754 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002813 |           0.003289 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.065497 |           0.063144 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  7.951068 |           7.930605 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000239 |           0.000209 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.304622 |          18.221566 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  0.819372 |           0.861501 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.107977 |           0.169999 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.066819 |           0.064171 |
| configured to use "minikube"           |           |                    |
|                                        |  0.004252 |           0.006834 |
+----------------------------------------+-----------+--------------------+

@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [68.09995939900001 64.99062224000001 65.202665205]
Average time for minikube: 66.09774894799999

Times for Minikube (PR 7631): [64.153992683 65.465271967 65.247266402]
Average time for Minikube (PR 7631): 64.95551035066666

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.063171 |           0.064420 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.021001 |           0.023403 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.003151 |           0.003575 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.328045 |          41.173768 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 22.790338 |          21.607561 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.349400 |           1.648132 |
| components...                  |           |                    |
| * Enabled addons:              |  0.451924 |           0.343436 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.087244 |           0.087025 |
| configured to use "minikube"   |           |                    |
|                                |  0.003475 |           0.004191 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [36.217356949999996 27.327111595 26.29773215]
Average time for minikube: 29.947400231666666

Times for Minikube (PR 7631): [26.728204794999996 26.904490444000004 26.650722499999993]
Average time for Minikube (PR 7631): 26.761139246333332

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.079781 |           0.077825 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.003613 |           0.003189 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.061421 |           0.062292 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.014075 |           7.801089 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Stopping "minikube" in               |  1.140000 |                    |
| docker ...                             |           |                    |
| * Deleting "minikube" in               |  6.334147 |                    |
| docker ...                             |           |                    |
| * Creating docker container            |           |                    |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000194 |           0.000329 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 17.917497 |          17.500355 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.167493 |           1.198182 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.138640 |           0.026851 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.068221 |           0.086842 |
| configured to use "minikube"           |           |                    |
|                                        |  0.005084 |           0.004186 |
+----------------------------------------+-----------+--------------------+

Move the "sudo" prefix to a central location, instead of
having it all over the place. Assume only needed on Linux.
@minikube-pr-bot
Copy link

kvm2 Driver
Times for minikube: [69.35988692500001 66.113753193 65.002090182]
Average time for minikube: 66.82524343333334

Times for Minikube (PR 7631): [63.905515557 64.47543386 63.948030700000004]
Average time for Minikube (PR 7631): 64.10966003899999

Averages Time Per Log

+--------------------------------+-----------+--------------------+
|              LOG               | MINIKUBE  | MINIKUBE (PR 7631) |
+--------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on   |  0.064549 |           0.064597 |
| Debian 9.11                    |           |                    |
| * Using the kvm2 driver based  |  0.023526 |           0.021783 |
| on existing profile            |           |                    |
| * Starting control plane node  |  0.009369 |           0.003603 |
| minikube in cluster minikube   |           |                    |
| * Creating kvm2 VM (CPUs=2,    | 41.568566 |          39.445125 |
| Memory=3700MB, Disk=20000MB)   |           |                    |
| ...                            |           |                    |
| * Preparing Kubernetes v1.18.0 | 22.904532 |          22.308352 |
| on Docker 19.03.8 ...          |           |                    |
| * Verifying Kubernetes         |  1.420176 |           1.723363 |
| components...                  |           |                    |
| * Enabled addons:              |  0.732337 |           0.457083 |
| default-storageclass,          |           |                    |
| storage-provisioner            |           |                    |
| * Done! kubectl is now         |  0.096982 |           0.081990 |
| configured to use "minikube"   |           |                    |
|                                |  0.005206 |           0.003763 |
+--------------------------------+-----------+--------------------+

docker Driver
Times for minikube: [29.46147349 27.406621491 27.222619354999996]
Average time for minikube: 28.030238111999996

Times for Minikube (PR 7631): [27.340332497 27.380156425000003 27.201906417000004]
Average time for Minikube (PR 7631): 27.307465113000003

Averages Time Per Log

+----------------------------------------+-----------+--------------------+
|                  LOG                   | MINIKUBE  | MINIKUBE (PR 7631) |
+----------------------------------------+-----------+--------------------+
| * minikube v1.10.0-beta.1 on           |  0.075838 |           0.079388 |
| Debian 9.11                            |           |                    |
| * Using the docker driver              |  0.002606 |           0.003029 |
| based on existing profile              |           |                    |
| * Starting control plane node          |  0.063378 |           0.062650 |
| minikube in cluster minikube           |           |                    |
| * Creating docker container            |  8.011662 |           7.888610 |
| (CPUs=2, Memory=3700MB) ...            |           |                    |
| * Preparing Kubernetes v1.18.0         |  0.000246 |           0.000256 |
| on Docker 19.03.2 ...                  |           |                    |
|   -                                    | 18.590276 |          18.100858 |
| kubeadm.pod-network-cidr=10.244.0.0/16 |           |                    |
| * Verifying Kubernetes                 |  1.208934 |           1.097593 |
| components...                          |           |                    |
| * Enabled addons:                      |  0.002710 |           0.002714 |
| default-storageclass,                  |           |                    |
| storage-provisioner                    |           |                    |
| * Done! kubectl is now                 |  0.068116 |           0.067433 |
| configured to use "minikube"           |           |                    |
|                                        |  0.006471 |           0.004935 |
+----------------------------------------+-----------+--------------------+

@afbjorklund afbjorklund requested a review from medyagh April 29, 2020 05:53
@tstromberg tstromberg changed the title The podman driver should not be run as root Add "sudo" to podman calls Apr 29, 2020
@@ -63,8 +64,24 @@ func (rr RunResult) Output() string {
return sb.String()
}

// PrefixCmd adds any needed prefix (such as sudo) to the command
func PrefixCmd(cmd *exec.Cmd) *exec.Cmd {
if cmd.Args[0] == Podman && runtime.GOOS == "linux" { // want sudo when not running podman-remote
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This will make a good insertion point for folks who want to add support for handling rootless. Thank you!

@tstromberg tstromberg merged commit dee6d51 into kubernetes:master Apr 29, 2020
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.

The podman driver should not require sudo or root
7 participants