From a2a4780186bdd65ac052b3d9d3b55d7e21fcacae Mon Sep 17 00:00:00 2001 From: Matt Rickard Date: Fri, 20 Oct 2017 17:28:43 -0400 Subject: [PATCH 1/3] Explicitly use localkube bootstrapper and binary Use the localkube binary built from CI in the integration tests. --- Makefile | 4 ++-- hack/jenkins/linux_integration_tests_kvm.sh | 3 ++- hack/jenkins/linux_integration_tests_none.sh | 4 +++- hack/jenkins/linux_integration_tests_virtualbox.sh | 2 ++ hack/jenkins/osx_integration_tests_hyperkit.sh | 2 ++ hack/jenkins/osx_integration_tests_virtualbox.sh | 2 ++ hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh | 3 ++- hack/jenkins/osx_integration_tests_xhyve.sh | 2 ++ hack/jenkins/windows_integration_test_virtualbox.ps1 | 2 +- 9 files changed, 18 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index dab6533fbd51..5e62d9f08270 100755 --- a/Makefile +++ b/Makefile @@ -149,7 +149,7 @@ test-pkg/%: go test -v -test.timeout=30m $(REPOPATH)/$* --tags="$(MINIKUBE_BUILD_TAGS)" .PHONY: all -all: cross drivers e2e-cross images +all: cross drivers e2e-cross images out/localkube .PHONY: drivers drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2 @@ -189,7 +189,7 @@ $(GOPATH)/bin/go-bindata: GOBIN=$(GOPATH)/bin go get github.com/jteeuwen/go-bindata/... .PHONY: cross -cross: out/localkube out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe +cross: out/minikube-linux-amd64 out/minikube-darwin-amd64 out/minikube-windows-amd64.exe .PHONY: e2e-cross e2e-cross: e2e-linux-amd64 e2e-darwin-amd64 e2e-windows-amd64.exe diff --git a/hack/jenkins/linux_integration_tests_kvm.sh b/hack/jenkins/linux_integration_tests_kvm.sh index 6deb3805556e..7e093cc1e9be 100644 --- a/hack/jenkins/linux_integration_tests_kvm.sh +++ b/hack/jenkins/linux_integration_tests_kvm.sh @@ -28,7 +28,8 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="kvm" JOB_NAME="Linux-KVM" - +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions source common.sh diff --git a/hack/jenkins/linux_integration_tests_none.sh b/hack/jenkins/linux_integration_tests_none.sh index 16f31afa20c2..b5c29b843f4e 100644 --- a/hack/jenkins/linux_integration_tests_none.sh +++ b/hack/jenkins/linux_integration_tests_none.sh @@ -29,7 +29,9 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="none" JOB_NAME="Linux-None" -EXTRA_BUILD_ARGS="$EXTRA_BUILD_ARGS --use-vendored-driver" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" + SUDO_PREFIX="sudo -E " export KUBECONFIG="/root/.kube/config" diff --git a/hack/jenkins/linux_integration_tests_virtualbox.sh b/hack/jenkins/linux_integration_tests_virtualbox.sh index fb90d5e92b6d..80fbc022ede9 100644 --- a/hack/jenkins/linux_integration_tests_virtualbox.sh +++ b/hack/jenkins/linux_integration_tests_virtualbox.sh @@ -28,6 +28,8 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="virtualbox" JOB_NAME="Linux-VirtualBox" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions source common.sh diff --git a/hack/jenkins/osx_integration_tests_hyperkit.sh b/hack/jenkins/osx_integration_tests_hyperkit.sh index db9165a57fc7..cdf4943092a3 100755 --- a/hack/jenkins/osx_integration_tests_hyperkit.sh +++ b/hack/jenkins/osx_integration_tests_hyperkit.sh @@ -29,6 +29,8 @@ set -e OS_ARCH="darwin-amd64" VM_DRIVER="hyperkit" JOB_NAME="OSX-Hyperkit" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions diff --git a/hack/jenkins/osx_integration_tests_virtualbox.sh b/hack/jenkins/osx_integration_tests_virtualbox.sh index f398189930f7..0aa43d07c4f4 100755 --- a/hack/jenkins/osx_integration_tests_virtualbox.sh +++ b/hack/jenkins/osx_integration_tests_virtualbox.sh @@ -28,6 +28,8 @@ set -e OS_ARCH="darwin-amd64" VM_DRIVER="virtualbox" JOB_NAME="OSX-Virtualbox" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions source common.sh \ No newline at end of file diff --git a/hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh b/hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh index 0b9a9447604c..7aee1870d60e 100644 --- a/hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh +++ b/hack/jenkins/osx_integration_tests_virtualbox_kubeadm.sh @@ -28,7 +28,8 @@ set -e OS_ARCH="darwin-amd64" VM_DRIVER="virtualbox" JOB_NAME="OSX-Virtualbox-Kubeadm" -EXTRA_ARGS="--bootstrapper=kubeadm" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions source common.sh diff --git a/hack/jenkins/osx_integration_tests_xhyve.sh b/hack/jenkins/osx_integration_tests_xhyve.sh index cd2ff638dd23..007fcda6e013 100755 --- a/hack/jenkins/osx_integration_tests_xhyve.sh +++ b/hack/jenkins/osx_integration_tests_xhyve.sh @@ -29,6 +29,8 @@ set -e OS_ARCH="darwin-amd64" VM_DRIVER="xhyve" JOB_NAME="OSX-Xhyve" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions diff --git a/hack/jenkins/windows_integration_test_virtualbox.ps1 b/hack/jenkins/windows_integration_test_virtualbox.ps1 index d1f28b917f67..5479e03a5d41 100644 --- a/hack/jenkins/windows_integration_test_virtualbox.ps1 +++ b/hack/jenkins/windows_integration_test_virtualbox.ps1 @@ -21,7 +21,7 @@ gsutil.cmd cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata . ./out/minikube-windows-amd64.exe delete Remove-Item -Recurse -Force C:\Users\jenkins\.minikube -out/e2e-windows-amd64.exe --% -minikube-start-args="--vm-driver=virtualbox" -minikube-args="--v=10 --logtostderr $env:EXTRA_BUILD_ARGS" -test.v -test.timeout=30m -binary=out/minikube-windows-amd64.exe +out/e2e-windows-amd64.exe --% -minikube-start-args="--vm-driver=virtualbox --kubernetes-version=file://./out/localkube " -minikube-args="--v=10 --logtostderr" -test.v -test.timeout=30m -binary=out/minikube-windows-amd64.exe $env:result=$lastexitcode # If the last exit code was 0->success, x>0->error From c20ebde4313cfd93ab3a6fc408497f63ffc341cb Mon Sep 17 00:00:00 2001 From: Matt Rickard Date: Mon, 23 Oct 2017 11:06:38 -0700 Subject: [PATCH 2/3] Bypass version check for localkube file URI --- hack/jenkins/common.sh | 2 +- hack/jenkins/linux_integration_tests_kvm_alt.sh | 2 ++ pkg/minikube/kubernetes_versions/kubernetes_versions.go | 4 ++++ 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index 12fccf988b4f..d5b152f0f6a6 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -83,7 +83,7 @@ find ~/.minikube || true # Allow this to fail, we'll switch on the return code below. set +e -${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-start-args="--vm-driver=${VM_DRIVER}" -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH} +${SUDO_PREFIX}out/e2e-${OS_ARCH} -minikube-start-args="--vm-driver=${VM_DRIVER} ${EXTRA_START_ARGS}" -minikube-args="--v=10 --logtostderr ${EXTRA_ARGS}" -test.v -test.timeout=30m -binary=out/minikube-${OS_ARCH} result=$? set -e diff --git a/hack/jenkins/linux_integration_tests_kvm_alt.sh b/hack/jenkins/linux_integration_tests_kvm_alt.sh index e150088603bf..f5de76da9abb 100644 --- a/hack/jenkins/linux_integration_tests_kvm_alt.sh +++ b/hack/jenkins/linux_integration_tests_kvm_alt.sh @@ -28,6 +28,8 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="kvm2" JOB_NAME="Linux-KVM-Alt" +EXTRA_ARGS="--bootstrapper=localkube" +EXTRA_START_ARGS="--kubernetes-version=file://$PWD/out/localkube" # Download files and set permissions source common.sh diff --git a/pkg/minikube/kubernetes_versions/kubernetes_versions.go b/pkg/minikube/kubernetes_versions/kubernetes_versions.go index 79be53911420..0c354de02e9c 100644 --- a/pkg/minikube/kubernetes_versions/kubernetes_versions.go +++ b/pkg/minikube/kubernetes_versions/kubernetes_versions.go @@ -21,6 +21,7 @@ import ( "fmt" "io" "net/http" + "strings" "k8s.io/minikube/pkg/minikube/constants" @@ -80,6 +81,9 @@ func GetK8sVersionsFromURL(url string) (K8sReleases, error) { } func IsValidLocalkubeVersion(v string, url string) (bool, error) { + if strings.HasPrefix(v, "file://") { + return true, nil + } k8sReleases, err := GetK8sVersionsFromURL(url) glog.Infoln(k8sReleases) if err != nil { From 3fceab3b5164d4b343801fac67184e52ea4b2032 Mon Sep 17 00:00:00 2001 From: Matt Rickard Date: Tue, 24 Oct 2017 10:23:05 -0700 Subject: [PATCH 3/3] Download localkube in e2e test --- hack/jenkins/common.sh | 1 + hack/jenkins/windows_integration_test_virtualbox.ps1 | 5 ++--- pkg/minikube/kubernetes_versions/kubernetes_versions.go | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index d5b152f0f6a6..548bf01b8809 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -27,6 +27,7 @@ # Copy only the files we need to this workspace mkdir -p out/ testdata/ gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH} out/ +gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/localkube out/ gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver-* out/ gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH} out/ gsutil cp gs://minikube-builds/${MINIKUBE_LOCATION}/testdata/busybox.yaml testdata/ diff --git a/hack/jenkins/windows_integration_test_virtualbox.ps1 b/hack/jenkins/windows_integration_test_virtualbox.ps1 index 5479e03a5d41..c33ac31a6742 100644 --- a/hack/jenkins/windows_integration_test_virtualbox.ps1 +++ b/hack/jenkins/windows_integration_test_virtualbox.ps1 @@ -14,15 +14,14 @@ mkdir -p out gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/minikube-windows-amd64.exe out/ +gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/localkube out/ gsutil.cmd cp gs://minikube-builds/$env:MINIKUBE_LOCATION/e2e-windows-amd64.exe out/ gsutil.cmd cp -r gs://minikube-builds/$env:MINIKUBE_LOCATION/testdata . - ./out/minikube-windows-amd64.exe delete Remove-Item -Recurse -Force C:\Users\jenkins\.minikube -out/e2e-windows-amd64.exe --% -minikube-start-args="--vm-driver=virtualbox --kubernetes-version=file://./out/localkube " -minikube-args="--v=10 --logtostderr" -test.v -test.timeout=30m -binary=out/minikube-windows-amd64.exe - +out/e2e-windows-amd64.exe -minikube-start-args="--vm-driver=virtualbox --kubernetes-version=https://storage.googleapis.com/minikube-builds/$env:MINIKUBE_LOCATION/localkube" -minikube-args="--v=10 --logtostderr" -binary=out/minikube-windows-amd64.exe -test.v -test.timeout=30m $env:result=$lastexitcode # If the last exit code was 0->success, x>0->error If($env:result -eq 0){$env:status="success"} diff --git a/pkg/minikube/kubernetes_versions/kubernetes_versions.go b/pkg/minikube/kubernetes_versions/kubernetes_versions.go index 0c354de02e9c..cffaecc30ec0 100644 --- a/pkg/minikube/kubernetes_versions/kubernetes_versions.go +++ b/pkg/minikube/kubernetes_versions/kubernetes_versions.go @@ -81,7 +81,7 @@ func GetK8sVersionsFromURL(url string) (K8sReleases, error) { } func IsValidLocalkubeVersion(v string, url string) (bool, error) { - if strings.HasPrefix(v, "file://") { + if strings.HasPrefix(v, "file://") || strings.HasPrefix(v, "http") { return true, nil } k8sReleases, err := GetK8sVersionsFromURL(url)