Create jobs to verify changes to scenarios
[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-engine-{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-verify-scenario-{os}-.*'
142             - 'cloud-infra-periodic-engine-{os}-.*'
143             - 'cloud-infra-os-.*'
144             - 'cloud-infra-k8-.*'
145           block-level: 'NODE'
146       - throttle:
147           max-per-node: 1
148           max-total: 3
149           option: project
150
151     wrappers:
152       - build-timeout:
153           timeout: 120
154       - fix-workspace-permissions
155
156     scm:
157       - git-scm-gerrit:
158           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
159           branch: '{branch}'
160           refspec: $GERRIT_REFSPEC
161
162     triggers:
163       - nordix-gerrit-trigger-patchset-created:
164           project: 'infra\/engine'
165           branch: '{branch}'
166           files: '**'
167
168     builders:
169       - multijob:
170           name: deploy
171           condition: SUCCESSFUL
172           projects:
173             - name: 'cloud-infra-verify-engine-{os}-deploy-{type}-{stream}'
174               current-parameters: true
175               predefined-parameters: |
176                 DISTRIBUTION=$DISTRIBUTION
177                 DEPLOY_TYPE=$DEPLOY_TYPE
178                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
179                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
180                 DIB_OS_RELEASE=$DIB_OS_RELEASE
181                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
182                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
183                 CLEANUP=$CLEANUP
184                 GERRIT_PROJECT=$GERRIT_PROJECT
185                 GERRIT_BRANCH=$GERRIT_BRANCH
186                 GERRIT_REFSPEC=$GERRIT_REFSPEC
187                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
188                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
189               node-parameters: true
190               kill-phase-on: FAILURE
191               abort-all-job: true
192       - multijob:
193           name: functest
194           condition: SUCCESSFUL
195           projects:
196             - name: 'cloud-infra-verify-engine-{os}-functest-{type}-{stream}'
197               current-parameters: true
198               predefined-parameters: |
199                 DISTRIBUTION=$DISTRIBUTION
200                 DEPLOY_TYPE=$DEPLOY_TYPE
201                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
202                 IPA_DIB_OS_ELEMENT=$IPA_DIB_OS_ELEMENT
203                 DIB_OS_RELEASE=$DIB_OS_RELEASE
204                 DIB_OS_ELEMENT=$DIB_OS_ELEMENT
205                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
206                 TEST_SUITE=$TEST_SUITE
207                 CLEANUP=$CLEANUP
208                 GERRIT_PROJECT=$GERRIT_PROJECT
209                 GERRIT_BRANCH=$GERRIT_BRANCH
210                 GERRIT_REFSPEC=$GERRIT_REFSPEC
211                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
212                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
213               node-parameters: true
214               kill-phase-on: FAILURE
215               abort-all-job: true
216
217 - job-template:
218     name: 'cloud-infra-verify-engine-{os}-{phase}-{type}-{stream}'
219
220     disabled: false
221
222     concurrent: true
223
224     properties:
225       - logrotate
226
227     parameters:
228       - string:
229           name: PROJECT
230           default: $GERRIT_PROJECT
231       - string:
232           name: DISTRIBUTION
233           default: 'ubuntu18'
234           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
235       - string:
236           name: DEPLOY_TYPE
237           default: 'virtual'
238           description: 'Type of the deployment. Overriden by upstream job.'
239       - string:
240           name: USE_PREBUILT_DEPLOYMENT_IMAGE
241           default: 'false'
242           description: 'Use prebuilt deployment image while running as part of CI/CD'
243       - string:
244           name: IPA_DIB_OS_ELEMENT
245           default: 'fedora'
246           description: 'DIB OS Element to use for building the ramdisk image. Overriden by upstream job.'
247       - string:
248           name: DIB_OS_RELEASE
249           default: 'bionic'
250           description: 'DIB OS Release to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
251       - string:
252           name: DIB_OS_ELEMENT
253           default: 'ubuntu-minimal'
254           description: 'DIB OS Element to use for building the deployment image to provision target nodes with. Overriden by upstream job.'
255       - string:
256           name: DEPLOY_SCENARIO
257           default: 'k8-calico-nofeature'
258           description: 'Scenario to deploy and test'
259       - string:
260           name: TEST_FW
261           default: '{phase}'
262           description: 'Test framework to use'
263       - string:
264           name: TEST_SUITE
265           default: 'healthcheck'
266           description: 'Test suite to run'
267       - string:
268           name: TEST_REPO_URL
269           default: 'https://gerrit.nordix.org/infra/test.git'
270           description: 'URL to Nordix Cloud Infra test repository'
271       - string:
272           name: CLEANUP
273           default: 'false'
274
275     wrappers:
276       - build-timeout:
277           timeout: 120
278       - fix-workspace-permissions
279
280     scm:
281       - git-scm-gerrit:
282           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
283           branch: '{branch}'
284           refspec: $GERRIT_REFSPEC
285
286     builders:
287       - 'cloud-infra-{phase}-macro'
288
289 # vim: set ts=2 sw=2 expandtab: