Versions Compared

Key

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

...

Tosca template deleted successfully


a) Control loop

...

for apex policy version

This sub-section describes the steps required for bringing up the control loop with apex policy version of the usecase. The tosca template to be used for commissioning this control loop is given below. The steps for commissioning are depicted in the previous sub-section.

...

"PUT /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" 200

...


a) Control loop for script version

This version is run in the stand-alone ONAP policy framework and uses an apex policy.

Assumption:

It is assumed that the DMaaP Message Router is already running as a docker container with the hostname "onap-dmaap" 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.

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
languagebash
git clone "https://gerrit.o-ran-sc.org/r/nonrtric"
git checkout e-release --track origin/e-release
cd nonrtric/docker-compose/docker-compose-policy-framework

Start all the containers by running this command:

...

languagebash

...

sub-section describes the steps required for bringing up the control loop with script version of the usecase. The tosca template to be used for commissioning this control loop is given below. The steps for commissioning are depicted in the sub-section Commission/Instantiate control loop via GUI.

Code Block
languageyml
titlecommission.yaml
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_1_0
data_types:
  onap.datatypes.ToscaConceptIdentifier:
    derived_from: tosca.datatypes.Root
    properties:
      name:
        type: string
        required: true
      version:
        type: string
        required: true
node_types:
  org.onap.policy.clamp.controlloop.Participant:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root
    properties:
      provider:
        type: string
        requred: false
  org.onap.policy.clamp.controlloop.ControlLoop:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root
    properties:
      provider:
        type: string
        requred: false
      elements:
        type: list
        required: true
        entry_schema:
          type: onap.datatypes.ToscaConceptIdentifier
  org.onap.policy.clamp.controlloop.ControlLoopElement:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root
    properties:
      provider:
        type: string
        requred: false
      participant_id:
        type: onap.datatypes.ToscaConceptIdentifier
        requred: true
  org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement:
    version: 1.0.1
    derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
    properties:
      chart:
        type: string
        required: true
      configs:
        type: list
        required: false
      requirements:
        type: string
        requred: false
      templates:
        type: list
        required: false
        entry_schema:
      values:
        type: string
        requred: true
topology_template:
  node_templates:
    org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition1:
      version: 1.2.3
      type: org.onap.policy.clamp.controlloop.ControlLoop
      type_version: 1.0.1
      description: Control loop for Link Monitor
      properties:
        provider: Ericsson
        elements:
        - name: org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElement
          version: 1.2.3
        - name: org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElement
          version: 1.2.3
        - name: org.onap.domain.linkmonitor.SdnrSimulatorK8SMicroserviceControlLoopElement
          version: 1.2.3
    org.onap.k8s.controlloop.K8SControlLoopParticipant:
      version: 2.3.4
      type: org.onap.policy.clamp.controlloop.Participant
      type_version: 1.0.1
      description: Participant for k8s
      properties:
        provider: ONAP
    org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElement:
      version: 1.2.3
      type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
      type_version: 1.0.1
      description: Control loop element for oru-app
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.k8s.controlloop.K8SControlLoopParticipant
          version: 2.3.4
        chart:
          chartId:
            name: oru-app
            version: 0.1.0
          releaseName: oru-app
          repository:
             repoName: chartmuseum
          namespace: nonrtric
          overrideParams:
            image.repository: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-o-ru-closed-loop-recovery
            image.tag: 1.0.0
            messagerouter.host: http://message-router.onap
            messagerouter.port: 3904
            sdnr.host: http://sdnr-simulator
            sdnr.port: 9990
    org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElement:
      version: 1.2.3
      type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
      type_version: 1.0.1
      description: Control loop element for message-generator
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.k8s.controlloop.K8SControlLoopParticipant
          version: 2.3.4
        chart:
          chartId:
            name: message-generator
            version: 0.1.0
          releaseName: message-generator
          repository:
             repoName: chartmuseum
          namespace: nonrtric
          overrideParams:
            image.repository: registry.nordix.org/onap/message-generator
            image.tag: 1.0.0
            messagerouter.host: http://message-router.onap
            messagerouter.port: 3904
    org.onap.domain.linkmonitor.SdnrSimulatorK8SMicroserviceControlLoopElement:
      version: 1.2.3
      type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
      type_version: 1.0.1
      description: Control loop element for sdnr-simulator
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.k8s.controlloop.K8SControlLoopParticipant
          version: 2.3.4
        chart:
          chartId:
            name: sdnr-simulator
            version: 0.1.0
          releaseName: sdnr-simulator
          repository:
             repoName: chartmuseum
          namespace: nonrtric
          overrideParams:
            image.repository: registry.nordix.org/onap/sdnr-simulator
            image.tag: 1.0.0
            messagerouter.host: http://message-router.onap
            messagerouter.port: 3904


