test: Set DEPLOY_SCENARIO to Arno scenario by default
[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             <<: *brahmaputra
29         - opnfv-jump-2:
30             installer: fuel
31             <<: *brahmaputra
32         - intel-pod5:
33             installer: joid
34             <<: *brahmaputra
35         - huawei-us-deploy-bare-1:
36             installer: compass
37             <<: *brahmaputra
38 #--------------------------------
39 #        master
40 #--------------------------------
41         - ericsson-pod1:
42             installer: fuel
43             <<: *master
44         - ericsson-pod2:
45             installer: fuel
46             <<: *master
47         - intel-pod6:
48             installer: joid
49             <<: *master
50         - intel-pod8:
51             installer: compass
52             <<: *master
53         - zte-build-1:
54             installer: fuel
55             <<: *master
56         - orange-pod2:
57             installer: joid
58             <<: *master
59         - opnfv-jump-1:
60             installer: apex
61             <<: *master
62 #--------------------------------
63     loop:
64         - daily
65
66     jobs:
67         - 'yardstick-{installer}-{pod}-{loop}-{stream}'
68
69 ################################
70 # job templates
71 ################################
72 - job-template:
73     name: 'yardstick-{installer}-{pod}-{loop}-{stream}'
74
75     disabled: false
76
77     wrappers:
78         - build-name:
79             name: '$BUILD_NUMBER - Scenario: $DEPLOY_SCENARIO'
80
81     parameters:
82         - project-parameter:
83             project: '{project}'
84         - '{pod}-defaults'
85         - '{installer}-defaults'
86         - 'yardstick-params-{pod}'
87         - string:
88             name: DEPLOY_SCENARIO
89             default: 'os-odl_l2-nofeature-ha'
90         - string:
91             name: YARDSTICK_SUITE_NAME
92             default: opnfv_${{NODE_NAME}}_{loop}.yaml
93             description: 'Path to test suite'
94         - string:
95             name: CI_DEBUG
96             default: 'false'
97             description: "Show debut output information"
98
99     scm:
100         - git-scm:
101             credentials-id: '{ssh-credentials}'
102             refspec: ''
103             branch: '{branch}'
104
105     builders:
106         - 'yardstick-cleanup'
107         #- 'yardstick-fetch-os-creds'
108         - 'yardstick-daily'
109
110     publishers:
111         - email:
112             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
113
114 ########################
115 # builder macros
116 ########################
117 - builder:
118     name: yardstick-daily
119     builders:
120         - shell: |
121             #!/bin/bash
122             set -e
123             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
124
125             # labconfig is used only for joid
126             labconfig=""
127             sshkey=""
128             if [[ ${INSTALLER_TYPE} == 'apex' ]]; then
129                 instack_mac=$(sudo virsh domiflist instack | grep default | \
130                               grep -Eo "[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+:[0-9a-f]+")
131                 INSTALLER_IP=$(/usr/sbin/arp -e | grep ${instack_mac} | awk {'print $1'})
132                 sshkey="-v /root/.ssh/id_rsa:/root/.ssh/id_rsa"
133                 if [[ -n $(sudo iptables -L FORWARD |grep "REJECT"|grep "reject-with icmp-port-unreachable") ]]; then
134                     #note: this happens only in opnfv-lf-pod1
135                     sudo iptables -D FORWARD -o virbr0 -j REJECT --reject-with icmp-port-unreachable
136                     sudo iptables -D FORWARD -i virbr0 -j REJECT --reject-with icmp-port-unreachable
137                 fi
138             elif [[ ${INSTALLER_TYPE} == 'joid' ]]; then
139                 # If production lab then creds may be retrieved dynamically
140                 # creds are on the jumphost, always in the same folder
141                 labconfig="-v $LAB_CONFIG/admin-openrc:/home/opnfv/openrc"
142                 # If dev lab, credentials may not be the default ones, just provide a path to put them into docker
143                 # replace the default one by the customized one provided by jenkins config
144             fi
145
146             opts="--privileged=true --rm"
147             envs="-e INSTALLER_TYPE=${INSTALLER_TYPE} -e INSTALLER_IP=${INSTALLER_IP} \
148                 -e NODE_NAME=${NODE_NAME} -e EXTERNAL_NETWORK=${EXTERNAL_NETWORK} \
149                 -e YARDSTICK_BRANCH=${GIT_BRANCH##origin/} -e DEPLOY_SCENARIO=${DEPLOY_SCENARIO}"
150
151             # Pull the latest image
152             docker pull opnfv/yardstick >$redirect
153
154             # Run docker
155             cmd="sudo docker run ${opts} ${envs} ${labconfig} ${sshkey} opnfv/yardstick \
156                 run_tests.sh ${YARDSTICK_DB_BACKEND} ${YARDSTICK_SUITE_NAME}"
157             echo "Yardstick: Running docker cmd: ${cmd}"
158             ${cmd}
159
160             echo "Yardstick: done!"
161
162 - builder:
163     name: yardstick-fetch-os-creds
164     builders:
165         - shell:
166             !include-raw: ../../utils/fetch_os_creds.sh
167
168 - builder:
169     name: yardstick-cleanup
170     builders:
171         - shell: |
172             #!/bin/bash
173             [[ $CI_DEBUG == true ]] && redirect="/dev/stdout" || redirect="/dev/null"
174
175             echo "Cleaning up docker containers/images..."
176             # Remove previous running containers if exist
177             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
178                 echo "Removing existing opnfv/yardstick containers..."
179                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm -f >$redirect
180
181             fi
182
183             # Remove existing images if exist
184             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
185                 echo "Docker images to remove:"
186                 docker images | head -1 && docker images | grep opnfv/yardstick
187                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
188                 for tag in "${image_tags[@]}"; do
189                     echo "Removing docker image opnfv/yardstick:$tag..."
190                     docker rmi opnfv/yardstick:$tag >$redirect
191
192                 done
193             fi
194 ########################
195 # parameter macros
196 ########################
197 - parameter:
198     name: 'yardstick-params-intel-pod5'
199     parameters:
200         - string:
201             name: YARDSTICK_DB_BACKEND
202             default: ''
203             description: 'Arguments to use in order to choose the backend DB'
204
205 - parameter:
206     name: 'yardstick-params-intel-pod6'
207     parameters:
208         - string:
209             name: YARDSTICK_DB_BACKEND
210             default: ''
211             description: 'Arguments to use in order to choose the backend DB'
212
213 - parameter:
214     name: 'yardstick-params-intel-pod8'
215     parameters:
216         - string:
217             name: YARDSTICK_DB_BACKEND
218             default: ''
219             description: 'Arguments to use in order to choose the backend DB'
220
221 - parameter:
222     name: 'yardstick-params-ericsson-pod1'
223     parameters:
224         - string:
225             name: YARDSTICK_DB_BACKEND
226             default: '-i 10.118.36.90:8086'
227             description: 'Arguments to use in order to choose the backend DB'
228
229 - parameter:
230     name: 'yardstick-params-ericsson-pod2'
231     parameters:
232         - string:
233             name: YARDSTICK_DB_BACKEND
234             default: '-i 10.118.36.90:8086'
235             description: 'Arguments to use in order to choose the backend DB'
236 - parameter:
237     name: 'yardstick-params-opnfv-jump-1'
238     parameters:
239         - string:
240             name: YARDSTICK_DB_BACKEND
241             default: '-r 213.77.62.197/results'
242             description: 'Arguments to use in order to choose the backend DB'
243 - parameter:
244     name: 'yardstick-params-opnfv-jump-2'
245     parameters:
246         - string:
247             name: YARDSTICK_DB_BACKEND
248             default: '-r 213.77.62.197/results'
249             description: 'Arguments to use in order to choose the backend DB'
250
251 - parameter:
252     name: 'yardstick-params-huawei-us-deploy-bare-1'
253     parameters:
254         - string:
255             name: YARDSTICK_DB_BACKEND
256             default: ''
257             description: 'Arguments to use in order to choose the backend DB'
258
259 - parameter:
260     name: 'yardstick-params-zte-build-1'
261     parameters:
262         - string:
263             name: YARDSTICK_DB_BACKEND
264             default: ''
265             description: 'Arguments to use in order to choose the backend DB'
266
267 - parameter:
268     name: 'yardstick-params-orange-pod2'
269     parameters:
270         - string:
271             name: YARDSTICK_DB_BACKEND
272             default: ''
273             description: 'Arguments to use in order to choose the backend DB'