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