Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This page describes how to get the Guilin release version of NonA1-RT RIC Policy functions up and running locally with two separate Near-RT RIC A1 simulator docker containers providing OSC_2.1.0 version of A1 interface.

All four components of the Nonthese Non-RT RIC (from three different repos) run inside function run as docker containers and communicate via a private docker network. Details of the architecture can be found from Guilin Release page.

  • Project Requirements

  • Build Code

    • Build nonrtric containersPolicy Management Service container

      • Configure policy-agentA1 Policy Management Service

      • Build the code and create docker images

      Build near-rt-ric-simulator container

      • Create docker image

    • Build

      NONRTRIC / A1 Policy control panel containerVerify controlpanel configuration

      A1 Adapter for Controller

      • Build the code and create docker imageimages

  • Run A1 Controller Docker Container

    • Open Daylight GUI

    Controller with OSC A1 Adapter

  • Run Near-RT RIC A1 Simulator Docker Containers

  • Run A1 Policy -agent Management Service Docker Container

    • policy-agent A1 Policy Management Service Swagger API

  • Run OSC Non-RT RIC Control Panel Docker Container

    • Open OSC NONRTRIC / A1 Policy Control Panel UI

Project Requirements

  • Java 11 (make sure that JAVA_HOME environment variable points to correct Java version)

  • Maven 3.6

  • Docker and docker-compose (latest)

Build Code

Build

...

A1 Policy Management Service container

  • Download the nonrtric repo (defaults to master branch): 

...

  • ccsdk/oran repo, guilin branch: 

    Code Block
    languagebash
    $ git clone "https://gerrit.onap.org/r/ccsdk/oran" -b guilin


Configure

...

the A1 Policy Management Service

To support local test with two separate Near-RT RIC simulator instances:  

  • create a new ccsdk/oranCopy the file oran/a1-policy-management/config/application_configuration.json json  to the current directory and update it with the configuration below.

  • The controller hostname and port values come from and must match those defined in nonrtric/sdnc-a1-controllerin in the sdnc/oam repo oam/installation/src/main/yaml/docker-compose.yml any defined ric names (see the step "Build A1 Controller" further below). The port for http is 8181.

  • Any defined ric host names (in the name and baseUrl for each ric) must match the given docker container names in Near-RT RIC A1 simulator startup - port is always the simulator's internal 8085

...

  • port 8085 for http or 8185 for https (see the step "Build A1 Controller" further below).


Code Block
languageyml
titleapplication-_configuration.yamljson
{
   "config": {
 
    "//description": "Application configuration",
 
    "controller": [

        {
            "name": "controller1",
            "baseUrl": "http://a1-sdnc_controller-_container:8181",
            "userName": "admin",

           "password": "Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U"
         }
      ],
      "ric": [
  
      {
   
        "name": "ric1",
   
        "baseUrl": "http://ric1:8085/",
            "controller": "controller1controller",
            "managedElementIds": [
  
            "kista_1",
               "kista_2"

           ]
         },
                  {
   
        "name": "ric2",

           "baseUrl": "http://ric2:8085/",
 
          "controller": "controller1controller",

           "managedElementIds": [
               "kista_3",
               "kista_4"
            ]
  
      }

     ]
   }
}

Build the code and create docker

...

image

To build docker images of sdnc-a1-controller and policy-agentimage of the policy management service:

Code Block
languagebash
$ cd ccsdk/oranoran/a1-policy-management/
$ mvn clean install -Dmaven.test.skip=true

Build near-rt-ric-simulator container

Download the near-rt-ric-simulator repo (defaults to master branch): 

     git clone "https://gerrit.o-ran-sc.org/r/sim/a1-interface"

Create docker image

...

If the build is successful an image with following name and tag shall be built, use the command 'docker images' to view the newly built image in the local docker registry.

Code Block
languagebash
themeMidnight
$ docker images
onap/ccsdk-oran-a1policymanagementservice 1.0.3-SNAPSHOT

Build A1 Adapter for Controller

