Adjust the trigger on zte-pod1.
[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-pod1:
112             installer: fuel
113             suite: daily
114             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
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         - huawei-sh-pod6:
147             installer: compass
148             suite: daily
149             auto-trigger-name: 'yardstick-daily-huawei-sh-pod6-trigger'
150             <<: *master
151         - virtual:
152             installer: joid
153             suite: daily
154             auto-trigger-name: 'brahmaputra-trigger-daily-disabled'
155             <<: *master
156 #--------------------------------
157
158     jobs:
159         - 'yardstick-{installer}-{pod}-{suite}-{stream}'
160
161 ################################
162 # job templates
163 ################################
164 - job-template:
165     name: 'yardstick-{installer}-{pod}-{suite}-{stream}'
166
167     disabled: false
168
169     concurrent: true
170
171     properties:
172         - throttle:
173             enabled: true
174             max-per-node: 1
175
176     wrappers:
177         - build-name:
178             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
179         - timeout:
180             timeout: 180
181             abort: true
182
183     triggers:
184         - '{auto-trigger-name}'
185
186     parameters:
187         - project-parameter:
188             project: '{project}'
189         - '{pod}-defaults'
190         - '{installer}-defaults'
191         - 'yardstick-params-{pod}'
192         - string:
193             name: DEPLOY_SCENARIO
194             default: 'os-odl_l2-nofeature-ha'
195         - string:
196             name: DOCKER_TAG
197             default: '{docker-tag}'
198             description: 'Tag to pull docker image'
199         - string:
200             name: YARDSTICK_SUITE_NAME
201             default: opnfv_${{NODE_NAME}}_{suite}.yaml
202             description: 'Path to test suite'
203         - string:
204             name: CI_DEBUG
205             default: 'false'
206             description: "Show debut output information"
207
208     scm:
209         - git-scm:
210             credentials-id: '{ssh-credentials}'
211             refspec: ''
212             branch: '{branch}'
213
214     builders:
215         - 'yardstick-cleanup'
216         #- 'yardstick-fetch-os-creds'
217         - 'yardstick-{suite}'
218
219     publishers:
220         - email:
221             recipients: ana.cunha@ericsson.com
222
223 ########################
224 # builder macros
225 ########################
226 - builder:
227     name: yardstick-daily
228     builders:
229         - shell: |
230             #!/bin/bash
231             set -e
232             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
233
234             # labconfig is used only for joid
235             labconfig=""
236             sshkey=""
237             if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
238                 instack_mac=$(sudo virsh domiflist instack | grep default | \
239                               grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
240                 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
241                 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
242                 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
243                     #note: this happens only in opnfv-lf-pod1
244                     sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
245                     sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
246                 fi
247             elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
248                 # If production lab then creds may be retrieved dynamically
249                 # creds are on the jumphost, always in the same folder
250                 labconfig="-v $LAB_CONFIG/admin-openrc:/home/opnfv/openrc"
251                 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
252                 # replace the default one by the customized one provided by jenkins config
253             fi
254
255             opts="--privileged=true --rm"
256             envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
257                 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
258                 -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
259
260             # Pull the latest image
261             docker pull opnfv/yardstick:$DOCKER_TAG >$redirect
262
263             # Run docker
264             cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick \
265                 run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
266             echo "Yardstick: Running docker cmd: ${cmd}"
267             ${cmd}
268
269             echo "Yardstick: done!"
270
271 - builder:
272     name: yardstick-vtcdaily
273     builders:
274         - shell: |
275             #!/bin/bash
276             set -e
277             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
278
279             cd $WORKSPACE
280             ./ci/apexlake-verify
281
282 - builder:
283     name: yardstick-fetch-os-creds
284     builders:
285         - shell:
286             !include-raw: ../../utils/fetch_os_creds.sh
287
288 - builder:
289     name: yardstick-cleanup
290     builders:
291         - shell: |
292             #!/bin/bash
293             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
294
295             echo "Cleaning up docker containers/images..."
296             # Remove previous running containers if exist
297             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
298                 echo "Removing existing opnfv/yardstick containers..."
299                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm -f >$redirect
300
301             fi
302
303             # Remove existing images if exist
304             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
305                 echo "Docker images to remove:"
306                 docker images | head -1 && docker images | grep opnfv/yardstick
307                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
308                 for tag in "${image_tags[@]}"; do
309                     echo "Removing docker image opnfv/yardstick:$tag..."
310                     docker rmi opnfv/yardstick:$tag >$redirect
311
312                 done
313             fi
314 ########################
315 # parameter macros
316 ########################
317 - parameter:
318     name: 'yardstick-params-intel-pod5'
319     parameters:
320         - string:
321             name: YARDSTICK_DB_BACKEND
322             default: '-i 104.197.68.199:8086'
323             description: 'Arguments to use in order to choose the backend DB'
324
325 - parameter:
326     name: 'yardstick-params-intel-pod6'
327     parameters:
328         - string:
329             name: YARDSTICK_DB_BACKEND
330             default: '-i 104.197.68.199:8086'
331             description: 'Arguments to use in order to choose the backend DB'
332
333 - parameter:
334     name: 'yardstick-params-intel-pod8'
335     parameters:
336         - string:
337             name: YARDSTICK_DB_BACKEND
338             default: ''
339             description: 'Arguments to use in order to choose the backend DB'
340
341 - parameter:
342     name: 'yardstick-params-ericsson-pod1'
343     parameters:
344         - string:
345             name: YARDSTICK_DB_BACKEND
346             default: '-i 104.197.68.199:8086'
347             description: 'Arguments to use in order to choose the backend DB'
348
349 - parameter:
350     name: 'yardstick-params-ericsson-pod2'
351     parameters:
352         - string:
353             name: YARDSTICK_DB_BACKEND
354             default: '-i 104.197.68.199:8086'
355             description: 'Arguments to use in order to choose the backend DB'
356
357 - parameter:
358     name: 'yardstick-params-opnfv-jump-1'
359     parameters:
360         - string:
361             name: YARDSTICK_DB_BACKEND
362             default: '-i 104.197.68.199:8086'
363             description: 'Arguments to use in order to choose the backend DB'
364
365 - parameter:
366     name: 'yardstick-params-opnfv-jump-2'
367     parameters:
368         - string:
369             name: YARDSTICK_DB_BACKEND
370             default: '-i 104.197.68.199:8086'
371             description: 'Arguments to use in order to choose the backend DB'
372
373 - parameter:
374     name: 'yardstick-params-huawei-us-deploy-bare-1'
375     parameters:
376         - string:
377             name: YARDSTICK_DB_BACKEND
378             default: '-i 104.197.68.199:8086'
379             description: 'Arguments to use in order to choose the backend DB'
380
381 - parameter:
382     name: 'yardstick-params-huawei-us-deploy-bare-2'
383     parameters:
384         - string:
385             name: YARDSTICK_DB_BACKEND
386             default: '-i 104.197.68.199:8086'
387             description: 'Arguments to use in order to choose the backend DB'
388
389 - parameter:
390     name: 'yardstick-params-zte-pod1'
391     parameters:
392         - string:
393             name: YARDSTICK_DB_BACKEND
394             default: '-i 104.197.68.199:8086'
395             description: 'Arguments to use in order to choose the backend DB'
396
397 - parameter:
398     name: 'yardstick-params-orange-pod2'
399     parameters:
400         - string:
401             name: YARDSTICK_DB_BACKEND
402             default: '-i 104.197.68.199:8086'
403             description: 'Arguments to use in order to choose the backend DB'
404
405 - parameter:
406     name: 'yardstick-params-virtual'
407     parameters:
408         - string:
409             name: YARDSTICK_DB_BACKEND
410             default: ''
411             description: 'Arguments to use in order to choose the backend DB'
412
413 - parameter:
414     name: 'yardstick-params-huawei-virtual'
415     parameters:
416         - string:
417             name: YARDSTICK_DB_BACKEND
418             default: ''
419             description: 'Arguments to use in order to choose the backend DB'
420
421 - parameter:
422     name: 'yardstick-params-huawei-sh-test-2'
423     parameters:
424         - string:
425             name: YARDSTICK_DB_BACKEND
426             default: ''
427             description: 'Arguments to use in order to choose the backend DB'
428
429 - parameter:
430     name: 'yardstick-params-huawei-sh-pod6'
431     parameters:
432         - string:
433             name: YARDSTICK_DB_BACKEND
434             default: ''
435             description: 'Arguments to use in order to choose the backend DB'
436
437 #######################
438 ## trigger macros
439 #######################
440 # trigger for PODs to only run yardstick test suites
441 - trigger:
442     name: 'yardstick-vtcdaily-ericsson-pod1-trigger'
443     triggers:
444         - timed: '0 1 * * *'
445
446 - trigger:
447     name: 'yardstick-daily-huawei-sh-test-2-trigger'
448     triggers:
449         - timed: '0 1 * * *'
450
451 - trigger:
452     name: 'yardstick-daily-huawei-sh-pod6-trigger'
453     triggers:
454         - timed: '0 1 * * *'