- Added documentation files 45/10045/13
authorminhac.lee <minhac.lee@samsung.com>
Fri, 9 Dec 2022 08:30:10 +0000 (17:30 +0900)
committerminhac.lee <minhac.lee@samsung.com>
Wed, 14 Dec 2022 00:49:23 +0000 (09:49 +0900)
- Added build script

- bug fix : remove function arg

Issue-Id: AIMLFW-12

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

14 files changed:
.readthedocs.yaml [new file with mode: 0644]
Dockerfile
container-tag.yaml [new file with mode: 0644]
docs/_static/logo.png [new file with mode: 0644]
docs/conf.py [new file with mode: 0644]
docs/conf.yaml [new file with mode: 0644]
docs/favicon.ico [new file with mode: 0644]
docs/index.rst [new file with mode: 0644]
docs/overview.rst [new file with mode: 0644]
docs/release-notes.rst [new file with mode: 0644]
docs/requirements-docs.txt [new file with mode: 0644]
docs/user-guide.rst [new file with mode: 0644]
influx/influx_client.go
tox.ini [new file with mode: 0644]

diff --git a/.readthedocs.yaml b/.readthedocs.yaml
new file mode 100644 (file)
index 0000000..8df5ada
--- /dev/null
@@ -0,0 +1,16 @@
+---
+version: 2
+
+formats:
+  - htmlzip
+
+build:
+  image: latest
+
+python:
+  version: 3.7
+  install:
+    - requirements: docs/requirements-docs.txt
+
+sphinx:
+  configuration: docs/conf.py
\ No newline at end of file
index 5337f41..c7ffaab 100644 (file)
@@ -34,7 +34,7 @@ ENV GO111MODULE=on GO_ENABLED=0 GOOS=linux
 COPY . .
 
 RUN mkdir /opt/qoe-aiml-assist/build \
-    && go build -mod vendor -o /opt/qoe-aiml-assist/build/qoe-aiml-assist qoe-aiml-assist.go
+    && go mod vendor && go build -mod vendor -o /opt/qoe-aiml-assist/build/qoe-aiml-assist qoe-aiml-assist.go
 
 FROM ubuntu:20.04
 
