Skip to content

Commit

Permalink
Upload gvisor-addon to integration tests bucket; build gvisor image f…
Browse files Browse the repository at this point in the history
…rom common.sh
  • Loading branch information
Priya Wadhwa committed Jul 9, 2019
1 parent d2e5a4b commit aa9b344
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 15 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 4 additions & 0 deletions hack/jenkins/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,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 ..."
Expand Down
14 changes: 0 additions & 14 deletions test/integration/functional_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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"
)

Expand Down Expand Up @@ -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")
Expand Down
20 changes: 20 additions & 0 deletions test/integration/testdata/gvisor-addon-Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]

0 comments on commit aa9b344

Please sign in to comment.