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