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