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