cloud-infra: Enable engine verification on OpenStack
[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
54     distro:
55       - ubuntu1804:
56           disabled: false
57           successful: false
58           failed: false
59           unstable: false
60           notbuilt: false
61       - centos7:
62           disabled: true
63           successful: true
64           failed: true
65           unstable: true
66           notbuilt: true
67     cloud:
68       - city:
69           slave-label: 'city-jumphost-onap-ubuntu1804'
70           openrc-credentials-file: 'est-jenkins-openrcfile-city-karlskrona-onap'
71
72     type:
73       - virtual:
74           provisioner-type: 'bifrost'
75       - cloud:
76           provisioner-type: 'heat'
77
78     phase:
79       - deploy:
80           build-timeout: 90
81       - functest:
82           build-timeout: 30
83
84     jobs:
85       - 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
86       - 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
87
88 - job-template:
89     name: 'cloud-infra-verify-engine-{distro}-{cloud}-{type}-{stream}'
90
91     project-type: multijob
92
93     disabled: '{obj:disabled}'
94
95     concurrent: true
96
97     parameters:
98       - project-parameters:
99           project: '{project}'
100           branch: '{branch}'
101       - nordix-gerrit-parameters
102       - label:
103           name: SLAVE_LABEL
104           default: '{slave-label}'
105           description: 'Slave label to schedule this job on. All slaves have Ubuntu1604 no matter what distro target nodes use'
106       - string:
107           name: DISTRO
108           default: '{distro}'
109           description: 'Distribution to use for configuring target nodes (networking etc.)'
110       - string:
111           name: PROVISIONER_TYPE
112           default: '{provisioner-type}'
113           description: 'Provisioner type to use'
114       - string:
115           name: DEPLOY_TYPE
116           default: '{type}'
117           description: 'Type of the deployment'
118       - string:
119           name: HEAT_ENVIRONMENT_FILENAME
120           default: 'heat-environment-{cloud}-{distro}.yaml'
121           description: 'Name of heat-environment file to use.'
122       - string:
123           name: STACK_NAME
124           default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
125           description: 'Name of the created stack'
126       - string:
127           name: USE_PREBUILT_DEPLOYMENT_IMAGE
128           default: 'true'
129           description: 'Use prebuilt deployment image while running as part of CI/CD'
130       - string:
131           name: TEST_SUITE
132           default: 'healthcheck'
133           description: 'Test suite to run'
134       - string:
135           name: YARDSTICK_DISPATCHER
136           default: 'file'
137           description: 'Dispatcher to use for Yardstick reporting'
138       - string:
139           name: DELETE_STACK
140           default: 'yes'
141           description: 'Delete the stack upon completion of the build'
142       - string:
143           name: CLEANUP
144           default: 'true'
145           description: 'Cleanup leftovers of the previous run'
146
147     properties:
148       - logrotate
149       - build-blocker:
150           use-build-blocker: true
151           blocking-jobs:
152             - 'cloud-infra-verify-engine-.*'
153             - 'cloud-infra-verify-scenario-.*'
154             - 'cloud-infra-periodic-engine-.*'
155             - 'k8-.*'
156             - 'nolabs-.*'
157           block-level: 'NODE'
158       - throttle:
159           max-per-node: 1
160           max-total: 3
161           option: project
162
163     wrappers:
164       - credentials-binding:
165           - file:
166               credential-id: '{openrc-credentials-file}'
167               variable: OPENRC_FILE
168       - mask-passwords
169       - build-timeout:
170           timeout: 120
171       - fix-workspace-permissions
172       - openstack:
173           single-use: True
174
175     scm:
176       - git-scm-gerrit:
177           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
178           branch: '{branch}'
179           refspec: $GERRIT_REFSPEC
180           wipe_workspace: true
181           clean_before: false
182
183     triggers:
184       - gerrit:
185           server-name: 'Nordix Gerrit'
186           trigger-on:
187             - patchset-created-event:
188                 exclude-drafts: 'false'
189                 exclude-trivial-rebase: 'false'
190                 exclude-no-code-change: 'false'
191             - draft-published-event
192             - comment-added-contains-event:
193                 comment-contains-value: 'recheck'
194             - comment-added-contains-event:
195                 comment-contains-value: 'reverify'
196           projects:
197             - project-compare-type: 'REG_EXP'
198               project-pattern: 'infra\/engine'
199               branches:
200                 - branch-compare-type: 'ANT'
201                   branch-pattern: '**/{branch}'
202               file-paths:
203                 - compare-type: 'ANT'
204                   pattern: '**'
205           skip-vote:
206             successful: '{obj:successful}'
207             failed: '{obj:failed}'
208             unstable: '{obj:unstable}'
209             notbuilt: '{obj:notbuilt}'
210           custom-url: '* $JOB_NAME $BUILD_URL'
211
212     builders:
213       - shell: |
214           #!/bin/bash
215           cp $OPENRC_FILE /tmp/openrc
216       - 'cloud-infra-determine-scenario-macro'
217       - multijob:
218           name: deploy
219           condition: SUCCESSFUL
220           projects:
221             - name: 'cloud-infra-verify-engine-{distro}-deploy-{type}-{stream}'
222               current-parameters: true
223               predefined-parameters: |
224                 DISTRO=$DISTRO
225                 DEPLOY_TYPE=$DEPLOY_TYPE
226                 PROVISIONER_TYPE=$PROVISIONER_TYPE
227                 STACK_NAME=$STACK_NAME
228                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
229                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
230                 CLEANUP=$CLEANUP
231                 GERRIT_PROJECT=$GERRIT_PROJECT
232                 GERRIT_BRANCH=$GERRIT_BRANCH
233                 GERRIT_REFSPEC=$GERRIT_REFSPEC
234                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
235                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
236               node-parameters: true
237               kill-phase-on: FAILURE
238               abort-all-job: true
239       - multijob:
240           name: functest
241           condition: SUCCESSFUL
242           projects:
243             - name: 'cloud-infra-verify-engine-{distro}-functest-{type}-{stream}'
244               current-parameters: true
245               predefined-parameters: |
246                 DISTRO=$DISTRO
247                 DEPLOY_TYPE=$DEPLOY_TYPE
248                 PROVISIONER_TYPE=$PROVISIONER_TYPE
249                 STACK_NAME=$STACK_NAME
250                 HEAT_ENVIRONMENT_FILENAME=$HEAT_ENVIRONMENT_FILENAME
251                 USE_PREBUILT_DEPLOYMENT_IMAGE=$USE_PREBUILT_DEPLOYMENT_IMAGE
252                 TEST_SUITE=$TEST_SUITE
253                 YARDSTICK_DISPATCHER=$YARDSTICK_DISPATCHER
254                 CLEANUP=$CLEANUP
255                 GERRIT_PROJECT=$GERRIT_PROJECT
256                 GERRIT_BRANCH=$GERRIT_BRANCH
257                 GERRIT_REFSPEC=$GERRIT_REFSPEC
258                 GERRIT_CHANGE_NUMBER=$GERRIT_CHANGE_NUMBER
259                 GERRIT_CHANGE_COMMIT_MESSAGE=$GERRIT_CHANGE_COMMIT_MESSAGE
260               node-parameters: true
261               kill-phase-on: FAILURE
262               abort-all-job: true
263
264     publishers:
265       - postbuildscript:
266           builders:
267             - role: SLAVE
268               build-on:
269                 - SUCCESS
270                 - FAILURE
271                 - ABORTED
272                 - NOT_BUILT
273                 - UNSTABLE
274               build-steps:
275                 - shell:
276                     !include-raw-escape: ./wait-for-pkg-manager.sh
277                 - shell:
278                     !include-raw: ./delete-heat-stack.sh
279
280 - job-template:
281     name: 'cloud-infra-verify-engine-{distro}-{phase}-{type}-{stream}'
282
283     disabled: false
284
285     concurrent: true
286
287     properties:
288       - logrotate
289
290     parameters:
291       - string:
292           name: PROJECT
293           default: $GERRIT_PROJECT
294       - string:
295           name: DISTRO
296           default: 'ubuntu1804'
297           description: 'Distribution to use for configuring target nodes (networking etc.). Overriden by upstream job.'
298       - string:
299           name: DEPLOY_TYPE
300           default: 'virtual'
301           description: 'Type of the deployment. Overriden by upstream job.'
302       - string:
303           name: PROVISIONER_TYPE
304           default: 'bifrost'
305           description: 'Provisioner type to use. Overriden by upstream job.'
306       - string:
307           name: HEAT_ENVIRONMENT_FILENAME
308           default: "heat-environment-city-ubuntu1804.yaml"
309           description: 'Name of heat-environment file to use.'
310       - string:
311           name: HEAT_ENVIRONMENT_FILE
312           default: "file://$WORKSPACE/engine/provisioner/heat/playbooks/roles/install-configure-heat/files/$HEAT_ENVIRONMENT_FILENAME"
313           description: 'Location of heat-environment file to use.'
314       - string:
315           name: STACK_NAME
316           default: "nordix-cicd-verify-engine-{distro}-$BUILD_NUMBER"
317           description: 'Name of the created stack'
318       - string:
319           name: USE_PREBUILT_DEPLOYMENT_IMAGE
320           default: 'false'
321           description: 'Use prebuilt deployment image while running as part of CI/CD'
322       - string:
323           name: TEST_FW
324           default: '{phase}'
325           description: 'Test framework to use'
326       - string:
327           name: TEST_SUITE
328           default: 'healthcheck'
329           description: 'Test suite to run'
330       - string:
331           name: TEST_REPO_URL
332           default: 'https://gerrit.nordix.org/infra/test.git'
333           description: 'URL to Nordix Cloud Infra test repository'
334       - string:
335           name: YARDSTICK_DISPATCHER
336           default: 'file'
337           description: 'Dispatcher to use for Yardstick reporting'
338       - string:
339           name: CLEANUP
340           default: 'false'
341
342     wrappers:
343       - mask-passwords
344       - build-timeout:
345           timeout: '{build-timeout}'
346       - fix-workspace-permissions
347
348     scm:
349       - git-scm-gerrit:
350           ssh-credentials-id: nordixinfra-nordix-gerrit-ssh
351           branch: '{branch}'
352           refspec: $GERRIT_REFSPEC
353           wipe_workspace: true
354           clean_before: false
355
356     builders:
357       - 'cloud-infra-determine-scenario-macro'
358       - 'cloud-infra-{phase}-macro'
359
360 # vim: set ts=2 sw=2 expandtab: