From a1e10904224ea3c3647776aec57702ee4f19d906 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sat, 22 Jun 2019 13:17:20 +0200 Subject: [PATCH 1/2] Add linux packaging for the kvm2 driver binary --- Makefile | 17 +++++++++++ hack/jenkins/release_build_and_upload.sh | 4 ++- .../deb/kvm2_deb_template/DEBIAN/control | 12 ++++++++ .../docker-machine-driver-kvm2.spec | 29 +++++++++++++++++++ 4 files changed, 61 insertions(+), 1 deletion(-) create mode 100644 installers/linux/deb/kvm2_deb_template/DEBIAN/control create mode 100644 installers/linux/rpm/kvm2_rpm_template/docker-machine-driver-kvm2.spec diff --git a/Makefile b/Makefile index 661fa59dbec8..1e49d9f98f4d 100755 --- a/Makefile +++ b/Makefile @@ -407,6 +407,23 @@ out/docker-machine-driver-kvm2: k8s.io/minikube/cmd/drivers/kvm chmod +X $@ +out/docker-machine-driver-kvm2_$(DEB_VERSION).deb: out/docker-machine-driver-kvm2 + cp -r installers/linux/deb/kvm2_deb_template out/docker-machine-driver-kvm2_$(DEB_VERSION) + chmod 0755 out/docker-machine-driver-kvm2_$(DEB_VERSION)/DEBIAN + sed -E -i 's/--VERSION--/'$(DEB_VERSION)'/g' out/docker-machine-driver-kvm2_$(DEB_VERSION)/DEBIAN/control + mkdir -p out/docker-machine-driver-kvm2_$(DEB_VERSION)/usr/bin + cp out/docker-machine-driver-kvm2 out/docker-machine-driver-kvm2_$(DEB_VERSION)/usr/bin/docker-machine-driver-kvm2 + fakeroot dpkg-deb --build out/docker-machine-driver-kvm2_$(DEB_VERSION) + rm -rf out/docker-machine-driver-kvm2_$(DEB_VERSION) + +out/docker-machine-driver-kvm2-$(RPM_VERSION).rpm: out/docker-machine-driver-kvm2 + cp -r installers/linux/rpm/kvm2_rpm_template out/docker-machine-driver-kvm2-$(RPM_VERSION) + sed -E -i 's/--VERSION--/'$(RPM_VERSION)'/g' out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec + sed -E -i 's|--OUT--|'$(PWD)/out'|g' out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec + rpmbuild -bb -D "_rpmdir $(PWD)/out" -D "_rpmfilename docker-machine-driver-kvm2-$(RPM_VERSION).rpm" \ + out/docker-machine-driver-kvm2-$(RPM_VERSION)/docker-machine-driver-kvm2.spec + rm -rf out/docker-machine-driver-kvm2-$(RPM_VERSION) + kvm-image: $(KVM_BUILD_IMAGE) # convenient alias to build the docker container $(KVM_BUILD_IMAGE): installers/linux/kvm/Dockerfile docker build --build-arg "GO_VERSION=$(GO_VERSION)" -t $@ -f $< $(dir $<) diff --git a/hack/jenkins/release_build_and_upload.sh b/hack/jenkins/release_build_and_upload.sh index 086ba72484c6..3bb3f3d97c03 100755 --- a/hack/jenkins/release_build_and_upload.sh +++ b/hack/jenkins/release_build_and_upload.sh @@ -37,7 +37,9 @@ cat Makefile | grep "VERSION_MINOR ?=" | grep $VERSION_MINOR cat Makefile | grep "VERSION_BUILD ?=" | grep $VERSION_BUILD # Build and upload -BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe out/minikube_${DEB_VERSION}.deb out/minikube-${RPM_VERSION}.rpm +BUILD_IN_DOCKER=y make -j 16 all out/minikube-installer.exe \ +out/minikube_${DEB_VERSION}.deb out/minikube-${RPM_VERSION}.rpm \ +out/docker-machine-driver-kvm2_${DEB_VERSION}.deb out/docker-machine-driver-kvm2-${RPM_VERSION}.rpm make checksum gsutil -m cp out/* gs://$BUCKET/releases/$TAGNAME/ diff --git a/installers/linux/deb/kvm2_deb_template/DEBIAN/control b/installers/linux/deb/kvm2_deb_template/DEBIAN/control new file mode 100644 index 000000000000..515669cb8312 --- /dev/null +++ b/installers/linux/deb/kvm2_deb_template/DEBIAN/control @@ -0,0 +1,12 @@ +Package: docker-machine-driver-kvm2 +Version: --VERSION-- +Section: base +Priority: optional +Architecture: amd64 +Depends: libvirt0 (>= 1.3.1) +Recommends: minikube +Maintainer: Aaron Prindle +Description: Machine driver for KVM + Minikube uses Docker Machine to manage the Kubernetes VM so it benefits + from the driver plugin architecture that Docker Machine uses to provide + a consistent way to manage various VM providers. diff --git a/installers/linux/rpm/kvm2_rpm_template/docker-machine-driver-kvm2.spec b/installers/linux/rpm/kvm2_rpm_template/docker-machine-driver-kvm2.spec new file mode 100644 index 000000000000..372e7e18cccd --- /dev/null +++ b/installers/linux/rpm/kvm2_rpm_template/docker-machine-driver-kvm2.spec @@ -0,0 +1,29 @@ +Name: docker-machine-driver-kvm2 +Version: --VERSION-- +Release: 0 +Summary: Machine driver for KVM +License: ASL 2.0 +Group: Development/Tools +URL: https://github.com/kubernetes/minikube +#Requires: + +# Needed for older versions of RPM +BuildRoot: %{_tmppath}%{name}-buildroot + +%description +Minikube uses Docker Machine to manage the Kubernetes VM so it benefits +from the driver plugin architecture that Docker Machine uses to provide +a consistent way to manage various VM providers. + +%prep +mkdir -p %{name}-%{version} +cd %{name}-%{version} +cp --OUT--/docker-machine-driver-kvm2 . + +%install +cd %{name}-%{version} +mkdir -p %{buildroot}%{_bindir} +install -m 755 docker-machine-driver-kvm2 %{buildroot}%{_bindir}/%{name} + +%files +%{_bindir}/%{name} From 2ef0f74ed2660a3b50c3e58b229a05ecc6ce022d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Anders=20F=20Bj=C3=B6rklund?= Date: Sun, 14 Jul 2019 09:32:19 +0200 Subject: [PATCH 2/2] Change deb maintainer, lower case minikube --- installers/linux/deb/kvm2_deb_template/DEBIAN/control | 4 ++-- installers/linux/deb/minikube_deb_template/DEBIAN/control | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/installers/linux/deb/kvm2_deb_template/DEBIAN/control b/installers/linux/deb/kvm2_deb_template/DEBIAN/control index 515669cb8312..49a6075b6a32 100644 --- a/installers/linux/deb/kvm2_deb_template/DEBIAN/control +++ b/installers/linux/deb/kvm2_deb_template/DEBIAN/control @@ -5,8 +5,8 @@ Priority: optional Architecture: amd64 Depends: libvirt0 (>= 1.3.1) Recommends: minikube -Maintainer: Aaron Prindle +Maintainer: Thomas Strömberg Description: Machine driver for KVM - Minikube uses Docker Machine to manage the Kubernetes VM so it benefits + minikube uses Docker Machine to manage the Kubernetes VM so it benefits from the driver plugin architecture that Docker Machine uses to provide a consistent way to manage various VM providers. diff --git a/installers/linux/deb/minikube_deb_template/DEBIAN/control b/installers/linux/deb/minikube_deb_template/DEBIAN/control index 6c1a6a6aca5a..98a93a25b8d2 100644 --- a/installers/linux/deb/minikube_deb_template/DEBIAN/control +++ b/installers/linux/deb/minikube_deb_template/DEBIAN/control @@ -4,9 +4,9 @@ Section: base Priority: optional Architecture: amd64 Recommends: virtualbox -Maintainer: Aaron Prindle +Maintainer: Thomas Strömberg Description: Minikube - Minikube is a tool that makes it easy to run Kubernetes locally. - Minikube runs a single-node Kubernetes cluster inside a VM on your + minikube is a tool that makes it easy to run Kubernetes locally. + minikube runs a single-node Kubernetes cluster inside a VM on your laptop for users looking to try out Kubernetes or develop with it day-to-day.