summaryrefslogtreecommitdiffstats
path: root/docs/xci-overview.rst
blob: 575eb37c8aabe2b4caad6f80d2fdeba2363e473f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
.. _xci-overview:

.. This work is licensed under a Creative Commons Attribution 4.0 International License.
.. SPDX-License-Identifier: CC-BY-4.0
.. (c) Fatih Degirmenci (fatih.degirmenci@ericsson.com)

======================================
Cross Community Continuous Integration
======================================

Introduction
============

OPNFV develops, operates, and maintains its Continuous Integration (CI) process
used by OPNFV community to develop, integrate, test and release the integrated
reference platform for NFV.

During past releases, OPNFV released different flavors (scenarios) of the
platform in an entirely automated fashion, resulting in feedback to OPNFV itself
and other communities OPNFV works with. This enabled the community to implement
new features, identify/fix bugs directly in corresponding
upstream communities.

The development and release model employed by OPNFV during the past releases
used stable versions of upstream components. This helps developers and users
who are focused on stability however requires a lot of time for development,
integration, and testing, thus resulting in a slower pace of innovation.

In order to increase the speed of development and evolution of the platform,
OPNFV needs to provide means for its developers and users. One of the ways to
achieve this is to ensure developers have access to the latest versions of the
upstream components they are developing, integrating, and testing.

Based on this need, OPNFV Infrastructure Working Group (Infra WG) started the
Cross Community Continuous Integration (XCI) initiative, bringing in a new
development and release model into OPNFV which is based on Continuous Delivery
and DevOps practices and principles.

Focus Areas
===========

Enabling Continuous Delivery
----------------------------

By definition, XCI focuses on master branches in order to

* shorten the time it takes to introduce new features
* make it easier to identify and fix bugs
* ease the effort to develop, integrate, and test the reference
  platform
* establish additional feedback loops within OPNFV, towards the users
  and between the communities OPNFV works with
* increase the visibility regarding the state of things at all times

XCI aims to enable this by applying basic CI/CD & DevOps principles and
following best practices such as

* fail fast, fix fast
* always have working software
* small and frequent commits
* work against the trunk, shortening development time
* fast and tailored feedback
* everything is visible to everyone all the time
* and others

By doing this, the overall quality of the platform components provided by the
upstream communities will increase greatly, making it easier for anyone to
consume them when they need them with less trouble, helping to find and fix bugs
much earlier than what it is today and develop new features.

How good this can work depends on the nature of the changes. If the changes are
atomic and more importantly complete, the value added by XCI will increase
significantly.

Putting Users and Developers First
----------------------------------

Apart from applying the principles and following the best practices, XCI puts
the users and developers first by pushing for

* less burden on developers as they do not need to be aware of all details that
  are not of their interest/concern
* reduced complexity
* an easy way to try and develop things
* speed, helping developers to bring their scenarios to OPNFV faster
* a real scenario ownership

The proof of the user and developer centric approach is that the first thing
XCI made available is the sandbox for users and developers to try things out.

Keeping Quality, Confidence and Predictability High
---------------------------------------------------

Another and perhaps the most crucial concern for XCI is to keep the quality high,
increase the confidence, have predictability, and have the availability of the
latest versions earlier. Some of the prerequisites to fulfill these goals are

* Test early and often
* Know the quality at all times
* Make the platform available early so people have time to develop, integrate,
  and test their work
* Avoid big bang uplifts
* Avoid surprises

Source Based Deployments
------------------------

CI starts on developer workstation and this is the fastest feedback a developer
can get. In order to ensure developers can apply this principle, they need the
tools and ways to enable fast development and test cycles that are repeatable as
many times as necessary without hassle.

One way to achieve this is to bring developers closer to the source and remove
anything between them. This means that what XCI brings is not only deploying from
upstream master branches but doing that from source with no intermediaries in between.

A simple scenario that demostrates the value of bringing capability of source based
deployments to OPNFV can be seen on the diagram below.

.. image:: images/source-based-dev.png
   :height: 240px
   :align: center

As you can see on the diagram, XCI provides tools and ways for developers to

* patch the source code on their laptop
* get the patch deployed to the stack with a single command
* run the tests
* fix if something is broken
* repeat the cycle until they are satisfied with it and have confidence in it
* send the patch for review and CI

This does not mean XCI will completely skip using artifacts. Artifact based
deployments will be available in later CI loops such as daily/weekly, but the
developer near loops will be run using source code.

Multi-distro Support
--------------------

Giving choice and not imposing things on developers and users are two
of the important aspects of XCI. This means that if they want to have all in one
deployments, they should be able to do that by using
:ref:`different flavors <sandbox-flavors>` provided by XCI.

Multi-distro support falls into same category for XCI; giving choice and making
sure people can pick and choose what Linux distribution they want to use.

XCI currently supports Ubuntu 16.04, CentOS 7, and openSUSE Leap 42.3 and the
choice is entirely left to the user.

Feature parity between the OPNFV scenarios on different Linux distributions
that are supported by XCI may vary and it is possible for OPNFV community
to work on bringing them to the same level.

XCI Pipelines
=============

