diff --git a/hack/jenkins/common.sh b/hack/jenkins/common.sh index 07673308a0..e8f38379e0 100755 --- a/hack/jenkins/common.sh +++ b/hack/jenkins/common.sh @@ -20,12 +20,13 @@ # The script expects the following env variables: # OS_ARCH: The operating system and the architecture separated by a hyphen '-' (e.g. darwin-amd64, linux-amd64, windows-amd64) # VM_DRIVER: the driver to use for the test +# CONTAINER_RUNTIME: the container runtime to use for the test # EXTRA_START_ARGS: additional flags to pass into minikube start # EXTRA_TEST_ARGS: additional flags to pass into go test # JOB_NAME: the name of the logfile and check name to update on github readonly TEST_ROOT="${HOME}/minikube-integration" -readonly TEST_HOME="${TEST_ROOT}/${OS_ARCH}-${VM_DRIVER}-${MINIKUBE_LOCATION}-$$-${COMMIT}" +readonly TEST_HOME="${TEST_ROOT}/${OS_ARCH}-${VM_DRIVER}-${CONTAINER_RUNTIME}-${MINIKUBE_LOCATION}-$$-${COMMIT}" export GOPATH="$HOME/go" export KUBECONFIG="${TEST_HOME}/kubeconfig" export PATH=$PATH:"/usr/local/bin/:/usr/local/go/bin/:$GOPATH/bin" @@ -52,6 +53,7 @@ echo "" echo "arch: ${OS_ARCH}" echo "build: ${MINIKUBE_LOCATION}" echo "driver: ${VM_DRIVER}" +echo "runtime: $CONTAINER_RUNTIME" echo "job: ${JOB_NAME}" echo "test home: ${TEST_HOME}" echo "sudo: ${SUDO_PREFIX}" @@ -299,7 +301,7 @@ if test -f "${TEST_OUT}"; then fi touch "${TEST_OUT}" ${SUDO_PREFIX}${E2E_BIN} \ - -minikube-start-args="--driver=${VM_DRIVER} ${EXTRA_START_ARGS}" \ + -minikube-start-args="--driver=${VM_DRIVER} --container-runtime=${CONTAINER_RUNTIME} ${EXTRA_START_ARGS}" \ -test.timeout=${TIMEOUT} -test.v \ ${EXTRA_TEST_ARGS} \ -binary="${MINIKUBE_BIN}" 2>&1 | tee "${TEST_OUT}" diff --git a/hack/jenkins/linux_integration_tests_docker.sh b/hack/jenkins/linux_integration_tests_docker.sh index fb912d2391..faba877c8c 100755 --- a/hack/jenkins/linux_integration_tests_docker.sh +++ b/hack/jenkins/linux_integration_tests_docker.sh @@ -28,6 +28,7 @@ set -e OS_ARCH="linux-amd64" VM_DRIVER="docker" JOB_NAME="Docker_Linux" +CONTAINER_RUNTIME="docker" mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES" sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP" diff --git a/hack/jenkins/linux_integration_tests_docker_containerd.sh b/hack/jenkins/linux_integration_tests_docker_containerd.sh new file mode 100644 index 0000000000..0d1a53ebf8 --- /dev/null +++ b/hack/jenkins/linux_integration_tests_docker_containerd.sh @@ -0,0 +1,40 @@ +#!/bin/bash + +# Copyright 2019 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. + + +# This script runs the integration tests on a Linux machine for the KVM Driver + +# The script expects the following env variables: +# MINIKUBE_LOCATION: GIT_COMMIT from upstream build. +# COMMIT: Actual commit ID from upstream build +# EXTRA_BUILD_ARGS (optional): Extra args to be passed into the minikube integrations tests +# access_token: The Github API access token. Injected by the Jenkins credential provider. + +set -e + +OS_ARCH="linux-amd64" +VM_DRIVER="docker" +JOB_NAME="Docker_Linux_containerd" +CONTAINER_RUNTIME="containerd" + + +mkdir -p cron && gsutil -qm rsync "gs://minikube-builds/${MINIKUBE_LOCATION}/cron" cron || echo "FAILED TO GET CRON FILES" +sudo install cron/cleanup_and_reboot_Linux.sh /etc/cron.hourly/cleanup_and_reboot || echo "FAILED TO INSTALL CLEANUP" + +# removing possible left over docker containers from previous runs +docker rm -f -v $(docker ps -aq) >/dev/null 2>&1 || true + +source ./common.sh diff --git a/hack/jenkins/minikube_set_pending.sh b/hack/jenkins/minikube_set_pending.sh index 1f2f5e4075..7bcdd813c6 100755 --- a/hack/jenkins/minikube_set_pending.sh +++ b/hack/jenkins/minikube_set_pending.sh @@ -41,6 +41,7 @@ jobs=( 'KVM_Linux' 'none_Linux' 'Docker_Linux' + 'Docker_Linux_containerd' # 'Docker_macOS' # 'Docker_Windows' # 'Podman_Linux'