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