Build the code and create docker images

A1 Adapter is a feature developed within CCSDK which can then be installed in SDNC Karaf Server. To build & run the A1-enabled SDNC Controller, you need to build the ccsdk & sdnc repo's.

The Controller provides a Northbound Interface, to be used only by the A1 Policy Management Service, allowing it to pass messages over the A1 interface to Near-RealTime RICs in the RAN.

Use the downloaded repo 'ccsdk/oran' as in the previous step, "Build A1 Policy Management Service container"

Code Block
languagebash
$ cd a1-interface/near-rt-ric-simulator
docker build -t near-rt-ric-simulator:latest .

Build NONRTRIC / A1 Policy control panel container

Download the nonrtric repo (defaults to master branch): 

...

adapter
$ mvn clean install -Dmaven.test.skip=true
$ docker images

After you build the A1 adapter artefacts, download below CCSDK/SDNC repos and build them in the following order.

ProjectRepoGerrit LinkCommandNote
CCSDKccsdk/parentgit clone "https://gerrit.

...

...

...

Verify controlpanel configuration

(warning)  Note that nonrtric-controlpanel/webapp-backend/src/main/resources/application.properties default property value policycontroller.url.prefix = http://policy-agent-container:8081 assumes that policy agent is started with name policy-agent-container and exposes port 8081 (as is done below)! 

Build the code and create docker image

...

languagebash

...

parent" -b guilinmvn clean install -Dmaven.test.skip=trueIf the parent artefacts are not released you need to build this repo in order to build other ccsdk repos (Including ccsdk/oran/a1-adapter)
CCSDKccsdk/featuregit clone "https://gerrit.onap.org/r/ccsdk/features" -b guilinmvn clean install -Dmaven.test.skip=true
CCSDKccsdk/distributiongit clone "https://gerrit.onap.org/r/ccsdk/distribution" -b guilinmvn clean install -Dmaven.test.skip=true -PdockerCreates the CCSDK docker image
SDNCsdnc/northboundgit clone "https://gerrit.onap.org/r/sdnc/northbound" -b guilinmvn clean install -Dmaven.test.skip=true
SDNCsdnc/oamgit clone "https://gerrit.onap.org/r/sdnc/oam" -b guilinmvn clean install -Dmaven.test.skip=true

...

Run A1 Controller Docker Container

...

A1 Controller must be started first to set up docker network

...

Change directory: 

cd nonrtric/sdnc-a1-controller/oam/installation/src/main/yaml

...

Run docker container using the command below  

docker-compose up a1-controller
  • the container is ready once message "Healthcheck Passed in XX seconds." appears

  • note that certificate-related errors "cp: can't stat '/opt/opendaylight/current/certs/*': No such file or directory" and "Error: File not found in path entered" can be ignored 

The Karaf logs of A1 controller can be followed e.g. by using command 

...

-PdockerCreates the SDNC docker image. Make sure you refer the right docker image version in the pom file.(eg: you may need to update ccsdk.docker.version for onap/ccsdk-ansible-server-image from 1.0-STAGING-latest to 1.0-SNAPSHOT-latest)

If the builds are successful, images with following name and tag shall exist, use the command 'docker images' to view the newly built images in the local docker registry.

Code Block
languagebash
themeMidnight
$ docker images | grep onap
onap/sdnc-image latest
onap/sdnc-ansible-server-image latest
onap/admportal-sdnc-image latest
onap/ccsdk-dgbuilder-image latest
onap/sdnc-ueb-listener-image latest
onap/sdnc-dmaap-listener-image:latest

Run A1-enabled Controller

To view the A1 policy operations, you need to run the SDNC docker image. This image has few other docker image dependencies but not all are important for A1 policy testing. To bring up the sdnc container for A1 Policy Management testing a number of the not needed services can be removed from the docker compose file.

Edit the docker compose file, oam/installation/src/main/yaml/docker-compose.yaml 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 DG and run your own DG, you may need to keep the Directed Graph image.

