* Docker now builds with an empty route file so rmr starts; it will not even start properly without this
* Change how fake_sdl is activated for docker convienence
* Create dev guide file
* Add instructions on how to test the rmr healthcheck in a running container
* Update to xapp frame 0.7.0 (which has rmr healthchecks)
Issue-ID: RICAPP-92
Change-Id: Ib0cd06870ba1bfc51ee8749c040d0b4c65f8c4fa
Signed-off-by: Tommy Carpenter <tc677g@att.com>
# RMR setup
RUN mkdir -p /opt/route/
COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3-go:5-a3.11-nng-rmr3 /usr/local/lib64/librmr_si.so /usr/local/lib64/librmr_si.so
+COPY --from=nexus3.o-ran-sc.org:10004/bldr-alpine3-go:5-a3.11-nng-rmr3 /usr/local/bin/health_ck /usr/local/bin/health_ck
ENV LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64
+COPY tests/fixtures/local.rt /opt/route/local.rt
+ENV RMR_SEED_RT /opt/route/local.rt
# sdl needs gcc
RUN apk update && apk add gcc musl-dev
--- /dev/null
+.. This work is licensed under a Creative Commons Attribution 4.0 International License.
+.. SPDX-License-Identifier: CC-BY-4.0
+.. Copyright (C) 2020 AT&T Intellectual Property
+
+
+Developers Guide
+=================
+
+.. contents::
+ :depth: 3
+ :local:
+
+Testing RMR Healthcheck
+-----------------------
+The following instructions should deploy the QP Driver container in bare docker, and allow you 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/health_ck -h 127.0.0.1:4562
+
+
overview.rst
release-notes.rst
installation-guide.rst
+ developers-guide.rst
* :ref:`genindex`
* :ref:`modindex`
:depth: 3
:local:
+[1.0.1] - 4/3/2020
+------------------
+::
+
+ * Docker now builds with an empty route file so rmr starts; it will not even start properly without this
+ * Change how fake_sdl is activated for docker convienence
+ * Create dev guide file
+ * Add instructions on how to test the rmr healthcheck in a running container
+ * Update to xapp frame 0.7.0 (which has rmr healthchecks)
+
+
[1.0.0] - 4/1/2020
------------------
::
# limitations under the License.
# ==================================================================================
import json
+from os import getenv
from ricxappframe.xapp_frame import RMRXapp
from qpdriver import data
from qpdriver.exceptions import UENotFound
self.logger.debug("Received a TS Request for a UE that does not exist!")
-def start(thread=False, use_fake_sdl=False):
+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.
"""
global rmr_xapp
- rmr_xapp = RMRXapp(default_handler, post_init=post_init, rmr_port=4562, use_fake_sdl=use_fake_sdl)
+ 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.register_callback(steering_req_handler, 30000)
rmr_xapp.run(thread)
setup(
name="qpdriver",
- version="1.0.0",
+ version="1.0.1",
packages=find_packages(exclude=["tests.*", "tests"]),
author="Tommy Carpenter",
description="QP Driver Xapp for traffic steering",
url="https://gerrit.o-ran-sc.org/r/admin/repos/ric-app/qp-driver",
- install_requires=["ricxappframe>=0.6.0"],
+ install_requires=["ricxappframe>=0.7.0"],
entry_points={"console_scripts": ["start.py=qpdriver.main:start"]}, # adds a magical entrypoint for Docker
license="Apache 2.0",
data_files=[("", ["LICENSE.txt"])],
--- /dev/null
+newrt|start
+newrt|end
monkeypatch.setattr("qpdriver.main.post_init", fake_post_init)
# start qpd
- main.start(thread=True, use_fake_sdl=True)
+ main.start(thread=True)
def test_rmr_flow(monkeypatch, qpd_to_qp, qpd_to_qp_bad_cell):
LD_LIBRARY_PATH = /usr/local/lib/:/usr/local/lib64
RMR_SEED_RT = tests/fixtures/test_local.rt
RMR_ASYNC_CONN = 0
+ USE_FAKE_SDL = 1
commands =
pytest -v --cov qpdriver --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70