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