Code Block
languagebash
$ export MTU=1500
$ docker network create nonrtric-docker-net
$ cd oam/installation/src/main/yaml
$ docker-compose up 
$ docker network connect nonrtric-docker-net sdnc_controller_container (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

...

Open Daylight GUI

...

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

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

  • Start docker containers for each ric defined in nonrtricoran/a1-policy-agentmanagement/config/application_configuration.json in previous steps 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):

    Code Block
    languagebash
    $ 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 
    near-rt-ric-simulator:latest
    nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0
    $ docker run -p 8086:8085 -p 
    8185
    8186:8185 -e A1_VERSION=OSC_2.1.0 -e ALLOW_HTTP=true --network=nonrtric-docker-net --name=ric2 
    near-rt-ric-simulator:latest
  • Change directory:  

    cd a1-interface/near-rt-ric-simulator/test/OSC_2.1.0/jsonfiles
  • Put an example policy_type into the started near-rt-ric-
    nexus3.o-ran-sc.org:10002/o-ran-sc/a1-simulator:2.1.0


  • Create a policy type json to load into the A1 simulators

    Code Block
    languagebash
    titlept1.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 and ric2 exposed to port 8086):

    Code Block
    languagebash
    $ curl -X PUT -v "http://localhost:8085/a1-p/policytypes/
    123
    1" -H "accept: application/json" \
     -H "Content-Type: application/json" --data-binary @pt1.json
    $ curl -X PUT -v "http://localhost:8086/a1-p/policytypes/
    123
    1" -H "accept: application/json" \
     -H "Content-Type: application/json" --data-binary @pt1.json


Run ONAP A1 Policy

...

Management Service Docker Container

  • 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 rics must be mounted as a volume to the container.

    Code Block
    languagebash
    $ docker run -p 8081:8081 --network=nonrtric-docker-net --name=policy-agent-container 
    o
    -
    ran-sc/nonrtric-policy-agent:2.0.0-SNAPSHOTOnce policy-agent
    -volume <Absolute path to application_configuration.json created above>:/opt/app/policy-agent/data/application_configuration.json onap/ccsdk-oran-a1policymanagementservice:1.0.3-SNAPSHOT


    Code Block
    languagebash
    $ 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

  • (Note: In Bronze Maintenance veriosn it will be possible to point docker to use a different configuration file than the version included inside the container - e.g. to add additional near-RT-RICs)

  • If (ric1 and ric2) via the A1 Controller.

  • If the policy-agent-container is configured to log at DEBUG trace level, the following logs entries should appear to log to show indicating that connection to the configured RICs has been established successfully via A1 Controller.

...


Code Block
title
languagebashSDNC A1 Client
$ docker logs policy-agentmanagement-containerservice | grep "protocol version" 
2020-0411-1723 1116:1000:1127.357484 DEBUG 1 --- [or-http-epoll-15] o.o.policyagentc.o.a.clients.A1ClientFactory        : Established protocol version:SDNC_OSC_OSC_V1 for RicNear-RT RIC: ric1 
2020-0411-1723 1116:1000:1127.387495 DEBUG 1 --- [or-http-epoll-16] o.o.c.o.policyagenta.clients.A1ClientFactory        : Established protocol version:SDNC_OSC_OSC_V1 for Near-RT RicRIC: ric2

...

A1 Policy Management Service Swagger API

For troubleshooting/verification purposes you can view/access the policy-agent swagger API from url: http://localhost:8081/swagger-ui.html

Run OSC Non-RT RIC Control Panel Docker Container

Run docker container using this command: 

Code Block
languagebash
$ docker run -p 8080:8080 --network=nonrtric-docker-net nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-controlpanel:2.

...

1.0

...

Open NONRTRIC / A1 Policy Control Panel UI

Dashboard The Control Panel UI can be accessed by pointing the web-browser to this URL: 

http://localhost:8080/

Thee policy type loaded in the simulator should be visible in the table. Instances of the policy type can now be created, updated and deleted.