Change qpd's RMR listen port to 4560 60/3960/2 1.0.9
authorLott, Christopher (cl778h) <cl778h@att.com>
Tue, 2 Jun 2020 18:43:30 +0000 (14:43 -0400)
committerLott, Christopher (cl778h) <cl778h@att.com>
Tue, 2 Jun 2020 23:23:48 +0000 (19:23 -0400)
Correct xApp descriptor tag to be rmr-data

Issue-ID: RICAPP-112, RICAPP-114
Signed-off-by: Lott, Christopher (cl778h) <cl778h@att.com>
Change-Id: Ie28b9853a4ea7a4d19ba034ffe61a5aa8d2f8e12

container-tag.yaml
docs/developers-guide.rst
docs/release-notes.rst
qpdriver/main.py
setup.py
tests/fixtures/local.rt
tests/fixtures/test_local.rt
xapp-descriptor/config.json

index ee6d321..ea2bed4 100644 (file)
@@ -1,4 +1,4 @@
 # The Jenkins job uses this string for the tag in the image name
 # for example nexus3.o-ran-sc.org:10004/my-image-name:my-tag
 ---
-tag: 1.0.8
+tag: 1.0.9
index 26379ff..9330ad4 100755 (executable)
@@ -19,6 +19,7 @@ This project follows semver. When changes are made, update the version strings i
 #. ``container-tag.yaml``
 #. ``docs/release-notes.rst``
 #. ``setup.py``
+#. ``xapp-descriptor/config.json``
 
 
 Testing RMR Healthcheck
@@ -30,7 +31,8 @@ to test that the RMR healthcheck is working.
 
     docker build -t qpd:latest -f  Dockerfile .
     docker run -d --net=host -e USE_FAKE_SDL=1 qpd:latest
-    docker exec -it CONTAINER_ID /usr/local/bin/rmr_probe -h 127.0.0.1:4562
+    docker exec -it CONTAINER_ID /usr/local/bin/rmr_probe -h 127.0.0.1:4560
+
 
 Unit Testing
 ------------
index 7546efc..024286c 100644 (file)
@@ -10,6 +10,12 @@ All notable changes to this project will be documented in this file.
 The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
 and this project adheres to `Semantic Versioning <http://semver.org/>`__.
 
+
+[1.0.9] - 2020-06-02
+--------------------
+* Change RMR listen port to 4560 (`RICAPP-112 <https://jira.o-ran-sc.org/browse/RICAPP-112>`_)
+
+
 [1.0.8] - 2020-05-22
 --------------------
 * Revise static route table (`RICAPP-108 <https://jira.o-ran-sc.org/browse/RICAPP-108>`_)
index 1fbf95f..6640e2f 100644 (file)
@@ -1,6 +1,3 @@
-"""
-qpdriver entrypoint module
-"""
 # ==================================================================================
 #       Copyright (c) 2020 AT&T Intellectual Property.
 #
@@ -16,13 +13,9 @@ qpdriver entrypoint module
 #   See the License for the specific language governing permissions and
 #   limitations under the License.
 # ==================================================================================
-import json
-from os import getenv
-from ricxappframe.xapp_frame import RMRXapp, rmr
-from qpdriver import data
-from qpdriver.exceptions import UENotFound
-
 """
+qpdriver entrypoint module
+
 RMR Messages
  #define TS_UE_LIST 30000
  #define TS_QOE_PRED_REQ 30001
@@ -30,18 +23,31 @@ RMR Messages
 30000 is the message type QPD receives; sends out type 30001, which should be routed to QP.
 """
 
+import json
+from os import getenv
+from ricxappframe.xapp_frame import RMRXapp, rmr
+from qpdriver import data
+from qpdriver.exceptions import UENotFound
+
 
+# pylint: disable=invalid-name
 rmr_xapp = None
 
 
 def post_init(self):
+    """
+    Function that runs when xapp initialization is complete
+    """
     self.def_hand_called = 0
     self.traffic_steering_requests = 0
 
 
 def default_handler(self, summary, sbuf):
+    """
+    Function that processes messages for which no handler is defined
+    """
     self.def_hand_called += 1
-    self.logger.info("QP Driver received an unexpected message of type: {}, dropping.".format(summary[rmr.RMR_MS_MSG_TYPE]))
+    self.logger.warning("QP Driver received an unexpected message of type: {}".format(summary[rmr.RMR_MS_MSG_TYPE]))
     self.rmr_free(sbuf)
 
 
@@ -71,8 +77,8 @@ def steering_req_handler(self, summary, sbuf):
         try:
             to_qpp = data.form_qp_pred_req(self, ueid)
             payload = json.dumps(to_qpp).encode()
-            ok = self.rmr_send(payload, 30001)
-            if not ok:
+            success = self.rmr_send(payload, 30001)
+            if not success:
                 self.logger.debug("QP Driver was unable to send to QP!")
         except UENotFound:
             self.logger.debug("Received a TS Request for a UE that does not exist!")
