[compass] set timer and attach testing jobs to the new senario(centos)
[releng.git] / jjb / yardstick / yardstick-ci-jobs.yml
1 ###################################
2 # job configuration for functest
3 ###################################
4 - project:
5     name: yardstick
6
7     project: '{name}'
8
9 #--------------------------------
10 # BRANCH ANCHORS
11 #--------------------------------
12     master: &master
13         stream: master
14         branch: '{stream}'
15         gs-pathname: ''
16         docker-tag: 'latest'
17     brahmaputra: &brahmaputra
18         stream: brahmaputra
19         branch: 'stable/{stream}'
20         gs-pathname: '{stream}'
21         docker-tag: 'brahmaputra.1.0'
22 #--------------------------------
23 # POD, INSTALLER, AND BRANCH MAPPING
24 #--------------------------------
25 #        brahmaputra
26 #--------------------------------
27     pod:
28         - opnfv-jump-1:
29             installer: apex
30             suite: daily
31             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
32             <<: *brahmaputra
33         - opnfv-jump-2:
34             installer: fuel
35             suite: daily
36             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
37             <<: *brahmaputra
38         - intel-pod5:
39             installer: joid
40             suite: daily
41             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
42             <<: *brahmaputra
43         - orange-pod2:
44             installer: joid
45             suite: daily
46             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
47             <<: *brahmaputra
48         - huawei-us-deploy-bare-1:
49             installer: compass
50             suite: daily
51             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
52             <<: *brahmaputra
53         - ericsson-pod1:
54             installer: fuel
55             suite: daily
56             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
57             <<: *brahmaputra
58         - ericsson-pod2:
59             installer: fuel
60             suite: daily
61             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
62             <<: *brahmaputra
63         - virtual:
64             installer: fuel
65             suite: daily
66             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
67             <<: *brahmaputra
68         - huawei-virtual:
69             installer: compass
70             suite: daily
71             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
72             <<: *brahmaputra
73         - virtual:
74             installer: joid
75             suite: daily
76             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
77             <<: *brahmaputra
78 #--------------------------------
79 #        master
80 #--------------------------------
81         - opnfv-jump-2:
82             installer: fuel
83             suite: daily
84             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
85             <<: *master
86         - ericsson-pod1:
87             installer: fuel
88             suite: daily
89             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
90             <<: *master
91         - ericsson-pod1:
92             installer: fuel
93             suite: vtcdaily
94             auto-trigger-name: 'yardstick-vtcdaily-ericsson-pod1-trigger'
95             <<: *master
96         - ericsson-pod2:
97             installer: fuel
98             suite: daily
99             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
100             <<: *master
101         - intel-pod6:
102             installer: joid
103             suite: daily
104             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
105             <<: *master
106         - intel-pod8:
107             installer: compass
108             suite: daily
109             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
110             <<: *master
111         - zte-build-1:
112             installer: fuel
113             suite: daily
114             auto-trigger-name: 'yardstick-daily-zte-build-1-trigger'
115             <<: *master
116         - orange-pod2:
117             installer: joid
118             suite: daily
119             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
120             <<: *master
121         - opnfv-jump-1:
122             installer: apex
123             suite: daily
124             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
125             <<: *master
126         - huawei-us-deploy-bare-2:
127             installer: compass
128             suite: daily
129             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
130             <<: *master
131         - virtual:
132             installer: fuel
133             suite: daily
134             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
135             <<: *master
136         - huawei-virtual:
137             installer: compass
138             suite: daily
139             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
140             <<: *master
141         - huawei-sh-test-2:
142             installer: compass
143             suite: daily
144             auto-trigger-name: 'yardstick-daily-huawei-sh-test-2-trigger'
145             <<: *master
146         - virtual:
147             installer: joid
148             suite: daily
149             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
150             <<: *master
151 #--------------------------------
152
153     jobs:
154         - 'yardstick-{installer}-{pod}-{suite}-{stream}'
155
156 ################################
157 # job templates
158 ################################
159 - job-template:
160     name: 'yardstick-{installer}-{pod}-{suite}-{stream}'
161
162     disabled: false
163
164     concurrent: true
165
166     properties:
167         - throttle:
168             enabled: true
169             max-per-node: 1
170
171     wrappers:
172         - build-name:
173             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
174         - timeout:
175             timeout: 180
176             abort: true
177
178     triggers:
179         - '{auto-trigger-name}'
180
181     parameters:
182         - project-parameter:
183             project: '{project}'
184         - '{pod}-defaults'
185         - '{installer}-defaults'
186         - 'yardstick-params-{pod}'
187         - string:
188             name: DEPLOY_SCENARIO
189             default: 'os-odl_l2-nofeature-ha'
190         - string:
191             name: DOCKER_TAG
192             default: '{docker-tag}'
193             description: 'Tag to pull docker image'
194         - string:
195             name: YARDSTICK_SUITE_NAME
196             default: opnfv_${{NODE_NAME}}_{suite}.yaml
197             description: 'Path to test suite'
198         - string:
199             name: CI_DEBUG
200             default: 'false'
201             description: "Show debut output information"
202
203     scm:
204         - git-scm:
205             credentials-id: '{ssh-credentials}'
206             refspec: ''
207             branch: '{branch}'
208
209     builders:
210         - 'yardstick-cleanup'
211         #- 'yardstick-fetch-os-creds'
212         - 'yardstick-{suite}'
213
214     publishers:
215         - email:
216             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
217
218 ########################
219 # builder macros
220 ########################
221 - builder:
222     name: yardstick-daily
223     builders:
224         - shell: |
225             #!/bin/bash
226             set -e
227             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
228
229             # labconfig is used only for joid
230             labconfig=""
231             sshkey=""
232             if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
233                 instack_mac=$(sudo virsh domiflist instack | grep default | \
234                               grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
235                 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
236                 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
237                 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
238                     #note: this happens only in opnfv-lf-pod1
239                     sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
240                     sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
241                 fi
242             elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
243                 # If production lab then creds may be retrieved dynamically
244                 # creds are on the jumphost, always in the same folder
245                 labconfig="-v $LAB_CONFIG/admin-openrc:/home/opnfv/openrc"
246                 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
247                 # replace the default one by the customized one provided by jenkins config
248             fi
249
250             opts="--privileged=true --rm"
251             envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
252                 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
253                 -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
254
255             # Pull the latest image
256             docker pull opnfv/yardstick:$DOCKER_TAG >$redirect
257
258             # Run docker
259             cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick \
260                 run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
261             echo "Yardstick: Running docker cmd: ${cmd}"
262             ${cmd}
263
264             echo "Yardstick: done!"
265
266 - builder:
267     name: yardstick-vtcdaily
268     builders:
269         - shell: |
270             #!/bin/bash
271             set -e
272             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
273
274             cd $WORKSPACE
275             ./ci/apexlake-verify
276
277 - builder:
278     name: yardstick-fetch-os-creds
279     builders:
280         - shell:
281             !include-raw: ../../utils/fetch_os_creds.sh
282
283 - builder:
284     name: yardstick-cleanup
285     builders:
286         - shell: |
287             #!/bin/bash
288             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
289
290             echo "Cleaning up docker containers/images..."
291             # Remove previous running containers if exist
292             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
293                 echo "Removing existing opnfv/yardstick containers..."
294                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm -f >$redirect
295
296             fi
297
298             # Remove existing images if exist
299             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
300                 echo "Docker images to remove:"
301                 docker images | head -1 && docker images | grep opnfv/yardstick
302                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
303                 for tag in "${image_tags[@]}"; do
304                     echo "Removing docker image opnfv/yardstick:$tag..."
305                     docker rmi opnfv/yardstick:$tag >$redirect
306
307                 done
308             fi
309 ########################
310 # parameter macros
311 ########################
312 - parameter:
313     name: 'yardstick-params-intel-pod5'
314     parameters:
315         - string:
316             name: YARDSTICK_DB_BACKEND
317             default: '-i 104.197.68.199:8086'
318             description: 'Arguments to use in order to choose the backend DB'
319
320 - parameter:
321     name: 'yardstick-params-intel-pod6'
322     parameters:
323         - string:
324             name: YARDSTICK_DB_BACKEND
325             default: '-i 104.197.68.199:8086'
326             description: 'Arguments to use in order to choose the backend DB'
327
328 - parameter:
329     name: 'yardstick-params-intel-pod8'
330     parameters:
331         - string:
332             name: YARDSTICK_DB_BACKEND
333             default: ''
334             description: 'Arguments to use in order to choose the backend DB'
335
336 - parameter:
337     name: 'yardstick-params-ericsson-pod1'
338     parameters:
339         - string:
340             name: YARDSTICK_DB_BACKEND
341             default: '-i 104.197.68.199:8086'
342             description: 'Arguments to use in order to choose the backend DB'
343
344 - parameter:
345     name: 'yardstick-params-ericsson-pod2'
346     parameters:
347         - string:
348             name: YARDSTICK_DB_BACKEND
349             default: '-i 104.197.68.199:8086'
350             description: 'Arguments to use in order to choose the backend DB'
351
352 - parameter:
353     name: 'yardstick-params-opnfv-jump-1'
354     parameters:
355         - string:
356             name: YARDSTICK_DB_BACKEND
357             default: '-i 104.197.68.199:8086'
358             description: 'Arguments to use in order to choose the backend DB'
359
360 - parameter:
361     name: 'yardstick-params-opnfv-jump-2'
362     parameters:
363         - string:
364             name: YARDSTICK_DB_BACKEND
365             default: '-i 104.197.68.199:8086'
366             description: 'Arguments to use in order to choose the backend DB'
367
368 - parameter:
369     name: 'yardstick-params-huawei-us-deploy-bare-1'
370     parameters:
371         - string:
372             name: YARDSTICK_DB_BACKEND
373             default: '-i 104.197.68.199:8086'
374             description: 'Arguments to use in order to choose the backend DB'
375
376 - parameter:
377     name: 'yardstick-params-huawei-us-deploy-bare-2'
378     parameters:
379         - string:
380             name: YARDSTICK_DB_BACKEND
381             default: '-i 104.197.68.199:8086'
382             description: 'Arguments to use in order to choose the backend DB'
383
384 - parameter:
385     name: 'yardstick-params-zte-build-1'
386     parameters:
387         - string:
388             name: YARDSTICK_DB_BACKEND
389             default: ''
390             description: 'Arguments to use in order to choose the backend DB'
391
392 - parameter:
393     name: 'yardstick-params-orange-pod2'
394     parameters:
395         - string:
396             name: YARDSTICK_DB_BACKEND
397             default: '-i 104.197.68.199:8086'
398             description: 'Arguments to use in order to choose the backend DB'
399
400 - parameter:
401     name: 'yardstick-params-virtual'
402     parameters:
403         - string:
404             name: YARDSTICK_DB_BACKEND
405             default: ''
406             description: 'Arguments to use in order to choose the backend DB'
407
408 - parameter:
409     name: 'yardstick-params-huawei-virtual'
410     parameters:
411         - string:
412             name: YARDSTICK_DB_BACKEND
413             default: ''
414             description: 'Arguments to use in order to choose the backend DB'
415
416 - parameter:
417     name: 'yardstick-params-huawei-sh-test-2'
418     parameters:
419         - string:
420             name: YARDSTICK_DB_BACKEND
421             default: ''
422             description: 'Arguments to use in order to choose the backend DB'
423
424 #######################
425 ## trigger macros
426 #######################
427 # trigger for PODs to only run yardstick test suites
428 - trigger:
429     name: 'yardstick-daily-zte-build-1-trigger'
430     triggers:
431         - timed: '0 2 * * *'
432
433 - trigger:
434     name: 'yardstick-vtcdaily-ericsson-pod1-trigger'
435     triggers:
436         - timed: '0 1 * * *'
437
438 - trigger:
439     name: 'yardstick-daily-huawei-sh-test-2-trigger'
440     triggers:
441         - timed: '0 1 * * *'