Refactoring of the entire dev deployment
[oam.git] / solution / dev / README.md
1 # Service Management and Orchestration (SMO)
2
3 ##### Table of Contents
4 [Service Management and Orchestration (SMO)](#service-management-and-orchestration-smo)
5 - [Introduction](#introduction)
6 - [Overview](#overview)
7 - [Prerequisites](#prerequisites)
8 - [Usage](#usage)
9   - [Bring Up Solution](#bring-up-solution)
10   - [Log files and karaf console](#log-files-and-karaf-console)
11   - [Customizing Solution](#customizing-solution)
12   - [Verification Solution](#verification-solution)
13     - [Access to SDN-R UX](#access-to-sdn-r-ux)
14   - [Terminate solution](#terminate-solution)
15   - [Cleanup](#cleanup)
16   - [Troubleshooting](#troubleshooting)
17
18 ## Introduction
19
20 With respect to OAM the SMO implements the O1-interface consumers. According to the O-RAN OAM Architecture and the O-RAN OAM Interface Specification, the SMO implements a NetConf Client for configuration and a HTTP/REST/VES server for receiving all kind of events in a VES format.
21
22 The setup contains an OpenDaylight based NetConf client and a VES Collector.
23
24 ## Overview
25
26 This docker-compose file starts a pre-configured, self-contained SDN-R solution 
27 for developer test or demo purposes
28
29   * **SDN-R** single node instance
30
31     ... representing the NetConf consumer on the Service Management and 
32     Orchestration framework (SMO) for the O1 interface based on 
33     ODL-Silicon/ONAP-Istanbul
34
35   * **VES collector**
36
37     ... representing the VES (REST) provider at SMO for all kind of events.
38
39   * **DMaaP**
40     ... representing SMO DMaaP component, includes message-router
41
42 ## Prerequisites
43
44 ```
45 $ cat /etc/os-release | grep PRETTY_NAME
46 PRETTY_NAME="Ubuntu 20.04.2 LTS"
47
48 $ docker --version
49 Docker version 20.10.2, build 20.10.2-0ubuntu1~20.04.2
50
51 $ docker-compose --version
52 docker-compose version 1.29.1, build c34c88b2
53
54 $ git --version
55 git version 2.25.1
56
57 ```
58
59 ## Usage
60
61 ### Bring Up Solution
62
63 #### Check (adjust if required) environment variables
64
65 ```
66 nano .env
67 ```
68
69 #### Startup solution
70
71 Please note that it is necessary to configure first the identity service,
72 before starting further docker images.
73
74 ```
75 docker-compose up -d
76 ```
77
78 The ntsim-ng configured for O1-interfaces nodes (e.g. O-DU) sends a ves:pnfRegistration event
79 every time the docker container is started.
80
81 Due to the fact that the first VES event gets "lost" please stop and start the 
82 ntsim-ng container **min 2 times**, AFTER you could log in to ODLUX (http://localhost:8181/odlux/index.html).
83
84
85 ```
86 docker-compose restart ntsim-ng-o-du-1122
87
88 docker-compose restart ntsim-ng-o-du-1122
89 ```
90
91
92 ![ves:pnfRegistration in ODLUX](docs/nstim-ng-connected-after-ves-pnf-registration-in-odlux.png "ves:pnfRegistration in ODLUX")
93
94 Once a new mount-point is created, it is possible to configure ntsim-ng, in a
95 way that automatically fault messaged are send to the ves-collector.
96
97 ```
98 $ python config-ntsim-ngs.py 
99 Set highstreet-O-DU-1122 True
100 ```
101
102 'True' indicated that the settings through SDN-R to the NETCONF server were
103 successful. 
104
105 SDN-R reads the fault events from DMaaP and processes them. 
106 Finally the fault events are visible in ODLUX.
107
108 ![ves:fault in ODLUX](docs/ves-fault-in-odlux.png "ves:fault in ODLUX")
109
110
111 ### Log files and karaf console
112
113 #### ODL karaf.logs
114
115 ```
116 docker exec -it sdnr tail -f /opt/opendaylight/data/log/karaf.log
117 ```
118
119 #### karaf console access (karaf:karaf)
120
121 ```
122 ssh karaf@localhost -p 8101
123 ```
124
125 #### ves-collector logs
126
127 ```
128 docker logs -f ves-collector
129 ```
130
131 ### Customizing Solution
132
133 '.env' file contains customizing parameters
134
135 ### Verification Solution
136
137 #### Access to SDN-R ODLUX
138
139 ##### Login into SDN-R
140
141     http://<host_ip>:8181/odlux/index.html
142
143     User: admin // see .env file
144     
145     Password: Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U
146
147 In case of trouble, please update the commands with your customized '.env' file.
148
149 ### Terminate solution
150
151 To stop all container:
152
153 ```
154 docker-compose down
155 ```
156
157 re-start solution at any point in time with
158 ```
159 docker-compose up -d
160 ```
161
162 ### Cleanup
163
164 !!! be careful if other stopped containers are on the same system
165 ```
166 docker system prune -a -f
167 ```
168 ### Troubleshooting
169
170 In most cases the .env setting do not fit to the environment and need to be
171 adjusted.
172
173 Please make sure that the network settings to not overlap with other networks.
174
175 The commands ...
176 ```
177 docker ps -a
178 docker-compose ps
179
180 ## Prerequisites
181 # python3, tmux, libtmux
182 tmux new-session -n workspace -s integration
183
184 # within tmux session
185 python tmux-logging.py
186 ```
187 ... are your friends.
188
189 ![tmux logging](docs/tmux-logging.png "tmux logging")