Revision 30b0d3fc3189a8383e766b76d14c388191c70cc1 authored by André Martins on 11 May 2020, 13:32:08 UTC, committed by André Martins on 26 May 2020, 12:42:04 UTC
Listing all pods, even if with a filter will load the etcd kvstore as the filtering is done in kube-apiserver. To avoid doing this operation every 10 seconds we can have a single watcher that keeps track of all unmanaged kube-dns pods locally. Signed-off-by: André Martins <andre@cilium.io>
1 parent 40fface
ginkgo-kubernetes-all.Jenkinsfile
@Library('cilium') _
pipeline {
agent {
label 'baremetal'
}
parameters {
string(defaultValue: '${ghprbPullDescription}', name: 'ghprbPullDescription')
string(defaultValue: '${ghprbActualCommit}', name: 'ghprbActualCommit')
string(defaultValue: '${ghprbTriggerAuthorLoginMention}', name: 'ghprbTriggerAuthorLoginMention')
string(defaultValue: '${ghprbPullAuthorLoginMention}', name: 'ghprbPullAuthorLoginMention')
string(defaultValue: '${ghprbGhRepository}', name: 'ghprbGhRepository')
string(defaultValue: '${ghprbPullLongDescription}', name: 'ghprbPullLongDescription')
string(defaultValue: '${ghprbCredentialsId}', name: 'ghprbCredentialsId')
string(defaultValue: '${ghprbTriggerAuthorLogin}', name: 'ghprbTriggerAuthorLogin')
string(defaultValue: '${ghprbPullAuthorLogin}', name: 'ghprbPullAuthorLogin')
string(defaultValue: '${ghprbTriggerAuthor}', name: 'ghprbTriggerAuthor')
string(defaultValue: '${ghprbCommentBody}', name: 'ghprbCommentBody')
string(defaultValue: '${ghprbPullTitle}', name: 'ghprbPullTitle')
string(defaultValue: '${ghprbPullLink}', name: 'ghprbPullLink')
string(defaultValue: '${ghprbAuthorRepoGitUrl}', name: 'ghprbAuthorRepoGitUrl')
string(defaultValue: '${ghprbTargetBranch}', name: 'ghprbTargetBranch')
string(defaultValue: '${ghprbPullId}', name: 'ghprbPullId')
string(defaultValue: '${ghprbActualCommitAuthor}', name: 'ghprbActualCommitAuthor')
string(defaultValue: '${ghprbActualCommitAuthorEmail}', name: 'ghprbActualCommitAuthorEmail')
string(defaultValue: '${ghprbTriggerAuthorEmail}', name: 'ghprbTriggerAuthorEmail')
string(defaultValue: '${GIT_BRANCH}', name: 'GIT_BRANCH')
string(defaultValue: '${ghprbPullAuthorEmail}', name: 'ghprbPullAuthorEmail')
string(defaultValue: '${sha1}', name: 'sha1')
string(defaultValue: '${ghprbSourceBranch}', name: 'ghprbSourceBranch')
}
environment {
PROJ_PATH = "src/github.com/cilium/cilium"
VM_MEMORY = "4096"
TESTDIR="${WORKSPACE}/${PROJ_PATH}/test"
GOPATH="${WORKSPACE}"
SERVER_BOX = "cilium/ubuntu"
FAILFAST=setIfLabel("ci/fail-fast", "true", "false")
CNI_INTEGRATION=setIfLabel("integration/cni-flannel", "FLANNEL", "")
GINKGO_TIMEOUT="98m"
}
options {
timeout(time: 540, unit: 'MINUTES')
timestamps()
ansiColor('xterm')
}
stages {
stage('Set build name') {
when {
not {environment name: 'GIT_BRANCH', value: 'origin/master'}
}
steps {
script {
currentBuild.displayName = env.getProperty('ghprbPullTitle') + ' ' + env.getProperty('ghprbPullLink') + ' ' + currentBuild.displayName
}
}
}
stage('Checkout') {
options {
timeout(time: 20, unit: 'MINUTES')
}
steps {
sh 'env'
Status("PENDING", "${env.JOB_NAME}")
checkout scm
sh 'mkdir -p ${PROJ_PATH}'
sh 'ls -A | grep -v src | xargs mv -t ${PROJ_PATH}'
sh '/usr/local/bin/cleanup || true'
}
}
stage('Make Cilium images') {
environment {
TESTDIR="${WORKSPACE}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ./make-images-push-to-local-registry.sh $(./print-node-ip.sh) latest'
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'building or pushing Cilium images failed ' + currentBuild.displayName
}
}
}
}
}
stage('Preload vagrant boxes') {
steps {
sh '/usr/local/bin/add_vagrant_box ${WORKSPACE}/${PROJ_PATH}/vagrant_box_defaults.rb'
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'preload vagrant boxes fail' + currentBuild.displayName
}
}
}
}
}
stage('Copy code and boot VMs 1.{12,13}'){
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
GOPATH="${WORKSPACE}"
TESTDIR="${WORKSPACE}/${PROJ_PATH}/test"
}
parallel {
stage('Boot vms 1.12') {
environment {
K8S_VERSION="1.12"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.12 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
stage('Boot vms 1.13') {
environment {
K8S_VERSION="1.13"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.13 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
stage('BDD-Test-k8s-1.12-and-1.13') {
environment {
CONTAINER_RUNTIME=setIfLabel("area/containerd", "containerd", "docker")
}
options {
timeout(time: 180, unit: 'MINUTES')
}
parallel {
stage('BDD-Test-k8s-1.12') {
environment {
K8S_VERSION="1.12"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.12 tests fail\n' + currentBuild.displayName
}
}
}
}
}
stage('BDD-Test-k8s-1.13') {
environment {
K8S_VERSION="1.13"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.13 tests fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
stage('Copy code and boot VMs 1.{14,15}'){
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
GOPATH="${WORKSPACE}"
TESTDIR="${WORKSPACE}/${PROJ_PATH}/test"
}
parallel {
stage('Boot vms 1.14') {
environment {
K8S_VERSION="1.14"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.14 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
stage('Boot vms 1.15') {
environment {
K8S_VERSION="1.15"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.15 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
stage('BDD-Test-k8s-1.14-and-1.15') {
environment {
CONTAINER_RUNTIME=setIfLabel("area/containerd", "containerd", "docker")
}
options {
timeout(time: 180, unit: 'MINUTES')
}
parallel {
stage('BDD-Test-k8s-1.14') {
environment {
K8S_VERSION="1.14"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.14 tests fail\n' + currentBuild.displayName
}
}
}
}
}
stage('BDD-Test-k8s-1.15') {
environment {
K8S_VERSION="1.15"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.15 tests fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
stage('Copy code and boot VMs 1.{16,17}'){
options {
timeout(time: 60, unit: 'MINUTES')
}
environment {
GOPATH="${WORKSPACE}"
TESTDIR="${WORKSPACE}/${PROJ_PATH}/test"
}
parallel {
stage('Boot vms 1.16') {
environment {
K8S_VERSION="1.16"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.16 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
stage('Boot vms 1.17') {
environment {
K8S_VERSION="1.17"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'mkdir -p ${GOPATH}/src/github.com/cilium'
sh 'cp -a ${WORKSPACE}/${PROJ_PATH} ${GOPATH}/${PROJ_PATH}'
retry(3) {
timeout(time: 20, unit: 'MINUTES'){
dir("${TESTDIR}") {
sh 'CILIUM_REGISTRY="$(./print-node-ip.sh)" ./vagrant-ci-start.sh'
}
}
}
}
post {
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8S 1.17 vm provisioning fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
stage('BDD-Test-k8s-1.16-and-1.17') {
environment {
CONTAINER_RUNTIME=setIfLabel("area/containerd", "containerd", "docker")
}
options {
timeout(time: 180, unit: 'MINUTES')
}
parallel {
stage('BDD-Test-k8s-1.16') {
environment {
K8S_VERSION="1.16"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.16 tests fail\n' + currentBuild.displayName
}
}
}
}
}
stage('BDD-Test-k8s-1.17') {
environment {
K8S_VERSION="1.17"
GOPATH="${WORKSPACE}/${K8S_VERSION}-gopath"
TESTDIR="${GOPATH}/${PROJ_PATH}/test"
}
steps {
sh 'cd ${TESTDIR}; ginkgo --focus=" K8s*" -v --failFast=${FAILFAST} -- -cilium.provision=false -cilium.timeout=${GINKGO_TIMEOUT} -cilium.registry=$(./print-node-ip.sh)'
}
post {
always {
sh 'cd ${TESTDIR}; ./post_build_agent.sh || true'
sh 'cd ${TESTDIR}; ./archive_test_results.sh || true'
sh 'cd ${TESTDIR}/..; mv *.zip ${WORKSPACE} || true'
sh 'cd ${TESTDIR}; mv *.xml ${WORKSPACE}/${PROJ_PATH}/test || true'
sh 'cd ${TESTDIR}; vagrant destroy -f || true'
}
unsuccessful {
script {
if (!currentBuild.displayName.contains('fail')) {
currentBuild.displayName = 'K8s 1.17 tests fail\n' + currentBuild.displayName
}
}
}
}
}
}
}
}
post {
always {
archiveArtifacts artifacts: '*.zip'
junit testDataPublishers: [[$class: 'AttachmentPublisher']], testResults: 'src/github.com/cilium/cilium/test/*.xml'
cleanWs()
sh '/usr/local/bin/cleanup || true'
}
success {
Status("SUCCESS", "${env.JOB_NAME}")
}
failure {
Status("FAILURE", "${env.JOB_NAME}")
}
}
}
![swh spinner](/static/img/swh-spinner.gif)
Computing file changes ...