--- /dev/null
+# https://help.github.com/articles/dealing-with-line-endings/
+
+# Set the default behavior, in case people don't have core.autocrlf set.
+* text=auto
+
+# Explicitly declare text files you want to always be normalized
+# and converted to native line endings on checkout.
+*.css text
+*.htm text diff=html
+*.html text diff=html
+*.java text diff=java
+*.js text
+*.jsp text
+*.less text
+*.properties text
+*.sql text
+*.xml text
+
+# Denote all files that are truly binary and should not be modified.
+*.png binary
+*.jpg binary
-
- [gerrit]
- host=gerrit.o-ran-sc.org
- port=29418
- project=ric-app/qp-driver
- defaultbranch=master
-
\ No newline at end of file
+[gerrit]
+host=gerrit.o-ran-sc.org
+port=29418
+project=ric-app/qp-driver
+defaultbranch=master
+defaultremote=origin
# 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.7
+tag: 1.0.8
The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
and this project adheres to `Semantic Versioning <http://semver.org/>`__.
+[1.0.8] - 2020-05-22
+--------------------
+* Revise static route table (`RICAPP-108 <https://jira.o-ran-sc.org/browse/RICAPP-108>`_)
+
+
[1.0.7] - 2020-05-15
--------------------
* Include xapp descriptor json in repo (`RICAPP-97 <https://jira.o-ran-sc.org/browse/RICAPP-97>`_)
-"""
-custom logic exceptions
-"""
# ==================================================================================
# Copyright (c) 2020 AT&T Intellectual Property.
#
# See the License for the specific language governing permissions and
# limitations under the License.
# ==================================================================================
+"""
+custom logic exceptions
+"""
class UENotFound(BaseException):
RMR Messages
#define TS_UE_LIST 30000
#define TS_QOE_PRED_REQ 30001
-30000 is the message QPD receives, sends out 30001 to QP
+ #define TS_QOE_PREDICTION 30002
+30000 is the message type QPD receives; sends out type 30001, which should be routed to QP.
"""
def steering_req_handler(self, summary, sbuf):
"""
- This is the main handler for this xapp, which handles the traffic steering requests.
+ This is the main handler for this xapp, which handles traffic steering requests.
Traffic steering requests predictions on a set of UEs.
- QP Driver (this) fetches a set of data, merges it together in a deterministic way, then sends a new message out to the QP predictor Xapp.
+ This app fetches a set of data, merges it together in a deterministic way,
+ then sends a new message out to the QP predictor Xapp.
The incoming message that this function handles looks like:
{“UEPredictionSet” : [“UEId1”,”UEId2”,”UEId3”]}
# we don't use rts here; free this
self.rmr_free(sbuf)
- # iterate over the ues and send a request each, if it is a valid UE, to QPP
+ # iterate over the UEs and send a request for each, if it is a valid UE, to QP
for ueid in ue_list:
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:
- self.logger.debug("QP Driver was unable to send to QP Predictor!")
+ 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!")
def start(thread=False):
"""
- this is a convienence function that allows this xapp to run in Docker for "real" (no thread, real SDL)
- but also easily modified for unit testing (e.g., use_fake_sdl)
- the defaults for this function are for the Dockerized xapp.
+ This is a convenience function that allows this xapp to run in Docker
+ for "real" (no thread, real SDL), but also easily modified for unit testing
+ (e.g., use_fake_sdl). The defaults for this function are for the Dockerized xapp.
"""
global rmr_xapp
fake_sdl = getenv("USE_FAKE_SDL", None)
setup(
name="qpdriver",
- version="1.0.7",
+ version="1.0.8",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter",
description="QP Driver Xapp for traffic steering",
newrt|start
+rte|30001|service-ricxapp-qp-rmr.ricxapp.svc.cluster.local:4562
newrt|end
from qpdriver import main, data
from ricxappframe.xapp_frame import Xapp, RMRXapp
-mock_traffic_steering = None
-mock_qp_predictor = None
+mock_ts_xapp = None
+mock_qp_xapp = None
"""
these tests are not currently parallelizable (do not use this tox flag)
def test_rmr_flow(monkeypatch, qpd_to_qp, qpd_to_qp_bad_cell):
"""
this flow mocks out the xapps on both sides of QP driver.
- It first stands up a mock qp predictor, then it starts up a
- mock traffic steering which will immediately send requests
- to the running qp driver]
+ It first stands up a mock qp, then it starts up a mock ts
+ which will immediately send requests to the running qp driver.
"""
expected_result = {}
# define a mock qp predictor
- def default_handler(self, summary, sbuf):
+ def mock_qp_default_handler(self, summary, sbuf):
pass
- def qp_driver_handler(self, summary, sbuf):
+ def mock_qp_predict_handler(self, summary, sbuf):
nonlocal expected_result # closures ftw
pay = json.loads(summary["payload"])
expected_result[pay["PredictionUE"]] = pay
- global mock_qp_predictor
- mock_qp_predictor = RMRXapp(default_handler, rmr_port=4666, use_fake_sdl=True)
- mock_qp_predictor.register_callback(qp_driver_handler, 30001)
- mock_qp_predictor.run(thread=True)
+ global mock_qp_xapp
+ mock_qp_xapp = RMRXapp(mock_qp_default_handler, rmr_port=4666, use_fake_sdl=True)
+ mock_qp_xapp.register_callback(mock_qp_predict_handler, 30001)
+ mock_qp_xapp.run(thread=True)
time.sleep(1)
# define a mock traffic steering xapp
- def entry(self):
+ def mock_ts_entry(self):
# make sure a bad steering request doesn't blow up in qpd
val = "notevenjson".encode()
val = json.dumps({"test send 60001": 2}).encode()
self.rmr_send(val, 60001)
- global mock_traffic_steering
- mock_traffic_steering = Xapp(entrypoint=entry, rmr_port=4564, use_fake_sdl=True)
- mock_traffic_steering.run() # this will return since entry isn't a loop
+ global mock_ts_xapp
+ mock_ts_xapp = Xapp(entrypoint=mock_ts_entry, rmr_port=4564, use_fake_sdl=True)
+ mock_ts_xapp.run() # this will return since entry isn't a loop
time.sleep(1)
"""
this is like a "finally"; the name of this function is pytest magic
safer to put down here since certain failures above can lead to pytest never returning
- for example if an exception gets raised before stop is called in any test function above, pytest will hang forever
+ for example if an exception gets raised before stop is called in any test function above,
+ pytest will hang forever
"""
with suppress(Exception):
- mock_traffic_steering.stop()
+ mock_ts_xapp.stop()
with suppress(Exception):
- mock_qp_predictor.stop()
+ mock_qp_xapp.stop()
with suppress(Exception):
main.stop()
"image": {\r
"registry": "nexus3.o-ran-sc.org:10002",\r
"name": "o-ran-sc/ric-app-qp-driver",\r
- "tag": "1.0.7"\r
+ "tag": "1.0.8"\r
}\r
}\r
],\r
"container": "qpdriver",\r
"port": 4562,\r
"rxMessages": ["TS_UE_LIST"],\r
- "txMessages": [ "TS_QUE_PRED_REQ" ],\r
+ "txMessages": [ "TS_QOE_PRED_REQ" ],\r
"policies": [],\r
"description": "rmr receive data port for qpdriver"\r
},\r
"protPort": "tcp:4562",\r
"maxSize": 2072,\r
"numWorkers": 1,\r
- "txMessages": ["TS_QUE_PRED_REQ"],\r
+ "txMessages": ["TS_QOE_PRED_REQ"],\r
"rxMessages": ["TS_UE_LIST"],\r
"policies": []\r
}\r