@@ -86,7 +92,7 @@ def start(thread=False):
     """
     global rmr_xapp
     fake_sdl = getenv("USE_FAKE_SDL", None)
-    rmr_xapp = RMRXapp(default_handler, post_init=post_init, use_fake_sdl=True if fake_sdl else False)
+    rmr_xapp = RMRXapp(default_handler, rmr_port=4560, post_init=post_init, use_fake_sdl=bool(fake_sdl))
     rmr_xapp.register_callback(steering_req_handler, 30000)
     rmr_xapp.run(thread)
 
@@ -100,5 +106,8 @@ def stop():
 
 
 def get_stats():
-    # hacky for now, will evolve
-    return {"DefCalled": rmr_xapp.def_hand_called, "SteeringRequests": rmr_xapp.traffic_steering_requests}
+    """
+    hacky for now, will evolve
+    """
+    return {"DefCalled": rmr_xapp.def_hand_called,
+            "SteeringRequests": rmr_xapp.traffic_steering_requests}
index fa52d60..22d3c2f 100644 (file)
--- a/setup.py
+++ b/setup.py
@@ -17,7 +17,7 @@ from setuptools import setup, find_packages
 
 setup(
     name="qpdriver",
-    version="1.0.8",
+    version="1.0.9",
     packages=find_packages(exclude=["tests.*", "tests"]),
     author="Tommy Carpenter",
     description="QP Driver Xapp for traffic steering",
index fa06be6..90898ea 100644 (file)
@@ -1,3 +1,3 @@
 newrt|start
-rte|30001|service-ricxapp-qp-rmr.ricxapp.svc.cluster.local:4562
+rte|30001|service-ricxapp-qp-rmr.ricxapp.svc.cluster.local:4560
 newrt|end
index 0356661..849d90b 100644 (file)
@@ -1,6 +1,6 @@
 # do NOT use localhost, seems unresolved on jenkins VMs
 newrt|start
-mse| 30000 | -1 | 127.0.0.1:4562
+mse| 30000 | -1 | 127.0.0.1:4560
 mse| 30001 | -1 | 127.0.0.1:4666
-mse| 60001 | -1 | 127.0.0.1:4562
+mse| 60001 | -1 | 127.0.0.1:4560
 newrt|end
index 451e995..9bc76b3 100644 (file)
@@ -1,41 +1,41 @@
-{\r
-        "xapp_name": "qpdriver",\r
-        "version": "1.0.0",\r
-        "containers": [\r
-            {\r
-                "name": "qpdriver",\r
-                "image": {\r
-                    "registry": "nexus3.o-ran-sc.org:10002",\r
-                    "name": "o-ran-sc/ric-app-qp-driver",\r
-                    "tag": "1.0.8"\r
-                }\r
-            }\r
-        ],\r
-        "messaging": {\r
-            "ports": [\r
-                {\r
-                    "name": "rmr-data-in",\r
-                    "container": "qpdriver",\r
-                    "port": 4562,\r
-                    "rxMessages": ["TS_UE_LIST"],\r
-                    "txMessages": [ "TS_QOE_PRED_REQ" ],\r
-                    "policies": [],\r
-                    "description": "rmr receive data port for qpdriver"\r
-                },\r
-                {\r
-                    "name": "rmr-route",\r
-                    "container": "qpdriver",\r
-                    "port": 4561,\r
-                    "description": "rmr route port for qpdriver"\r
-                }\r
-            ]\r
-        },\r
-        "rmr": {\r
-            "protPort": "tcp:4562",\r
-            "maxSize": 2072,\r
-            "numWorkers": 1,\r
-            "txMessages": ["TS_QOE_PRED_REQ"],\r
-            "rxMessages": ["TS_UE_LIST"],\r
-            "policies": []\r
-        }\r
-    }\r
+{
+        "xapp_name": "qpdriver",
+        "version": "1.0.9",
+        "containers": [
+            {
+                "name": "qpdriver",
+                "image": {
+                    "registry": "nexus3.o-ran-sc.org:10002",
+                    "name": "o-ran-sc/ric-app-qp-driver",
+                    "tag": "1.0.9"
+                }
+            }
+        ],
+        "messaging": {
+            "ports": [
+                {
+                    "name": "rmr-data",
+                    "container": "qpdriver",
+                    "port": 4560,
+                    "rxMessages": ["TS_UE_LIST"],
+                    "txMessages": ["TS_QOE_PRED_REQ"],
+                    "policies": [],
+                    "description": "rmr receive data port for qpdriver"
+                },
+                {
+                    "name": "rmr-route",
+                    "container": "qpdriver",
+                    "port": 4561,
+                    "description": "rmr route port for qpdriver"
+                }
+            ]
+        },
+        "rmr": {
+            "protPort": "tcp:4560",
+            "maxSize": 2072,
+            "numWorkers": 1,
+            "txMessages": ["TS_QOE_PRED_REQ"],
+            "rxMessages": ["TS_UE_LIST"],
+            "policies": []
+        }
+    }