apex, yardstick: integrate yardstick into apex
[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: YARDSTICK_SUITE_NAME
89             default: opnfv_${{NODE_NAME}}_{loop}.yaml
90             description: 'Path to test suite'
91
92     scm:
93         - git-scm:
94             credentials-id: '{ssh-credentials}'
95             refspec: ''
96             branch: '{branch}'
97
98     builders:
99         - 'yardstick-cleanup'
100         - 'yardstick-fetch-os-creds'
101         - 'yardstick-daily'
102
103     publishers:
104         - email:
105             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
106
107 ########################
108 # builder macros
109 ########################
110 - builder:
111     name: yardstick-daily
112     builders:
113         - shell: |
114             #!/bin/bash
115             set -o errexit
116
117             echo "Yardstick: Run benchmark test suites ..."
118
119             # Pull the latest image
120             docker pull opnfv/yardstick
121
122             docker run \
123                --privileged=true \
124                 --rm \
125                 -t \
126                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
127                 -e "INSTALLER_IP=${INSTALLER_IP}" \
128                 -e "POD_NAME=${NODE_NAME}" \
129                 -e "EXTERNAL_NETWORK=${EXTERNAL_NETWORK}" \
130                 -e "YARDSTICK_BRANCH=${GERRIT_BRANCH}" \
131                 opnfv/yardstick \
132                 run_tests.sh $YARDSTICK_DB_BACKEND \
133                 $YARDSTICK_SUITE_NAME
134
135             echo "Yardstick: done!"
136
137 - builder:
138     name: yardstick-fetch-os-creds
139     builders:
140         - shell:
141             !include-raw ../../utils/fetch_os_creds.sh
142
143 - builder:
144     name: yardstick-cleanup
145     builders:
146         - shell: |
147             #!/bin/bash
148
149             echo "Cleaning up docker containers/images..."
150
151             # Remove previous running containers if exist
152             if [[ ! -z $(docker ps -a | grep opnfv/yardstick) ]]; then
153                 echo "Removing existing opnfv/yardstick containers..."
154                 docker ps | grep opnfv/yardstick | awk '{print $1}' | xargs docker stop
155                 docker ps -a | grep opnfv/yardstick | awk '{print $1}' | xargs docker rm
156             fi
157
158             # Remove existing images if exist
159             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
160                 echo "Docker images to remove:"
161                 docker images | head -1 && docker images | grep opnfv/yardstick
162                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
163                 for tag in "${image_tags[@]}"; do
164                     echo "Removing docker image opnfv/yardstick:$tag..."
165                     docker rmi opnfv/yardstick:$tag
166                 done
167             fi
168 ########################
169 # parameter macros
170 ########################
171 - parameter:
172     name: 'yardstick-params-intel-pod5'
173     parameters:
174         - string:
175             name: YARDSTICK_DB_BACKEND
176             default: ''
177             description: 'Arguments to use in order to choose the backend DB'
178
179 - parameter:
180     name: 'yardstick-params-intel-pod6'
181     parameters:
182         - string:
183             name: YARDSTICK_DB_BACKEND
184             default: ''
185             description: 'Arguments to use in order to choose the backend DB'
186
187 - parameter:
188     name: 'yardstick-params-intel-pod8'
189     parameters:
190         - string:
191             name: YARDSTICK_DB_BACKEND
192             default: ''
193             description: 'Arguments to use in order to choose the backend DB'
194
195 - parameter:
196     name: 'yardstick-params-ericsson-pod1'
197     parameters:
198         - string:
199             name: YARDSTICK_DB_BACKEND
200             default: ''
201             description: 'Arguments to use in order to choose the backend DB'
202
203 - parameter:
204     name: 'yardstick-params-ericsson-pod2'
205     parameters:
206         - string:
207             name: YARDSTICK_DB_BACKEND
208             default: ''
209             description: 'Arguments to use in order to choose the backend DB'
210 - parameter:
211     name: 'yardstick-params-opnfv-jump-1'
212     parameters:
213         - string:
214             name: YARDSTICK_DB_BACKEND
215             default: '-r 213.77.62.197/results'
216             description: 'Arguments to use in order to choose the backend DB'
217 - parameter:
218     name: 'yardstick-params-opnfv-jump-2'
219     parameters:
220         - string:
221             name: YARDSTICK_DB_BACKEND
222             default: '-r 213.77.62.197'
223             description: 'Arguments to use in order to choose the backend DB'
224
225 - parameter:
226     name: 'yardstick-params-huawei-us-deploy-bare-1'
227     parameters:
228         - string:
229             name: YARDSTICK_DB_BACKEND
230             default: ''
231             description: 'Arguments to use in order to choose the backend DB'
232
233 - parameter:
234     name: 'yardstick-params-zte-build-1'
235     parameters:
236         - string:
237             name: YARDSTICK_DB_BACKEND
238             default: ''
239             description: 'Arguments to use in order to choose the backend DB'
240
241 - parameter:
242     name: 'yardstick-params-orange-pod2'
243     parameters:
244         - string:
245             name: YARDSTICK_DB_BACKEND
246             default: ''
247             description: 'Arguments to use in order to choose the backend DB'