Create periodic jobs for scenarios
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-periodic-engine.yaml
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-engine'
40
41     project: 'infra/engine'
42
43     stream:
44       - 'master':
45           branch: '{stream}'
46           disabled: 'false'
47
48     os:
49       - ubuntu1804:
50           disabled: 'false'
51           distribution: 'ubuntu18'
52           ipa_dib_os_element: 'coreos'
53           dib_os_release: 'bionic'
54           dib_os_element: 'ubuntu-minimal'
55       - centos7:
56           disabled: 'true'
57           distribution: 'centos7'
58           ipa_dib_os_element: 'coreos'
59           dib_os_release: '7'
60           dib_os_element: 'centos-minimal'
61
62     type:
63       - virtual:
64           slave-label: 'vpod-deploy-city'
65           yardstick-dispatcher: 'file'
66           build-trigger: 'H H/3 * * *'
67       - baremetal:
68           slave-label: 'baremetal-deploy'
69           yardstick-dispatcher: 'influxdb'
70           build-trigger: '@daily'
71
72     phase:
73       - deploy:
74           build-timeout: 60
75       - functest:
76           build-timeout: 120
77       - yardstick:
78           build-timeout: 30
79
80     jobs:
81       - 'cloud-infra-periodic-engine-{os}-{type}-{stream}'
82       - 'cloud-infra-periodic-{os}-{phase}-{type}-{stream}'
83
84 - job-template:
85     name: 'cloud-infra-periodic-engine-{os}-{type}-{stream}'
86
87     project-type: multijob
88
89     disabled: '{obj:disabled}'
90
91     concurrent: true
92
93     parameters:
94       - project-parameters:
95           project: '{project}'
96           branch: '{branch}'
97       - nordix-gerrit-parameters
98       - label:
99           name: SLAVE_LABEL
100           default: '{slave-label}'
101           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
102       - string:
103           name: DISTRIBUTION
104           default: '{distribution}'
105           description: 'Distribution to use for configuring target nodes (networking etc.)'
106       - string:
107           name: DEPLOY_TYPE
108           default: '{type}'
109           description: 'Type of the deployment'
110       - string:
111           name: USE_PREBUILT_DEPLOYMENT_IMAGE
112           default: 'true'
113           description: 'Use prebuilt deployment image while running as part of CI/CD'
114       - string:
115           name: IPA_DIB_OS_ELEMENT
116           default: '{ipa_dib_os_element}'
117           description: 'DIB OS Element to use for building the ramdisk image'
118       - string:
119           name: DIB_OS_RELEASE
120           default: '{dib_os_release}'
121           description: 'DIB OS Release to use for building the deployment image to provision target nodes with'
122       - string:
123           name: DIB_OS_ELEMENT
124           default: '{dib_os_element}'
125           description: 'DIB OS Element to use for building the deployment image to provision target nodes with'
126       - string:
127           name: INSTALLER_TYPE
128           default: 'kubespray'
129           description: 'Installer to use for deploying the scenario'
130       - string:
131           name: DEPLOY_SCENARIO
132           default: 'k8-calico-nofeature'
133           description: 'Scenario to deploy and test'
134       - string:
135           name: TEST_SUITE
136           default: 'smoke'
137           description: 'Test suite to run'
138       - string:
139           name: YARDSTICK_DISPATCHER
140           default: '{yardstick-dispatcher}'
141           description: 'Dispatcher to use for Yardstick reporting'
142       - string:
143           name: CLEANUP
144           default: 'true'
145           description: 'Cleanup leftovers of the previous run'
146
147     properties:
148       - logrotate
149       - build-blocker:
150           use-build-blocker: true
151           blocking-jobs:
152             - 'cloud-infra-verify-engine-{os}-.*'
153             - 'cloud-infra-verify-scenario-{os}-.*'
154             - 'cloud-infra-periodic-engine-{os}-.*'
155             - 'cloud-infra-os-.*'
156             - 'cloud-infra-k8-.*'
157           block-level: 'NODE'
158       - throttle:
159           max-per-node: 1
160           max-total: 3
161           option: project
162
163     wrappers:
164       - build-timeout:
165           timeout: 210
166       - fix-workspace-permissions
167
168     scm:
169       - git-scm:
170           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
171           branch: '{branch}'
172           refspec: ''
173
174     triggers:
175       - timed: '{build-trigger}'
176
177     builders:
178       - multijob:
179           name: deploy
180           condition: SUCCESSFUL
181           projects:
182             - name: 'cloud-infra-periodic-{os}-deploy-{type}-{stream}'
183               current-parameters: true
184               predefined-parameters: |
185                 DISTRIBUTION=$DISTRIBUTION
186                 DEPLOY_TYPE=$DEPLOY_TYPE
187                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
188                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
189                 DIB_OS_RELEASE=$DIB_OS_RELEASE
190                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
191                 INSTALLER_TYPE=$INSTALLER_TYPE
192                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
193                 CLEANUP=$CLEANUP
194               git-revision: true
195               node-parameters: true
196               kill-phase-on: FAILURE
197               abort-all-job: true
198       - multijob:
199           name: functest
200           condition: ALWAYS
201           projects:
202             - name: 'cloud-infra-periodic-{os}-functest-{type}-{stream}'
203               current-parameters: true
204               predefined-parameters: |
205                 DISTRIBUTION=$DISTRIBUTION
206                 DEPLOY_TYPE=$DEPLOY_TYPE
207                 INSTALLER_TYPE=$INSTALLER_TYPE
208                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
209                 TEST_SUITE=$TEST_SUITE
210                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
211                 CLEANUP=$CLEANUP
212               node-parameters: true
213               kill-phase-on: NEVER
214               abort-all-job: false
215       - multijob:
216           name: yardstick
217           condition: ALWAYS
218           projects:
219             - name: 'cloud-infra-periodic-{os}-yardstick-{type}-{stream}'
220               current-parameters: true
221               predefined-parameters: |
222                 DISTRIBUTION=$DISTRIBUTION
223                 DEPLOY_TYPE=$DEPLOY_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
233 - job-template:
234     name: 'cloud-infra-periodic-{os}-{phase}-{type}-{stream}'
235
236     disabled: false
237
238     concurrent: true
239
240     properties:
241       - logrotate
242
243     parameters:
244       - string:
245           name: PROJECT
246           default: $GERRIT_PROJECT
247       - string:
248           name: DISTRIBUTION
249           default: 'ubuntu18'
250           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
251       - string:
252           name: DEPLOY_TYPE
253           default: 'virtual'
254           description: 'Type of the deployment. Overriden by upstream job.'
255       - string:
256           name: USE_PREBUILT_DEPLOYMENT_IMAGE
257           default: 'false'
258           description: 'Use prebuilt deployment image while running as part of CI/CD'
259       - string:
260           name: IPA_DIB_OS_ELEMENT
261           default: 'fedora'
262           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
263       - string:
264           name: DIB_OS_RELEASE
265           default: 'bionic'
266           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
267       - string:
268           name: DIB_OS_ELEMENT
269           default: 'ubuntu-minimal'
270           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
271       - string:
272           name: ENGINE_ANSIBLE_PARAMS
273           default: ' -v '
274           description: 'Extra paramters that can be added when run the play books.'
275       - string:
276           name: INSTALLER_TYPE
277           default: 'kubespray'
278           description: 'Installer to use for deploying the scenario'
279       - string:
280           name: DEPLOY_SCENARIO
281           default: 'k8-calico-nofeature'
282           description: 'Scenario to deploy and test'
283       - string:
284           name: TEST_FW
285           default: '{phase}'
286           description: 'Test framework to use'
287       - string:
288           name: TEST_SUITE
289           default: 'smoke'
290           description: 'Test suite to run'
291       - string:
292           name: TEST_REPO_URL
293           default: 'https://gerrit.nordix.org/infra/test.git'
294           description: 'URL to Nordix Cloud Infra test repository'
295       - string:
296           name: YARDSTICK_DISPATCHER
297           default: 'file'
298           description: 'Dispatcher to use for Yardstick reporting'
299       - string:
300           name: CLEANUP
301           default: 'false'
302
303     wrappers:
304       - build-timeout:
305           timeout: '{build-timeout}'
306       - fix-workspace-permissions
307
308     scm:
309       - git-scm:
310           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
311           branch: '{branch}'
312           refspec: ''
313
314     builders:
315       - 'cloud-infra-{phase}-macro'
316
317 # vim: set ts=2 sw=2 expandtab: