Update branch references
[integration.git] / docs / repo-onap-integration-ci.rst
1 .. _integration-ci:
2
3 Integration Continuous Integration Guide
4 ----------------------------------------
5
6 .. important::
7    Continuous Integration is key due to the complexity of the ONAP projects.
8    Several chains have been created:
9
10   - Daily stable chain
11   - Daily master chain
12   - Gating: On demand deployment of a full ONAP solution to validate patchsets
13
14 They are run on different environments (Orange labs, DT labs, Azure Cloud).
15
16 The following document will detail these chains and how you could set up such
17 chains and/or provide test results to the community.
18
19 Integration CI Ecosystem
20 ------------------------
21
22 Overview
23 ~~~~~~~~
24
25 The global ecosystem can de described as follows:
26
27 .. figure:: files/CI/ONAP_CI_10.png
28    :align: center
29
30 Several chains are run in ONAP.
31 The CI chains are triggered from different CI systems (Jenkins or gitlab-ci) (1)
32 on different target environments hosted on community labs (Windriver,
33 Orange, DT, E///) or Azure clouds. Jobs (installation, tests) are executed on
34 these labs (2). At the end, the results are pushed through the OPNFV test API (3)
35 to a test database (4) hosted by Linux Foundation on
36 http://testresults.opnfv.org.
37 Results can be reported in different web pages hosted on LF or on gitlab.com (5).
38
39
40 Daily Chains
41 ~~~~~~~~~~~~
42
43 CI daily chains (Master and last Stable) are run on Orange, DT using gitlab-ci
44 jobs and Ericsson using jenkins jobs.
45
46 Gating
47 ~~~~~~
48
49 OOM gating has been introduced for El Alto. It consists of a deployment followed
50 by a set of tests on patchsets submitted to OOM repository.
51
52 The CI part is managed on gitlab.com and the deployment is executed on ONAP
53 Orange lab and Azure clouds.
54 The goal is to provide a feedback - and ultimately to vote - on code change
55 prior to merge to consolidate the OOM Master branch.
56
57 The developer can evaluate the consequences of his/her patchset on a fresh
58 installation.
59
60 The 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
66 The procedure to submit new feature in CI is done in 3 steps as described in the
67 figure below:
68
69 .. figure:: files/CI/ONAP_CI_0.png
70    :align: center
71
72
73 Visualization of the CI pipelines
74 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
75
76 As the CI chains are triggered from different systems, several web interfaces
77 can be used to visualize them.
78
79 A web site has been created to centralize the links on http://testresults.opnfv.org/onap-integration/index.html
80
81 For Gating and gitlab.com based CI chains, the pipelines consist in pipelines of
82 pipelines managed through the chaining of .gitlab-ci.yml file thanks to an Open
83 Source deployment called chained-ci (https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci).
84 A visualization tool is available to list all your chains as described in the
85 figure below:
86
87 .. figure:: files/CI/ONAP_CI_1.png
88    :align: center
89    :width: 10in
90
91 If you click on any element of the chain, you will open a new window:
92
93 .. figure:: files/CI/ONAP_CI_2.png
94    :align: center
95
96 In order to provide the logs to the developer an additional web page has been
97 created to summarize the tests and grant access to their associated logs:
98
99 .. figure:: files/CI/ONAP_CI_8.png
100    :align: center
101    :width: 6.5in
102
103 Additionnaly, for the daily chain, another page displays the results as time
104 series, allowing to see the evolution of the tests over time.
105
106 .. figure:: files/CI/ONAP_CI_9.png
107    :align: center
108    :width: 6.5in
109
110
111 Setup Your Own CI Chains
112 ------------------------
113
114 If you want to setup a gitlab.com based CI chain, and want to use chained-ci,
115 you can follow the tutorial on  https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci-handson
116
117 You should be able to chain your automation projects:
118
119 * Create resources
120 * Deployment of Kubernetes
121 * Test of your Kubernetes (using OPNFV functest-k8s tests)
122 * Deployment of your ONAP (you can use your own automatic installation
123   procedure or https://gitlab.com/Orange-OpenSource/lfn/onap/onap_oom_automatic_installation/)
124 * Test ONAP thanks to the differnet ONAP xtesting dockers covering infrastructure
125   healthcheck, components healthcheck tests, end to end tests, security tests.
126
127 If you want to report your results to the community, do not hesitate to contact
128 the integration team. The Test database is public but the pods must be declared
129 to be allowed to report results from third party labs.