This xApp framework supports rapid development of RIC applications using Python.

Please comment on this page with questions so the interaction is available to the community.


  • No labels

15 Comments

  1. 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.)? 


    1. 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 

  2. 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?)


  3. 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:

    Traceback (most recent call last):
      File "pong_xapp.py", line 21, in <module>
        from ricxappframe.xapp_frame import RMRXapp, rmr
      File "/root/xapp/xapp/xapp-frame-py/ricxappframe/xapp_frame.py", line 32, in <module>
        from ricxappframe import xapp_rmr
      File "/root/xapp/xapp/xapp-frame-py/ricxappframe/xapp_rmr.py", line 27, in <module>
        from ricxappframe.rmr import rmr, helpers
      File "/root/xapp/xapp/xapp-frame-py/ricxappframe/rmr/rmr.py", line 25, in <module>
        from ricxappframe.rmr.rmrclib.rmrclib import rmr_c_lib, get_constants, state_to_status
      File "/root/xapp/xapp/xapp-frame-py/ricxappframe/rmr/rmrclib/rmrclib.py", line 33, in <module>
        _rmr_free_consts = rmr_c_lib.rmr_free_consts
      File "/usr/lib/python3.8/ctypes/__init__.py", line 386, in __getattr__
        func = self.__getitem__(name)
      File "/usr/lib/python3.8/ctypes/__init__.py", line 391, in __getitem__
        func = self._FuncPtr((name_or_ordinal, self))
    AttributeError: /usr/local/lib/librmr_si.so: undefined symbol: rmr_free_consts

    Have someone met this problem?


    1. 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.

      1. Thank Thoralf Czichy,when i used rmr 4.8.3(last version), this problem was solved!

      2. 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?


        1. 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

          1. I modified the docker file and updated the RIC-986.

  4. 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!

    1. 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

      1. 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!!

  5. hi everyine is there any video where i can learn how to developed the xapp in pythin framework

  6. 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 

    1. ok thanks let me check it