- Update docs 44/10144/6 master
authorminhac.lee <minhac.lee@samsung.com>
Wed, 14 Dec 2022 23:44:45 +0000 (08:44 +0900)
committerminhac.lee <minhac.lee@samsung.com>
Thu, 15 Dec 2022 01:34:09 +0000 (10:34 +0900)
- Formatting docs
- Added RMR msg `TS_QOE_PRED_REQ` to handle msg from QP driver
- Add license header to _test.go
- Added test command to get coverage report

Issue-Id: AIMLFW-12

Signed-off-by: minhac.lee <minhac.lee@samsung.com>
Change-Id: Ie30bb0d72859e689338ceac306b29f04389810fa

Dockerfile
config/config-file.json
control/control_test.go
control/mocks/fake_rmr_client.go
docs/overview.rst
docs/user-guide.rst

index edc4ead..03d7c26 100644 (file)
@@ -24,6 +24,7 @@ RUN apt-get update && apt-get install -y \
     build-essential \
     && apt-get clean
 
     build-essential \
     && apt-get clean
 
+ENV LD_LIBRARY_PATH /usr/local/lib
 ENV PATH $PATH:/usr/local/bin:$GOPATH/bin
 
 RUN mkdir /opt/qoe-aiml-assist
 ENV PATH $PATH:/usr/local/bin:$GOPATH/bin
 
 RUN mkdir /opt/qoe-aiml-assist
@@ -35,6 +36,13 @@ COPY . .
 
 RUN go mod tidy -compat=1.17 && go mod vendor && go build -o build/qoe-aiml-assist
 
 
 RUN go mod tidy -compat=1.17 && go mod vendor && go build -o build/qoe-aiml-assist
 
+# for unittest
+RUN sed -r "s/^(::1.*)/#\1/" /etc/hosts > /etc/hosts.new \
+    && cat /etc/hosts.new > /etc/hosts \
+    && cat /etc/hosts \
+    && go test -v ./influx ./control -test.coverprofile /tmp/qp_cover.out \
+    && go tool cover -html=/tmp/qp_cover.out -o /tmp/qp_cover.html
+
 FROM ubuntu:20.04
 
 ENV CFG_FILE=config/config-file.json
 FROM ubuntu:20.04
 
 ENV CFG_FILE=config/config-file.json
