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