This control loop will bring up three micro-services in the nonrtric namespace: oru-app (running the actual logic of the usecase), message-generator (sending the LinkFailure messages at random intervals), and sdnr-simulator (for receiving the REST calls made by oru-app). Make sure that the sdnr-simulator is not already running in the nonrtric namespace, otherwise the control loop instantiation might fail.

NOTE: The default hostname/port for sdnr and message-router are specified in overrideParams of the above file. They should be replaced with actual values if using different hostname/port.


Before commissioning this tosca template, some preparations need to be done in the kubernetes-participant component of the clamp.

  • First step is to copy the kube config file of the cluster inside the kubernetes-participant. Find the pod-name of the this component using:
Code Block
languagebash
kubectl -n onap get pod | grep k8s-ppnt

Copy the config file using this command:

Code Block
languagebash
kubectl cp ~/.kube/config onap/<POD-NAME-k8s-ppnt>:/home/policy/.kube/config

In order to make sure that the kubernetes-participant is properly configured, get into the pod using "kubectl -n onap exec -it <POD-NAME-k8s-ppnt> sh" and run the following command:

Code Block
languagebash
kubectl get ns

This should show all the namespaces in the cluster where ONAP is deployed.

  • Next step is to copy the helm charts of all three components into the kubernetes-participant. The helm charts are located in the nonrtric repo of OSC.
Code Block
languagebash
cd /nonrtric/test/usecases/oruclosedlooprecovery/scriptversion/helm/sdnr-simulator/
helm package .
kubectl cp ./sdnr-simulator-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/sdnr-simulator-0.1.0.tgz

cd /nonrtric/test/usecases/oruclosedlooprecovery/scriptversion/helm/message-generator/
helm package .
kubectl cp ./message-generator-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/message-generator-0.1.0.tgz

cd /nonrtric/test/usecases/oruclosedlooprecovery/scriptversion/helm/oru-app/
helm package .
kubectl cp ./oru-app-0.1.0.tgz onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/oru-app-0.1.0.tgz
  • Finally, install chartmuseum into the kubernetes-participant and push the above helm charts into it. Get into the pod using "kubectl -n onap exec -it <POD-NAME-k8s-ppnt> sh" and run the following commands:
Code Block
languagebash
mkdir -p ~/helm3-storage
curl -LO https://s3.amazonaws.com/chartmuseum/release/latest/bin/linux/amd64/chartmuseum
chmod +x ./chartmuseum
./chartmuseum --storage local --storage-local-rootdir /home/policy/helm3-storage -port 8080 &

curl --data-binary "@local-charts/sdnr-simulator-0.1.0.tgz" http://localhost:8080/api/charts
curl --data-binary "@local-charts/message-generator-0.1.0.tgz" http://localhost:8080/api/charts
curl --data-binary "@local-charts/oru-app-0.1.0.tgz" http://localhost:8080/api/charts

helm repo add chartmuseum http://localhost:8080
helm repo update


Once the kubernetes-participant is set up, the  tosca template can be commissioned. After that, the control loop can be instantiated using the steps described in the sub-section Commission/Instantiate control loop via GUI. Once the control loop is in RUNNING state, check that three micro-services have been created in the nonrtric namespace.

Code Block
languagebash
kubectl -n nonrtric get pod

In order to test the correct working of the usecase, check logs in each of the three components. There should be messages flowing in this order:

message-generator → oru-app → sdnr-simulator