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