diff --git a/container-tag.yaml b/container-tag.yaml
new file mode 100644 (file)
index 0000000..73a715b
--- /dev/null
@@ -0,0 +1,5 @@
+# The Jenkins job requires a tag to build the Docker image.
+# By default this file is in the docker build directory,
+# but the location can configured in the JJB template.
+---
+tag: "1.0.0"
diff --git a/docs/_static/logo.png b/docs/_static/logo.png
new file mode 100644 (file)
index 0000000..c3b6ce5
Binary files /dev/null and b/docs/_static/logo.png differ
diff --git a/docs/conf.py b/docs/conf.py
new file mode 100644 (file)
index 0000000..4be587c
--- /dev/null
@@ -0,0 +1,24 @@
+# ==================================================================================
+#
+#       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.
+#
+# ==================================================================================
+
+from docs_conf.conf import *
+linkcheck_ignore = [
+    'http://localhost.*',
+    'http://127.0.0.1.*',
+    'https://gerrit.o-ran-sc.org.*'
+]
diff --git a/docs/conf.yaml b/docs/conf.yaml
new file mode 100644 (file)
index 0000000..cdc7e0c
--- /dev/null
@@ -0,0 +1,6 @@
+---
+project_cfg: oran
+project: ric-app/qp-aimlfw
+
+# Change this to ReleaseBranchName to modify the header
+version: latest
\ No newline at end of file
diff --git a/docs/favicon.ico b/docs/favicon.ico
new file mode 100644 (file)
index 0000000..00b0fd0
Binary files /dev/null and b/docs/favicon.ico differ
diff --git a/docs/index.rst b/docs/index.rst
new file mode 100644 (file)
index 0000000..61d3d27
--- /dev/null
@@ -0,0 +1,18 @@
+
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-B
+.. Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+Welcome to QoE Prediction assist xapp for AIML Framework
+
+.. toctree::
+   :maxdepth: 2
+   :caption: Contents:
+
+   overview.rst
+   release-notes.rst
+   user-guide.rst
+
+* :ref:`genindex`
+* :ref:`modindex`
+* :ref:`search`
diff --git a/docs/overview.rst b/docs/overview.rst
new file mode 100644 (file)
index 0000000..7f9e4e2
--- /dev/null
@@ -0,0 +1,41 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+.. Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+QoE Prediction assist xApp Overview
+===================================
+
+QoE Prediction assist xApp(ric-app-qp-aimlfw) is an xApp that supports QoE Prediction on the AIMLFW, and an xApp of the Traffic Steering O-RAN usecase.
+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.
+#. 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.
+
+.. code-block:: none 
+
+{"UEPredictionSet": ["Car-1"]}
+
+
+Expected Output
+---------------
+QoE Prediction assist xApp transmits the following message along with the `TS_QOE_PREDICTION` message type throgh RMR.
+The message below is the prediction result for both downlink and uplink throughput.
+
+.. code-block:: none 
+
+ {"Car-1":{
+ "c6/B2": [12650, 12721],
+ "c6/N77": [12663, 12739],
+ "c1/B13": [12576, 12655],
+ "c7/B13": [12649, 12697],
+ "c5/B13": [12592, 12688]
+ }}
\ No newline at end of file
diff --git a/docs/release-notes.rst b/docs/release-notes.rst
new file mode 100644 (file)
index 0000000..afe0f27
--- /dev/null
@@ -0,0 +1,47 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+.. Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+Release-Notes
+=============
+
+This document provides the release notes for O-RAN SC G release of ric-app/qp-aimlfw
+
+.. contents::
+   :depth: 3
+   :local:
+
+
+Version history
+---------------
++--------------------+--------------------+--------------------+--------------------+
+| **Date**           | **Ver.**           | **Author**         | **Comment**        |
+|                    |                    |                    |                    |
++--------------------+--------------------+--------------------+--------------------+
+| 2022-12-15         | v1.0.0             | Minha Lee          | G Release          |
+|                    |                    | Youhwan Seol       |                    |
++--------------------+--------------------+--------------------+--------------------+
+
+Summary
+-------
+  - G release supports QoE prediction working with MLxApp
+
+Release Data
+------------
++--------------------------------------+--------------------------------------+
+| **Project**                          | QoE assist xApp                      |
+|                                      |                                      |
++--------------------------------------+--------------------------------------+
+| **Repo/commit-ID**                   | ric-app/qp-aimlfw                    |
+|                                      |                                      |
++--------------------------------------+--------------------------------------+
+| **Release designation**              | G                                    |
+|                                      |                                      |
++--------------------------------------+--------------------------------------+
+| **Release date**                     | 2022-12-19                           |
+|                                      |                                      |
++--------------------------------------+--------------------------------------+
+| **Purpose of the delivery**          | New Release                          |
+|                                      |                                      |
++--------------------------------------+--------------------------------------+
\ No newline at end of file
diff --git a/docs/requirements-docs.txt b/docs/requirements-docs.txt
new file mode 100644 (file)
index 0000000..4f9d174
--- /dev/null
@@ -0,0 +1,5 @@
+sphinx
+sphinx-rtd-theme
+sphinxcontrib-httpdomain
+recommonmark
+lfdocs-conf
\ No newline at end of file
diff --git a/docs/user-guide.rst b/docs/user-guide.rst
new file mode 100644 (file)
index 0000000..7a6614f
--- /dev/null
@@ -0,0 +1,119 @@
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. http://creativecommons.org/licenses/by/4.0
+
+.. Copyright (c) 2022 Samsung Electronics Co., Ltd. All Rights Reserved.
+
+User-Guide
+================
+
+.. contents::
+   :depth: 3
+   :local:
+
+Overview
+--------
+- The entire operation scenario can be checked when deployed with KPIMON xApp, Traffic Sterring xApp.
+- 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.
+
+.. 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
+
+
+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.
+
+`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
+---------------------------------------------
+Before deploying QoE Prediction assist xApp, onboarding should be done using `config-file.json` and `schema.json`
+Onboarding is required for the first time before deploy, and must be performed whenever the value of `config-file.json` is changed.
+For onboarding, `dms_cli` and helm3 are required. `dms_cli` can be referred to in this `documentation <https://docs.o-ran-sc.org/projects/o-ran-sc-it-dep/en/latest/installation-guides.html#ric-applications>`
+
+.. code-block:: none 
+
+$ 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 "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"
+}
+
+
+Deployment of qp-aimlfw using `dms_cli` tool
+---------------------------------------------
+Deploy the onboarded QoE Prediction assist xApp using `dms_cli`.
+
+.. code-block:: none 
+
+$ dms_cli install --xapp_chart_name=qoe-aiml-assist --version=1.0.0 --namespace=ricxapp
+
+status: OK
+
+Check if QoE Prediction assist xApp deployed normally.
+
+.. 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 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
index 065b975..a9c68ee 100644 (file)
@@ -93,7 +93,7 @@ func (c *InfluxClient) getQueryRange() string {
        return `|> range(start: ` + start + `, stop: ` + stop + `)`
 }
 
-func (c *InfluxClient) RetrieveCellMetrics(ueid string) ([]data.CellMetricsEntry, error) {
+func (c *InfluxClient) RetrieveCellMetrics() ([]data.CellMetricsEntry, error) {
 
        queryApi := c.client.QueryApi(c.influx.Org)
 
diff --git a/tox.ini b/tox.ini
new file mode 100644 (file)
index 0000000..bee72d6
--- /dev/null
+++ b/tox.ini
@@ -0,0 +1,36 @@
+#
+#   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.
+#
+# ==================================================================================
+
+# documentation only
+[tox]
+envlist = docs,docs-linkcheck
+skipsdist = true
+
+[testenv:docs]
+basepython = python3
+deps = 
+    sphinx
+    sphinx-rtd-theme
+    sphinxcontrib-httpdomain
+    recommonmark
+    lfdocs-conf
+    
+commands =
+    sphinx-build -W -b html -n -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/html
+    echo "Generated docs available in {toxinidir}/docs/_build/html"
+whitelist_externals = echo
+
+[testenv:docs-linkcheck]
+basepython = python3
+deps = sphinx
+       sphinx-rtd-theme
+       sphinxcontrib-httpdomain
+       recommonmark
+       lfdocs-conf
+commands = sphinx-build -W -b linkcheck -d {envtmpdir}/doctrees ./docs/ {toxinidir}/docs/_build/linkcheck
\ No newline at end of file