|
1 | 1 | # Jenkins
|
2 | 2 |
|
3 |
| -[Jenkins](http://jenkins-ci.org/) is a pluggable continuous |
4 |
| -integration system. The Google team is running two Jenkins servers in GCE for |
5 |
| -the Kubernetes project. The post-commit instance runs continuous builds, unit |
6 |
| -tests, integration tests, code verification tests, and end-to-end tests on |
7 |
| -multiple providers using the latest commits to the Kubernetes repo from the |
8 |
| -master and release branches. The PR Jenkins instance runs these tests on each |
9 |
| -PR by a trusted contributor, it but only runs a subset of the end-to-end tests |
10 |
| -and only on GCE. |
| 3 | +Jenkins is no longer in use, please see the [test-infra repo][test-infra] and in |
| 4 | +particular [Prow][prow] instead. |
11 | 5 |
|
12 |
| -## General flow |
13 |
| -The flow of the post-commit Jenkins instance: |
14 |
| -* Under the `kubernetes-build` job: Every 2 minutes, Jenkins polls for a batch |
15 |
| - of new commits, after which it runs the `build.sh` script (in this directory) |
16 |
| - on the latest tip. This results in build assets getting pushed to GCS and the |
17 |
| - `latest.txt` file in the `ci` bucket being updated. |
18 |
| -* On trigger, and every half hour (which effectively means all the time, unless |
19 |
| - we're failing cluster creation), e2e variants run, on the latest build assets |
20 |
| - in GCS: |
21 |
| - * `kubernetes-e2e-gce`: Standard GCE e2e. |
22 |
| - * `kubernetes-e2e-gke`: GKE provider e2e, with head k8s client and GKE |
23 |
| - creating clusters at its default version. |
24 |
| - * `kubernetes-e2e-aws`: AWS provider e2e. This only runs once a day. |
25 |
| -* Each job will not run concurrently with itself, so, for instance, |
26 |
| - Jenkins executor will only ever run one `kubernetes-build` |
27 |
| - job. However, it may run the jobs in parallel, |
28 |
| - i.e. `kubernetes-build` may be run at the same time as |
29 |
| - `kubernetes-e2e-gce`. For this reason, you may see your changes |
30 |
| - pushed to our GCS bucket rapidly, but they may take some time to |
31 |
| - fully work through Jenkins. Or you may get lucky and catch the |
32 |
| - train in 5 minutes. |
33 |
| -* There are many jobs not listed here, including upgrade tests, soak tests, and |
34 |
| - tests for previous releases. |
| 6 | +This directory contains some scripts that are still used by the new CI. |
35 | 7 |
|
36 |
| -## Scripts |
37 |
| - |
38 |
| -The scripts in this directory are directly used by Jenkins, either by |
39 |
| -curl from githubusercontent (if we don't have a git checkout handy) or |
40 |
| -by executing it from the git checkout. Since Jenkins is an entity |
41 |
| -outside this repository, it's tricky to keep documentation for it up |
42 |
| -to date quickly. However, the scripts themselves attempt to provide |
43 |
| -color for the configuration(s) that each script runs in. |
44 |
| - |
45 |
| -## GCS Log Format |
46 |
| - |
47 |
| -Our `upload-to-gcs.sh` script runs at the start and end of every job. Logs on |
48 |
| -post-commit Jenkins go under `gs://kubernetes-jenkins/logs/`. Logs on PR |
49 |
| -Jenkins go under `gs://kubernetes-jenkins-pull/pr-logs/pull/PULL_NUMBER/`. |
50 |
| -Individual run logs go into the `JOB_NAME/BUILD_NUMBER` folder. |
51 |
| - |
52 |
| -At the start of the job, it uploads `started.json` containing the version of |
53 |
| -Kubernetes under test and the timestamp. |
54 |
| - |
55 |
| -At the end, it uploads `finished.json` containing the result and timestamp, as |
56 |
| -well as the build log into `build-log.txt`. Under `artifacts/` we put our |
57 |
| -test results in `junit_XY.xml`, along with gcp resource lists and cluster logs. |
58 |
| - |
59 |
| -It also updates `latest-build.txt` at the end to point to this build number. |
60 |
| -In the end, the directory structure looks like this: |
61 |
| - |
62 |
| -``` |
63 |
| -gs://kubernetes-jenkins/logs/kubernetes-e2e-gce/ |
64 |
| - latest-build.txt |
65 |
| - 12345/ |
66 |
| - build-log.txt |
67 |
| - started.json |
68 |
| - finished.json |
69 |
| - artifacts/ |
70 |
| - gcp-resources-{before, after}.txt |
71 |
| - junit_{00, 01, ...}.xml |
72 |
| - jenkins-e2e-master/{kube-apiserver.log, ...} |
73 |
| - jenkins-e2e-node-abcd/{kubelet.log, ...} |
74 |
| - 12344/ |
75 |
| - ... |
76 |
| -``` |
77 |
| - |
78 |
| -The munger uses `latest-build.txt` and the JUnit reports to figure out whether |
79 |
| -or not the job is healthy. |
80 |
| - |
81 |
| -## Job Builder |
82 |
| - |
83 |
| -New jobs should be specified as YAML files to be processed by [Jenkins Job |
84 |
| -Builder](http://docs.openstack.org/infra/jenkins-job-builder/). The YAML files |
85 |
| -live in `jenkins/job-configs` and its subfolders **in the |
86 |
| -[kubernetes/test-infra repository](https://github.com/kubernetes/test-infra)**. |
87 |
| -Jenkins runs Jenkins Job Builder in a Docker container defined in |
88 |
| -`job-builder-image`, and triggers it using `update-jobs.sh`. Jenkins Job Builder |
89 |
| -uses a config file called |
90 |
| -[jenkins_jobs.ini](http://docs.openstack.org/infra/jenkins-job-builder/execution.html) |
91 |
| -which contains the location and credentials of the Jenkins server. |
92 |
| - |
93 |
| -E2E Job definitions are templated to avoid code duplication. To add a new job, |
94 |
| -add a new entry to the appropriate `project`. |
95 |
| -[This](https://github.com/kubernetes/kubernetes/commit/eb273e5a4bdd3905f881563ada4e6543c7eb96b5) |
96 |
| -is an example of a commit which does this. If necessary, create a new project, as in |
97 |
| -[this](https://github.com/kubernetes/kubernetes/commit/09c27cdabc300e0420a2914100bedb565c23ed73) |
98 |
| -commit. |
99 |
| - |
100 |
| -[]() |
| 8 | +[test-infra]: https://github.com/kubernetes/test-infra |
| 9 | +[prow]: https://github.com/kubernetes/test-infra/tree/master/prow |
0 commit comments