blob: 99e72313e72852da2e925d733f316a0f5306c7cc [file] [log] [blame]
mrichommee7f09272020-01-07 11:38:43 +01001.. _onap-integration-ci:
2
3Integration Continuous Integration Guide
4----------------------------------------
5
6Continuous Integration is key due to the complexity of the ONAP projects.
7Several chains have been created:
8
9- Daily stable chain
10- Daily master chain
11- Gating: On demand deployment of a full ONAP solution to validate patchsets
12
mrichomme5649e662020-03-12 14:50:19 +010013They are run on different environments (Orange labs, DT labs, Azure Cloud).
mrichommee7f09272020-01-07 11:38:43 +010014
15The following document will detail these chains and how you could set up such
16chains and/or provide test results to the community.
17
18Integration CI Ecosystem
19------------------------
20
21Overview
22~~~~~~~~
23
mrichomme5649e662020-03-12 14:50:19 +010024The global ecosystem can de described as follows:
25
26.. figure:: files/CI/ONAP_CI_10.png
mrichomme92938ec2020-03-12 15:34:58 +010027 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +010028 :align: center
29
30Several chains are run in ONAP.
31The CI chains are triggered from different CI systems (Jenkins or gitlab-ci) (1)
32on different target environments hosted on community labs (Windriver,
33Orange, DT, E///) or Azure clouds. Jobs (installation, tests) are executed on
34these labs (2). At the end, the results are pushed through the OPNFV test API (3)
35to a test database (4) hosted by Linux Foundation on
36http://testresults.opnfv.org.
37Results can be reported in different web pages hosted on LF or on gitlab.com (5).
38
39
mrichommee7f09272020-01-07 11:38:43 +010040Daily Chains
41~~~~~~~~~~~~
42
mrichomme5649e662020-03-12 14:50:19 +010043CI daily chains (Master and last Stable) are run on Orange, DT using gitlab-ci
44jobs and Ericsson using jenkins jobs.
45
mrichommee7f09272020-01-07 11:38:43 +010046Gating
47~~~~~~
48
mrichomme5649e662020-03-12 14:50:19 +010049OOM gating has been introduced for El Alto. It consists of a deployment followed
50by a set of tests on patchsets submitted to OOM repository.
51
52The CI part is managed on gitlab.com and the deployment is executed on ONAP
53Orange lab and Azure clouds.
54The goal is to provide a feedback - and ultimately to vote - on code change
55prior to merge to consolidate the OOM Master branch.
56
57The developer can evaluate the consequences of his/her patchset on a fresh
58installation.
59
60The gating is triggered in 2 scenarios:
61
62 - new patchset in OOM
63 - comment with the magic word **oom_redeploy** is posted in the Gerrit's comment
64 section
65
66The procedure to submit new feature in CI is done in 3 steps as described in the
67figure below:
68
mrichomme92938ec2020-03-12 15:34:58 +010069.. figure:: files/CI/ONAP_CI_0.png
mrichomme5649e662020-03-12 14:50:19 +010070 :scale: 100 %
71 :align: center
72
73
74Visualization of the CI pipelines
75~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
76
77As the CI chains are triggered from different systems, several web interfaces
78can be used to visualize them.
79
80A web site has been created to centralize the links on http://testresults.opnfv.org/onap-integration/index.html
81
82.. figure:: files/CI/ONAP_CI_3.png
mrichomme92938ec2020-03-12 15:34:58 +010083 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +010084 :align: center
85
86For Gating and gitlab.com based CI chains, the pipelines consist in pipelines of
87pipelines managed through the chaining of .gitlab-ci.yml file thanks to an Open
88Source deployment called chained-ci (https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci).
89A visualization tool is available to list all your chains as described in the
90figure below:
91
92.. figure:: files/CI/ONAP_CI_1.png
mrichomme92938ec2020-03-12 15:34:58 +010093 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +010094 :align: center
95
96If you click on any element of the chain, you will open a new window:
97
98.. figure:: files/CI/ONAP_CI_2.png
mrichomme92938ec2020-03-12 15:34:58 +010099 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +0100100 :align: center
101
102In order to provide the logs to the developer an additional web page has been
103created to summarize the tests and grant access to their associated logs:
104
105.. figure:: files/CI/ONAP_CI_8.png
mrichomme92938ec2020-03-12 15:34:58 +0100106 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +0100107 :align: center
108
109Additionnaly, for the daily chain, another page displays the results as time
110series, allowing to see the evolution of the tests over time.
111
112.. figure:: files/CI/ONAP_CI_9.png
mrichomme92938ec2020-03-12 15:34:58 +0100113 :scale: 100 %
mrichomme5649e662020-03-12 14:50:19 +0100114 :align: center
115
116
mrichommee7f09272020-01-07 11:38:43 +0100117Setup Your Own CI Chains
118------------------------
119
mrichomme5649e662020-03-12 14:50:19 +0100120If you want to setup a gitlab.com based CI chain, and want to use chained-ci,
121you can follow the tutorial on https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci-handson
122
123You should be able to chain your automation projects:
124
125* Create resources
126* Deployment of Kubernetes
127* Test of your Kubernetes (using OPNFV functest-k8s tests)
128* Deployment of your ONAP (you can use your own automatic installation
129 procedure or https://gitlab.com/Orange-OpenSource/lfn/onap/onap_oom_automatic_installation/)
130* Test ONAP thanks to the differnet ONAP xtesting dockers covering infrastructure
131 healthcheck, components healthcheck tests, end to end tests, security tests.
132
133If you want to report your results to the community, do not hesitate to contact
134the integration team. The Test database is public but the pods must be declared
135to be allowed to report results from third party labs.
136
137
mrichommee7f09272020-01-07 11:38:43 +0100138ONAP Integration Testing Gate
139~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
140
mrichomme5649e662020-03-12 14:50:19 +01001415 categories have been defined for the ONAP integration testing gate:
142
143* infrastructure healthcheck: verify ONAP from a k8S perspective. It includes
144 2 tests: onap-k8s (all the deployments, jobs, statefulste,..must be OK at
145 the end of an installation), onap-helm (all the helm chart must be
146 completed at the end of the installation)
147* healthcheck: the traditionnal robot tests run from the cluster to perform
148 tests on the different components.
149* smoke-usecases: End to end tests
150* candidate-usecases: New end to end tests introduced in the automation chain
151 for the release
152* security tests (security of kubernetes (CVE, CIS tests) and ONAP (exposed
153 ports, check the containers run as root,...))
154* benchmarking (robustness, stress tests): not yet available
155
156All these tests have been packaged thanks to the OPNFV Open Source tool xtesting.
157Xtesting is a python package allowing to unify the way to declare, run tests. It
158also ensures a consistent way to get the test results whatever the test framework
159used (python, robotframework, bash, ...). It includes the mechanism to
160automatically push the results to the test database using the test API.
161It simplifies the integration in CI.
162
163The package can be found here https://pypi.org/project/xtesting/.
164
165The different ONAP xtesting dockers can be found on https://gitlab.com/Orange-OpenSource/lfn/onap/integration/xtesting/container_registry
166
167As an illustration, you can run the infrastructure healthcheck by typing the
168following command::
169
170 docker run -v <the kube config>:/root/.kube/config -v <result directory>:
171 /var/lib/xtesting/results registry.gitlab.com/orange-opensource/lfn/onap/integration/xtesting/infra-healthcheck:latest
172
173All the xtesting tests are included in Daily and gating chains.
174Please note that you can build your own onap-xtesting docker if you want to
175include your tests. See https://wiki.onap.org/pages/viewpage.action?pageId=79202765
176for details.