@@ -52,4 +60,6 @@ COPY --from=builder /opt/qoe-aiml-assist/build/qoe-aiml-assist .
 COPY --from=builder /usr/local/include /usr/local/include
 COPY --from=builder /usr/local/lib /usr/local/lib
 COPY --from=builder /opt/qoe-aiml-assist/config/* /opt/ric/config/
 COPY --from=builder /usr/local/include /usr/local/include
 COPY --from=builder /usr/local/lib /usr/local/lib
 COPY --from=builder /opt/qoe-aiml-assist/config/* /opt/ric/config/
+COPY --from=builder /tmp/qp_cover.* /tmp/
+
 RUN ldconfig
 RUN ldconfig
index 48d23cc..503559f 100644 (file)
@@ -70,7 +70,8 @@
                 "port": 4560,
                 "rxMessages": [
                     "RIC_HEALTH_CHECK_REQ",
                 "port": 4560,
                 "rxMessages": [
                     "RIC_HEALTH_CHECK_REQ",
-                    "TS_UE_LIST"
+                    "TS_UE_LIST",
+                    "TS_QOE_PRED_REQ"
                 ],
                 "txMessages": [
                     "RIC_HEALTH_CHECK_RESP",
                 ],
                 "txMessages": [
                     "RIC_HEALTH_CHECK_RESP",
         ],
         "rxMessages": [
             "RIC_HEALTH_CHECK_REQ",
         ],
         "rxMessages": [
             "RIC_HEALTH_CHECK_REQ",
-            "TS_UE_LIST"
+            "TS_UE_LIST",
+            "TS_QOE_PRED_REQ"
         ],
         "policies": [
             1
         ],
         "policies": [
             1
index c114976..ae0f9bf 100644 (file)
@@ -1,3 +1,21 @@
+/*
+==================================================================================
+      Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+==================================================================================
+*/
 package control
 
 import (
 package control
 
 import (
index 81e09ec..dc1975e 100644 (file)
@@ -1,3 +1,21 @@
+/*
+==================================================================================
+      Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+  Licensed under the Apache License, Version 2.0 (the "License");
+  you may not use this file except in compliance with the License.
+  You may obtain a copy of the License at
+
+         http://www.apache.org/licenses/LICENSE-2.0
+
+  Unless required by applicable law or agreed to in writing, software
+  distributed under the License is distributed on an "AS IS" BASIS,
+  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+  See the License for the specific language governing permissions and
+  limitations under the License.
+
+==================================================================================
+*/
 package mocks
 
 import "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
 package mocks
 
 import "gerrit.o-ran-sc.org/r/ric-plt/xapp-frame/pkg/xapp"
index 7f9e4e2..e337dd1 100644 (file)
@@ -10,19 +10,75 @@ QoE Prediction assist xApp(ric-app-qp-aimlfw) is an xApp that supports QoE Predi
 The difference from the existing QoE Prediction(ric-app-qp) is that the function to interact with the MLxApp of AIMLFW is added and the inference function is removing.
 The main operations are as follows:
 
 The difference from the existing QoE Prediction(ric-app-qp) is that the function to interact with the MLxApp of AIMLFW is added and the inference function is removing.
 The main operations are as follows:
 
-#. Traffic Steering xApp transmits prediction request to QoE Prediction assist xApp.
-#. QoE Prediction assist xApp builds prediction request message using cell metrics from influxdb and then sends prediction request to MLxApp. Cell Metrics are stored in the influxDB by the KPIMON xApp.
+#. QP Driver xApp transmits prediction request to QoE Prediction assist xApp.
+#. QoE Prediction assist xApp builds prediction request message and then sends prediction request to MLxApp.
 #. QoE Prediction assist xApp receives the result of prediction from MLxApp.
 #. QoE Prediction assist xApp transmits the received prediction result to Traffic Sterring xApp.
 
 
 Expected Input
 --------------
 #. QoE Prediction assist xApp receives the result of prediction from MLxApp.
 #. QoE Prediction assist xApp transmits the received prediction result to Traffic Sterring xApp.
 
 
 Expected Input
 --------------
-QoE Prediction assist xApp expects the following message along with the `TS_UE_LIST` message type through RMR.
+QoE Prediction assist xApp expects the following message along with the `TS_QOE_PRED_REQ` message type through RMR.
 
 .. code-block:: none 
 
 
 .. code-block:: none 
 
-{"UEPredictionSet": ["Car-1"]}
+    {
+        PredictionUE: "12345",
+               UEMeasurement: {
+                       ServingCellID:            "310-680-200-555002",
+                       MeasTimestampUEPDCPBytes: "2020-03-18 02:23:18.220",
+                       MeasPeriodUEPDCPBytes:    20,
+                       UEPDCPBytesDL:            2500000,
+                       UEPDCPBytesUL:            1000000,
+                       MeasTimestampUEPRBUsage:  "2020-03-18 02:23:18.220",
+                       MeasPeriodUEPRBUsage:     20,
+                       UEPRBUsageDL:             10,
+                       UEPRBUsageUL:             30,
+               },
+               CellMeasurements: [
+                       {
+                               CellID:                 "310-680-220-555001",
+                               MeasTimestampPDCPBytes: "2020-03-18 02:23:18.220",
+                               MeasPeriodPDCPBytes:    20,
+                               PDCPBytesDL:            250000,
+                               PDCPBytesUL:            100000,
+                               MeasTimestampAvailPRB:  "2020-03-18 02:23:18.220",
+                               MeasPeriodAvailPRB:     20,
+                               AvailPRBDL:             30,
+                               AvailPRBUL:             50,
+                               MeasTimestampRF:        "2020-03-18 02:23:18.220",
+                               MeasPeriodRF:           40,
+                               RFMeasurements:         data.RFMeasurement{RSRP: -90, RSRQ: -13, RSSINR: -2.5},
+                       },
+                       {
+                               CellID:                 "310-680-220-555003",
+                               MeasTimestampPDCPBytes: "2020-03-18 02:23:18.220",
+                               MeasPeriodPDCPBytes:    20,
+                               PDCPBytesDL:            200000,
+                               PDCPBytesUL:            120000,
+                               MeasTimestampAvailPRB:  "2020-03-18 02:23:18.220",
+                               MeasPeriodAvailPRB:     20,
+                               AvailPRBDL:             60,
+                               AvailPRBUL:             80,
+                               MeasTimestampRF:        "2020-03-18 02:23:18.220",
+                               MeasPeriodRF:           40,
+                               RFMeasurements:         data.RFMeasurement{RSRP: -140, RSRQ: -17, RSSINR: -6},
+                       },
+                       {
+                               CellID:                 "310-680-220-555002",
+                               MeasTimestampPDCPBytes: "2020-03-18 02:23:18.220",
+                               MeasPeriodPDCPBytes:    20,
+                               PDCPBytesDL:            190000,
+                               PDCPBytesUL:            100000,
+                               MeasTimestampAvailPRB:  "2020-03-18 02:23:18.220",
+                               MeasPeriodAvailPRB:     20,
+                               AvailPRBDL:             30,
+                               AvailPRBUL:             45,
+                               MeasTimestampRF:        "2020-03-18 02:23:18.220",
+                               MeasPeriodRF:           40,
+                               RFMeasurements:         data.RFMeasurement{RSRP: -115, RSRQ: -16, RSSINR: -5},
+                       }]
+       }
 
 
 Expected Output
 
 
 Expected Output
index 7a6614f..d467fc9 100644 (file)
@@ -12,41 +12,40 @@ User-Guide
 
 Overview
 --------
 
 Overview
 --------
-- The entire operation scenario can be checked when deployed with KPIMON xApp, Traffic Sterring xApp.
+- The entire operation scenario can be checked when deployed with KPIMON xApp, Traffic Steering xApp and QP Driver xApp.
 - This is compatible with influxDB2.
 
 Build Image
 -----------
 - This is compatible with influxDB2.
 
 Build Image
 -----------
-Use the `build_images.sh` script for docker image build.
-We can change the name and tag of an image by changing the variables in the script.
+Use the `docker build` command for docker image build.
 
 .. code-block:: none 
 
 
 .. code-block:: none 
 
-qp-aimlfw $ docker build -f Dockerfile .
-
-Setting up curl (7.68.0-1ubuntu2.14) ...
-Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
-Processing triggers for ca-certificates (20211016ubuntu0.20.04.1) ...
-Updating certificates in /etc/ssl/certs...
-0 added, 0 removed; done.
-Running hooks in /etc/ca-certificates/update.d...
-done.
-Removing intermediate container 694003ecb2e1
----> 18d14cdf7365
-Step 15/19 : COPY --from=builder /opt/qoe-aiml-assist/build/qoe-aiml-assist .
----> 20d6be2c65b1
-Step 16/19 : COPY --from=builder /usr/local/include /usr/local/include
----> e5f0c6465df4
-Step 17/19 : COPY --from=builder /usr/local/lib /usr/local/lib
----> 5bcaca789e8c
-Step 18/19 : COPY --from=builder /opt/qoe-aiml-assist/config/* /opt/ric/config/
----> a5ef330d90df
-Step 19/19 : RUN ldconfig
----> Running in b6ee4f81f4ff
-Removing intermediate container b6ee4f81f4ff
----> 91d0473a7cf1
-Successfully built 91d0473a7cf1
-Successfully tagged nexus3.o-ran-sc.org:10004/o-ran-sc/ric-app-qp-aimlfw-docker:1.0.0
+    qp-aimlfw $ docker build -f Dockerfile .
+
+    Setting up curl (7.68.0-1ubuntu2.14) ...
+    Processing triggers for libc-bin (2.31-0ubuntu9.9) ...
+    Processing triggers for ca-certificates (20211016ubuntu0.20.04.1) ...
+    Updating certificates in /etc/ssl/certs...
+    0 added, 0 removed; done.
+    Running hooks in /etc/ca-certificates/update.d...
+    done.
+    Removing intermediate container 694003ecb2e1
+     ---> 18d14cdf7365
+    Step 15/19 : COPY --from=builder /opt/qoe-aiml-assist/build/qoe-aiml-assist .
+      ---> 20d6be2c65b1
+    Step 16/19 : COPY --from=builder /usr/local/include /usr/local/include
+      ---> e5f0c6465df4
+    Step 17/19 : COPY --from=builder /usr/local/lib /usr/local/lib
+      ---> 5bcaca789e8c
+    Step 18/19 : COPY --from=builder /opt/qoe-aiml-assist/config/* /opt/ric/config/
+      ---> a5ef330d90df
+    Step 19/19 : RUN ldconfig
+      ---> Running in b6ee4f81f4ff
+    Removing intermediate container b6ee4f81f4ff
+      ---> 91d0473a7cf1
+    Successfully built 91d0473a7cf1
+    Successfully tagged nexus3.o-ran-sc.org:10004/o-ran-sc/ric-app-qp-aimlfw-docker:1.0.0
 
 
 Environments of qp-aimlfw
 
 
 Environments of qp-aimlfw
@@ -54,16 +53,28 @@ Environments of qp-aimlfw
 By modifying the `config/config-file.json` file before onboarding, we can change the environment variable of the QoE Prediction assist xApp.
 Below is a description of the configurable environmental variables related to QoE xApp.
 
 By modifying the `config/config-file.json` file before onboarding, we can change the environment variable of the QoE Prediction assist xApp.
 Below is a description of the configurable environmental variables related to QoE xApp.
 
-`INFLUX_URL` : URL contianing the address and port of influxDB. ex) "http://127.0.0.1:8086"
-`INFLUX_TOKEN` : a influx token composed of alphabets and numbers. 
-`INFLUX_BUCKET` : a bucket name of influxDB.
-`INFLUX_ORG` : organization name of influxDB.
-`INFLUX_QUERY_START` : start point of the influxDB query range ex) "-3m" or "-10s"
-`INFLUX_QUERY_STOP` : end point of the influxDB query range. If this value is not set like `""`, the end point is set to the current time(now). ex) "-1m" or "" 
-`MLXAPP_REQ_HEADER_HOST` : header of MLxApp's host. ex) "qoe-model.kserve-test.example.com" 
-`MLXAPP_HOST` : host address of MLxApp. ex) "http://127.0.0.1" 
-`MLXAPP_PORT` : port number of MLxApp. ex) "2222"
-`MLXAPP_REQ_URL` : requet URL of MLxapp. ex) "v1/models/qoe-model:predict"
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_URL`            | URL contianing the address and port of influxDB. ex) "http://127.0.0.1:8086"   |
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_TOKEN`          |a influx token composed of alphabets and numbers.                               |
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_BUCKET`         | a bucket name of influxDB.                                                     |
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_ORG`            | organization name of influxDB.                                                 |
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_QUERY_START`    | start point of the influxDB query range ex) "-3m" or "-10s"                    |
++------------------------+--------------------------------------------------------------------------------+
+|`INFLUX_QUERY_STOP`     | end point of the influxDB query range. If this value is not set like `""`,     |
+|                        | the end point is set to the current time(now). ex) "-1m" or ""                 |
++------------------------+--------------------------------------------------------------------------------+
+|`MLXAPP_REQ_HEADER_HOST`| header of MLxApp's host. ex) "qoe-model.kserve-test.example.com"               |
++------------------------+--------------------------------------------------------------------------------+
+|`MLXAPP_HOST`           | host address of MLxApp. ex) "http://127.0.0.1"                                 |
++------------------------+--------------------------------------------------------------------------------+
+|`MLXAPP_PORT`           | port number of MLxApp. ex) "2222"                                              |
++------------------------+--------------------------------------------------------------------------------+
+|`MLXAPP_REQ_URL`        |requet URL of MLxapp. ex) "v1/models/qoe-model:predict"                         |
++------------------------+--------------------------------------------------------------------------------+
 
 
 Onboarding of qp-aimlfw using `dms_cli` tool
 
 
 Onboarding of qp-aimlfw using `dms_cli` tool
@@ -74,23 +85,23 @@ For onboarding, `dms_cli` and helm3 are required. `dms_cli` can be referred to i
 
 .. code-block:: none 
 
 
 .. code-block:: none 
 
-$ dms_cli onboard --config_file_path=config/config-file.json --schema_file_path=config/schema.json
+    $ dms_cli onboard --config_file_path=config/config-file.json --schema_file_path=config/schema.json
 
 
-httpGet:
-path: '{{ index .Values "readinessProbe" "httpGet" "path" | toJson }}'
-port: '{{ index .Values "readinessProbe" "httpGet" "port" | toJson }}'
-initialDelaySeconds: '{{ index .Values "readinessProbe" "initialDelaySeconds" | toJson }}'
-periodSeconds: '{{ index .Values "readinessProbe" "periodSeconds" | toJson }}'
+    httpGet:
+    path: '{{ index .Values "readinessProbe" "httpGet" "path" | toJson }}'
+    port: '{{ index .Values "readinessProbe" "httpGet" "port" | toJson }}'
+    initialDelaySeconds: '{{ index .Values "readinessProbe" "initialDelaySeconds" | toJson }}'
+    periodSeconds: '{{ index .Values "readinessProbe" "periodSeconds" | toJson }}'
 
 
-httpGet:
-path: '{{ index .Values "livenessProbe" "httpGet" "path" | toJson }}'
-port: '{{ index .Values "livenessProbe" "httpGet" "port" | toJson }}'
-initialDelaySeconds: '{{ index .Values "livenessProbe" "initialDelaySeconds" | toJson }}'
-periodSeconds: '{{ index .Values "livenessProbe" "periodSeconds" | toJson }}'
+    httpGet:
+    path: '{{ index .Values "livenessProbe" "httpGet" "path" | toJson }}'
+    port: '{{ index .Values "livenessProbe" "httpGet" "port" | toJson }}'
+    initialDelaySeconds: '{{ index .Values "livenessProbe" "initialDelaySeconds" | toJson }}'
+    periodSeconds: '{{ index .Values "livenessProbe" "periodSeconds" | toJson }}'
 
 
-{
-"status": "Created"
-}
+    {
+    "status": "Created"
+    }
 
 
 Deployment of qp-aimlfw using `dms_cli` tool
 
 
 Deployment of qp-aimlfw using `dms_cli` tool
@@ -99,21 +110,21 @@ Deploy the onboarded QoE Prediction assist xApp using `dms_cli`.
 
 .. code-block:: none 
 
 
 .. code-block:: none 
 
-$ dms_cli install --xapp_chart_name=qoe-aiml-assist --version=1.0.0 --namespace=ricxapp
+    $ dms_cli install --xapp_chart_name=qoe-aiml-assist --version=1.0.0 --namespace=ricxapp
 
 
-status: OK
+    status: OK
 
 
-Check if QoE Prediction assist xApp deployed normally.
+    Check if QoE Prediction assist xApp deployed normally.
 
 .. code-block:: none 
 
 
 .. code-block:: none 
 
-$ kubectl get pods -n ricxapp
-NAME                                       READY   STATUS    RESTARTS   AGE
-ricxapp-qoe-aiml-assist-5f788bb667-47k5h   0/1     Pending   0          3m
+    $ kubectl get pods -n ricxapp
+    NAME                                       READY   STATUS    RESTARTS   AGE
+    ricxapp-qoe-aiml-assist-5f788bb667-47k5h   0/1     Pending   0          3m
 
 
 
 
-$ kubectl get svc -n=ricxapp
-NAME                                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
-aux-entry                              ClusterIP   10.106.133.25   <none>        80/TCP,443/TCP      8d
-service-ricxapp-qoe-aiml-assist-http   ClusterIP   10.96.95.160    <none>        8080/TCP            129m
-service-ricxapp-qoe-aiml-assist-rmr    ClusterIP   10.107.182.86   <none>        4560/TCP,4561/TCP   129m
+    $ kubectl get svc -n=ricxapp
+    NAME                                   TYPE        CLUSTER-IP      EXTERNAL-IP   PORT(S)             AGE
+    aux-entry                              ClusterIP   10.106.133.25   <none>        80/TCP,443/TCP      8d
+    service-ricxapp-qoe-aiml-assist-http   ClusterIP   10.96.95.160    <none>        8080/TCP            129m
+    service-ricxapp-qoe-aiml-assist-rmr    ClusterIP   10.107.182.86   <none>        4560/TCP,4561/TCP   129m