Add jenkins job for running barometer tests on a daily basis
[releng.git] / jjb / functest / functest-kubernetes-pi.yaml
1 ---
2 - functest-kubernetes-pi-jobs: &functest-kubernetes-pi-jobs
3     name: 'functest-kubernetes-pi-jobs'
4     current-parameters: true
5
6 - functest-kubernetes-pi-params: &functest-kubernetes-pi-params
7     name: 'functest-kubernetes-pi-params'
8     repo: 'ollivier'
9     port:
10     tag:
11       - latest:
12           branch: master
13           slave: lf-virtual1-5
14       - kali:
15           branch: stable/kali
16           slave: lf-virtual1-4
17       - jerma:
18           branch: stable/jerma
19           slave: lf-virtual1-3
20       - iruya:
21           branch: stable/iruya
22           slave: lf-virtual1-2
23       - hunter:
24           branch: stable/hunter
25           slave: lf-virtual1-1
26       - arm-latest:
27           branch: master
28           slave: lf-virtual1-5
29       - arm-kali:
30           branch: stable/kali
31           slave: lf-virtual1-4
32       - arm-jerma:
33           branch: stable/jerma
34           slave: lf-virtual1-3
35       - arm-iruya:
36           branch: stable/iruya
37           slave: lf-virtual1-2
38       - arm-hunter:
39           branch: stable/hunter
40           slave: lf-virtual1-1
41       - arm64-latest:
42           branch: master
43           slave: lf-virtual1-5
44       - arm64-kali:
45           branch: stable/kali
46           slave: lf-virtual1-4
47       - arm64-jerma:
48           branch: stable/jerma
49           slave: lf-virtual1-3
50       - arm64-iruya:
51           branch: stable/iruya
52           slave: lf-virtual1-2
53       - arm64-hunter:
54           branch: stable/hunter
55           slave: lf-virtual1-1
56
57 - parameter:
58     name: functest-kubernetes-pi-slave
59     parameters:
60       - label:
61           name: slave
62           default: '{slave}'
63
64 - parameter:
65     name: functest-kubernetes-pi-build_tag
66     parameters:
67       - random-string:
68           name: build_tag
69
70 - parameter:
71     name: functest-kubernetes-pi-branch
72     parameters:
73       - string:
74           name: branch
75           default: '{branch}'
76
77 - parameter:
78     name: functest-kubernetes-pi-DEPLOY_SCENARIO
79     parameters:
80       - string:
81           name: DEPLOY_SCENARIO
82           default: k8-nosdn-nofeature-noha
83 - parameter:
84     name: functest-kubernetes-pi-DEBUG
85     parameters:
86       - string:
87           name: DEBUG
88           default: 'true'
89
90 - functest-kubernetes-pi-containers: &functest-kubernetes-pi-containers
91     name: 'functest-kubernetes-pi-containers'
92     repo: '{repo}'
93     port: '{port}'
94     container: '{container}'
95     tag: '{tag}'
96
97 - functest-kubernetes-pi-run-containers: &functest-kubernetes-pi-run-containers
98     name: 'functest-kubernetes-pi-run-containers'
99     <<: *functest-kubernetes-pi-containers
100     test: '{test}'
101     privileged: '{privileged}'
102     network: '{network}'
103
104 - builder:
105     name: functest-kubernetes-pi-pull-containers
106     builders:
107       - shell: |
108           set +x
109           if [ "{repo}" = "_" ]; then
110             image={container}:{tag}
111           elif [ "{port}" = "None" ]; then
112             image={repo}/{container}:{tag}
113           else
114             image={repo}:{port}/{container}:{tag}
115           fi
116           docker pull $image
117
118 - builder:
119     name: functest-kubernetes-pi-run-containers
120     builders:
121       - shell: |
122           set +x
123           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/* || true
124           if [ "{repo}" = "_" ]; then
125             image={container}:{tag}
126           elif [ "{port}" = "None" ]; then
127             image={repo}/{container}:{tag}
128           else
129             image={repo}:{port}/{container}:{tag}
130           fi
131           docker run --rm \
132             --privileged={privileged} \
133             --network={network} \
134             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
135             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
136             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes/$BUILD_TAG/$JOB_NAME-$BUILD_ID \
137             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
138             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
139             -e NODE_NAME=$slave \
140             -e BUILD_TAG=$BUILD_TAG \
141             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
142             -e DEPLOY_SCENARIO=$DEPLOY_SCENARIO \
143             -e DEBUG=$DEBUG \
144             -v /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config \
145             -v /home/opnfv/functest-kubernetes/.boto:/root/.boto \
146             $image run_tests -t {test} -p -r
147
148 - builder:
149     name: functest-kubernetes-pi-remove-images
150     builders:
151       - shell: |
152           set +x
153           if [ "{repo}" = "_" ]; then
154             image={container}:{tag}
155           elif [ "{port}" = "None" ]; then
156             image={repo}/{container}:{tag}
157           else
158             image={repo}:{port}/{container}:{tag}
159           fi
160           docker rmi $image || true
161
162
163 - job-template:
164     name: 'functest-kubernetes-pi-{repo}-{container}-{tag}-pull'
165     parameters:
166       - functest-kubernetes-pi-slave:
167           slave: '{slave}'
168     builders:
169       - functest-kubernetes-pi-pull-containers:
170           <<: *functest-kubernetes-pi-containers
171
172 - project:
173     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck-pull'
174     <<: *functest-kubernetes-pi-params
175     container: 'functest-kubernetes-healthcheck'
176     exclude:
177       - tag: arm-hunter
178       - tag: arm64-hunter
179     jobs:
180       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-pull'
181
182 - project:
183     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-pull'
184     <<: *functest-kubernetes-pi-params
185     container: 'functest-kubernetes-smoke'
186     exclude:
187       - tag: arm-hunter
188       - tag: arm64-hunter
189     jobs:
190       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-pull'
191
192 - project:
193     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-pull'
194     <<: *functest-kubernetes-pi-params
195     container: 'functest-kubernetes-security'
196     jobs:
197       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-pull'
198
199 - project:
200     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf-pull'
201     <<: *functest-kubernetes-pi-params
202     container: 'functest-kubernetes-cnf'
203     jobs:
204       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-pull'
205
206 - job-template:
207     name: 'functest-kubernetes-pi-{repo}-{container}-{tag}-rmi'
208     parameters:
209       - functest-kubernetes-pi-slave:
210           slave: '{slave}'
211     builders:
212       - functest-kubernetes-pi-remove-images:
213           <<: *functest-kubernetes-pi-containers
214
215 - project:
216     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck-rmi'
217     <<: *functest-kubernetes-pi-params
218     container: 'functest-kubernetes-healthcheck'
219     exclude:
220       - tag: arm-hunter
221       - tag: arm64-hunter
222     jobs:
223       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-rmi'
224
225 - project:
226     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-rmi'
227     <<: *functest-kubernetes-pi-params
228     container: 'functest-kubernetes-smoke'
229     exclude:
230       - tag: arm-hunter
231       - tag: arm64-hunter
232     jobs:
233       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-rmi'
234
235 - project:
236     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-rmi'
237     <<: *functest-kubernetes-pi-params
238     container: 'functest-kubernetes-security'
239     jobs:
240       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-rmi'
241
242 - project:
243     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf-rmi'
244     <<: *functest-kubernetes-pi-params
245     container: 'functest-kubernetes-cnf'
246     jobs:
247       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-rmi'
248
249 - job-template:
250     name: 'functest-kubernetes-pi-{repo}-{container}-{tag}-{test}-run'
251     parameters:
252       - functest-kubernetes-pi-slave:
253           slave: '{slave}'
254       - functest-kubernetes-pi-build_tag:
255           build_tag: ''
256       - functest-kubernetes-pi-DEPLOY_SCENARIO:
257           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
258       - functest-kubernetes-pi-DEBUG:
259           DEBUG: 'true'
260     builders:
261       - functest-kubernetes-pi-run-containers:
262           <<: *functest-kubernetes-pi-run-containers
263
264 - job-template:
265     name: 'functest-kubernetes-pi-{repo}-functest-kubernetes-cnf-{tag}-k8s_vims-run'
266     properties:
267       - build-blocker:
268           use-build-blocker: true
269           blocking-level: 'GLOBAL'
270           blocking-jobs:
271             - '^functest-kubernetes(-pi)?-*-k8s_vims-run$'
272     parameters:
273       - functest-kubernetes-pi-slave:
274           slave: '{slave}'
275       - functest-kubernetes-pi-build_tag:
276           build_tag: ''
277       - functest-kubernetes-pi-DEPLOY_SCENARIO:
278           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
279       - functest-kubernetes-pi-DEBUG:
280           DEBUG: 'true'
281     builders:
282       - functest-kubernetes-pi-run-containers:
283           <<: *functest-kubernetes-pi-run-containers
284
285 - project:
286     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck'
287     <<: *functest-kubernetes-pi-params
288     container: 'functest-kubernetes-healthcheck'
289     test:
290       - k8s_smoke
291     exclude:
292       - tag: arm-hunter
293       - tag: arm64-hunter
294     privileged: 'false'
295     network: bridge
296     jobs:
297       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-{test}-run'
298
299 - project:
300     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke'
301     <<: *functest-kubernetes-pi-params
302     container: 'functest-kubernetes-smoke'
303     test:
304       - xrally_kubernetes
305       - k8s_conformance
306     exclude:
307       - tag: arm-hunter
308       - tag: arm64-hunter
309     privileged: 'false'
310     network: bridge
311     jobs:
312       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-{test}-run'
313
314 - project:
315     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security'
316     <<: *functest-kubernetes-pi-params
317     container: 'functest-kubernetes-security'
318     test:
319       - kube_hunter
320       - kube_bench
321     privileged: 'false'
322     network: bridge
323     jobs:
324       - 'functest-kubernetes-pi-{repo}-{container}-{tag}-{test}-run'
325
326 - project:
327     name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf'
328     <<: *functest-kubernetes-pi-params
329     container: 'functest-kubernetes-cnf'
330     test:
331       - k8s_vims
332     privileged: 'false'
333     network: bridge
334     jobs:
335       - 'functest-kubernetes-pi-{repo}-functest-kubernetes-cnf-{tag}-k8s_vims-run'
336
337
338 - builder:
339     name: functest-kubernetes-pi-zip
340     builders:
341       - shell: |
342           set +x
343           [ ! -z "$WORKSPACE" ] && rm -rf $WORKSPACE/* || true
344           if [ "{repo}" = "_" ]; then
345             image={container}:{tag}
346           elif [ "{port}" = "None" ]; then
347             image={repo}/{container}:{tag}
348           else
349             image={repo}:{port}/{container}:{tag}
350           fi
351           docker run --rm \
352             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
353             -e S3_DST_URL=s3://artifacts.opnfv.org/functest-kubernetes \
354             -e HTTP_DST_URL=http://artifacts.opnfv.org/functest-kubernetes \
355             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
356             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
357             -e BUILD_TAG=$BUILD_TAG \
358             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
359             -e DEPLOY_SCENARIO=$DEPLOY_SCENARIO \
360             -e DEBUG=$DEBUG \
361             -v /home/opnfv/functest-kubernetes/config.{tag}:/root/.kube/config \
362             -v /home/opnfv/functest-kubernetes/.boto:/root/.boto \
363             $image zip_campaign
364
365 - job-template:
366     name: 'functest-kubernetes-pi-{tag}-zip'
367     parameters:
368       - functest-kubernetes-pi-slave:
369           slave: '{slave}'
370       - functest-kubernetes-pi-build_tag:
371           build_tag: ''
372       - functest-kubernetes-pi-DEPLOY_SCENARIO:
373           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
374       - functest-kubernetes-pi-DEBUG:
375           DEBUG: 'true'
376     builders:
377       - functest-kubernetes-pi-zip:
378           <<: *functest-kubernetes-pi-containers
379
380 - project:
381     name: 'functest-kubernetes-pi-{tag}-zip'
382     <<: *functest-kubernetes-pi-params
383     container: 'functest-kubernetes-security'
384     jobs:
385       - 'functest-kubernetes-pi-{tag}-zip'
386
387 - job-template:
388     name: 'functest-kubernetes-pi-{tag}-daily'
389     project-type: multijob
390     triggers:
391       - timed: '@daily'
392     parameters:
393       - functest-kubernetes-pi-slave:
394           slave: '{slave}'
395       - functest-kubernetes-pi-build_tag:
396           build_tag: ''
397       - functest-kubernetes-pi-DEPLOY_SCENARIO:
398           DEPLOY_SCENARIO: k8-nosdn-nofeature-noha
399       - functest-kubernetes-pi-DEBUG:
400           DEBUG: 'true'
401     properties:
402       - build-blocker:
403           use-build-blocker: true
404           blocking-level: 'NODE'
405           blocking-jobs:
406             - '^functest-kubernetes(-pi)?-(arm.*-|amd64-)*[a-z]+-(daily|gate|check)$'
407     builders:
408       - multijob:
409           name: remove former images
410           projects:
411             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck-{tag}-rmi'
412               <<: *functest-kubernetes-pi-jobs
413             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-{tag}-rmi'
414               <<: *functest-kubernetes-pi-jobs
415             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-{tag}-rmi'
416               <<: *functest-kubernetes-pi-jobs
417             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf-{tag}-rmi'
418               <<: *functest-kubernetes-pi-jobs
419       - multijob:
420           name: pull containers
421           projects:
422             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck-{tag}-pull'
423               <<: *functest-kubernetes-pi-jobs
424             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-{tag}-pull'
425               <<: *functest-kubernetes-pi-jobs
426             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-{tag}-pull'
427               <<: *functest-kubernetes-pi-jobs
428             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf-{tag}-pull'
429               <<: *functest-kubernetes-pi-jobs
430       - multijob:
431           name: ollivier/functest-kubernetes-healthcheck:{tag}
432           projects:
433             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-healthcheck-{tag}-k8s_smoke-run'
434               <<: *functest-kubernetes-pi-jobs
435       - multijob:
436           name: ollivier/functest-kubernetes-smoke:{tag}
437           projects:
438             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-{tag}-xrally_kubernetes-run'
439               <<: *functest-kubernetes-pi-jobs
440             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-smoke-{tag}-k8s_conformance-run'
441               <<: *functest-kubernetes-pi-jobs
442       - multijob:
443           name: ollivier/functest-kubernetes-security:{tag}
444           projects:
445             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-{tag}-kube_hunter-run'
446               <<: *functest-kubernetes-pi-jobs
447             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-security-{tag}-kube_bench-run'
448               <<: *functest-kubernetes-pi-jobs
449       - multijob:
450           name: ollivier/functest-kubernetes-cnf:{tag}
451           projects:
452             - name: 'functest-kubernetes-pi-ollivier-functest-kubernetes-cnf-{tag}-k8s_vims-run'
453               <<: *functest-kubernetes-pi-jobs
454       - multijob:
455           name: dump all campaign data
456           projects:
457             - name: 'functest-kubernetes-pi-{tag}-zip'
458               <<: *functest-kubernetes-pi-jobs
459
460
461 - project:
462     name: 'functest-kubernetes-pi'
463     <<: *functest-kubernetes-pi-params
464     jobs:
465       - 'functest-kubernetes-pi-{tag}-daily'
466
467 - view:
468     name: functest-kubernetes-pi
469     view-type: list
470     columns:
471       - status
472       - weather
473       - job
474       - last-success
475       - last-failure
476       - last-duration
477     regex: ^functest-kubernetes-pi-(arm.*-|amd64-)*[a-z]+-daily$