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 H))

All components run as docker containers and communicate via a private docker network. Details of the architecture can be found from London Release page.

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)

Project Requirements

Create Configuration for A1 Policy Management Service

Configure the A1 Policy Management Service

To support local test with four separate near-RT-RIC simulator instances:  

Sample application configuration

{
  "description": "Application configuration",
  "config": {    
    "controller": [
      {
        "name": "controller1",
        "baseUrl": "http://sdnc_controller:8181",
        "userName": "admin",
        "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"
      }
    ],
    "ric": [
      {
        "name": "ric1",
        "baseUrl": "http://ric1:8085/", 
        "managedElementIds": [
        ]
      },
      {
        "name": "ric2",
        "baseUrl": "http://ric2:8085/",       
        "managedElementIds": [
          "kista_3",
          "kista_4"
        ]
      },
       {
        "name": "ric3",
        "baseUrl": "http://ric3:8085/",
        "controller": "controller1", 
        "managedElementIds": [
          "kista_5",
          "kista_6"
        ]
      },
       {
        "name": "ric4",
        "baseUrl": "http://ric4:8085/",
        "controller": "controller1", 
        "managedElementIds": [
          "kista_7",
          "kista_8",
          "kista_9",
          "kista_10",
          "kista_11"
         ]
      }
    ]
  }
}



{
  "description": "Application configuration",
  "config": {    
    "ric": [
      {
        "name": "ric1",
        "baseUrl": "http://ric1:8085/", 
        "managedElementIds": [
        ]
      },
      {
        "name": "ric2",
        "baseUrl": "http://ric2:8085/",       
        "managedElementIds": [
          "kista_3",
          "kista_4"
        ]
      },
       {
        "name": "ric3",
        "baseUrl": "http://ric3:8085/",
        "managedElementIds": [
          "kista_5",
          "kista_6"
        ]
      },
       {
        "name": "ric4",
        "baseUrl": "http://ric4:8085/",
        "managedElementIds": [
          "kista_7",
          "kista_8",
          "kista_9",
          "kista_10",
          "kista_11"
         ]
      }
    ]
  }
}



JSON Schema for the 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 (london))

{
  "$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"
                },
                "customAdapterClass": {
                  "type": "string"
                },
                "managedElementIds": {
                  "type": "array",
                  "items": [
                    {
                      "type": "string"
                    },
                    {
                      "type": "string"
                    }
                  ]
                }
              },
              "required": [
                "name",
                "baseUrl",
                "managedElementIds"
              ],
              "additionalProperties": false
            }
          ]
        }
      },
      "required": [
        "ric"
      ],
      "additionalProperties": true
    }
  },
  "required": [
    "config"
  ]
}

For more information on configuring the A1-Policy Management Service please see London - 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.

ComponentRelease image and version tagStaging images and version tagManual snapshot (only available if manually built)
and version tag
A1 Policy Management Service

nexus3.onap.org:10002/onap/ccsdk-oran-a1policymanagementservice:1.5.0

nexus3.onap.org:10004/onap/ccsdk-oran-a1policymanagementservice:1.5.1-STAGING-latest

onap/ccsdk-oran-a1policymanagementservice:1.5.1-SNAPSHOT

SDNC imagenexus3.onap.org:10002/onap/sdnc-image:2.5.5nexus3.onap.org:10004/onap/sdnc-image:2.5.5-STAGING-latestonap/sdnc-image:2.5.5-SNAPSHOT

Run A1-enabled Controller

If you choose to bypass the A1-Controller (SDNC + A1-Adapter), there is no need to start it, so you can skip this step.


