This xApp framework supports rapid development of RIC applications using Python.
- Code: https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/xapp-frame-py
- Doc: https://docs.o-ran-sc.org/projects/o-ran-sc-ric-plt-xapp-frame-py/en/latest/
- general xapp writers guide: check "Xapp frameworks in general" from Introduction and guides
Please comment on this page with questions so the interaction is available to the community.
15 Comments
imhusky@live.com
Hi
I am building my xapps using this framework and wondering whether xapps could communicate with other components in RIC (subscription manager, routing manager, etc.)?
steve ratti
hi can you tell how you are using the xapp framework for the customization of xapp
of is there any tutorial to develop the xapp in python framework
allan martins
Hello,
Is there a "best practice" way to implement the http REST API responses (for subscriptions for instance)? Right now I'm using Flask by it feels like overdoing it. Does the python API have an http response library? (like the go xapp-frame version?)
菜芽
I download the code.
Then I run the example code(ping, pong) locally as the floow command(README.md) :
example code path: examples\
# Running locally
Running the two examples (adjust for your shell notation)
pip install --user -e .
cd examples
set -x LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64; set -x RMR_SEED_RT test_route.rt; python3 pong_xapp.py
(diff tmux window)
set -x LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64; set -x RMR_SEED_RT test_route.rt; python3 ping_xapp.py
At last, I met this problem:
Have someone met this problem?
Thoralf Czichy
This is related to a memory leak fix that was introduced in https://gerrit.o-ran-sc.org/r/c/ric-plt/xapp-frame-py/+/7209 . you need to make sure to use the latest RMR version that includes the definition of rmr_free_consts(). The RMR c++ library introduced this in https://gerrit.o-ran-sc.org/r/c/ric-plt/lib/rmr/+/7176 and teh first released version that includes this fix is 4.8.0. Debian and RPM packages are here: https://packagecloud.io/app/o-ran-sc/release/search?q=rmr , but you could also build from source. Probably best to use the latest RMR version.
菜芽
Thank Thoralf Czichy,when i used rmr 4.8.3(last version), this problem was solved!
durga vijaya
Hello,
The error seems to be persistent when xApp is run as a docker image.
Local execution:
/xapp-frame-py/examples$ set -x LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64; set -x RMR_SEED_RT test_route.rt; python3 pong_xapp.py
+ set -x LD_LIBRARY_PATH /usr/local/lib/:/usr/local/lib64
+ set -x RMR_SEED_RT test_route.rt
+ python3 pong_xapp.py
1686029616899 9710/RMR [INFO] ric message routing library on SI95 p=4562 mv=3 flg=02 id=a (a1be12a 4.9.0 built: Feb 14 2023)
While building docker image:
sudo docker run -i --net=host pong:latest
+ sudo docker run -i --net=host pong:latest
Traceback (most recent call last):
File "pong_xapp.py", line 21, in <module>
from ricxappframe.xapp_frame import RMRXapp, rmr
File "/usr/local/lib/python3.8/site-packages/ricxappframe/xapp_frame.py", line 32, in <module>
from ricxappframe import xapp_rmr
File "/usr/local/lib/python3.8/site-packages/ricxappframe/xapp_rmr.py", line 27, in <module>
from ricxappframe.rmr import rmr, helpers
File "/usr/local/lib/python3.8/site-packages/ricxappframe/rmr/rmr.py", line 25, in <module>
from ricxappframe.rmr.rmrclib.rmrclib import rmr_c_lib, get_constants, state_to_status
File "/usr/local/lib/python3.8/site-packages/ricxappframe/rmr/rmrclib/rmrclib.py", line 33, in <module>
_rmr_free_consts = rmr_c_lib.rmr_free_consts
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
func = self.__getitem__(name)
File "/usr/local/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
func = self._FuncPtr((name_or_ordinal, self))
AttributeError: Symbol not found: rmr_free_consts
Just wondering if the Dockerfiles need to be updated to build from newer rmr libraries?
Thoralf Czichy
I raised a JIRA bug report with some hints on what do: RIC-986. If you happen to work on this, please also provide as merge to xapp-frame-py
durga vijaya
I modified the docker file and updated the RIC-986.
allan martins
Hello threre,
With the f-release all the xApps are facing this error when trying to import XApp or RMRXapp classes:
ModuleNotFoundError: No module named 'ricxappframe.entities'
Any ideias?
Thanks!
Erkki Hietala
xappframe python has the submodule reference set in the xapp_frame.py and usually when the package has been installed via pip tool the reference from the system is resolved correctly. In case you want to use the xappframe locally, then you should set following - this has been defined in the docs/developer-guide.rst. Otherwise the reference to sub modules are not found:
export PYTHONPATH=./
export LD_LIBRARY_PATH=/usr/local/lib:$LD_LIBRARY_PATH
export RMR_SEED_RT=examples/descriptor/xapp-test.rt
export RMR_SRC_ID="192.168.1.122"
python3 examples/xapp_test.py -config examples/descriptor/config-file.json -port 8888 -xapp xapp-test -service xapp-test
allan martins
Hello Mr. Hietala,
Thank you so much for the answer! Its clear now! It really works if I set PYTHONPATH, however, the installation was done using
python3 setup.py build
python3 setup.py install
inside a dockerfile. Shouldn't that set the module on the correct path (or vice versa, set the path to the right folder?)
Thank you again for the answer, was very useful!!
steve ratti
hi everyine is there any video where i can learn how to developed the xapp in pythin framework
Abdul Wahid W
I think you can refer to the hw-python implementation here - https://gerrit.o-ran-sc.org/r/gitweb?p=ric-app/hw-python.git;a=summary
More details with SUNIL SINGH
steve ratti
ok thanks let me check it