f7d5e77dc5cfb38f4f49364922b867122fac769b
[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           node: xtesting
16       - 2023.1:
17           node: xtesting
18       - zed:
19           node: xtesting
20       - yoga:
21           node: xtesting
22       - xena:
23           node: xtesting
24       - wallaby:
25           node: xtesting
26       - arm-latest:
27           node: xtesting
28       - arm-2.23.1:
29           node: xtesting
30       - arm-zed:
31           node: xtesting
32       - arm-yoga:
33           node: xtesting
34       - arm-xena:
35           node: xtesting
36       - arm-wallaby:
37           node: xtesting
38       - arm64-latest:
39           node: xtesting
40       - arm64-2023.1:
41           node: xtesting
42       - arm64-zed:
43           node: xtesting
44       - arm64-yoga:
45           node: xtesting
46       - arm64-xena:
47           node: xtesting
48       - arm64-wallaby:
49           node: xtesting
50
51 - xtesting-pi-jobs: &xtesting-pi-jobs
52     name: 'xtesting-pi-jobs'
53     current-parameters: true
54
55 - parameter:
56     name: xtesting-pi-node
57     parameters:
58       - label:
59           name: node
60           default: '{node}'
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=$node \
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-node:
159           node: '{node}'
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 - job-template:
172     name: 'xtesting-pi-{repo}-{container}-{tag}-rmi'
173     parameters:
174       - xtesting-pi-node:
175           node: '{node}'
176     builders:
177       - xtesting-pi-remove-images:
178           <<: *xtesting-pi-containers
179
180 - project:
181     name: 'xtesting-pi-ollivier-xtesting-rmi'
182     <<: *xtesting-pi-params
183     container: 'xtesting'
184     jobs:
185       - 'xtesting-pi-{repo}-{container}-{tag}-rmi'
186
187 - job-template:
188     name: 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
189     parameters:
190       - xtesting-pi-node:
191           node: '{node}'
192       - xtesting-pi-build_tag:
193           build_tag: ''
194     builders:
195       - xtesting-pi-run-containers:
196           <<: *xtesting-pi-run-containers
197
198 - project:
199     name: 'xtesting-pi-ollivier-xtesting'
200     <<: *xtesting-pi-params
201     volumes:
202     env:
203     published_ports:
204     container: 'xtesting'
205     test:
206       - first
207       - second
208       - third
209       - fourth
210       - fifth
211       - sixth
212       - eighth
213       - nineth
214     privileged: 'false'
215     network: bridge
216     uid: 1000
217     gid: 1000
218     exclude:
219       - tag: wallaby
220         test: nineth
221       - tag: xena
222         test: nineth
223     jobs:
224       - 'xtesting-pi-ollivier-xtesting-{tag}-{test}-run'
225
226 - builder:
227     name: xtesting-pi-zip
228     builders:
229       - shell: |
230           set +x
231           volumes=;
232           if [ "{volumes}" != "None" ]; then
233             for i in $(echo {volumes} | tr -d '[]' |sed "s/, / /g" ); \
234               do volumes="-v $i $volumes"; done
235           fi
236           env=;
237           if [ "{env}" != "None" ]; then
238             for i in $(eval echo {env} | tr -d '[]' |sed "s/, / /g" ); \
239               do env="-e $i $env"; done
240           fi
241           published_ports=;
242           if [ "{published_ports}" != "None" ]; then
243             for i in $(echo {published_ports} | tr -d '[]' |sed "s/, / /g" ); \
244               do published_ports="-p $i $published_ports"; done
245           fi
246           [ ! -z "$WORKSPACE" ] && sudo rm -rf $WORKSPACE/results || true
247           if [ "{repo}" = "_" ]; then
248             image={container}:{tag}
249           elif [ "{port}" = "None" ]; then
250             image={repo}/{container}:{tag}
251           else
252             image={repo}:{port}/{container}:{tag}
253           fi
254           sudo mkdir -p $WORKSPACE/results
255           sudo chown {uid}:{gid} $WORKSPACE/results
256           sudo docker run --rm \
257             $volumes \
258             $env \
259             $published_ports \
260             -e S3_ENDPOINT_URL=https://storage.googleapis.com \
261             -e S3_DST_URL=s3://artifacts.opnfv.org/xtesting \
262             -e HTTP_DST_URL=http://artifacts.opnfv.org/xtesting \
263             -v /home/opnfv/xtesting/.boto:/etc/boto.cfg \
264             -e TEST_DB_URL=http://testresults.opnfv.org/test/api/v1/results \
265             -e TEST_DB_EXT_URL=http://testresults.opnfv.org/test/api/v1/results \
266             -e BUILD_TAG=$BUILD_TAG \
267             -v $WORKSPACE/../$JOB_NAME/results:/var/lib/xtesting/results \
268             $image zip_campaign
269
270 - job-template:
271     name: 'xtesting-pi-{tag}-zip'
272     parameters:
273       - xtesting-pi-node:
274           node: '{node}'
275       - xtesting-pi-build_tag:
276           build_tag: ''
277     builders:
278       - xtesting-pi-zip:
279           <<: *xtesting-pi-containers
280           volumes: '{volumes}'
281           env: '{env}'
282           uid: '{uid}'
283           gid: '{gid}'
284           published_ports: '{published_ports}'
285
286 - project:
287     name: 'xtesting-pi-{tag}-zip'
288     <<: *xtesting-pi-params
289     volumes:
290     env:
291     published_ports:
292     container: 'xtesting'
293     uid: 1000
294     gid: 1000
295     jobs:
296       - 'xtesting-pi-{tag}-zip'
297
298 - job-template:
299     name: 'xtesting-pi-{tag}-daily'
300     project-type: multijob
301     triggers:
302       - timed: '@daily'
303     parameters:
304       - xtesting-pi-node:
305           node: '{node}'
306       - xtesting-pi-build_tag:
307           build_tag: ''
308     # PyYAML and yamllint differ here
309     # see https://github.com/yaml/pyyaml/issues/234
310     # yamllint disable rule:indentation
311     properties:
312       - build-blocker:
313           blocking-jobs:
314           - ^xtesting-(pi-)*{tag}-(daily|docker|review)$
315     # yamllint enable rule:indentation
316     builders:
317       - multijob:
318           name: remove former images
319           projects:
320             - name: 'xtesting-pi-ollivier-xtesting-{tag}-rmi'
321               <<: *xtesting-pi-jobs
322       - multijob:
323           name: pull containers
324           projects:
325             - name: 'xtesting-pi-ollivier-xtesting-{tag}-pull'
326               <<: *xtesting-pi-jobs
327       - multijob:
328           name: ollivier/xtesting:{tag}
329           projects:
330             - name: 'xtesting-pi-ollivier-xtesting-{tag}-first-run'
331               <<: *xtesting-pi-jobs
332             - name: 'xtesting-pi-ollivier-xtesting-{tag}-second-run'
333               <<: *xtesting-pi-jobs
334             - name: 'xtesting-pi-ollivier-xtesting-{tag}-third-run'
335               <<: *xtesting-pi-jobs
336             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fourth-run'
337               <<: *xtesting-pi-jobs
338             - name: 'xtesting-pi-ollivier-xtesting-{tag}-fifth-run'
339               <<: *xtesting-pi-jobs
340             - name: 'xtesting-pi-ollivier-xtesting-{tag}-sixth-run'
341               <<: *xtesting-pi-jobs
342             - name: 'xtesting-pi-ollivier-xtesting-{tag}-eighth-run'
343               <<: *xtesting-pi-jobs
344             - name: 'xtesting-pi-ollivier-xtesting-{tag}-nineth-run'
345               <<: *xtesting-pi-jobs
346       - multijob:
347           name: dump all campaign data
348           projects:
349             - name: 'xtesting-pi-{tag}-zip'
350               <<: *xtesting-pi-jobs
351     publishers:
352       - email-ext:
353           failure: false
354           first-failure: true
355           fixed: true
356           recipients: cedric.ollivier@orange.com
357
358 - project:
359     name: 'xtesting-pi-daily'
360     <<: *xtesting-pi-params
361     jobs:
362       - 'xtesting-pi-{tag}-daily'
363
364 - view:
365     name: xtesting-pi
366     view-type: list
367     columns:
368       - status
369       - weather
370       - job
371       - last-success
372       - last-failure
373       - last-duration
374     regex: ^xtesting-pi-[a-z-0-9.]+-daily$