From eba1767af661f0f5f53560c753ed1c98f28b181b Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Wed, 17 Feb 2016 21:12:18 -0800 Subject: [PATCH 1/3] yaml for jenkins node docker-build-push/e2e cadvisor/heapster/node jobs. #20538 --- hack/jenkins/job-configs/global.yaml | 27 +++++ hack/jenkins/job-configs/node-e2e.yaml | 151 +++++++++++++++++++++++++ 2 files changed, 178 insertions(+) create mode 100644 hack/jenkins/job-configs/node-e2e.yaml diff --git a/hack/jenkins/job-configs/global.yaml b/hack/jenkins/job-configs/global.yaml index cda176e487..98603d4577 100644 --- a/hack/jenkins/job-configs/global.yaml +++ b/hack/jenkins/job-configs/global.yaml @@ -85,6 +85,33 @@ 100.0 +- builder: + name: docker-build-publish + builders: + - raw: + xml: | + + + + 1f361efb-5b85-4f61-91a7-4ec7fb2a5c23 + + {repoName} + true + true + {dockerfilePath} + false + false + {tag} + false + true + true + + - shell: | + #!/bin/bash + set -e + set -x + docker rmi -f {repoName}:{tag} + # Default email recipients are set in Jenkins global config - defaults: name: global diff --git a/hack/jenkins/job-configs/node-e2e.yaml b/hack/jenkins/job-configs/node-e2e.yaml new file mode 100644 index 0000000000..6273426cdf --- /dev/null +++ b/hack/jenkins/job-configs/node-e2e.yaml @@ -0,0 +1,151 @@ +- job-template: + name: '{gitproject}-dockercanarybuild-ci' + description: 'Build and push {gitproject} docker image.
Test Owner: {owner}.' + node: 'node' + logrotate: + numToKeep: 200 + node: node + builders: + - docker-build-publish: + repoName: '{repoName}' + dockerfilePath: 'go/src/{gitbasedir}/{dockerfilePath}' + tag: 'canary' + publishers: + - claim-build + - gcs-uploader + - log-parser + - email-ext: + recipients: '{owner}' + scm: + - git: + url: 'https://github.com/{repoName}' + browser: githubweb + browser-url: 'https://github.com/{repoName}' + branches: + - 'master' + skip-tag: true + basedir: 'go/src/{gitbasedir}' + triggers: + - pollscm: + cron: 'H/5 * * * *' + - timed: '@daily' + wrappers: + - ansicolor: + colormap: xterm + - timeout: + timeout: 30 + fail: true + - timestamps + +- job-template: + name: '{gitproject}-gce-e2e-ci' + description: '{gitproject} continuous e2e tests.
Test Owner: {owner}.' + node: 'node' + logrotate: + numToKeep: 200 + node: node + builders: + - shell: '{shell}' + publishers: + - claim-build + - gcs-uploader + - log-parser + - email-ext: + recipients: '{owner}' + scm: + - git: + url: 'https://github.com/{repoName}' + browser: githubweb + browser-url: 'https://github.com/{repoName}' + branches: + - 'master' + skip-tag: true + basedir: 'go/src/{gitbasedir}' + triggers: + - pollscm: + cron: 'H/5 * * * *' + - timed: '@daily' + wrappers: + - ansicolor: + colormap: xterm + - timeout: + timeout: 30 + fail: true + - timestamps + - inject: + properties-content: | + GOROOT=/usr/local/go + GOPATH=$WORKSPACE/go + PATH=$PATH:$GOROOT/bin:$WORKSPACE/go/bin + +- project: + name: node-docker-canary-build + repoName: 'google/cadvisor' + gitproject: + - 'cadvisor': + repoName: 'google/cadvisor' + gitbasedir: 'github.com/google/cadvisor' + dockerfilePath: 'deploy/canary/Dockerfile' + owner: 'vishnuk@google.com' + - 'heapster': + repoName: 'kubernetes/heapster' + gitbasedir: 'k8s.io/heapster' + dockerfilePath: 'deploy/docker/canary/Dockerfile' + owner: 'pszczesniak@google.com' + jobs: + - '{gitproject}-dockercanarybuild-ci' + +- project: + name: node-gce-e2e + repoName: 'google/cadvisor' + gitproject: + - 'cadvisor': + repoName: 'google/cadvisor' + gitbasedir: 'github.com/google/cadvisor' + owner: 'vishnuk@google.com' + shell: | + #!/bin/bash + set -e + set -x + cd go/src/github.com/google/cadvisor + + go get -u github.com/tools/godep + + ./build/presubmit.sh + godep go build -tags test github.com/google/cadvisor/integration/runner + ./runner --logtostderr --test-retry-count=8 --test-retry-whitelist=integration/runner/retrywhitelist.txt \ + --ssh-options "-i /home/jenkins/.ssh/google_compute_engine -o UserKnownHostsFile=/dev/null -o IdentitiesOnly=yes -o CheckHostIP=no -o StrictHostKeyChecking=no" \ + e2e-cadvisor-ubuntu-trusty \ + e2e-cadvisor-coreos-beta \ + e2e-cadvisor-container-vm-v20151215 \ + e2e-cadvisor-container-vm-v20160127 \ + e2e-cadvisor-rhel-7 + - 'heapster': + repoName: 'kubernetes/heapster' + gitbasedir: 'k8s.io/heapster' + owner: 'pszczesniak@google.com' + shell: | + #!/bin/bash + set -e + set -x + cd go/src/k8s.io/heapster + + make test-unit test-integration + - 'kubelet': + repoName: 'kubernetes/kubernetes' + gitbasedir: 'k8s.io/kubernetes' + owner: 'pwittroc@google.com' + shell: | + #!/bin/bash + set -e + set -x + cd go/src/k8s.io/kubernetes + + go get -u github.com/tools/godep + go get -u github.com/onsi/ginkgo/ginkgo + go get -u github.com/onsi/gomega + + godep go build test/e2e_node/environment/conformance.go + godep go run test/e2e_node/runner/run_e2e.go --zone us-central1-f --hosts e2e-node-container-vm-v20151215,e2e-node-coreos-beta.c.kubernetes-jenkins.internal,e2e-node-ubuntu-trusty,e2e-node-ubuntu-trusty-docker1-10 --logtostderr -v 2 + jobs: + - '{gitproject}-gce-e2e-ci' From 35e753f22bba84bc743ed3492de9780f65c9aa4e Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Tue, 23 Feb 2016 10:52:51 -0800 Subject: [PATCH 2/3] Move credentialsId to a variable --- hack/jenkins/job-configs/global.yaml | 2 +- hack/jenkins/job-configs/node-e2e.yaml | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/hack/jenkins/job-configs/global.yaml b/hack/jenkins/job-configs/global.yaml index 98603d4577..5a51ecc622 100644 --- a/hack/jenkins/job-configs/global.yaml +++ b/hack/jenkins/job-configs/global.yaml @@ -93,7 +93,7 @@ - 1f361efb-5b85-4f61-91a7-4ec7fb2a5c23 + {credentialsId} {repoName} true diff --git a/hack/jenkins/job-configs/node-e2e.yaml b/hack/jenkins/job-configs/node-e2e.yaml index 6273426cdf..d42e0897e1 100644 --- a/hack/jenkins/job-configs/node-e2e.yaml +++ b/hack/jenkins/job-configs/node-e2e.yaml @@ -10,6 +10,7 @@ repoName: '{repoName}' dockerfilePath: 'go/src/{gitbasedir}/{dockerfilePath}' tag: 'canary' + credentialsId: '1f361efb-5b85-4f61-91a7-4ec7fb2a5c23' publishers: - claim-build - gcs-uploader From 538a2c489c28ac7f871ac0341b61cce060a707f0 Mon Sep 17 00:00:00 2001 From: Phillip Wittrock Date: Tue, 23 Feb 2016 11:18:56 -0800 Subject: [PATCH 3/3] Address pr comments --- hack/jenkins/job-configs/global.yaml | 10 ++++++++++ hack/jenkins/job-configs/node-e2e.yaml | 20 ++++++++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/hack/jenkins/job-configs/global.yaml b/hack/jenkins/job-configs/global.yaml index 5a51ecc622..179f50213a 100644 --- a/hack/jenkins/job-configs/global.yaml +++ b/hack/jenkins/job-configs/global.yaml @@ -85,6 +85,16 @@ 100.0 +# Implements Docker Build and Publish Plugin +# https://wiki.jenkins-ci.org/display/JENKINS/CloudBees+Docker+Build+and+Publish+plugin +# From the docs: 'This plugin provides the ability to build projects with a Dockerfile, and publish the resultant +# tagged image (repo) to the docker registry.' +# +# repoName: docker registry repo name to publish the image +# dockerfilePath: workspace relative path to the 'Dockerfile' to build +# tag: Tag to apply to the built image +# credentialsId: Jenkins 'Username with password' credentials ID (hex string) to authenticate to docker registry. +# Found under http:/credentials -> "Advanced" - builder: name: docker-build-publish builders: diff --git a/hack/jenkins/job-configs/node-e2e.yaml b/hack/jenkins/job-configs/node-e2e.yaml index d42e0897e1..0e9621f396 100644 --- a/hack/jenkins/job-configs/node-e2e.yaml +++ b/hack/jenkins/job-configs/node-e2e.yaml @@ -1,3 +1,13 @@ +# Job template to checkout source from github to $WORKSPACE/go/src/{gitbasedir} and build + publish a docker image. +# - Tags the docker image with 'canary'. +# - Job is executed daily and when changes are found polling github (every 5m). +# - Console output is published to google cloud storage. +# +# gitproject: name of the project - for display purposes only +# owner: owner to be notified for job failures. test results are published to owner email +# repoName: github repo to checkout e.g. kubernetes/kubernetes or google/cadvisor. Must match the docker image repo name where the image will be published. +# gitbasedir: directory under $WORKSPACE/go/src to checkout source repo to - e.g. k8s.io/kubernetes or github.com/google/cadvisor +# dockerfilePath: workspace relative path to the 'Dockerfile' to build - job-template: name: '{gitproject}-dockercanarybuild-ci' description: 'Build and push {gitproject} docker image.
Test Owner: {owner}.' @@ -38,6 +48,16 @@ fail: true - timestamps +# Job template to checkout source from github to $WORKSPACE/go/src/{gitbasedir}, setup go environment variables, and execute a +# shell script. +# - Job is executed daily and when changes are found polling github (every 5m). +# - Console output is published to google cloud storage. +# +# gitproject: name of the project - for display purposes only +# owner: owner to be notified for job failures. test results are published to owner email +# repoName: github repo to checkout e.g. kubernetes/kubernetes or google/cadvisor +# gitbasedir: directory under $WORKSPACE/go/src to checkout source repo to - e.g. k8s.io/kubernetes or github.com/google/cadvisor +# shell: shell to execute from workspace - job-template: name: '{gitproject}-gce-e2e-ci' description: '{gitproject} continuous e2e tests.
Test Owner: {owner}.'