ea706b76f317c8b516e94b26f5885ee9c55213ec
[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
47     distro:
48       - ubuntu1804
49 #      - centos7:
50 #          disabled: 'true'
51
52     deploy-scenario:
53       - k8-calico-nofeature:
54           disabled: 'true'
55       - k8-flannel-nofeature:
56           disabled: 'true'
57       - k8-canal-nofeature:
58           disabled: 'true'
59       - k8-cilium-nofeature:
60           disabled: 'true'
61       - k8-weave-nofeature:
62           disabled: 'true'
63       - k8-multus-nofeature:
64           disabled: 'true'
65
66     ci-loop:
67       - daily
68
69     type:
70       - baremetal:
71           pod-name: est-baremetal
72           provisioner-type: bifrost
73           installer-type: kubespray
74           slave-label: baremetal-deploy
75           yardstick-dispatcher: 'influxdb'
76
77     phase:
78       - deploy:
79           build-timeout: 90
80       - functest:
81           build-timeout: 240
82       - yardstick:
83           build-timeout: 120
84       - promote:
85           build-timeout: 5
86
87     jobs:
88       - '{deploy-scenario}-{distro}-kubespray-{type}-{ci-loop}-{stream}'
89       - 'kubernetes-{phase}-{distro}-kubespray-{type}-{ci-loop}-{stream}'
90
91 - job-template:
92     name: '{deploy-scenario}-{distro}-kubespray-{type}-{ci-loop}-{stream}'
93
94     project-type: multijob
95
96     disabled: '{obj:disabled}'
97
98     concurrent: true
99
100     parameters:
101       - project-parameters:
102           project: '{project}'
103           branch: '{branch}'
104       - nordix-gerrit-parameters
105       - label:
106           name: SLAVE_LABEL
107           default: '{slave-label}'
108           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
109       - string:
110           name: DISTRO
111           default: '{distro}'
112           description: 'Distribution to use for configuring target nodes (networking etc.)'
113       - string:
114           name: DEPLOY_TYPE
115           default: '{type}'
116           description: 'Type of the deployment'
117       - string:
118           name: USE_PREBUILT_DEPLOYMENT_IMAGE
119           default: 'true'
120           description: 'Use prebuilt deployment image while running as part of CI/CD'
121       - string:
122           name: PROVISIONER_TYPE
123           default: '{provisioner-type}'
124           description: 'Provisioner to use for provisioning nodes'
125       - string:
126           name: INSTALLER_TYPE
127           default: '{installer-type}'
128           description: 'Installer to use for deploying the scenario'
129       - string:
130           name: DEPLOY_SCENARIO
131           default: '{deploy-scenario}'
132           description: 'Scenario to deploy and test'
133       - string:
134           name: TEST_SUITE
135           default: 'smoke'
136           description: 'Test suite to run'
137       - string:
138           name: YARDSTICK_DISPATCHER
139           default: '{yardstick-dispatcher}'
140           description: 'Dispatcher to use for Yardstick reporting'
141
142     properties:
143       - logrotate
144       - build-blocker:
145           use-build-blocker: true
146           blocking-jobs:
147             - 'cloud-infra-verify-engine-.*'
148             - 'cloud-infra-verify-scenario-.*'
149             - 'cloud-infra-periodic-engine-.*'
150             - 'onap-.*'
151             - 'k8-.*'
152             - 'os-.*'
153             - 'nolabs-.*'
154           block-level: 'NODE'
155       - throttle:
156           max-per-node: 1
157           max-total: 3
158           option: project
159
160     wrappers:
161       - build-timeout:
162           timeout: 455
163       - fix-workspace-permissions
164
165     scm:
166       - git-scm:
167           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
168           branch: '{branch}'
169           refspec: ''
170           wipe_workspace: true
171           clean_before: false
172
173     triggers:
174       - timed: '@daily'
175
176     builders:
177       - description-setter:
178           description: $PROVISIONER_TYPE | $INSTALLER_TYPE | $DEPLOY_SCENARIO
179       - multijob:
180           name: deploy
181           condition: SUCCESSFUL
182           projects:
183             - name: 'kubernetes-deploy-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
184               current-parameters: true
185               predefined-parameters: |
186                 DISTRO=$DISTRO
187                 DEPLOY_TYPE=$DEPLOY_TYPE
188                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
189                 PROVISIONER_TYPE=$PROVISIONER_TYPE
190                 INSTALLER_TYPE=$INSTALLER_TYPE
191                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
192               git-revision: true
193               node-parameters: true
194               kill-phase-on: FAILURE
195               abort-all-job: true
196       - multijob:
197           name: functest
198           condition: ALWAYS
199           projects:
200             - name: 'kubernetes-functest-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
201               current-parameters: true
202               predefined-parameters: |
203                 DISTRO=$DISTRO
204                 DEPLOY_TYPE=$DEPLOY_TYPE
205                 PROVISIONER_TYPE=$PROVISIONER_TYPE
206                 INSTALLER_TYPE=$INSTALLER_TYPE
207                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
208                 TEST_SUITE=$TEST_SUITE
209                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
210               node-parameters: true
211               kill-phase-on: NEVER
212               abort-all-job: false
213       - multijob:
214           name: yardstick
215           condition: ALWAYS
216           projects:
217             - name: 'kubernetes-yardstick-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
218               current-parameters: true
219               predefined-parameters: |
220                 DISTRO=$DISTRO
221                 DEPLOY_TYPE=$DEPLOY_TYPE
222                 PROVISIONER_TYPE=$PROVISIONER_TYPE
223                 INSTALLER_TYPE=$INSTALLER_TYPE
224                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
225                 TEST_SUITE=$TEST_SUITE
226                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
227               node-parameters: true
228               kill-phase-on: NEVER
229               abort-all-job: false
230       - multijob:
231           name: promote
232           condition: SUCCESSFUL
233           projects:
234             - name: 'kubernetes-promote-{distro}-{installer-type}-{type}-{ci-loop}-{stream}'
235               current-parameters: true
236               predefined-parameters: |
237                 DISTRO=$DISTRO
238                 DEPLOY_TYPE=$DEPLOY_TYPE
239                 PROVISIONER_TYPE=$PROVISIONER_TYPE
240                 INSTALLER_TYPE=$INSTALLER_TYPE
241                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
242                 TEST_SUITE=$TEST_SUITE
243                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
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: true
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
307     wrappers:
308       - build-timeout:
309           timeout: '{build-timeout}'
310       - fix-workspace-permissions
311
312     scm:
313       - git-scm:
314           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
315           branch: '{branch}'
316           refspec: ''
317           wipe_workspace: true
318           clean_before: false
319
320     builders:
321       - description-setter:
322           description: $PROVISIONER_TYPE | $INSTALLER_TYPE | $DEPLOY_SCENARIO
323       - 'scenario-{phase}-macro'
324
325 # vim: set ts=2 sw=2 expandtab: