Improve documentation
[portal/nonrtric-controlpanel.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 Nordix
4
5 Developer Guide
6 ===============
7
8 This document provides a quickstart for developers of the Non-RT RIC Control Panel.
9
10 The Non-RT RIC Control Panel is an interface that allows human users to create, edit and delete policy instances, for
11 each existing policy type. The policy types and their definitions are retrieved from each Near-RT RIC. It is also
12 possible to change the configuration of available RICs, provided that Consul is not used.
13
14 Additionally, producers and jobs for the Enrichment Information coordinator service can be viewed.
15
16 See the README.md file in the nonrtric-controlpanel repo for information about how to use it.
17
18 Start the Control Panel for development
19 ---------------------------------------
20
21 To run the Control Panel locally for development , follow the steps below.
22
23 First, fetch the latest code from `gerrit <https://gerrit.o-ran-sc.org/r/admin/repos/portal/nonrtric-controlpanel>`_ and
24 go in to the frontend folder in the repo:
25
26
27     +----------------------------------------------------+
28     | cd nonrtric-controlpanel/webapp-frontend           |
29     +----------------------------------------------------+
30
31 The Control Panel can be started with mock data to make it easy to develop the GUI without the need to start all services.
32 Run the following command to start with mock data:
33
34   +------------------------------+
35   | npm run start:mock           |
36   +------------------------------+
37
38 To start the frontend to get real information from Non-RT RIC services the following services need to be started first:
39
40 -  ControlPanel API Gateway
41 -  Policy Management Service,
42 -  EI Service.
43
44 By pulling the `nonrtric <https://gerrit.o-ran-sc.org/r/admin/repos/nonrtric>`__ repo and using the script
45 "PM_EI_DEMO.sh" in the folder "test/autotest", the above services will be started and populated with data. It requires
46 Docker to run. To run this script with a local version of the Control Panel, a docker image of the Control Panel must
47 first be created. To do this, run the following command:
48
49   +-------------------------------------------------------------------+
50   | docker build -t o-ran-sc/nonrtric-controlpanel:2.2.0-SNAPSHOT .   |
51   +-------------------------------------------------------------------+
52
53 Then run the following command to start the script with the local image:
54
55   +-------------------------------------------------------------------------------------------------------------------+
56   | sudo ./PM_EI_DEMO.sh remote-remove docker  --env-file ../common/test_env-oran-d-release.sh --use-local-image CP   |
57   +-------------------------------------------------------------------------------------------------------------------+
58
59 When the above servers are started and populated with data, run the following command:
60
61    +---------------------+
62    | npm start           |
63    +---------------------+
64
65 Open the URL:  `localhost:4200`_ in a browser to access the Control Panel.
66
67     .. _localhost:4200: http://localhost:4200
68
69 From the main page, click on the "Policy Control" card or use the menu on the left hand side of the page. From here, it
70 is possible to create or list instances for each existing policy type.
71
72 When the instances are listed, it is possible to edit or delete each instance from the expanded view.
73
74 .. image:: ./images/non-RT_RIC_controlpanel_Policy.PNG
75
76 It is also possible to manage the configuration of available RICs, provided that Consul is not used, from the Control Panel.
77 From the menu on the left hand side, select "Policy -> RIC Config".
78
79 .. image:: ./images/non-RT_RIC_controlpanel_ric_config.PNG
80
81
82 From the main page, click on the "Enrichment information coordinator" card or use the menu on the left hand side of the page.
83 From here it is possible to view producers and jobs from the EI service,
84
85 .. image:: ./images/non-RT_RIC_controlpanel_EI.PNG
86
87 End-to-end call
88 ---------------
89
90 In order to make a complete end-to-end call, follow the instructions given in this `guide`_.
91
92 .. _guide: https://wiki.o-ran-sc.org/pages/viewpage.action?pageId=34963461