apt-get install -y \
wget gcc musl-dev
-ARG rmr_version=4.1.2
+ARG rmr_version=4.8.0
ARG e2ap_version=1.1.0
# download rmr and e2ap libraries from package cloud
FROM python:3.8-slim
-ARG rmr_version=4.1.2
+ARG rmr_version=4.8.0
ARG e2ap_version=1.1.0
COPY --from=stretch /usr/local/lib/librmr_si.so.${rmr_version} /usr/local/lib/librmr_si.so
The format is based on `Keep a Changelog <http://keepachangelog.com/>`__
and this project adheres to `Semantic Versioning <http://semver.org/>`__.
+[3.0.0] - 2021-12-03
+--------------------
+* Upgrade to RMR version 4.8.0 to fix memory leak in get_constants() function (`RIC-858 <https://jira.o-ran-sc.org/browse/RIC-858>`_)
+* From xapp-frame-py version 3.0.0 onwards it is required to have RMR version 4.8.0 or newer.
+
[2.3.0] - 2021-09-15
--------------------
* Add Xapp Registration (`RIC-706 <https://jira.o-ran-sc.org/browse/RIC-706>`_)
rmr_c_lib = ctypes.CDLL("librmr_si.so", mode=ctypes.RTLD_GLOBAL)
_rmr_get_consts = rmr_c_lib.rmr_get_consts
_rmr_get_consts.argtypes = []
-_rmr_get_consts.restype = ctypes.c_char_p
+_rmr_get_consts.restype = ctypes.POINTER(ctypes.c_char)
+
+_rmr_free_consts = rmr_c_lib.rmr_free_consts
+_rmr_free_consts.argtypes = [ctypes.POINTER(ctypes.c_char)]
+_rmr_free_consts.restype = None
def get_constants(cache={}):
if cache:
return cache
- js = _rmr_get_consts() # read json string
+ ptr = _rmr_get_consts() # read char pointer
+ js = ctypes.cast(ptr, ctypes.c_char_p).value # cast to json string
cache = json.loads(str(js.decode())) # create constants value object as a hash
+ _rmr_free_consts(ptr)
return cache
# CI script installs RMR from PackageCloud using this version
---
-version: 4.1.2
+version: 4.8.0
setup(
name="ricxappframe",
- version="2.3.0",
+ version="3.0.0",
packages=find_packages(exclude=["tests.*", "tests"]),
author="O-RAN Software Community",
description="Xapp and RMR framework for Python",
commands =
# add -s flag after pytest to show logs immediately instead of delaying
- pytest --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml
+ pytest --ignore=tests/test_config.py --ignore=tests/test_rmr.py --cov ricxappframe --cov-report xml --cov-report term-missing --cov-report html --cov-fail-under=70 --junitxml=/tmp/tests.xml
coverage xml -i
[testenv:flake8]