cloud-infra: Setup periodic virtual jobs for OpenStack
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-openstack.yml
1 ---
2 #
3 # ============LICENSE_START=======================================================
4 #  Copyright (C) 2019 Nordix Foundation.
5 # ================================================================================
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
9 #
10 #      http://www.apache.org/licenses/LICENSE-2.0
11 #
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
17 #
18 # SPDX-License-Identifier: Apache-2.0
19 # ============LICENSE_END=========================================================
20
21 #--------------------------------------------------------------------------------------
22 # The jobs declared in this JJB configuration file are used for verifying cloud-infra
23 # engine from the tip of the master branch periodically to check the stability of it.
24 #
25 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
26 # The slaves have
27 #   - Ubuntu1604 as the base distro
28 #   - nested virtualization
29 #   - internet access
30 #   - passwordless sudo
31 #   - 16 CPUs/32GB RAM/200 GB Disk
32 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
33 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
34 #
35 # The slaves should not have a cloud infra scenario deployed on them.
36 #--------------------------------------------------------------------------------------
37
38 - project:
39     name: 'cloud-infra-periodic-openstack'
40
41     project: 'infra/engine'
42
43     stream:
44       - 'master':
45           disabled: 'true'
46           engine-branch: 'master'
47           openstack-branch: '{stream}'
48       - 'train':
49           disabled: 'true'
50           engine-branch: 'master'
51           openstack-branch: '{stream}'
52       - 'stein':
53           disabled: 'false'
54           engine-branch: 'master'
55           openstack-branch: '{stream}'
56       - 'rocky':
57           disabled: 'true'
58           engine-branch: 'master'
59           openstack-branch: '{stream}'
60
61     distro:
62       - ubuntu1804
63
64     deploy-scenario:
65       - os-nosdn-nofeature
66
67     ci-loop:
68       - daily
69
70     type:
71       - baremetal:
72           pod-name: est-baremetal
73           slave-label: baremetal-deploy
74           provisioner-type: bifrost
75           installer-type: kolla
76           test-suite: smoke
77           yardstick-dispatcher: 'influxdb'
78           trigger-on: '@daily'
79       - virtual:
80           pod-name: est-virtual
81           slave-label: vpod
82           provisioner-type: bifrost
83           installer-type: kolla
84           test-suite: healthcheck
85           yardstick-dispatcher: 'influxdb'
86           trigger-on: '0 */8 * * *'
87
88     phase:
89       - deploy:
90           build-timeout: 90
91       - functest:
92           build-timeout: 240
93       - yardstick:
94           build-timeout: 120
95       - promote:
96           build-timeout: 5
97
98     jobs:
99       - '{deploy-scenario}-{distro}-kolla-{type}-{ci-loop}-{stream}'
100       - 'openstack-{phase}-{distro}-kolla-{type}-{ci-loop}-{stream}'
101
102 - job-template:
103     name: '{deploy-scenario}-{distro}-kolla-{type}-{ci-loop}-{stream}'
104
105     project-type: multijob
106
107     disabled: '{obj:disabled}'
108
109     concurrent: true
110
111     parameters:
112       - project-parameters:
113           project: '{project}'
114           branch: '{engine-branch}'
115       - nordix-gerrit-parameters
116       - label:
117           name: SLAVE_LABEL
118           default: '{slave-label}'
119           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
120       - string:
121           name: DISTRO
122           default: '{distro}'
123           description: 'Distribution to use for configuring target nodes (networking etc.)'
124       - string:
125           name: DEPLOY_TYPE
126           default: '{type}'
127           description: 'Type of the deployment'
128       - string:
129           name: USE_PREBUILT_DEPLOYMENT_IMAGE
130           default: 'true'
131           description: 'Use prebuilt deployment image while running as part of CI/CD'
132       - string:
133           name: OPENSTACK_VERSION
134           default: '{openstack-branch}'
135           description: 'OpenStack Version to deploy and test'
136       - string:
137           name: PROVISIONER_TYPE
138           default: '{provisioner-type}'
139           description: 'Provisioner to use for provisioning nodes'
140       - string:
141           name: INSTALLER_TYPE
142           default: '{installer-type}'
143           description: 'Installer to use for deploying the scenario'
144       - string:
145           name: DEPLOY_SCENARIO
146           default: '{deploy-scenario}'
147           description: 'Scenario to deploy and test'
148       - string:
149           name: TEST_SUITE
150           default: '{test-suite}'
151           description: 'Test suite to run'
152       - string:
153           name: YARDSTICK_DISPATCHER
154           default: '{yardstick-dispatcher}'
155           description: 'Dispatcher to use for Yardstick reporting'
156       - string:
157           name: CLEANUP
158           default: 'true'
159           description: 'Cleanup leftovers of the previous run'
160
161     properties:
162       - logrotate
163       - build-blocker:
164           use-build-blocker: true
165           blocking-jobs:
166             - 'cloud-infra-periodic-engine-.*'
167             - 'k8-.*'
168             - 'os-.*'
169           block-level: 'NODE'
170       - throttle:
171           max-per-node: 1
172           max-total: 3
173           option: project
174
175     wrappers:
176       - build-timeout:
177           timeout: 455
178       - fix-workspace-permissions
179
180     scm:
181       - git-scm:
182           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
183           branch: '{engine-branch}'
184           refspec: ''
185           wipe_workspace: true
186           clean_before: false
187
188     triggers:
189       - timed: '{trigger-on}'
190
191     builders:
192       - description-setter:
193           description: $PROVISIONER_TYPE | $INSTALLER_TYPE | $DEPLOY_SCENARIO
194       - multijob:
195           name: deploy
196           condition: SUCCESSFUL
197           projects:
198             - name: 'openstack-deploy-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
199               current-parameters: true
200               predefined-parameters: |
201                 DISTRO=$DISTRO
202                 DEPLOY_TYPE=$DEPLOY_TYPE
203                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
204                 OPENSTACK_VERSION=$OPENSTACK_VERSION
205                 PROVISIONER_TYPE=$PROVISIONER_TYPE
206                 INSTALLER_TYPE=$INSTALLER_TYPE
207                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
208                 CLEANUP=$CLEANUP
209               git-revision: true
210               node-parameters: true
211               kill-phase-on: FAILURE
212               abort-all-job: true
213       - multijob:
214           name: functest
215           condition: ALWAYS
216           projects:
217             - name: 'openstack-functest-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
218               current-parameters: true
219               predefined-parameters: |
220                 DISTRO=$DISTRO
221                 DEPLOY_TYPE=$DEPLOY_TYPE
222                 OPENSTACK_VERSION=$OPENSTACK_VERSION
223                 PROVISIONER_TYPE=$PROVISIONER_TYPE
224                 INSTALLER_TYPE=$INSTALLER_TYPE
225                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
226                 TEST_SUITE=$TEST_SUITE
227                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
228                 CLEANUP=$CLEANUP
229               node-parameters: true
230               kill-phase-on: NEVER
231               abort-all-job: false
232       - multijob:
233           name: yardstick
234           condition: ALWAYS
235           projects:
236             - name: 'openstack-yardstick-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
237               current-parameters: true
238               predefined-parameters: |
239                 DISTRO=$DISTRO
240                 DEPLOY_TYPE=$DEPLOY_TYPE
241                 OPENSTACK_VERSION=$OPENSTACK_VERSION
242                 PROVISIONER_TYPE=$PROVISIONER_TYPE
243                 INSTALLER_TYPE=$INSTALLER_TYPE
244                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
245                 TEST_SUITE=$TEST_SUITE
246                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
247                 CLEANUP=$CLEANUP
248               node-parameters: true
249               kill-phase-on: NEVER
250               abort-all-job: false
251       - multijob:
252           name: promote
253           condition: SUCCESSFUL
254           projects:
255             - name: 'openstack-promote-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
256               current-parameters: true
257               predefined-parameters: |
258                 DISTRO=$DISTRO
259                 DEPLOY_TYPE=$DEPLOY_TYPE
260                 OPENSTACK_VERSION=$OPENSTACK_VERSION
261                 PROVISIONER_TYPE=$PROVISIONER_TYPE
262                 INSTALLER_TYPE=$INSTALLER_TYPE
263                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
264                 TEST_SUITE=$TEST_SUITE
265                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
266                 CLEANUP=$CLEANUP
267               node-parameters: true
268               kill-phase-on: FAILURE
269               abort-all-job: true
270
271 - job-template:
272     name: 'openstack-{phase}-{distro}-kolla-{type}-{ci-loop}-{stream}'
273
274     disabled: false
275
276     concurrent: true
277
278     properties:
279       - logrotate
280
281     parameters:
282       - string:
283           name: PROJECT
284           default: $GERRIT_PROJECT
285       - string:
286           name: DISTRO
287           default: 'ubuntu1804'
288           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
289       - string:
290           name: DEPLOY_TYPE
291           default: 'virtual'
292           description: 'Type of the deployment. Overriden by upstream job.'
293       - string:
294           name: OPENSTACK_VERSION
295           default: 'stein'
296           description: 'OpenStack Version to deploy and test'
297       - string:
298           name: USE_PREBUILT_DEPLOYMENT_IMAGE
299           default: 'false'
300           description: 'Use prebuilt deployment image while running as part of CI/CD'
301       - string:
302           name: ENGINE_ANSIBLE_PARAMS
303           default: ' -v '
304           description: 'Extra paramters that can be added when run the play books.'
305       - string:
306           name: DEPLOY_SCENARIO
307           default: 'k8-calico-nofeature'
308           description: 'Scenario to deploy and test'
309       - string:
310           name: PROVISIONER_TYPE
311           default: 'bifrost'
312           description: 'Provisioner to use for provisioning nodes'
313       - string:
314           name: INSTALLER_TYPE
315           default: 'kolla'
316           description: 'Installer to use for deploying the scenario'
317       - string:
318           name: TEST_FW
319           default: '{phase}'
320           description: 'Test framework to use'
321       - string:
322           name: TEST_SUITE
323           default: 'smoke'
324           description: 'Test suite to run'
325       - string:
326           name: TEST_REPO_URL
327           default: 'https://gerrit.nordix.org/infra/test.git'
328           description: 'URL to Nordix Cloud Infra test repository'
329       - string:
330           name: YARDSTICK_DISPATCHER
331           default: 'file'
332           description: 'Dispatcher to use for Yardstick reporting'
333       - string:
334           name: CLEANUP
335           default: 'false'
336
337     wrappers:
338       - build-timeout:
339           timeout: '{build-timeout}'
340       - fix-workspace-permissions
341
342     scm:
343       - git-scm:
344           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
345           branch: '{engine-branch}'
346           refspec: ''
347           wipe_workspace: true
348           clean_before: false
349
350     builders:
351       - description-setter:
352           description: $PROVISIONER_TYPE | $INSTALLER_TYPE | $DEPLOY_SCENARIO
353       - 'scenario-{phase}-macro'
354
355 # vim: set ts=2 sw=2 expandtab: