Upload gvisor-addon to integration tests bucket; build gvisor image from common.sh

pull/4717/head
Priya Wadhwa 2019-07-09 14:59:36 -07:00
parent d2e5a4b052
commit 1a49eecaf7
4 changed files with 27 additions and 16 deletions

View File

@ -175,7 +175,7 @@ test-pkg/%: pkg/minikube/assets/assets.go pkg/minikube/translate/translations.go
go test -v -test.timeout=60m ./$* --tags="$(MINIKUBE_BUILD_TAGS)"
.PHONY: all
all: cross drivers e2e-cross
all: cross drivers e2e-cross out/gvisor-addon
.PHONY: drivers
drivers: out/docker-machine-driver-hyperkit out/docker-machine-driver-kvm2

View File

@ -71,7 +71,8 @@ echo ">> Downloading test inputs from ${MINIKUBE_LOCATION} ..."
gsutil -qm cp \
"gs://minikube-builds/${MINIKUBE_LOCATION}/minikube-${OS_ARCH}" \
"gs://minikube-builds/${MINIKUBE_LOCATION}/docker-machine-driver"-* \
"gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH}" out
"gs://minikube-builds/${MINIKUBE_LOCATION}/e2e-${OS_ARCH}" out \
"gs://minikube-builds/${MINIKUBE_LOCATION}/gvisor-addon" out
gsutil -qm cp "gs://minikube-builds/${MINIKUBE_LOCATION}/testdata"/* testdata/
@ -88,6 +89,10 @@ if [[ "${procs}" != "" ]]; then
kill -9 ${procs} || true
fi
# Build gvisor image locally
echo ">> Building gvisor addon image locally."
docker build -t gcr.io/k8s-minikube/gvisor-addon:latest -f testdata/gvisor-addon-Dockerfile out
# Cleanup stale test outputs.
echo ""
echo ">> Cleaning up after previous test runs ..."

View File

@ -19,12 +19,10 @@ limitations under the License.
package integration
import (
"os/exec"
"strings"
"testing"
"github.com/docker/machine/libmachine/state"
"k8s.io/minikube/pkg/minikube/constants"
"k8s.io/minikube/test/integration/util"
)
@ -62,24 +60,12 @@ func TestFunctionalContainerd(t *testing.T) {
r.RunCommand("delete", true)
}
// Build current version of the gvisor image.
buildGvisorImage(t)
r.Start("--container-runtime=containerd", "--docker-opt containerd=/var/run/containerd/containerd.sock")
t.Run("Gvisor", testGvisor)
t.Run("GvisorRestart", testGvisorRestart)
r.RunCommand("delete", true)
}
func buildGvisorImage(t *testing.T) {
cmd := exec.Command("docker", "build", "-t", constants.GvisorImage, "-f", "deploy/gvisor/Dockerfile", ".")
cmd.Dir = "../../"
stdout, err := cmd.CombinedOutput()
if err != nil {
t.Fatalf("Error running command: %s in directory: %s %v. Output: %s", cmd.Args, cmd.Dir, err, string(stdout))
}
}
// usingNoneDriver returns true if using the none driver
func usingNoneDriver(r util.MinikubeRunner) bool {
return strings.Contains(r.StartArgs, "--vm-driver=none")

View File

@ -0,0 +1,20 @@
# Copyright 2016 The Kubernetes Authors All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
FROM ubuntu:18.04
RUN apt-get update && \
apt-get install -y kmod gcc wget xz-utils libc6-dev bc libelf-dev bison flex openssl libssl-dev libidn2-0 sudo libcap2 && \
rm -rf /var/lib/apt/lists/*
COPY gvisor-addon /gvisor-addon
CMD ["/gvisor-addon"]