Providing timely and tailored feedback is one of the most important things about
CI. It is important to make the feedback easily accessible and consumable for the
community so the issues can be analysed as quickly as possible and fixes can be
issued appropriately.

XCI focuses on feedback aspects of the CI and ensures that whatever feedback provided
to community makes sense rather than just pointing to some logs. In order to
achieve this, XCI enhances existing feedback loops and establishes new ones based on
who needs the feedback. XCI does this by its pipelines as listed below.

Pipelines for Upstream Projects
-------------------------------

OPNFV work upstream first which means that majority of the work is done in upstream
projects. The upstream projects OPNFV works with have CI pipelines for the code
contributed but the pipelines generally lack the testing that is important for
the OPNFV community.

XCI aims to provide patch level feedback and feedback based on the tip of the master
branches for the upstream projects. This means that if an OPNFV developer contributes
to an upstream project, it will be possible for developer to get additional feedback
from OPNFV XCI in order to ensure the contribution works in OPNFV context
as well. The level of testing will be adjusted based on the community needs and it
is important not to duplicate the testing done by the upstream communities in their
CI pipelines.

Apart from providing feedback to the developers, these pipelines will be used for
finding working versions of upstream components from their master branches to pin
them for development purposes.

.. image:: images/pipelines-upstream.png
   :height: 320px
   :align: center

Please note that the types and scope of testing done by XCI vary for different
projects and the work for enabling pipelines is still in progress which heavily
depends on the readiness of the upstream projects.

Pipelines for OPNFV Scenarios
-----------------------------

OPNFV CI has pipelines for scenarios constructed by the OPNFV projects. However
the existing pipelines have number of areas that require improvements.

The existing pipelines lack the granularity one might expect. This means that the
changes to the scenarios are either not tested properly or tested together with
unrelated scenarios, resulting in lack of testing or taking too much time to get
feedback.

Apart from the test coverage and the time it takes to test, scenarios are generally
tested on a daily basis on baremetal even if it may not be necessary and there are
no changes.

XCI will change how the feedback is provided for the scenarios by pushing scenario
ownership to corresponding projects and establishing loops for patchset verification,
daily and weekly tests. This means that if a scenario changes in a project repo,
verification for that scenario will directly be triggered and testing will be done using
virtual deployments, providing feedback to the project.

Daily and weekly loops will be run on baremetal if and only if the scenario is worth
testing on baremetal. This will be achieved by applying promotion concepts; if a
scenario passes virtual deployments, it will be tested by daily loops on baremetal
and by weekly loops later on.

.. image:: images/pipelines-scenarios.png
   :height: 320px
   :align: center

Pipelines for OPNFV Test Projects
---------------------------------

OPNFV Test Projects generally lack the CI coverage they need. Most of the test projects
only have unit tests, resulting in faults slipping into platform testing, making it
harder for community to understand what really went wrong; for example, is there a
problem with the scenario itself or is the problem with the test framework/cases?

XCI aims to establish proper CI pipelines for the test projects by employing
virtual deployments, so any change that is done to test frameworks/cases
themselves will be tested against a real virtual deployment. The deployments
will be brought up using a verified version of the relevant scenario and via snapshots
so the patch verification will be relevant and quick. If the testing at this level fails,
it is most probably due to the patch itself rather than the scenario, preventing
faulty code from slipping into master branch of the test project. Further feedback loops,
such as post-merge, can be established depending on the needs of the community.

.. image:: images/pipelines-testprojects.png
   :height: 320px
   :align: center

Pipelines for XCI Framework and Sandbox
---------------------------------------

XCI itself needs to be tested properly in order to ensure the changes to the framework
or the sandbox do not break anything for the community.

Putting All Together
--------------------

All the pipelines explained in earlier sections run in parallel and as independently
from each other as possible, providing feedback to relevant communities and people
so they can get the feedback that fit their purposes.

Output of these pipelines (verdicts, artifacts, and so on) are also used by each
of the pipelines appropriately, ensuring that the pipeline uses well tested versions
of artifacts they need.

An example of this could be the pipelines for OPNFV test projects and the pipelines
for the OPNFV scenarios. Pipelines for OPNFV projects need verified versions of the
scenarios to gate changes coming to test project repositories so they can be tested
in isolation. This means that whatever goes wrong during the gate is probably due to
change itself and not because of the scenario since the scenario is tested long before
and promoted to test pipeline to be used for gating.

Similar thing is valid for the OPNFV scenarios as well; the pipelines
need verified versions of test frameworks/cases so when scenario is put on a baremetal
and tested, only thing that really changed and possibily of causing a failure
is the scenario itself.

.. image:: images/pipelines-parallel.png
   :height: 480px
   :align: center

How to Get Involved
===================

OPNFV XCI is an initiative driven by OPNFV community and receives contributions from
various open source communities such as `OpenStack <https://www.openstack.org/>`_ and
`OpenDaylight <https://www.opendaylight.org/>`_.

Anyone can contribute to XCI by trying the :ref:`XCI Sandbox <xci-user-guide>`, issuing
bug reports, updating the documentation, or contributing the code.

You can get in touch with XCI developers on ``#opnfv-pharos`` IRC channel
on Freenode or send mail to ``opnfv-users@lists.opnfv.org`` for any questions
you might have.