To use the A1 Controller function (SDNC + 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 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 (london) and keep only sdnc and maria db images. The rest of the images are not needed for A1 Policy testing.
In addition, remove or comment out the following two entries for sdnc in the docker-compose file: '- ansible' and  '- ansible:ansiblehost'. 
(However if you want to change the SLI DG graphs or run your own SLI DG graphs, then keep the dgbuilder image.)

Download the sdnc-basic.yml (Gerrit - london) (or) sdnc-basic.yaml (wiki)

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

 Locally built
Release image from nexus
sdnc:    
image: onap/sdnc-image:latest
sdnc:
image: nexus3.onap.org:10002/onap/sdnc-image:2.5.5


(There is also a file named sdnc_basic.yaml that can be used instead, it only includes maria db and sdnc so it only needs to be modified when images have not been built locally so versions need to be updated from latest to a specific version, for example nexus3.onap.org:10002/onap/sdnc-image:2.5.5. In this case when using a different docker compose file you will use docker-compose -f sdnc-basic.yml up instead of the normal docker-compose up command in the code block below)

The docker-compose files above requires several environment variables to be set according to your environment.
Sample settings for these environment variables can be found here (london), but first check if these values are suitable for your environment.

export MTU=1500
docker network create nonrtric-docker-net
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 features into the Karaf Server. You can check the logs of the server at /opt/opendaylight/data/log/karaf.log

Another useful log to check is /opt/opendaylight/data/log/A1-Adapter.log to see log entries related to the SLI DG operation inside the A1-Adapter.

The SDNC/ODL API GUI is also handy, where the internal A1-Policy APIs can be seen/tested. (It may take several minutes before the URLs work as expected as the SDNC/ODL component loads)

http://localhost:8282/apidoc/explorer/index.html (or) http://<yourclusterloginip>/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: This A1-Adapter API is not intended for public use. It is used for internal communication only - between the A1 Policy Management Service and the A1-Adapter. This API may change/disappear without notice. This API should only be used for verification/debugging) 


(Note these instructions create an A1 Controller deployment scenario aligned towards the sample A1 Policy configuration given above)

If the steps above are unsuccessful more help can be found from the CCSDK/SDNC Developer teams: CCSDK Project & SDNC Project

Run OSC Near-RT-RIC/A1 Simulator Docker Containers

For more details about running the OSC A1 Simulator see the related OSC NONRTRIC Wiki page (Release H) and OSC A1 Simulator Documentation (H Release)

Run ONAP A1 Policy Management Service Docker Container


docker logs a1policymanagmentservice  | grep "checked" 
	2022-03-16 14:15:03.805 DEBUG 1 --- [or-http-epoll-5] o.o.c.o.a.tasks.RicSupervision           : Ric: ric1 checked OK
	2022-03-16 14:15:03.816 DEBUG 1 --- [or-http-epoll-6] o.o.c.o.a.tasks.RicSupervision           : Ric: ric3 checked OK
	2022-03-16 14:15:03.835 DEBUG 1 --- [or-http-epoll-1] o.o.c.o.a.tasks.RicSupervision           : Ric: ric2 checked OK
	2022-03-16 14:15:03.851 DEBUG 1 --- [or-http-epoll-2] o.o.c.o.a.tasks.RicSupervision           : Ric: ric4 checked OK

A1 Policy Management Service Swagger API

For troubleshooting/verification purposes you can view/access the A1 Policy Management Service 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

The OSC Non-RT RIC Control Panel uses two docker images, one is the Control Panel API Gateway (backend) and the Non-RT RIC Control Panel (frontend).

In order to start the Control Panel API gateway, an configuration file is needed to specify the routes and paths accepted by the gateway and where those requests will be redirect to, so the following example can be used:

server:
  port: 9090
spring:
  cloud:
    gateway:
      httpclient:
        ssl:
          useInsecureTrustManager: true
        wiretap: true
      httpserver:
        wiretap: true
      routes:
      - id: A1-Policy
        uri: http://a1policymanagmentservice: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

The configuration, application_nonrtricgateway.yaml must be mounted as a volume to the container.

Run docker container using this command:

It is important to provide absolute path of the application_nonrtricgateway.yaml file!

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:10002/o-ran-sc/nonrtric-gateway:1.2.0

Example:

docker run -p 9090:9090 --network=nonrtric-docker-net --name=nonrtric-gateway --volume /home/infra/workspace/application-nonrtricgateway.yaml:/opt/app/nonrtric-gateway/config/application.yaml:ro nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-gateway:1.2.0

In order to run docker container for control panel use the following command: 

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.5.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/ (or) http://<yourclusterloginip>:8080/
Note: the hostname may be different depending on your environment. The port number is defined using the docker command above.

Example:



For each managed "RIC" (A1-Simulator) should be visible in the 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".

For more examples of using the NONRTRIC Control panel see London - Testing end-to-end call