Skip to content

Commit

Permalink
remove arm64 kvm (kubernetes#19985)
Browse files Browse the repository at this point in the history
* remove arm64 kvm

* add to drivers

* spaces

* spaces

* remove kvm arm64 from build and upload script

* add missing backslash

* remove deb arm64 kvm

* add not used

* remove kvm arm64
  • Loading branch information
medyagh authored Dec 4, 2024
1 parent 9529030 commit 2b52e11
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 22 deletions.
38 changes: 20 additions & 18 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -356,12 +356,12 @@ test-pkg/%: ## Trigger packaging test
.PHONY: all
all: cross drivers e2e-cross cross-tars exotic retro out/gvisor-addon ## Build all different minikube components

# After https://github.com/kubernetes/minikube/issues/19959 is fixed kvm2-arm64 can be added back
.PHONY: drivers
drivers: ## Build Hyperkit and KVM2 drivers
drivers: docker-machine-driver-hyperkit \
docker-machine-driver-kvm2 \
out/docker-machine-driver-kvm2-amd64 \
out/docker-machine-driver-kvm2-arm64


.PHONY: docker-machine-driver-hyperkit
Expand Down Expand Up @@ -557,7 +557,7 @@ debs: out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_amd64.deb \
out/minikube_$(DEB_VERSION)-$(DEB_REVISION)_arm64.deb \
out/docker-machine-driver-kvm2_$(DEB_VERSION).deb \
out/docker-machine-driver-kvm2_$(DEB_VERSION)-$(DEB_REVISION)_amd64.deb \
out/docker-machine-driver-kvm2_$(DEB_VERSION)-$(DEB_REVISION)_arm64.deb
# out/docker-machine-driver-kvm2_$(DEB_VERSION)-$(DEB_REVISION)_arm64.deb

.PHONY: deb_version
deb_version:
Expand Down Expand Up @@ -842,6 +842,7 @@ out/docker-machine-driver-kvm2-x86_64: out/docker-machine-driver-kvm2-amd64
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@

# https://github.com/kubernetes/minikube/issues/19959
out/docker-machine-driver-kvm2-aarch64: out/docker-machine-driver-kvm2-arm64
$(if $(quiet),@echo " CP $@")
$(Q)cp $< $@
Expand Down Expand Up @@ -899,24 +900,25 @@ kvm_in_docker:
install-kvm-driver: out/docker-machine-driver-kvm2 ## Install KVM Driver
mkdir -p $(GOBIN)
cp out/docker-machine-driver-kvm2 $(GOBIN)/docker-machine-driver-kvm2


out/docker-machine-driver-kvm2-arm64:
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
docker image inspect -f '{{.Id}} {{.RepoTags}}' $(KVM_BUILD_IMAGE_ARM64) || $(MAKE) kvm-image-arm64
$(call DOCKER,$(KVM_BUILD_IMAGE_ARM64),/usr/bin/make $@ COMMIT=$(COMMIT))
else
$(if $(quiet),@echo " GO $@")
$(Q)GOARCH=arm64 \
go build \
-buildvcs=false \
-installsuffix "static" \
-ldflags="$(KVM2_LDFLAGS)" \
-tags "libvirt_without_lxc" \
-o $@ \
k8s.io/minikube/cmd/drivers/kvm
endif
chmod +X $@
echo "not used till https://github.com/kubernetes/minikube/issues/19959"
# ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
# docker image inspect -f '{{.Id}} {{.RepoTags}}' $(KVM_BUILD_IMAGE_ARM64) || $(MAKE) kvm-image-arm64
# $(call DOCKER,$(KVM_BUILD_IMAGE_ARM64),/usr/bin/make $@ COMMIT=$(COMMIT))
# else
# $(if $(quiet),@echo " GO $@")
# $(Q)GOARCH=arm64 \
# go build \
# -buildvcs=false \
# -installsuffix "static" \
# -ldflags="$(KVM2_LDFLAGS)" \
# -tags "libvirt_without_lxc" \
# -o $@ \
# k8s.io/minikube/cmd/drivers/kvm
# endif
# chmod +X $@

out/docker-machine-driver-kvm2-%:
ifeq ($(MINIKUBE_BUILD_IN_DOCKER),y)
Expand Down
1 change: 0 additions & 1 deletion hack/jenkins/minikube_cross_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@ make -j 16 \
out/minikube_${DEB_VER}_arm64.deb \
out/docker-machine-driver-kvm2_$(make deb_version_base).deb \
out/docker-machine-driver-kvm2_${DEB_VER}_amd64.deb \
out/docker-machine-driver-kvm2_${DEB_VER}_arm64.deb \
&& failed=$? || failed=$?

BUILT_VERSION=$("out/minikube-$(go env GOOS)-$(go env GOARCH)" version)
Expand Down
6 changes: 3 additions & 3 deletions hack/jenkins/release_build_and_upload.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,10 @@ env BUILD_IN_DOCKER=y \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_armhf.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_ppc64el.deb" \
"out/minikube_${DEB_VERSION}-${DEB_REVISION}_s390x.deb" \
"out/docker-machine-driver-kvm2_${DEB_VERSION}-${DEB_REVISION}_amd64.deb" \
"out/docker-machine-driver-kvm2_${DEB_VERSION}-${DEB_REVISION}_arm64.deb"
"out/docker-machine-driver-kvm2_${DEB_VERSION}-${DEB_REVISION}_amd64.deb"
# "out/docker-machine-driver-kvm2_${DEB_VERSION}-${DEB_REVISION}_arm64.deb"

env BUILD_IN_DOCKER=y
env BUILD_IN_DOCKER=y \
make \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.x86_64.rpm" \
"out/minikube-${RPM_VERSION}-${RPM_REVISION}.aarch64.rpm" \
Expand Down
13 changes: 13 additions & 0 deletions pkg/minikube/registry/drvs/kvm2/kvm2.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import (
"os/exec"
"os/user"
"path/filepath"
"runtime"
"strings"
"time"

Expand Down Expand Up @@ -165,6 +166,18 @@ func status() registry.State {
Doc: docURL,
}
}

if runtime.GOARCH == "arm64" {
return registry.State{
Installed: true,
Running: true,
Error: fmt.Errorf("KVM is not supported on arm64 due to a gcc build error, contributions are welcome"),
Fix: "follow the github issue for possible fix",
Doc: "https://github.com/kubernetes/minikube/issues/19959",
}

}

if err != nil {
return registry.State{
Installed: true,
Expand Down

0 comments on commit 2b52e11

Please sign in to comment.