This page describes how to get the Istanbul release version of A1-Policy functions up and running.
The A1 Policy Management Service and the (optional) A1-enabled Controller (SDNC with A1-Adapter) and A1 Policy Management Service will run in a local demonstrative deployment with four near-RT-RIC A1 simulator instances (docker containers). These simulators will be configured to emulate devices implementing either the "OSC_2.1.0" version or "STD_2.0.0" version of the O-RAN A1 interface. (For more information on the OSC A1 Simulator functions see OSC NONRTRIC Wiki page (Release D))
...
To support local test with two four separate near-RT-RIC simulator instances:
Copy the file default configuration file oran/a1-policy-management/config/application_configuration.json to (Istanbul) to the current directory and update it , then replace/amend the configuration with the sample demo configuration below.
(Note the configuration below is just a sample, and should be updated to match particular deployments. The deployment below assumes 4 near-RT-RICs exist - addressable at the urls given. See the step "Run OSC Near-RT-RIC/A1 Simulator Docker Containers" below)The
controller
hostname, port,username
and port values come from and must match those defined in in the sdnc/oam repo oam/installation/src/main/yaml/docker-compose.yml (see the step "Buildpassword
values to access the A1 controller must match the values configured for the SDNC-A1-Controller. (See the step "Run A1 Controller" further below). The port for http is 8181.
(Note the configuration below is just a sample, and should be updated to match particular deployments. The deployment below assumes an A1 Controller function (SDNC) exists - addressable at the url given, using the authentication credentials given.)Any defined
ric
host names (in the name andbaseUrl
for each ric) must match the given docker container names in near-RT-RIC simulator startup - port is always the simulator's internal port 8085 for http or 8185 for https.- It The A1 Policy Management service can entirely by-pass the A1-Controller if required - it is optional to access the near-RT-RIC through a controller. The an A1-Controller.
In the configuration the "controller
" property is optional in the "ric
" objects. If no controller is used, and the whole "controller" object at the top can be omitted if no controller is used.
If all configured rics bypass the A1-Controller there is no need to start an A1-Controller. There is no functional gain in accessing the near-RT-RIC through a an A1 controller.
Sample application configuration
...
To use the A1 Controller function (SDNC with A1-Adapter) you need to run the SDNC docker image. This image has few other docker image dependencies but not all are important for A1 policy Policy functions. To bring up the sdnc SDNC container for A1 Policy testing a number of the unneeded services can be removed from the docker compose file. (It is often difficult to get a full SDNC deployment up & running; removing unneeded components makes this easier)
Edit Download and edit the docker compose file, oam oam/installation/src/main/yaml/docker-compose.yaml (Istanbul) and keep only sdnc
, maria db
and ansible
images. The rest of the images are not necessary for A1 Policy testing.
(However if you want to change the SLI DG graphs or run your own SLI DG graphs, then keep the dgbuilder
image. If you wish to use the DMaaP interface then keep & configure the dmaaplistener
image.)
If you have built the images locally you don't need any other change, however if the images have not been built locally, versions should be modified, from latest to the version that you would like to use, for example: nexus3.onap.org:10002/onap/sdnc-image:2.2.0
Locally built | Release image from nexus |
---|---|
sdnc: | sdnc: |
There is also a file name sdnc_basic.yaml that can be used instead, it only includes maria db and sdnc so it only need to be modified in case images have not been built locally and version need to be update from latest to a specific version, for example nexus3.onap.org:10002/onap/sdnc-image:2.2.0. In case this file is used, instead of using command docker-compose up, use docker-compose -f sdnc-basic.yml up.
The docker-compose file above requires several environment variables to be set according to your environment.
Sample settings for these environment variables can be found here (Istanbul), but first check if these values are suitable for your environment the DG and run your own DG, you may need to keep the Directed Graph image.
Code Block | ||
---|---|---|
| ||
$ export MTU=1500 $ docker network create nonrtric-docker-net $ cd oam/installation/src/main/yaml $ docker-compose up (In $ a new shell) docker network connect nonrtric-docker-net sdnc_controller (use another shell) |
The SDNC image will take a while to install all the features into Karaf Server. You can check the logs of the server at /opt/opendaylight/data/log/karaf.log
...
The A1 Policy in ODL GUI can be accessed by this URL (it may take several minutes before the URL works)
http://localhost:8282/apidoc/explorer/index.html Username / password: admin / Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U (Note Username & password are defined in the environment variables used when starting the controller using docker-compose above |
(Note these instructions create an A1 Controller deployment scenario aligned towards the sample A1 Policy configuration given above)
...
Start docker containers for each near-RT-RIC defined in oran/a1-policy-management/config/application_configuration.json in the step for "Configuration Policy Management Service" (in this example for ric1 and ric2) and providing A1 interface version OSC_2.1.0 with the following commands (use separate shells):use separate shells):
Code Block (Each in a new shell)
Code Block language bash $ docker run -p 8085:8085 -p 8185:8185 -e A1_VERSION=OSC_2.1.0 -e ALLOW_HTTP=true --network=nonrtric-docker-net --name=ric1 nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0 $ docker run -p 8086:8085 -p 8186:8185 -e A1_VERSION=OSC_2.1.0 -e ALLOW_HTTP=true --network=nonrtric-docker-net --name=ric2 nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0 $ docker run -p 8087:8085 -p 8187:8185 -e A1_VERSION=STD_2.0.0 -e ALLOW_HTTP=true --network=nonrtric-docker-net --name=ric3 nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0 $ docker run -p 8088:8085 -p 8188:8185 -e A1_VERSION=STD_2.0.0 -e ALLOW_HTTP=true --network=nonrtric-docker-net --name=ric4 nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0
(Note these commands create a deployment scenario aligned towards the sample A1 Policy configuration given above)
(Note these commands can be run in the background - all in one shell - by usingdocker run -d -p .....
)Create a policy type json to load into the A1 simulators (running version OSC.2.1.0)
Code Block language bashjs title pt1.json { "name": "pt1", "description": "pt1 policy type", "policy_type_id": 1, "create_schema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "OSC_Type1_1.0.0", "description": "Type 1 policy type", "type": "object", "properties": { "scope": { "type": "object", "properties": { "ueId": { "type": "string" }, "qosId": { "type": "string" } }, "additionalProperties": false, "required": [ "ueId", "qosId" ] }, "qosObjectives": { "type": "object", "properties": { "priorityLevel": { "type": "number" } }, "additionalProperties": false, "required": [ "priorityLevel" ] } }, "additionalProperties": false, "required": [ "scope", "qosObjectives" ] } }
Put the example policy type into the started A1 simulator instances by running these curl commands (in this example to
ric1
exposed to port 8085 andric2
exposed to port 8086):Code Block language bash $ curl -X PUT -v "http://localhost:8085/a1-p/policytypes/1" -H "accept: application/json" \ -H "Content-Type: application/json" --data-binary @pt1.json $ curl -X PUT -v "http://localhost:8086/a1-p/policytypes/1" -H "accept: application/json" \ -H "Content-Type: application/json" --data-binary @pt1.json
Create a policy type json to load into the A1 simulators (running version STD.2.0.0)
Code Block language bashjs title std_qos2_0.0.1.json { "policySchema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "STD_QOS2_0.1.0", "description": "STD QOS2 policy type", "type": "object", "properties": { "scope": { "type": "object", "properties": { "ueId": { "type": "string" }, "qosId": { "type": "string" } }, "additionalProperties": false, "required": [ "ueId", "qosId" ] }, "qosObjectives": { "type": "object", "properties": { "priorityLevel": { "type": "number" } }, "additionalProperties": false, "required": [ "priorityLevel" ] } } }, "statusSchema": { "$schema": "http://json-schema.org/draft-07/schema#", "title": "STD_QOS_0.2.0", "description": "STD QOS policy type status", "type": "object", "properties": { "enforceStatus": { "type": "string" }, "enforceReason": { "type": "string" }, "additionalProperties": false, "required": [ "enforceStatus" ] } } }
Put the example policy type into the started A1 simulator instances by running these curl commands (in this example to
ric3
exposed to port 8087 andric4
exposed to port 8088):Code Block language bash $ curl -X PUT -v "http://localhost:8087/policytype?id=STD_QOS2_0.1.0" -H "accept: application/json" \ -H "Content-Type: application/json" --data-binary @std_qos2_0.0.1.json $ curl -X PUT -v "http://localhost:8088/policytype?id=STD_QOS2_0.1.0" -H "accept: application/json" \ -H "Content-Type: application/json" --data-binary @std_qos2_0.0.1.json
...
Run docker container using this command once the A1-enabled Controller and simulators have been fully started and optionally set the logging level to trace (the curl command will not work until the container is fully up and running).
The configuration, application_configuration.json, of the controller and near-RT-RICs must be mounted as a volume to the container., so absolute path and name of the file must be substitute in the following command:Code Block language bash $ docker run -p 8081:8081 --network=nonrtric-docker-net --name=policy-agent-container --volume <Absolute path to application_configuration.json created above>:/opt/app/policy-agent/data/application_configuration.json .json nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.2.2-SNAPSHOT1
Code Block language bash $ curl -X POST http://localhost:8081/actuator/loggers/org.onap.ccsdk.oran.a1policymanagementservice -H "Content-Type:application/json" -d {\"configuredLevel\":\"trace\"}
Once the Policy Management Service is up and running, it establishes connections to all configured near-RT-RICs (ric1 and ric2) via the A1 Controller.
If the policy-agent-container is configured to log at trace level, the following logs entries should appear indicating that connection to the configured RICs has been established successfully via A1 Controller.
Code Block | ||
---|---|---|
| ||
$ docker logs policy-agent-container | grep "checked" 2021-03-16 14:15:03.805 DEBUG 1 --- [or-http-epoll-5] o.o.c.o.a.tasks.RicSupervision : Ric: ric1 checked OK 2021-03-16 14:15:03.816 DEBUG 1 --- [or-http-epoll-6] o.o.c.o.a.tasks.RicSupervision : Ric: ric3 checked OK 2021-03-16 14:15:03.835 DEBUG 1 --- [or-http-epoll-1] o.o.c.o.a.tasks.RicSupervision : Ric: ric2 checked OK 2021-03-16 14:15:03.851 DEBUG 1 --- [or-http-epoll-2] o.o.c.o.a.tasks.RicSupervision : Ric: ric4 checked OK |
...
For troubleshooting/verification purposes you can view/access the A1 Policy Management Service (policy-agent) swagger API from url: http://localhost:8081/swagger-ui.html (Note: the hostname may be different depending on your environment)
Run OSC Non-RT RIC Control Panel Docker Container
...
In order to start the Control Panel API gateway, an application file is needed to specify the routes and paths accepted by the gateway and where those request are going to be redirect, so the following example can be used:
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
server: port: 9090 spring: cloud: gateway: httpclient: ssl: useInsecureTrustManager: true wiretap: true httpserver: wiretap: true routes: - id: A1-Policy uri: http://policy-agent-container:8081 predicates: - Path=/a1-policy/** management: endpoint: gateway: enabled: true endpoints: web: exposure: include: "gateway,loggers,logfile,health,info,metrics,threaddump,heapdump" logging: level: ROOT: ERROR org.springframework: ERROR org.springframework.cloud.gateway: INFO reactor.netty: INFO file: name: /var/log/nonrtric-gateway/application.log |
...
Run docker container using this command:
It is important to provide absolute path of the application_nonrtricgateway.yaml file!
Code Block | ||
---|---|---|
| ||
$ docker run -p 9090:9090 --network=nonrtric-docker-net --name=nonrtric-gateway --volume <Absolute path to application_nonrtricgateway.yaml created above>:/opt/app/nonrtric-gateway/config/application.yaml:ro nexus3.o-ran-sc.org:1000410002/o-ran-sc/nonrtric-gateway:1.0.0 |
In order to run docker container for control panel use the following command:
Code Block | ||
---|---|---|
| ||
$ docker run -p 8080:8080 --network=nonrtric-docker-net --name=nonrtric-control-panel nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-controlpanel:2.2.0 |
Open NONRTRIC / A1 Policy Control Panel UI
The Control Panel UI can be accessed by pointing the web-browser to this URL:
http://localhost:8080/ (Note: the hostname may be different depending on your environment)
The A1 policy Policy type pre-configured in the simulator should be visible (read-only) in the Control Panel display. Instances of the policy type can now be created, updated and deleted.
(Note: A1 policy types can only be created or deleted directly in the near-RT-RIC (or simulators), which will then be synchronized in the A1 Policy Management Service, and can seen in the Control Panel display when refreshed. )