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