This page describes how to get the Istanbul release version of A1-Policy functions up and running using Docker.
The A1 Policy Management Service and the (optional) A1-enabled Controller (SDNC with A1-Adapter) 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 E))
All components run as docker containers and communicate via a private docker network. Details of the architecture can be found from Jakara Release page.
Note: Version numbers used in this page may not be the most recent ... you should verify the latest version numbers for latest released versions of pre-built components in the docker image repository (https://nexus3.onap.org)
Table of Contents |
---|
Project Requirements
Java 11 (make sure that JAVA_HOME environment variable points to correct Java version)
Maven 3.6 (make sure you have configured maven to use access the ONAP maven repositories)
Docker and docker-compose (latest)
...
Copy the default configuration file oran/a1-policy-management/config/application_configuration.json (Jakarta) to the current directory, 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 URLs given. See the step "Run OSC Near-RT-RIC/A1 Simulator Docker Containers" below)The
controller
URL(
hostname, port),username
andpassword
values to access the A1 Controller (SDNC + A1 Adapter) must match the values configured for the SDNC-A1-Controller. (See the step "Run A1 Controller" further below). The port number 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 thename
andbaseUrl
for eachric
entry) 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.- The A1 Policy Management service can entirely by-pass the A1-Controller if required (SDNC + A1 Adapter) if desired - it is optional to access the near-RT-RIC through an A1-Controller.
In the configuration the "controller
" property is optional in the "ric
" objects, and
If all configuredric
s bypass the A1-Controller (do not have "controller
" values) then the "controller
" object at the top of the configuration can be omitted if no controller is used.
If all configuredric
s 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 an A1 controller-Controller.
Sample application configuration
...
The configuration must comply to the following JSON schema. There are several publicly available tools (e.g. online) where it is possible to validate JSON objects against their schema.
...
The schema is available in the gerrit repo (application_configuration_schema.json (Jakarta))
Code Block | ||||||||
---|---|---|---|---|---|---|---|---|
| ||||||||
{ "$schema": "http://json-schema.org/draft-04/schema#", "type": "object", "properties": { "config": { "type": "object", "properties": { "//description": { "type": "string" }, "description": { "type": "string" }, "controller": { "type": "array", "items": [ { "type": "object", "properties": { "name": { "type": "string" }, "baseUrl": { "type": "string" }, "userName": { "type": "string" }, "password": { "type": "string" } }, "required": [ "name", "baseUrl", "userName", "password" ], "additionalProperties": false } ] }, "ric": { "type": "array", "items": [ { "type": "object", "properties": { "name": { "type": "string" }, "baseUrl": { "type": "string" }, "controller": { "type": "string" }, "managedElementIds": { "type": "array", "items": [ { "type": "string" }, { "type": "string" } ] } }, "required": [ "name", "baseUrl", "managedElementIds" ], "additionalProperties": false } ] }, "streams_publishes": { "type": "object", "properties": { "dmaap_publisher": { "type": "object", "properties": { "type": { "type": "string" }, "dmaap_info": { "type": "object", "properties": { "topic_url": { "type": "string" } }, "required": [ "topic_url" ] } }, "required": [ "type", "dmaap_info" ] } }, "required": [ "dmaap_publisher" ] }, "streams_subscribes": { "type": "object", "properties": { "dmaap_subscriber": { "type": "object", "properties": { "type": { "type": "string" }, "dmaap_info": { "type": "object", "properties": { "topic_url": { "type": "string" } }, "required": [ "topic_url" ] } }, "required": [ "type", "dmaap_info" ] } }, "required": [ "dmaap_subscriber" ] } }, "required": [ "ric" ], "additionalProperties": false } }, "required": [ "config" ] } |
For more information on configuring the A1-Policy Management Service please see Jakarta - Component configuration
Running the functions
Note: Version numbers used in this page may not be the most recent ... you should verify the latest version numbers for released pre-built components in the docker image repository (https://nexus3.onap.org), and check the version number in appropriate POM files if building manually.
Component | Release image and version tag | Staging images and version tag | Manual snapshot (only available if manually built) and version tag |
---|---|---|---|
A1 Policy Management Service | nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.23.1 | nexus3.onap.org:1000410004/onap/ccsdk-oran-a1policymanagementservice:1.23.1-STAGING-latest | onap/ccsdk-oran-a1policymanagementservice:1.23.2-SNAPSHOT |
SDNC image | nexus3.onap.org:10002/onap/sdnc-image:2.23.01 | nexus3.onap.org:1000410004/onap/sdnc-image:2.23.01-STAGING-latest | onap/sdnc-image:2.3.2.1-SNAPSHOT |
Run A1-enabled Controller
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 functions. To bring up the run a cut-down 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)
Download and edit the docker compose file, oam/installation/src/main/yaml/docker-compose.yaml (IstanbulJakarta) and keep only sdnc
, maria db
and ansible
images. The rest of the images are not necessary need 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.23.01
Locally built | Release image from nexus |
---|---|
sdnc: | sdnc: |
(There is also a file name named sdnc_basic.yaml that can be used instead, it only includes maria db and sdnc so it only need needs to be modified in case when images have not been built locally and version so versions need to be update updated from latest to a specific version, for example nexus3.onap.org:10002/onap/sdnc-image:2.23.01. In case this file is used, instead of using command docker-compose up, this case when using a different docker compose file you will use docker-compose -f sdnc-basic.yml
up.up
instead of the normal docker-compose up
command in the code block below)
The docker-compose file files above requires several environment variables to be set according to your environment.
Sample settings for these environment variables can be found here (IstanbulJakarta), but first check if these values are suitable for your environment.
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 |
The SDNC image will take quite a while to install all the features into the Karaf Server. You can check the logs of the server at at /opt/opendaylight/data/log/karaf.log
Other logs that can be Another useful log to check is /opt/opendaylight/data/log/A1-Adapter.log
to see entries coming from DGlog entries related to the SLI DG operation inside the A1-Adapter.
The SDNC/ODL API GUI is also handy, where the internal A1-Policy in ODL GUI APIs can be accessed by this URL (it seen/tested. (It may take several minutes before the URL worksthe URLs work as expected as the SDNC/ODL component loads)
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 |
...
Start docker containers for each near-RT-RIC defined in
oran/a1-policy-management/config/application_configuration.
jsonjson
in the step for "Configuration Configure the A1 Policy Management Service" (in this example for ric1 and ric2) and providing A1 interface version above.
Different Simulators can use different A1-Interface profiles, for exampleOSC_2.1.0
andSTD_2.0.0
below. Start each simulator instance with the following commands (use separate shells):Code Block (Each in a new shell) 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.12.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.12.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.12.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.12.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 For the
OSC.2.1.0
simulators create a new A1 Policy Type policy type definition (JSON), and load it into each of theOSC.2.1.0
A1 Simulators instances.
(Note the format for A1 Policy Type Definitions (JSON) differs for different A1-Interface profiles)Code Block language js 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 Insert the example policy type into the started A1 simulator
OSC_2.1.0
A1 Simulator instances by running thesecurl
commands (in this example toric1
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.For the
STD_2.0.0
simulators create a new A1 Policy Type policy type definition (JSON), and load it into each of theSTD_2.0.0
A1 Simulators instances.
(Note the format for A1 Policy Type Definitions (JSON) differs for different A1-Interface profiles)Code Block language js 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 Insert the example policy type into the started A1 simulator
STD_2.0.0
A1 Simulator instances by running thesecurl
commands (in this example toric3
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
For more details about running the OSC A1 Simulator see the related OSC NONRTRIC Wiki page (Release D) E) and OSC A1 Simulator Documentation (latest)
Run ONAP A1 Policy Management Service Docker Container
Run A1 Policy Management Service docker container using this the command once below, after the A1-enabled Controller and simulators have been fully started and optionally .
It may be useful to set the logging level to trace (the curl command will not work until the containerTRACE
level, where you can verify the A1-Controller, A1-Simualtors and A1 Policy Management Service is fully up and running).
The configuration , file (application_configuration.json , of the controller and near-RT-RICs described above) must be mounted as avolume
to into the container, so absolute path and name of the file must be substitute substituted in the following command:Code Block language bash title Docker: Run the A1 Policy Management Service docker run -p 8081:8081 --network=nonrtric-docker-net --name=policy-agent-containera1policymanagmentservice --volume <Absolute path to application_configuration.json created above>:/opt/app/policy-agent/data/application_configuration.json nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.2.11.3.1
Note: Version numbers used in this page may not be the most recent ... you should verify the latest version numbers for released pre-built components in the docker image repository (https://nexus3.onap.org)
Code Block language bash title Optional: Enable TRACE level logging in A1 Policy Management Service collapse true 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
,ric3
,ric4
) via the A1 Controller.If the policy-agent-
a1policymanagmentservice
container is configured to log at traceTRACE
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 a1policymanagmentservice policy-agent-container | grep "checked" 20212022-03-16 14:15:03.805 DEBUG 1 --- [or-http-epoll-5] o.o.c.o.a.tasks.RicSupervision : Ric: ric1 checked OK 20212022-03-16 14:15:03.816 DEBUG 1 --- [or-http-epoll-6] o.o.c.o.a.tasks.RicSupervision : Ric: ric3 checked OK 20212022-03-16 14:15:03.835 DEBUG 1 --- [or-http-epoll-1] o.o.c.o.a.tasks.RicSupervision : Ric: ric2 checked OK 20212022-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, port 8081
is configured in the docker command above)
Run OSC Non-RT RIC Control Panel Docker Container
Control panel use The OSC Non-RT RIC Control Panel uses two docker images, one is the Control Panel API Gateway (backend) and the NonRTRIC Non-RT RIC Control Panel (frontend).
In order to start the Control Panel API gateway, an application configuration file is needed to specify the routes and paths accepted by the gateway and where those request are going to requests will be redirect to, 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-containera1policymanagmentservice: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 |
...
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.23.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 port number is defined using the docker command above.
For each managed "RIC" (A1-Simualtor) should be visible int eh Control Panel display, with each of the A1 Policy Types defined & loaded above.
(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.)
A1 Policy instances for those A1 Policy Types can now be created, updated and deleted in the managed "RIC".