yc999.jang | 750eb5b | 2021-06-10 19:04:18 +0900 | [diff] [blame^] | 1 | .. |
| 2 | .. Copyright (c) 2021 Samsung Electronics. |
| 3 | .. |
| 4 | .. Licensed under the Creative Commons Attribution 4.0 International |
| 5 | .. Public License (the "License"); you may not use this file except |
| 6 | .. in compliance with the License. You may obtain a copy of the License at |
| 7 | .. |
| 8 | .. https://creativecommons.org/licenses/by/4.0/ |
| 9 | .. |
| 10 | .. Unless required by applicable law or agreed to in writing, documentation |
| 11 | .. distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | .. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | .. |
| 14 | .. See the License for the specific language governing permissions and |
| 15 | .. limitations under the License. |
| 16 | .. |
| 17 | |
| 18 | |
| 19 | RNIB(Radio network information base) |
| 20 | ==================================== |
| 21 | |
| 22 | RNIB information is stored in SDL by E2mgr during the E2SETUP process. |
| 23 | It is saved as protobuf serialized, see [nodeb-rnib](https://gerrit.o-ran-sc.org/r/admin/repos/ric-plt/nodeb-rnib) for .proto definition. |
| 24 | |
| 25 | The .proto files defines the message format is located in the rnib repo. |
| 26 | The rnib repo is set to submodule. |
| 27 | |
| 28 | **How to compile .proto files** |
| 29 | |
| 30 | Prerequisite |
| 31 | |
| 32 | * protoc (v3.6.1) |
| 33 | |
| 34 | .. code-block:: bash |
| 35 | |
| 36 | $ PYTHON_OUT="ricxappframe/entities/rnib" |
| 37 | $ RNIB_PROTO="nodeb-rnib/entities" |
| 38 | $ protoc --python_out="${PYTHON_OUT}" \ |
| 39 | --proto_path="${RNIB_PROTO}" \ |
| 40 | $(find "${RNIB_PROTO}" -iname "*.proto" -printf "%f ") |
| 41 | $ sed -i -E 's/^import.*_pb2/from . \0/' ${PYTHON_OUT}/*_pb2.py |
| 42 | |
| 43 | **The reason why sed is needed** |
| 44 | |
| 45 | *To use relative imports in generated modules* : `protobuf issue |
| 46 | <https://github.com/protocolbuffers/protobuf/issues/1491>`_ |