Merge "xci: Enable yardstick"
[releng.git] / jjb / xci / xci-daily-jobs.yaml
1 ---
2 - project:
3     project: 'releng-xci'
4
5     name: 'xci-daily'
6
7     # -------------------------------
8     # Branch Anchors
9     # -------------------------------
10     master: &master
11       stream: master
12       opnfv-releng-version: master
13       gs-pathname: ''
14
15     # -------------------------------
16     # Scenarios
17     # -------------------------------
18     scenario:
19       - 'os-nosdn-nofeature-noha':
20           auto-trigger-name: 'daily-trigger-disabled'
21           deploy-scenario: 'os-nosdn-nofeature'
22           installer-type: 'osa'
23           xci-flavor: 'mini'
24       - 'os-nosdn-osm-noha':
25           auto-trigger-name: 'daily-trigger-disabled'
26           deploy-scenario: 'os-nosdn-osm'
27           installer-type: 'osa'
28           xci-flavor: 'mini'
29       - 'os-odl-nofeature-noha':
30           auto-trigger-name: 'daily-trigger-disabled'
31           deploy-scenario: 'os-odl-nofeature'
32           installer-type: 'osa'
33           xci-flavor: 'mini'
34       - 'os-odl-bgpvpn-noha':
35           auto-trigger-name: 'daily-trigger-disabled'
36           deploy-scenario: 'os-odl-bgpvpn'
37           installer-type: 'osa'
38           xci-flavor: 'mini'
39       - 'os-odl-sfc-noha':
40           auto-trigger-name: 'daily-trigger-disabled'
41           deploy-scenario: 'os-odl-sfc'
42           installer-type: 'osa'
43           xci-flavor: 'mini'
44       - 'k8-nosdn-nofeature-noha':
45           auto-trigger-name: 'daily-trigger-disabled'
46           deploy-scenario: 'k8-nosdn-nofeature'
47           installer-type: 'kubespray'
48           xci-flavor: 'mini'
49       - 'k8-canal-nofeature-noha':
50           auto-trigger-name: 'daily-trigger-disabled'
51           deploy-scenario: 'k8-canal-nofeature'
52           installer-type: 'kubespray'
53           xci-flavor: 'mini'
54       - 'k8-calico-nofeature-noha':
55           auto-trigger-name: 'daily-trigger-disabled'
56           deploy-scenario: 'k8-calico-nofeature'
57           installer-type: 'kubespray'
58           xci-flavor: 'mini'
59       - 'k8-contiv-nofeature-noha':
60           auto-trigger-name: 'daily-trigger-disabled'
61           deploy-scenario: 'k8-contiv-nofeature'
62           installer-type: 'kubespray'
63           xci-flavor: 'mini'
64       - 'k8-flannel-nofeature-noha':
65           auto-trigger-name: 'daily-trigger-disabled'
66           deploy-scenario: 'k8-flannel-nofeature'
67           installer-type: 'kubespray'
68           xci-flavor: 'mini'
69       - 'k8-nosdn-istio-noha':
70           auto-trigger-name: 'daily-trigger-disabled'
71           deploy-scenario: 'k8-nosdn-istio'
72           installer-type: 'kubespray'
73           xci-flavor: 'mini'
74
75     # -------------------------------
76     # XCI PODs
77     # -------------------------------
78     pod:
79       - virtual:
80           <<: *master
81
82     # -------------------------------
83     # Supported Distros
84     # -------------------------------
85     distro:
86       - 'ubuntu':
87           disabled: false
88           slave-label: xci-virtual
89       - 'centos':
90           disabled: true
91           slave-label: xci-virtual
92       - 'opensuse':
93           disabled: false
94           slave-label: xci-virtual
95
96     # -------------------------------
97     #        Phases
98     # -------------------------------
99     phase:
100       - 'deploy'
101       - 'functest'
102       - 'yardstick'
103
104     # -------------------------------
105     # jobs
106     # -------------------------------
107     jobs:
108       - 'xci-{scenario}-{pod}-{distro}-daily-{stream}'
109       - 'xci-{phase}-{pod}-{distro}-daily-{stream}'
110
111 # -------------------------------
112 # job templates
113 # -------------------------------
114 - job-template:
115     name: 'xci-{scenario}-{pod}-{distro}-daily-{stream}'
116
117     disabled: '{obj:disabled}'
118
119     concurrent: false
120
121     properties:
122       - build-blocker:
123           use-build-blocker: true
124           blocking-jobs:
125             - '^xci-verify.*'
126             - '^xci-merge.*'
127             - '^xci-os.*'
128             - '^xci-k8.*'
129             - '^xci-deploy.*'
130             - '^xci-functest.*'
131             - '^bifrost-.*periodic.*'
132             - '^osa-.*periodic.*'
133           block-level: 'NODE'
134       - logrotate-default
135
136     parameters:
137       - string:
138           name: DEPLOY_SCENARIO
139           default: '{deploy-scenario}'
140       - string:
141           name: INSTALLER_TYPE
142           default: '{installer-type}'
143       - string:
144           name: XCI_FLAVOR
145           default: '{xci-flavor}'
146       - label:
147           name: SLAVE_LABEL
148           default: '{slave-label}'
149       - string:
150           name: XCI_DISTRO
151           default: '{distro}'
152       - string:
153           name: FUNCTEST_MODE
154           default: 'tier'
155       - string:
156           name: FUNCTEST_SUITE_NAME
157           default: 'healthcheck'
158       - string:
159           name: CI_LOOP
160           default: 'daily'
161       - string:
162           name: GIT_BASE
163           default: https://gerrit.opnfv.org/gerrit/$PROJECT
164           description: 'Git URL to use on this Jenkins Slave'
165
166     triggers:
167       - '{auto-trigger-name}'
168
169     wrappers:
170       - ssh-agent-wrapper
171       - build-timeout:
172           timeout: 240
173       - fix-workspace-permissions
174
175     builders:
176       - description-setter:
177           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
178       - trigger-builds:
179           - project: 'xci-deploy-{pod}-{distro}-daily-{stream}'
180             current-parameters: false
181             predefined-parameters: |
182               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
183               INSTALLER_TYPE=$INSTALLER_TYPE
184               XCI_FLAVOR=$XCI_FLAVOR
185               CI_LOOP=$CI_LOOP
186               XCI_DISTRO=$XCI_DISTRO
187             same-node: true
188             block: true
189       - trigger-builds:
190           - project: 'xci-functest-{pod}-{distro}-daily-{stream}'
191             current-parameters: false
192             predefined-parameters: |
193               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
194               INSTALLER_TYPE=$INSTALLER_TYPE
195               XCI_FLAVOR=$XCI_FLAVOR
196               CI_LOOP=$CI_LOOP
197               XCI_DISTRO=$XCI_DISTRO
198               FUNCTEST_MODE=$FUNCTEST_MODE
199               FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
200             same-node: true
201             block: true
202             block-thresholds:
203               build-step-failure-threshold: 'never'
204               failure-threshold: 'never'
205               unstable-threshold: 'FAILURE'
206       - trigger-builds:
207           - project: 'xci-yardstick-{pod}-{distro}-daily-{stream}'
208             current-parameters: false
209             predefined-parameters: |
210               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
211               INSTALLER_TYPE=$INSTALLER_TYPE
212               XCI_FLAVOR=$XCI_FLAVOR
213               CI_LOOP=$CI_LOOP
214               XCI_DISTRO=$XCI_DISTRO
215             same-node: true
216             block: true
217             block-thresholds:
218               build-step-failure-threshold: 'never'
219               failure-threshold: 'never'
220               unstable-threshold: 'FAILURE'
221
222     publishers:
223       # yamllint disable rule:line-length
224       # yamllint enable rule:line-length
225       - email-jenkins-admins-on-failure
226
227 - job-template:
228     name: 'xci-{phase}-{pod}-{distro}-daily-{stream}'
229
230     disabled: false
231
232     concurrent: true
233
234     properties:
235       - build-blocker:
236           use-build-blocker: true
237           blocking-jobs:
238             - '^xci-verify.*'
239             - '^xci-merge.*'
240             - '^xci-deploy.*'
241             - '^xci-functest.*'
242             - '^bifrost-.*periodic.*'
243             - '^osa-.*periodic.*'
244           block-level: 'NODE'
245       - throttle:
246           enabled: true
247           max-per-node: 1
248           option: 'project'
249       - logrotate-default
250
251     wrappers:
252       - ssh-agent-wrapper
253       - build-timeout:
254           timeout: 240
255       - fix-workspace-permissions
256
257     scm:
258       - git-scm
259
260     parameters:
261       - project-parameter:
262           project: '{project}'
263           branch: '{opnfv-releng-version}'
264       - string:
265           name: DEPLOY_SCENARIO
266           default: 'os-nosdn-nofeature-noha'
267       - string:
268           name: INSTALLER_TYPE
269           default: 'osa'
270       - string:
271           name: XCI_FLAVOR
272           default: 'mini'
273       - string:
274           name: XCI_DISTRO
275           default: 'ubuntu'
276       - label:
277           name: SLAVE_LABEL
278           default: '{slave-label}'
279       - string:
280           name: FUNCTEST_MODE
281           default: 'tier'
282       - string:
283           name: FUNCTEST_SUITE_NAME
284           default: 'healthcheck'
285       - string:
286           name: CI_LOOP
287           default: 'daily'
288       - string:
289           name: GIT_BASE
290           default: https://gerrit.opnfv.org/gerrit/$PROJECT
291
292     builders:
293       - description-setter:
294           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
295       - 'xci-daily-{phase}-macro'
296
297 # --------------------------
298 # builder macros
299 # --------------------------
300 # These need to be properly fixed once the basic deployment, functest, and
301 # yardstick jobs are working outside of clean vm.
302 # One of the ugly fixes is moving test  preparation step into the
303 # deployment job itself since test preparation requires some of the
304 # things from deployment job. With clean VM, this wasn't an issue
305 # since everything was on clean VM. When we move things out of clean
306 # VM, things are done in workspaces of the jobs that are different.
307 #
308 # Apart from these things, we will need to go through the scripts
309 # used for verify jobs and make them updated in order to be able to
310 # use them for jobs that don't use clean VM.
311 - builder:
312     name: 'xci-daily-deploy-macro'
313     builders:
314       - shell: |
315           #!/bin/bash
316           set -o errexit
317           set -o pipefail
318
319           echo "Cleaning the leftovers from the earlier run"
320           echo "---------------------------------------------------------------------------------"
321           for vm in $(sudo virsh list --all --name | grep -v xci_vm); do
322               echo "Removing $vm"
323               sudo virsh destroy $vm > /dev/null 2>&1 || true
324               sudo virsh undefine $vm > /dev/null 2>&1 || true
325           done
326           echo "---------------------------------------------------------------------------------"
327
328           cd $WORKSPACE/xci && ./xci-deploy.sh
329
330           echo "Prepare OPNFV VM for Tests"
331           echo "---------------------------------------------------------------------------------"
332           export XCI_PATH=$WORKSPACE
333           export XCI_VENV=${XCI_PATH}/venv
334           source $XCI_VENV/bin/activate
335           while read var; do
336               declare -x "\${var}" 2>/dev/null
337               echo $var
338           done < ${XCI_PATH}/.cache/xci.env && cd ${XCI_PATH}/xci && \
339           ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-tests.yml
340           ssh root@192.168.122.2 "/root/prepare-tests.sh"
341           echo "---------------------------------------------------------------------------------"
342
343 - builder:
344     name: 'xci-daily-functest-macro'
345     builders:
346       - shell: |
347           #!/bin/bash
348           set -o errexit
349           set -o pipefail
350
351           ssh root@192.168.122.2 "/root/run-functest.sh"
352 - builder:
353     name: 'xci-daily-yardstick-macro'
354     builders:
355       - shell: |
356           #!/bin/bash
357           set -o errexit
358           set -o pipefail
359
360           ssh root@192.168.122.2 "/root/run-yardstick.sh"