-
Notifications
You must be signed in to change notification settings - Fork 5.1k
kvm: Convert to internal driver #21625
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
base: master
Are you sure you want to change the base?
Conversation
Skipping CI for Draft Pull Request. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: nirs The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
061cec4
to
b25c816
Compare
/cc @afbjorklund |
/ok-to-test |
bff2cfd
to
c311677
Compare
/ok-to-test |
Testing upgrade from version using external driver to version using builtin driverCreating kvm cluster with master:
Switch to minikube version using builtin driver:
Checking existing cluster:
Stopping the cluster
Checking status:
Starting stopped cluster:
|
cross build failing https://storage.googleapis.com/minikube-builds/logs/21625/build.txt |
c311677
to
32d5596
Compare
Should be fixed by https://github.com/kubernetes/minikube/compare/c311677bf8f9c6cb525eeb8b7add2a03a583aae4..32d5596fa0884e36b3f6d22bac7ae1c120219447 |
74046b4
to
41720cd
Compare
Converting to draft for do some cleanups. |
03653be
to
9a86213
Compare
This comment has been minimized.
This comment has been minimized.
e67ffec
to
1f56101
Compare
Trying to close and reopen to recover the stuck Jenkins Cross Build ... |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/retest |
@nirs: The following test failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
/retest-this-please |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
/retest-this-please |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
The DOCKER command was missing :Z for the ~/go directory, failing with: $ BUILD_IN_DOCKER=y make all ... GOOS="linux" GOARCH="arm64" \ go build -tags "libvirt_dlopen" -ldflags="-X k8s.io/minikube/pkg/version.version=v1.37.0 ... go: could not create module cache: stat /go/pkg/mod: permission denied make: *** [Makefile:279: out/minikube-linux-arm64] Error 1 make: *** [Makefile:276: out/minikube-linux-arm64] Error 2 With this change we can debug build issues on Fedora or other distros using selinux.
My editor is configured to remove trailing spaces automatically. Adding as a separate commit to minimize the actual change and allow commit this change separately from the kvm driver change.
It checked for HyperV() instead. This seems wrong since auxdriver is used only for hyperkit and kvm.
Add matchDrivers() helper for looking up --driver=name or --vm-driver=name.
Remove the docker-machine-driver-kvm2 wrapper and use the kvm driver as internal driver. To avoid dependency on libvirt shared library on Linux, we build now with libvirt_dlopen tag. With this we don't need libvirt devel libraies during build, and in runtime we will fail if libvirt shared library is not installed. With this change minikube can not be built for linux !amd64 since building libvirt go binding requires CGO, and it does not work by changing GOARCH.
The build fails on linux/arm64 because libvirt.org/go/libvirt is using CGO, and cross compiling CGO requires a C cross compiler. Setting GOARCH=arm64 is not enough. The issue is tracked in kubernetes#19959. Previously we built the kvm driver also on arm64 as part of the docker-machine-driver-kvm2 executable, but the build was skipped on arm64. Now that we build the driver as part of minikube, we cannot skip the entire build. Change the build tag so the libvirt bits are built only on amd64. To make this possible, the generic linux bits needed by the registry moved to pkg/drivers/kvm/driver.go, and a kvm_stub.go is used for unsupported architectures. In the registry Driver.Status(), move the arm64 check to front since there is no point in checking that libvirt is installed correctly if the driver is not supported yet.
1f56101
to
f5ddb06
Compare
kvm2 driver with docker runtime
Times for minikube start: 45.4s 44.7s 46.0s 42.2s 40.7s Times for minikube (PR 21625) ingress: 15.7s 15.8s 15.7s 27.9s 15.8s docker driver with docker runtime
Times for minikube ingress: 10.6s 10.6s 12.6s 10.6s 10.6s Times for minikube (PR 21625) start: 24.7s 22.5s 21.6s 21.7s 22.0s docker driver with containerd runtime
Times for minikube (PR 21625) start: 20.2s 19.8s 19.4s 22.7s 19.7s Times for minikube ingress: 21.1s 21.1s 20.1s 20.1s 20.1s |
Here are the number of top 10 failed tests in each environments with lowest flake rate.
Besides the following environments also have failed tests:
To see the flake rates of all tests by environment, click here. |
Remove the docker-machine-driver-kvm2 wrapper and use the kvm driver as internal driver. This fixes all the build and test issues related to building and testing the docker-machine-driver-kvm2, and simplify the kvm driver runtime flow.
To avoid dependency on libvirt shared library on Linux, we build now with libvirt_dlopen tag. With this we don't need libvirt devel libraies during build, and in runtime we will fail if libvirt shared library is not installed.
Building minikube for arm64 with libvirt does not work yet. This build was already skipped for docker-machine-driver-kvm2 external driver. Since now the kvm driver is internal, the kvm driver was modified to build only for linux/amd64.
Example run
Testing
Fixes #21618
Fixes #21551
Fixes #21582
Fixes #21581
Fixes #21580
Based on #21644 for testing.