c6fb7e14264e7a20229bcc825cd8a4da20d73369
[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
118     properties:
119       - logrotate
120       - build-blocker:
121           use-build-blocker: true
122           blocking-jobs:
123             - 'cloud-infra-verify-engine-.*'
124             - 'cloud-infra-verify-scenario-.*'
125             - 'cloud-infra-periodic-engine-.*'
126             - 'onap-.*'
127             - 'k8-.*'
128             - 'os-.*'
129             - 'nolabs-.*'
130           block-level: 'NODE'
131       - throttle:
132           max-per-node: 1
133           max-total: 3
134           option: project
135
136     wrappers:
137       - build-timeout:
138           timeout: 240
139       - fix-workspace-permissions
140
141     scm:
142       - git-scm:
143           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
144           branch: '{branch}'
145           refspec: ''
146           wipe_workspace: true
147           clean_before: false
148
149     triggers:
150       - timed: '{build-trigger}'
151
152     builders:
153       - multijob:
154           name: deploy
155           condition: SUCCESSFUL
156           projects:
157             - name: 'cloud-infra-periodic-{distro}-deploy-{type}-{stream}'
158               current-parameters: true
159               predefined-parameters: |
160                 DISTRO=$DISTRO
161                 DEPLOY_TYPE=$DEPLOY_TYPE
162                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
163                 INSTALLER_TYPE=$INSTALLER_TYPE
164                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
165               git-revision: true
166               node-parameters: true
167               kill-phase-on: FAILURE
168               abort-all-job: true
169       - multijob:
170           name: functest
171           condition: ALWAYS
172           projects:
173             - name: 'cloud-infra-periodic-{distro}-functest-{type}-{stream}'
174               current-parameters: true
175               predefined-parameters: |
176                 DISTRO=$DISTRO
177                 DEPLOY_TYPE=$DEPLOY_TYPE
178                 INSTALLER_TYPE=$INSTALLER_TYPE
179                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
180                 TEST_SUITE=$TEST_SUITE
181                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
182               node-parameters: true
183               kill-phase-on: NEVER
184               abort-all-job: false
185       - multijob:
186           name: yardstick
187           condition: ALWAYS
188           projects:
189             - name: 'cloud-infra-periodic-{distro}-yardstick-{type}-{stream}'
190               current-parameters: true
191               predefined-parameters: |
192                 DISTRO=$DISTRO
193                 DEPLOY_TYPE=$DEPLOY_TYPE
194                 INSTALLER_TYPE=$INSTALLER_TYPE
195                 DEPLOY_SCENARIO=$DEPLOY_SCENARIO
196                 TEST_SUITE=$TEST_SUITE
197                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
198               node-parameters: true
199               kill-phase-on: NEVER
200               abort-all-job: false
201
202 - job-template:
203     name: 'cloud-infra-periodic-{distro}-{phase}-{type}-{stream}'
204
205     disabled: true
206
207     concurrent: true
208
209     properties:
210       - logrotate
211
212     parameters:
213       - string:
214           name: PROJECT
215           default: $GERRIT_PROJECT
216       - string:
217           name: DISTRO
218           default: 'ubuntu1804'
219           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
220       - string:
221           name: DEPLOY_TYPE
222           default: 'virtual'
223           description: 'Type of the deployment. Overriden by upstream job.'
224       - string:
225           name: USE_PREBUILT_DEPLOYMENT_IMAGE
226           default: 'false'
227           description: 'Use prebuilt deployment image while running as part of CI/CD'
228       - string:
229           name: ENGINE_ANSIBLE_PARAMS
230           default: ' -v '
231           description: 'Extra paramters that can be added when run the play books.'
232       - string:
233           name: INSTALLER_TYPE
234           default: 'kubespray'
235           description: 'Installer to use for deploying the scenario'
236       - string:
237           name: DEPLOY_SCENARIO
238           default: 'k8-calico-nofeature'
239           description: 'Scenario to deploy and test'
240       - string:
241           name: TEST_FW
242           default: '{phase}'
243           description: 'Test framework to use'
244       - string:
245           name: TEST_SUITE
246           default: 'smoke'
247           description: 'Test suite to run'
248       - string:
249           name: TEST_REPO_URL
250           default: 'https://gerrit.nordix.org/infra/test.git'
251           description: 'URL to Nordix Cloud Infra test repository'
252       - string:
253           name: YARDSTICK_DISPATCHER
254           default: 'file'
255           description: 'Dispatcher to use for Yardstick reporting'
256
257     wrappers:
258       - build-timeout:
259           timeout: '{build-timeout}'
260       - fix-workspace-permissions
261
262     scm:
263       - git-scm:
264           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
265           branch: '{branch}'
266           refspec: ''
267           wipe_workspace: true
268           clean_before: false
269
270     builders:
271       - 'cloud-infra-{phase}-macro'
272
273 # vim: set ts=2 sw=2 expandtab: