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