mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 1 | Integration Continuous Integration Guide |
| 2 | ---------------------------------------- |
| 3 | |
| 4 | Continuous Integration is key due to the complexity of the ONAP projects. |
| 5 | Several 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 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 11 | They are run on different environments (Orange labs, DT labs, Azure Cloud). |
mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 12 | |
| 13 | The following document will detail these chains and how you could set up such |
| 14 | chains and/or provide test results to the community. |
| 15 | |
| 16 | Integration CI Ecosystem |
| 17 | ------------------------ |
| 18 | |
| 19 | Overview |
| 20 | ~~~~~~~~ |
| 21 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 22 | The global ecosystem can de described as follows: |
| 23 | |
| 24 | .. figure:: files/CI/ONAP_CI_10.png |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 25 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 26 | :align: center |
| 27 | |
| 28 | Several chains are run in ONAP. |
| 29 | The CI chains are triggered from different CI systems (Jenkins or gitlab-ci) (1) |
| 30 | on different target environments hosted on community labs (Windriver, |
| 31 | Orange, DT, E///) or Azure clouds. Jobs (installation, tests) are executed on |
| 32 | these labs (2). At the end, the results are pushed through the OPNFV test API (3) |
| 33 | to a test database (4) hosted by Linux Foundation on |
| 34 | http://testresults.opnfv.org. |
| 35 | Results can be reported in different web pages hosted on LF or on gitlab.com (5). |
| 36 | |
| 37 | |
mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 38 | Daily Chains |
| 39 | ~~~~~~~~~~~~ |
| 40 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 41 | CI daily chains (Master and last Stable) are run on Orange, DT using gitlab-ci |
| 42 | jobs and Ericsson using jenkins jobs. |
| 43 | |
mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 44 | Gating |
| 45 | ~~~~~~ |
| 46 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 47 | OOM gating has been introduced for El Alto. It consists of a deployment followed |
| 48 | by a set of tests on patchsets submitted to OOM repository. |
| 49 | |
| 50 | The CI part is managed on gitlab.com and the deployment is executed on ONAP |
| 51 | Orange lab and Azure clouds. |
| 52 | The goal is to provide a feedback - and ultimately to vote - on code change |
| 53 | prior to merge to consolidate the OOM Master branch. |
| 54 | |
| 55 | The developer can evaluate the consequences of his/her patchset on a fresh |
| 56 | installation. |
| 57 | |
| 58 | The 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 | |
| 64 | The procedure to submit new feature in CI is done in 3 steps as described in the |
| 65 | figure below: |
| 66 | |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 67 | .. figure:: files/CI/ONAP_CI_0.png |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 68 | :scale: 100 % |
| 69 | :align: center |
| 70 | |
| 71 | |
| 72 | Visualization of the CI pipelines |
| 73 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 74 | |
| 75 | As the CI chains are triggered from different systems, several web interfaces |
| 76 | can be used to visualize them. |
| 77 | |
| 78 | A 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 |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 81 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 82 | :align: center |
| 83 | |
| 84 | For Gating and gitlab.com based CI chains, the pipelines consist in pipelines of |
| 85 | pipelines managed through the chaining of .gitlab-ci.yml file thanks to an Open |
| 86 | Source deployment called chained-ci (https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci). |
| 87 | A visualization tool is available to list all your chains as described in the |
| 88 | figure below: |
| 89 | |
| 90 | .. figure:: files/CI/ONAP_CI_1.png |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 91 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 92 | :align: center |
| 93 | |
| 94 | If you click on any element of the chain, you will open a new window: |
| 95 | |
| 96 | .. figure:: files/CI/ONAP_CI_2.png |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 97 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 98 | :align: center |
| 99 | |
| 100 | In order to provide the logs to the developer an additional web page has been |
| 101 | created to summarize the tests and grant access to their associated logs: |
| 102 | |
| 103 | .. figure:: files/CI/ONAP_CI_8.png |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 104 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 105 | :align: center |
| 106 | |
| 107 | Additionnaly, for the daily chain, another page displays the results as time |
| 108 | series, allowing to see the evolution of the tests over time. |
| 109 | |
| 110 | .. figure:: files/CI/ONAP_CI_9.png |
mrichomme | 92938ec | 2020-03-12 15:34:58 +0100 | [diff] [blame] | 111 | :scale: 100 % |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 112 | :align: center |
| 113 | |
| 114 | |
mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 115 | Setup Your Own CI Chains |
| 116 | ------------------------ |
| 117 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 118 | If you want to setup a gitlab.com based CI chain, and want to use chained-ci, |
| 119 | you can follow the tutorial on https://gitlab.com/Orange-OpenSource/lfn/ci_cd/chained-ci-handson |
| 120 | |
| 121 | You 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 | |
| 131 | If you want to report your results to the community, do not hesitate to contact |
| 132 | the integration team. The Test database is public but the pods must be declared |
| 133 | to be allowed to report results from third party labs. |
| 134 | |
| 135 | |
mrichomme | e7f0927 | 2020-01-07 11:38:43 +0100 | [diff] [blame] | 136 | ONAP Integration Testing Gate |
| 137 | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 138 | |
mrichomme | 5649e66 | 2020-03-12 14:50:19 +0100 | [diff] [blame] | 139 | 5 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 | |
| 154 | All these tests have been packaged thanks to the OPNFV Open Source tool xtesting. |
| 155 | Xtesting is a python package allowing to unify the way to declare, run tests. It |
| 156 | also ensures a consistent way to get the test results whatever the test framework |
| 157 | used (python, robotframework, bash, ...). It includes the mechanism to |
| 158 | automatically push the results to the test database using the test API. |
| 159 | It simplifies the integration in CI. |
| 160 | |
| 161 | The package can be found here https://pypi.org/project/xtesting/. |
| 162 | |
| 163 | The different ONAP xtesting dockers can be found on https://gitlab.com/Orange-OpenSource/lfn/onap/integration/xtesting/container_registry |
| 164 | |
| 165 | As an illustration, you can run the infrastructure healthcheck by typing the |
| 166 | following 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 | |
| 171 | All the xtesting tests are included in Daily and gating chains. |
| 172 | Please note that you can build your own onap-xtesting docker if you want to |
| 173 | include your tests. See https://wiki.onap.org/pages/viewpage.action?pageId=79202765 |
| 174 | for details. |