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