This page describes how to run the stand-alone ONAP policy framework and deploy the apex policy designed for O-RU and O-DU use case.
Assumption:
It is assumed that the DMaaP message router is already running as a docker container with the hostname "onap-dmaap-mr" and connected to the docker network named "nonrtric-docker-net". It is also assumed that a topic named "unauthenticated.SEC_FAULT_OUTPUT" has already been created in the message router.
Build the apex-pdp image from ONAP Policy framework
The ONAP Policy framework comprises different components. The docker-compose referred to in the next section includes the Honolulu released docker images (available in ONAP Nexus) for all the components except the apex-pdp. The reason is that some changes were done in the master branch of apex-pdp in order to get the apex policy for O-RU & O-DU use case working properly. Hence, the code for apex-pdp needs to be fetched from the master branch and a docker image is built from this code.
Code Block |
---|
|
git clone "https://gerrit.onap.org/r/policy/apex-pdp"
cd apex-pdp
mvn clean install -P docker |
Start the ONAP Policy framework
The ONAP Policy framework can be run in a stand-alone mode using the docker-compose in OSC nonrtric repo:
Code Block |
---|
|
git clone "https://gerrit.o-ran-sc.org/r/nonrtric"
git checkout dawn --track origin/dawn
cd nonrtric/docker-compose/docker-compose-policy-framework |
...
Code Block |
---|
|
docker-compose up -d |
Run SDNR-simulator
The apex policy will make a REST call to the SDNR-simulator for sending the configuration messages. The code for SDNR simulator is available in the nonrtric repo. Run the following commands to build the docker image for SDNR-simulator:
...
Code Block |
---|
|
docker run --rm --name sdnr-sim --network nonrtric-docker-net -e MR-HOST="http://onap-dmaap-mr" -e MR-PORT="3904" sdnr-simulator:1.0.0 |
Create/Deploy apex policy for O-RU & O-DU use case
All the ingredients of apex policy designed for O-RU & O-DU use case are available here:
...
"POST /rests/data/network-topology:network-topology/topology=topology-netconf/node=HCL-O-DU-1123/yang-ext:mount/o-ran-sc-du-hello-world:network-function/du-to-ru-connection=ERICSSON-O-RU-11225 HTTP/1.1" 201200
- The logs of policy-apex-pdp docker container should show some messages messages exchanged related related to the LinkFailureEvent that was sent.
Code Block |
---|
|
docker logs policy-apex-pdp |
Workflow for updating the policy config
In case some changes need to be made in the policy config (located in /config directory), a new ToscaPolicy.json file (located in /deployment directory) has to be generated for deploying the apex policy. The new file can be created by using the apexCLIToscaEditor.sh script in the policy-apex-pdp docker container via the following steps:
- Run the policy-apex-pdp docker container and mount the LinkMonitor directory (located in the nonrtric repo) into the docker container:
Code Block |
---|
|
docker run -it --rm --name policy-apex-pdp --network nonrtric-docker-net -v <<Path_to_nonrtric_repo>>/nonrtric/test/usecases/oruclosedlooprecovery/apexpolicyversion/LinkMonitor/:/home/apexuser/examples/LinkMonitor/ onap/policy-apex-pdp:latest |
...
Code Block |
---|
|
docker exec -it policy-apex-pdp sh
/opt/app/policy/apex-pdp/bin/apexCLIToscaEditor.sh -c /home/apexuser/examples/LinkMonitor/models/LinkMonitorModelJavascript_0.0.1.apex -ot /home/apexuser/examples/LinkMonitor/deployment/ToscaPolicy.json -ac /home/apexuser/examples/LinkMonitor/config/LinkMonitorConfigDmaap2RestJsonEvent.json -t /home/apexuser/examples/LinkMonitor/tosca/ToscaTemplate.json |
...
- After running the above command, the ToscaPolicy.json file is automatically updated in the /deployment directory of nonrtric repo in the host where docker command has been runis running.