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

none driver: fix image build #16386

Merged
merged 1 commit into from
May 8, 2023
Merged

Conversation

spowelljr
Copy link
Member

Fixes #16385

The cause was from the below lines:

if driver.BareMetal(cc.Driver) {
kubeNodeName = "m01"
}

} else if nodeName != n.Name && nodeName != m {
continue
}

The none driver if statement was causing n.Name to be m01, which then caused nodeName != n.Name to be true as nodeName was empty but n.Name was m01, hitting the continue causing no build to occur.

Before:

$ sudo -E minikube image build -t test:latest ../test --alsologtostderr
I0427 01:52:48.094340   44206 out.go:296] Setting OutFile to fd 1 ...
I0427 01:52:48.094538   44206 out.go:348] isatty.IsTerminal(1) = true
I0427 01:52:48.094558   44206 out.go:309] Setting ErrFile to fd 2...
I0427 01:52:48.094564   44206 out.go:348] isatty.IsTerminal(2) = true
I0427 01:52:48.094675   44206 root.go:336] Updating PATH: /home/jenkins/.minikube/bin
W0427 01:52:48.094794   44206 root.go:312] Error reading config file at /home/jenkins/.minikube/config/config.json: open /home/jenkins/.minikube/config/config.json: no such file or directory
I0427 01:52:48.095219   44206 config.go:182] Loaded profile config "minikube": Driver=none, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0427 01:52:48.095624   44206 config.go:182] Loaded profile config "minikube": Driver=none, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0427 01:52:48.095652   44206 build_images.go:123] succeeded building to: 
I0427 01:52:48.095661   44206 build_images.go:124] failed building to: 

After:

$ sudo -E minikube image build -t test:latest ../test --alsologtostderr
I0427 02:01:40.472852   53708 out.go:296] Setting OutFile to fd 1 ...
I0427 02:01:40.473042   53708 out.go:348] isatty.IsTerminal(1) = true
I0427 02:01:40.473057   53708 out.go:309] Setting ErrFile to fd 2...
I0427 02:01:40.473074   53708 out.go:348] isatty.IsTerminal(2) = true
I0427 02:01:40.473188   53708 root.go:336] Updating PATH: /home/jenkins/.minikube/bin
W0427 02:01:40.473344   53708 root.go:312] Error reading config file at /home/jenkins/.minikube/config/config.json: open /home/jenkins/.minikube/config/config.json: no such file or directory
I0427 02:01:40.473828   53708 config.go:182] Loaded profile config "minikube": Driver=none, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0427 02:01:40.474332   53708 config.go:182] Loaded profile config "minikube": Driver=none, ContainerRuntime=docker, KubernetesVersion=v1.26.3
I0427 02:01:40.474558   53708 exec_runner.go:51] Run: systemctl --version
I0427 02:01:40.476643   53708 kubeconfig.go:92] found "minikube" server: "https://10.138.0.48:8443"
I0427 02:01:40.476673   53708 api_server.go:166] Checking apiserver status ...
I0427 02:01:40.476705   53708 exec_runner.go:51] Run: sudo pgrep -xnf kube-apiserver.*minikube.*
I0427 02:01:40.494438   53708 exec_runner.go:51] Run: sudo egrep ^[0-9]+:freezer: /proc/52175/cgroup
I0427 02:01:40.505467   53708 api_server.go:182] apiserver freezer: "3:freezer:/kubepods/burstable/pod1946fe5227089af505b39a701a0481e2/07fc6ee85cae390207e47a22099cb9e1b2de1ad57543609274fe168b0c04af49"
I0427 02:01:40.505529   53708 exec_runner.go:51] Run: sudo cat /sys/fs/cgroup/freezer/kubepods/burstable/pod1946fe5227089af505b39a701a0481e2/07fc6ee85cae390207e47a22099cb9e1b2de1ad57543609274fe168b0c04af49/freezer.state
I0427 02:01:40.515685   53708 api_server.go:204] freezer state: "THAWED"
I0427 02:01:40.515717   53708 api_server.go:253] Checking apiserver healthz at https://10.138.0.48:8443/healthz ...
I0427 02:01:40.519666   53708 api_server.go:279] https://10.138.0.48:8443/healthz returned 200:
ok
I0427 02:01:40.519877   53708 build_images.go:151] Building image from path: /tmp/build.2939681210.tar
I0427 02:01:40.519916   53708 exec_runner.go:51] Run: sudo mkdir -p /var/lib/minikube/build
I0427 02:01:40.530156   53708 exec_runner.go:151] cp: /tmp/build.2939681210.tar --> /var/lib/minikube/build/build.2939681210.tar (2048 bytes)
I0427 02:01:40.530283   53708 exec_runner.go:51] Run: sudo cp -a /tmp/minikube2208548583 /var/lib/minikube/build/build.2939681210.tar
I0427 02:01:40.540666   53708 exec_runner.go:51] Run: sudo mkdir -p /var/lib/minikube/build/build.2939681210
I0427 02:01:40.549022   53708 exec_runner.go:51] Run: sudo tar -C /var/lib/minikube/build/build.2939681210 -xf /var/lib/minikube/build/build.2939681210.tar
I0427 02:01:40.559651   53708 docker.go:336] Building image: /var/lib/minikube/build/build.2939681210
I0427 02:01:40.559708   53708 exec_runner.go:51] Run: docker build -t test:latest /var/lib/minikube/build/build.2939681210
#1 [internal] load .dockerignore
#1 transferring context: 2B done
#1 DONE 0.0s

