Updates for yardstick docker image
[releng.git] / jjb / yardstick / yardstick.yml
1 - project:
2     name: yardstick
3
4     project: 'yardstick'
5
6     pod:
7         - lf:
8             node: 'opnfv-jump-2'
9             installer_type: 'fuel'
10             installer_ip: '10.20.0.2'
11         - ericsson:
12             node: 'yardstick-pod'
13             installer_type: 'fuel'
14             installer_ip: '10.20.0.2'
15
16     installer:
17         - fuel
18
19     jobs:
20         - 'yardstick-{installer}-{pod}-{stream}'
21         - 'yardstick-merge'
22         - 'yardstick-verify'
23
24     # stream:    branch with - in place of / (eg. stable-helium)
25     # branch:    branch (eg. stable/helium)
26     stream:
27         - master:
28             branch: 'master'
29
30 - job-template:
31     name: 'yardstick-verify'
32
33     node: ericsson-build
34
35     parameters:
36         - project-parameter:
37             project: '{project}'
38         - gerrit-parameter:
39             branch: 'master'
40         - string:
41             name: GIT_BASE
42             default: https://gerrit.opnfv.org/gerrit/$PROJECT
43             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
44
45     scm:
46         - gerrit-trigger-scm:
47             credentials-id: '{ssh-credentials}'
48             refspec: '$GERRIT_REFSPEC'
49             choosing-strategy: 'gerrit'
50
51     triggers:
52         - gerrit:
53             trigger-on:
54                 - patchset-created-event:
55                     exclude-drafts: 'false'
56                     exclude-trivial-rebase: 'false'
57                     exclude-no-code-change: 'false'
58                 - draft-published-event
59                 - comment-added-contains-event:
60                     comment-contains-value: 'recheck'
61                 - comment-added-contains-event:
62                     comment-contains-value: 'reverify'
63             projects:
64               - project-compare-type: 'ANT'
65                 project-pattern: 'yardstick'
66                 branches:
67                   - branch-compare-type: 'ANT'
68                     branch-pattern: '**/master'
69
70     builders:
71         - shell: |
72             #!/bin/bash
73             set -o errexit
74             set -o pipefail
75
76             echo "Running unit tests..."
77             cd $WORKSPACE
78             virtualenv $WORKSPACE/yardstick_venv
79             source $WORKSPACE/yardstick_venv/bin/activate
80             easy_install -U setuptools
81             python setup.py develop
82             ./run_tests.sh
83             deactivate
84
85 - job-template:
86     name: 'yardstick-merge'
87
88     # builder-merge job to run JJB update
89     #
90     # This job's purpose is to update all the JJB
91
92     node: ericsson-build
93
94     parameters:
95         - project-parameter:
96             project: '{project}'
97         - gerrit-parameter:
98             branch: 'master'
99         - string:
100             name: GIT_BASE
101             default: https://gerrit.opnfv.org/gerrit/$PROJECT
102             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
103
104     scm:
105         - gerrit-trigger-scm:
106             credentials-id: '{ssh-credentials}'
107             refspec: ''
108             choosing-strategy: 'default'
109
110     triggers:
111         - gerrit:
112             trigger-on:
113                 - change-merged-event
114                 - comment-added-contains-event:
115                     comment-contains-value: 'remerge'
116             projects:
117               - project-compare-type: 'ANT'
118                 project-pattern: 'yardstick'
119                 branches:
120                     - branch-compare-type: 'ANT'
121                       branch-pattern: '**/master'
122
123     builders:
124         - shell: |
125             #!/bin/bash
126             set -o errexit
127             set -o pipefail
128
129             echo "Running unit tests..."
130             cd $WORKSPACE
131             virtualenv $WORKSPACE/yardstick_venv
132             source $WORKSPACE/yardstick_venv/bin/activate
133             easy_install -U setuptools
134             python setup.py develop
135             ./run_tests.sh
136             deactivate
137
138 - job-template:
139     name: 'yardstick-{installer}-{pod}-{stream}'
140
141     disabled: false
142
143     node: '{node}'
144
145     parameters:
146         - project-parameter:
147             project: '{project}'
148         - '{pod}-parameters'
149         - string:
150             name: POD_NAME
151             default: '{pod}'
152             description: "POD where the job runs"
153         - string:
154             name: INSTALLER_TYPE
155             default: '{installer_type}'
156             description: "Installer name that is used for deployment."
157         - string:
158             name: INSTALLER_IP
159             default: '{installer_ip}'
160             description: "Installer IP."
161
162     scm:
163         - git-scm:
164             credentials-id: '{ssh-credentials}'
165             refspec: ''
166             branch: master
167
168     triggers:
169         - 'yardstick-trigger-{pod}'
170
171     builders:
172         - 'yardstick-fetch-os-creds'
173         - 'yardstick-daily'
174
175     publishers:
176         - email:
177             recipients: ana.cunha@ericsson.com jorgen.w.karlsson@ericsson.com
178
179 ########################
180 # builder macros
181 ########################
182 - builder:
183     name: yardstick-daily
184     builders:
185         - shell: |
186             #!/bin/bash
187             set -o errexit
188
189             echo "Yardstick: Run benchmark test suites ..."
190
191             # Remove old containers
192             docker ps | grep opnfv/yardstick |\
193                 awk '{print $1}' | xargs -r docker stop &>/dev/null
194             docker ps -a | grep opnfv/yardstick |\
195                 awk '{print $1}' | xargs -r  docker rm &>/dev/null
196
197             # Remove existing images if exist
198             if [[ ! -z $(docker images | grep opnfv/yardstick) ]]; then
199                 echo "Docker images to remove:"
200                 docker images | head -1 && docker images | grep opnfv/yardstick
201                 image_tags=($(docker images | grep opnfv/yardstick | awk '{print $2}'))
202                 for tag in "${image_tags[@]}"; do
203                     echo "Removing docker image opnfv/yardstick:$tag..."
204                     docker rmi opnfv/yardstick:$tag
205                 done
206             fi
207
208             # Make sure we have latest image
209             docker pull opnfv/yardstick
210
211             # Test suites to run
212             TEST_SUITES=opnfv_${POD_NAME}_daily.yaml
213
214             docker run \
215                --privileged=true \
216                 --rm \
217                 -t \
218                 -e "INSTALLER_TYPE=${INSTALLER_TYPE}" \
219                 -e "INSTALLER_IP=${INSTALLER_IP}" \
220                 -e "POD_NAME=${POD_NAME}" \
221                 -e "EXTERNAL_NETWORK=net04_ext" \
222                 opnfv/yardstick \
223                 run_tests.sh \
224                 $TEST_SUITES
225
226             echo "Yardstick: done!"
227
228 - builder:
229     name: yardstick-fetch-os-creds
230     builders:
231         - shell:
232             !include-raw ../../utils/fetch_os_creds.sh
233
234 ########################
235 # parameter macros
236 ########################
237 - parameter:
238     name: 'ericsson-parameters'
239     parameters:
240         - string:
241             name: GIT_BASE
242             default: https://gerrit.opnfv.org/gerrit/$PROJECT
243             description: "Used for overriding the GIT URL coming from Global Jenkins configuration in case if the stuff is done on none-LF HW."
244
245 - parameter:
246     name: 'lf-parameters'
247     parameters:
248         - string:
249             name: GIT_BASE
250             default: ssh://gerrit.opnfv.org:29418/$PROJECT
251             description: "URL for LF POD"
252
253 ########################
254 # trigger macros
255 ########################
256 - trigger:
257     name: 'yardstick-trigger-ericsson'
258     triggers:
259         - timed: '@midnight'
260
261 - trigger:
262     name: 'yardstick-trigger-lf'
263     triggers:
264         - timed: '#@midnight'