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