#2 [internal] load build definition from Dockerfile
#2 transferring dockerfile: 73B done
#2 DONE 0.0s

#3 [internal] load metadata for docker.io/library/alpine:latest
#3 DONE 0.6s

#4 [1/2] FROM docker.io/library/alpine:latest@sha256:124c7d2707904eea7431fffe91522a01e5a861a624ee31d03372cc1d138a3126
#4 CACHED

#5 [2/2] RUN echo "hello"
#5 0.248 hello
#5 DONE 0.3s

#6 exporting to image
#6 exporting layers 0.0s done
#6 writing image sha256:2d1a7a3871bc40aa321d870a4e13bb50ee452be61a536273799cd881dcb6b6f2 done
#6 naming to docker.io/library/test:latest done
#6 DONE 0.0s
I0427 02:01:41.635100   53708 exec_runner.go:84] Completed: docker build -t test:latest /var/lib/minikube/build/build.2939681210: (1.075360167s)
I0427 02:01:41.635158   53708 exec_runner.go:51] Run: sudo rm -rf /var/lib/minikube/build/build.2939681210
I0427 02:01:41.660332   53708 exec_runner.go:51] Run: sudo rm -f /var/lib/minikube/build/build.2939681210.tar
I0427 02:01:41.687267   53708 build_images.go:207] Built test:latest from /tmp/build.2939681210.tar
I0427 02:01:41.687303   53708 build_images.go:123] succeeded building to: minikube
I0427 02:01:41.687318   53708 build_images.go:124] failed building to: 

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Apr 27, 2023
@k8s-ci-robot k8s-ci-robot added approved Indicates a PR has been approved by an approver from all required OWNERS files. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Apr 27, 2023
@spowelljr
Copy link
Member Author

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

kvm2 driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16386) |
+----------------+----------+---------------------+
| minikube start | 50.4s    | 50.6s               |
| enable ingress | 37.7s    | 25.9s               |
+----------------+----------+---------------------+

Times for minikube (PR 16386) start: 51.0s 51.3s 50.3s 49.4s 51.0s
Times for minikube start: 52.2s 48.9s 52.0s 51.4s 47.5s

Times for minikube ingress: 23.7s 25.2s 28.2s 27.2s 84.2s
Times for minikube (PR 16386) ingress: 27.7s 24.7s 27.2s 25.2s 24.7s

docker driver with docker runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16386) |
+----------------+----------+---------------------+
| minikube start | 22.7s    | 23.4s               |
| enable ingress | 21.1s    | 21.9s               |
+----------------+----------+---------------------+

Times for minikube start: 21.8s 22.3s 22.4s 21.9s 25.0s
Times for minikube (PR 16386) start: 22.5s 22.2s 24.9s 22.6s 24.8s

Times for minikube ingress: 22.5s 19.5s 22.5s 21.0s 20.0s
Times for minikube (PR 16386) ingress: 22.0s 23.0s 24.0s 21.0s 19.5s

docker driver with containerd runtime

+----------------+----------+---------------------+
|    COMMAND     | MINIKUBE | MINIKUBE (PR 16386) |
+----------------+----------+---------------------+
| minikube start | 21.0s    | 22.7s               |
| enable ingress | 32.0s    | 32.4s               |
+----------------+----------+---------------------+

Times for minikube start: 20.3s 20.4s 20.7s 23.7s 20.0s
Times for minikube (PR 16386) start: 23.0s 20.5s 23.8s 23.1s 23.3s

Times for minikube ingress: 31.5s 32.0s 31.5s 32.0s 33.0s
Times for minikube (PR 16386) ingress: 32.5s 31.5s 32.0s 33.0s 33.0s

@minikube-pr-bot
Copy link

These are the flake rates of all failed tests.

Environment Failed Tests Flake Rate (%)
Docker_Windows TestNetworkPlugins/group/enable-default-cni/NetCatPod (gopogh) 0.00 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/AddonExistsAfterStop (gopogh) 2.65 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/SecondStart (gopogh) 2.65 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/UserAppExistsAfterStop (gopogh) 2.65 (chart)
Docker_macOS TestStartStop/group/default-k8s-diff-port/serial/Pause (gopogh) 3.31 (chart)
KVM_Linux TestMultiNode/serial/StartAfterStop (gopogh) 12.50 (chart)

To see the flake rates of all tests by environment, click here.

@spowelljr spowelljr added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Apr 27, 2023
@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

@spowelljr
Copy link
Member Author

Don't merge until #16408 is merged as to not break our test infra.

@medyagh medyagh merged commit fbc7775 into kubernetes:master May 8, 2023
@spowelljr spowelljr deleted the fixNoneImageBuild branch May 8, 2023 20:44
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. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. ok-to-test Indicates a non-member PR verified by an org member that is safe to test. size/S Denotes a PR that changes 10-29 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Fix minikube image build failing on none driver
4 participants