CI: Migrate tox verify from Jenkins to GHA
[ric-app/ad.git] / README.txt
1 # ==================================================================================
2 #  Copyright (c) 2020 HCL Technologies Limited.
3 #
4 #  Licensed under the Apache License, Version 2.0 (the "License");
5 #  you may not use this file except in compliance with the License.
6 #  You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 #  Unless required by applicable law or agreed to in writing, software
11 #  distributed under the License is distributed on an "AS IS" BASIS,
12 #  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 #  See the License for the specific language governing permissions and
14 #  limitations under the License.
15 # ==================================================================================
16
17 Usage of all the programs and files have been mentioned below for the reference.
18 For AD xapp we require UEReport (UE related dataset)
19
20 AD xApp expect UE data from influxDB database in following structure:
21         * There exists database with name "RIC-Test"
22         * Inside "RIC-Test" database we have measurments namely "UEReports"
23         
24 Note: *We need to update ad_config.ini with influxdb configuration. 
25 Update host as one of the following:
26         1. influxdb service ruuning in RIC platform (host = <service name>.<namespace>) 
27            OR IP of influxdb pod
28         2. Update user and password for influxDB instance
29
30 To polpulate influxdb with static data provided in .csv (ue.csv). 
31         1. Run "python3 insert.py"
32         2. Wait for few minutes before deploying AD xApp
33         Note: This will be depreciated in next release when there will be data coming from KPIMON
34         
35
36 AD xApp performs following:
37
38 * Initiates xapp api, make connection with influxDB and runs the entry() using xapp.run()
39 * If Model is not present in the current path, 
40    a) Read history data from InfluxDB
41    b) apply pre-processing steps
42    c) trigger Training of ML model.
43    d) after model validation, save transformation, model artifacts
44 * Detect anomalous user in real-time. 
45    a) Read live data from influxDB every 0.5 second
46    b) Detect anomalous records on given input
47    c) Investigate degradation type for anomalous users
48 * Listens to RMR port for A1 policy (message type 20011) in a format given below. Which consists throughput threshold parameter (default: 70%) for an degradataion event to qualify for a handover
49    {'operation': 'CREATE', 'payload': '{\"thp_threshold\":74}', 'policy_instance_id': 'demo-1', 'policy_type_id': '9997'}"}
50 * Send the ue-id, DU-ID, Degradation type and timestamp for the qualified anomalous records to the Traffic Steering (via rmr with the message type as 30003)
51 * Get the acknowledgement message from the traffic steering 
52 * store xApp result in "AD" measurement of influxDB
53
54 Note: Need to implement the logic if we do not get the acknowledgment from the TS. (How xapp api handle this?)