Upadated Xappframework for Xapp registration/deregistration to RIC
[ric-plt/xapp-frame-py.git] / docs / developer-guide.rst
1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. SPDX-License-Identifier: CC-BY-4.0
3 .. Copyright (C) 2020 AT&T Intellectual Property
4
5 Developer Guide
6 ===============
7
8 This document explains how to maintain the RIC Xapp framework.
9 Information for users of this framework (i.e., Xapp developers) is in the User Guide.
10
11 Tech Stack
12 ----------
13
14 The framework requires Python version 3.7 or later, and depends on
15 these packages provided by the O-RAN-SC project and third parties:
16
17 * msgpack
18 * mdclogpy
19 * ricsdl
20
21
22 Version bumping the framework
23 -----------------------------
24
25 This project follows semver. When changes are made, the versions are in:
26
27 #. ``docs/release-notes.rst``
28 #. ``setup.py``
29
30 Version bumping RMR
31 -------------------
32
33 These items in this repo must be kept in sync with the RMR version:
34
35 #. Dockerfile-Unit-Test
36 #. examples/Dockerfile-Ping
37 #. examples/Dockerfile-Pong
38 #. ``rmr-version.yaml`` controls what version of RMR is installed for
39    unit testing in Jenkins CI
40
41 Registration/Deregistartion of Xapp
42 -----------------------------------
43
44 For registration and deregistration of Xapp following items need to be defined:
45
46 #. CONFIG_FILE_PATH variable as a environment variable in Dockerfile if running
47    Xapp as a docker container or in configmap in case of Xapp as a pod.
48 #. Copy the xappConfig.json into the docker image in Dockerfile.
49
50
51 Unit Testing
52 ------------
53
54 Running the unit tests requires the python packages ``tox`` and ``pytest``.
55
56 The RMR library is also required during unit tests. If running directly from tox
57 (outside a Docker container), install RMR according to its instructions.
58
59 Upon completion, view the test coverage like this:
60
61 ::
62
63    tox
64    open htmlcov/index.html
65
66 Alternatively, if you cannot install RMR locally, you can run the unit
67 tests in Docker. This is somewhat less nice because you don't get the
68 pretty HTML report on coverage.
69
70 ::
71
72    docker build  --no-cache -f Dockerfile-Unit-Test .