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