xci: Pass functest tier and suite to downstream jobs
[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               FUNCTEST_MODE=$FUNCTEST_MODE
188               FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
189             same-node: true
190             block: true
191       - trigger-builds:
192           - project: 'xci-functest-{pod}-{distro}-daily-{stream}'
193             current-parameters: false
194             predefined-parameters: |
195               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
196               INSTALLER_TYPE=$INSTALLER_TYPE
197               XCI_FLAVOR=$XCI_FLAVOR
198               CI_LOOP=$CI_LOOP
199               XCI_DISTRO=$XCI_DISTRO
200               FUNCTEST_MODE=$FUNCTEST_MODE
201               FUNCTEST_SUITE_NAME=$FUNCTEST_SUITE_NAME
202             same-node: true
203             block: true
204             block-thresholds:
205               build-step-failure-threshold: 'never'
206               failure-threshold: 'never'
207               unstable-threshold: 'FAILURE'
208       - trigger-builds:
209           - project: 'xci-yardstick-{pod}-{distro}-daily-{stream}'
210             current-parameters: false
211             predefined-parameters: |
212               DEPLOY_SCENARIO=$DEPLOY_SCENARIO
213               INSTALLER_TYPE=$INSTALLER_TYPE
214               XCI_FLAVOR=$XCI_FLAVOR
215               CI_LOOP=$CI_LOOP
216               XCI_DISTRO=$XCI_DISTRO
217             same-node: true
218             block: true
219             block-thresholds:
220               build-step-failure-threshold: 'never'
221               failure-threshold: 'never'
222               unstable-threshold: 'FAILURE'
223
224     publishers:
225       # yamllint disable rule:line-length
226       # yamllint enable rule:line-length
227       - email-jenkins-admins-on-failure
228
229 - job-template:
230     name: 'xci-{phase}-{pod}-{distro}-daily-{stream}'
231
232     disabled: false
233
234     concurrent: true
235
236     properties:
237       - build-blocker:
238           use-build-blocker: true
239           blocking-jobs:
240             - '^xci-verify.*'
241             - '^xci-merge.*'
242             - '^xci-deploy.*'
243             - '^xci-functest.*'
244             - '^bifrost-.*periodic.*'
245             - '^osa-.*periodic.*'
246           block-level: 'NODE'
247       - throttle:
248           enabled: true
249           max-per-node: 1
250           option: 'project'
251       - logrotate-default
252
253     wrappers:
254       - ssh-agent-wrapper
255       - build-timeout:
256           timeout: 240
257       - fix-workspace-permissions
258
259     scm:
260       - git-scm
261
262     parameters:
263       - project-parameter:
264           project: '{project}'
265           branch: '{opnfv-releng-version}'
266       - string:
267           name: DEPLOY_SCENARIO
268           default: 'os-nosdn-nofeature-noha'
269       - string:
270           name: INSTALLER_TYPE
271           default: 'osa'
272       - string:
273           name: XCI_FLAVOR
274           default: 'mini'
275       - string:
276           name: XCI_DISTRO
277           default: 'ubuntu'
278       - label:
279           name: SLAVE_LABEL
280           default: '{slave-label}'
281       - string:
282           name: FUNCTEST_MODE
283           default: 'tier'
284       - string:
285           name: FUNCTEST_SUITE_NAME
286           default: 'healthcheck'
287       - string:
288           name: CI_LOOP
289           default: 'daily'
290       - string:
291           name: GIT_BASE
292           default: https://gerrit.opnfv.org/gerrit/$PROJECT
293
294     builders:
295       - description-setter:
296           description: "Scenario: $DEPLOY_SCENARIO | Node: $NODE_NAME"
297       - 'xci-daily-{phase}-macro'
298
299 # --------------------------
300 # builder macros
301 # --------------------------
302 # These need to be properly fixed once the basic deployment, functest, and
303 # yardstick jobs are working outside of clean vm.
304 # One of the ugly fixes is moving test  preparation step into the
305 # deployment job itself since test preparation requires some of the
306 # things from deployment job. With clean VM, this wasn't an issue
307 # since everything was on clean VM. When we move things out of clean
308 # VM, things are done in workspaces of the jobs that are different.
309 #
310 # Apart from these things, we will need to go through the scripts
311 # used for verify jobs and make them updated in order to be able to
312 # use them for jobs that don't use clean VM.
313 - builder:
314     name: 'xci-daily-deploy-macro'
315     builders:
316       - shell: |
317           #!/bin/bash
318           set -o errexit
319           set -o pipefail
320
321           echo "Cleaning the leftovers from the earlier run"
322           echo "---------------------------------------------------------------------------------"
323           for vm in $(sudo virsh list --all --name | grep -v xci_vm); do
324               echo "Removing $vm"
325               sudo virsh destroy $vm > /dev/null 2>&1 || true
326               sudo virsh undefine $vm > /dev/null 2>&1 || true
327           done
328           echo "---------------------------------------------------------------------------------"
329
330           cd $WORKSPACE/xci && ./xci-deploy.sh
331
332           echo "Prepare OPNFV VM for Tests"
333           echo "---------------------------------------------------------------------------------"
334           export XCI_PATH=$WORKSPACE
335           export XCI_VENV=${XCI_PATH}/venv
336           source $XCI_VENV/bin/activate
337           while read var; do
338               declare -x "\${var}" 2>/dev/null
339               echo $var
340           done < ${XCI_PATH}/.cache/xci.env && cd ${XCI_PATH}/xci && \
341           ansible-playbook -i playbooks/dynamic_inventory.py playbooks/prepare-tests.yml
342           ssh root@192.168.122.2 "/root/prepare-tests.sh"
343           echo "---------------------------------------------------------------------------------"
344
345 - builder:
346     name: 'xci-daily-functest-macro'
347     builders:
348       - shell: |
349           #!/bin/bash
350           set -o errexit
351           set -o pipefail
352
353           ssh root@192.168.122.2 "/root/run-functest.sh"
354 - builder:
355     name: 'xci-daily-yardstick-macro'
356     builders:
357       - shell: |
358           #!/bin/bash
359           set -o errexit
360           set -o pipefail
361
362           ssh root@192.168.122.2 "/root/run-yardstick.sh"