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