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