Configure jobs for baremetal deployments
[infra/cicd.git] / jjb / cloud-infra / cloud-infra-verify-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 patches
23 # that are sent to the repositories below
24 #   - cloud-infra/engine
25 #
26 # These jobs verify changes that
27 #   - implement new features or fix bugs for the deployment framework, engine, itself
28 #   - implement new features or fix bugs to the playbooks and roles used for utilizing
29 #     open source components such as bifrost, kubespray, and kolla-ansible
30 #   - bump versions of open source components or the scenarios
31 #
32 # These jobs are set to run on slaves with label vpod-deploy-ubuntu1604.
33 # The slaves have
34 #   - Ubuntu1604 as the base distro
35 #   - nested virtualization
36 #   - internet access
37 #   - passwordless sudo
38 #   - 16 CPUs/32GB RAM/200 GB Disk
39 #   - docker, git vim curl wget zip unzip chrony apt-transport-https ca-certificates curl
40 #     gnupg-agent software-properties-common docker-ce docker-ce-cli containerd.io openjdk-8-jre
41 #
42 # The slaves should not have a cloud infra scenario deployed on them.
43 #--------------------------------------------------------------------------------------
44
45 - project:
46     name: 'cloud-infra-verify-engine'
47
48     project: 'infra/engine'
49
50     stream:
51       - 'master':
52           branch: '{stream}'
53           disabled: 'false'
54
55     os:
56       - ubuntu1804:
57           disabled: 'false'
58           distribution: 'ubuntu18'
59           ipa_dib_os_element: 'coreos'
60           dib_os_release: 'bionic'
61           dib_os_element: 'ubuntu-minimal'
62       - centos7:
63           disabled: 'true'
64           distribution: 'centos7'
65           ipa_dib_os_element: 'coreos'
66           dib_os_release: '7'
67           dib_os_element: 'centos-minimal'
68
69     type:
70       - virtual
71
72     phase:
73       - deploy
74       - functest
75
76     jobs:
77       - 'cloud-infra-verify-engine-{os}-{type}-{stream}'
78       - 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
79
80 - job-template:
81     name: 'cloud-infra-verify-engine-{os}-{type}-{stream}'
82
83     project-type: multijob
84
85     disabled: '{obj:disabled}'
86
87     concurrent: true
88
89     parameters:
90       - project-parameters:
91           project: '{project}'
92           branch: '{branch}'
93       - nordix-gerrit-parameters
94       - label:
95           name: SLAVE_LABEL
96           default: 'vpod-deploy-city'
97           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
98       - string:
99           name: DISTRIBUTION
100           default: '{distribution}'
101           description: 'Distribution to use for configuring target nodes (networking etc.)'
102       - string:
103           name: DEPLOY_TYPE
104           default: '{type}'
105           description: 'Type of the deployment'
106       - string:
107           name: USE_PREBUILT_DEPLOYMENT_IMAGE
108           default: 'true'
109           description: 'Use prebuilt deployment image while running as part of CI/CD'
110       - string:
111           name: IPA_DIB_OS_ELEMENT
112           default: '{ipa_dib_os_element}'
113           description: 'DIB OS Element to use for building the ramdisk image'
114       - string:
115           name: DIB_OS_RELEASE
116           default: '{dib_os_release}'
117           description: 'DIB OS Release to use for building the deployment image to provision target nodes with'
118       - string:
119           name: DIB_OS_ELEMENT
120           default: '{dib_os_element}'
121           description: 'DIB OS Element to use for building the deployment image to provision target nodes with'
122       - string:
123           name: DEPLOY_SCENARIO
124           default: 'k8-calico-nofeature'
125           description: 'Scenario to deploy and test'
126       - string:
127           name: TEST_SUITE
128           default: 'healthcheck'
129           description: 'Test suite to run'
130       - string:
131           name: CLEANUP
132           default: 'true'
133           description: 'Cleanup leftovers of the previous run'
134
135     properties:
136       - logrotate
137       - build-blocker:
138           use-build-blocker: true
139           blocking-jobs:
140             - 'cloud-infra-verify-engine-{os}-.*'
141             - 'cloud-infra-periodic-engine-{os}-.*'
142             - 'cloud-infra-os-.*'
143             - 'cloud-infra-k8-.*'
144           block-level: 'NODE'
145       - throttle:
146           max-per-node: 1
147           max-total: 3
148           option: project
149
150     wrappers:
151       - build-timeout:
152           timeout: 120
153       - fix-workspace-permissions
154
155     scm:
156       - git-scm-gerrit:
157           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
158           branch: '{branch}'
159           refspec: $GERRIT_REFSPEC
160
161     triggers:
162       - nordix-gerrit-trigger-patchset-created:
163           project: 'infra\/engine'
164           branch: '{branch}'
165           files: '**'
166
167     builders:
168       - multijob:
169           name: deploy
170           condition: SUCCESSFUL
171           projects:
172             - name: 'cloud-infra-verify-{os}-deploy-{type}-{stream}'
173               current-parameters: true
174               predefined-parameters: |
175                 DISTRIBUTION=$DISTRIBUTION
176                 DEPLOY_TYPE=$DEPLOY_TYPE
177                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
178                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
179                 DIB_OS_RELEASE=$DIB_OS_RELEASE
180                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
181                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
182                 CLEANUP=$CLEANUP
183                 GERRIT_PROJECT=$GERRIT_PROJECT
184                 GERRIT_BRANCH=$GERRIT_BRANCH
185                 GERRIT_REFSPEC=$GERRIT_REFSPEC
186                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
187                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
188               node-parameters: true
189               kill-phase-on: FAILURE
190               abort-all-job: true
191       - multijob:
192           name: functest
193           condition: SUCCESSFUL
194           projects:
195             - name: 'cloud-infra-verify-{os}-functest-{type}-{stream}'
196               current-parameters: true
197               predefined-parameters: |
198                 DISTRIBUTION=$DISTRIBUTION
199                 DEPLOY_TYPE=$DEPLOY_TYPE
200                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
201                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
202                 DIB_OS_RELEASE=$DIB_OS_RELEASE
203                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
204                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
205                 TEST_SUITE=$TEST_SUITE
206                 CLEANUP=$CLEANUP
207                 GERRIT_PROJECT=$GERRIT_PROJECT
208                 GERRIT_BRANCH=$GERRIT_BRANCH
209                 GERRIT_REFSPEC=$GERRIT_REFSPEC
210                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
211                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
212               node-parameters: true
213               kill-phase-on: FAILURE
214               abort-all-job: true
215
216 - job-template:
217     name: 'cloud-infra-verify-{os}-{phase}-{type}-{stream}'
218
219     disabled: false
220
221     concurrent: true
222
223     properties:
224       - logrotate
225
226     parameters:
227       - string:
228           name: PROJECT
229           default: $GERRIT_PROJECT
230       - string:
231           name: DISTRIBUTION
232           default: 'ubuntu18'
233           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
234       - string:
235           name: DEPLOY_TYPE
236           default: 'virtual'
237           description: 'Type of the deployment. Overriden by upstream job.'
238       - string:
239           name: USE_PREBUILT_DEPLOYMENT_IMAGE
240           default: 'false'
241           description: 'Use prebuilt deployment image while running as part of CI/CD'
242       - string:
243           name: IPA_DIB_OS_ELEMENT
244           default: 'fedora'
245           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
246       - string:
247           name: DIB_OS_RELEASE
248           default: 'bionic'
249           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
250       - string:
251           name: DIB_OS_ELEMENT
252           default: 'ubuntu-minimal'
253           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
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-gerrit:
281           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
282           branch: '{branch}'
283           refspec: $GERRIT_REFSPEC
284
285     builders:
286       - 'cloud-infra-{phase}-macro'
287
288 # vim: set ts=2 sw=2 expandtab: