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