Versions Compared

Key

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

...

Instantiate the control loop


Create Instance dialog



Image RemovedImage Added

Instantiation properties saved successfully

...

Code Block
languagebash
git clone "https://gerrit.o-ran-sc.org/r/nonrtric/rapp/orufhrecovery"
git checkout f-release --track origin/f-release

cd orucfronthaulrecovery/scriptversion/helm/sdnr-simulator/
helm package .

helm install sdnr-simulator sdnr-simulator-0.1.0.tgz --set image.repository=registry.nordix.org/onap/sdnr-simulator --set image.tag=1.01.0 --set messagerouter.host="http://message-router.onap" --set messagerouter.port="3904" --namespace nonrtric --create-namespace --wait

...

The logs of the sdnr-simulator should show that a PUT request has been successfully received.

"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/dudistributed-tounit-ru-connectionfunctions=ERICSSON-O-RU-11225/radio-resource-management-policy-ratio=rrm-pol-1 HTTP/1.1" 200200 


b) Control loop for script version

...

Code Block
languageyml
titlecommission.yaml
linenumberstrue
collapsetrue
tosca_definitions_version: tosca_simple_yaml_1_1_03
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.controlloopacm.Participant:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root
    properties:
      provider:
        type: string
        requred: false
  org.onap.policy.clamp.controlloopacm.ControlLoopAutomationCompositionElement:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root
    properties:
      provider:
        type: string
        requredrequired: false
        elementsmetadata:
          typecommon: listtrue
        required: true
  description: Specifies the organization that provides the automation composition element
      entryparticipant_schemaid:
          type: onap.datatypes.ToscaConceptIdentifier
  org.onap.policy.clamp.controlloop.ControlLoopElement:
    version: 1.0.1
    derived_from: tosca.nodetypes.Root requred: true
    properties:
      providermetadata:
        type: string
        requredcommon: falsetrue
      participant_idparticipantType:
        type: onap.datatypes.ToscaConceptIdentifier
        requredrequired: true
    org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement:
    versionmetadata:
 1.0.1
    derived_from: org.onap.policy.clamp.controlloop.ControlLoopElement
    propertiescommon: true
      chart:
  description: The identity of the participant type: string
that hosts this type of Automation Composition  required: trueElement
      configsstartPhase:
        type: listinteger
        required: false
        requirementsconstraints:
          - typegreater_or_equal: string0
        requredmetadata: false
      templates:
        typecommon: listtrue
        requireddescription: false
A value indicating the start phase in which entry_schema:
this automation composition element will be started, values:the
        type: string
        requred: true
topology_template:
  node_templates:  first start phase is zero. Automation Composition Elements are started in their start_phase order and stopped
    org.onap.domain.linkmonitor.LinkMonitorControlLoopDefinition1:
      version: 1.2.3
      type: org.onap.policy.clamp.controlloop.ControlLoop
      type_version: 1.0.1in reverse start phase order. Automation Composition Elements with the same start phase are started and
      description: Control loop for Linkstopped Monitorsimultaneously
      propertiesuninitializedToPassiveTimeout:
        providertype: Ericssoninteger
        elementsrequired: false
        - nameconstraints: org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElement

          - versiongreater_or_equal: 1.2.30
        - namedefault: org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElement60
          versionmetadata:
 1.2.3
        - namecommon: org.onap.domain.linkmonitor.SdnrSimulatorK8SMicroserviceControlLoopElement
true
        description: The maximum version: 1.2.3
    org.onap.k8s.controlloop.K8SControlLoopParticipant:
      version: 2.3.4time in seconds to wait for a state chage from uninitialized to passive
      typepassiveToRunningTimeout: org.onap.policy.clamp.controlloop.Participant

        type_version: 1.0.1integer
      description  required: Participantfalse
 for k8s
      propertiesconstraints:
          - providergreater_or_equal: ONAP0
    org.onap.domain.linkmonitor.OruAppK8SMicroserviceControlLoopElement:
    default: 60
        versionmetadata: 1.2.3

          typecommon: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
true
        type_versiondescription: 1.0.1
      description: Control loop element for oru-app The maximum time in seconds to wait for a state chage from passive to running
      propertiesrunningToPassiveTimeout:
        providertype: ONAPinteger
        participant_idrequired: false
          nameconstraints: K8sParticipant0
          version- greater_or_equal: 1.0.0
        participantTypedefault: 60
          name: org.onap.k8s.controlloop.K8SControlLoopParticipantmetadata:
          versioncommon: 2.3.4true
        chartdescription:
 The maximum time in seconds to wait for a chartId:
state chage from running to passive
       name: oru-apppassiveToUninitializedTimeout:
        type:  integer
  version: 0.1.0
     required: false
    releaseName: oru-app
   constraints:
       repository:
   - greater_or_equal: 0
        repoNamedefault: chartmuseum60
          namespacemetadata: nonrtric
          overrideParamscommon: true
        description: The maximum time image.repository: nexus3.o-ran-sc.org:10002/o-ran-sc/nonrtric-o-ru-closed-loop-recovery
            image.tagin seconds to wait for a state chage from passive to uninitialized
  org.onap.policy.clamp.acm.AutomationComposition:
    version: 1.0.1
            messagerouter.host: http://message-router.onapderived_from: tosca.nodetypes.Root
    properties:
        messagerouter.port: 3904provider:
            sdnr.hosttype: http://sdnr-simulatorstring
        required: false
   sdnr.port: 9990
    org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceControlLoopElementmetadata:
      version: 1.2.3
   common: true
  type: org.onap.policy.clamp.controlloop.K8SMicroserviceControlLoopElement
      type_versiondescription: 1.0.1
      description: Control loop element for message-generatorSpecifies the organization that provides the automation composition element
      propertieselements:
        providertype: ONAPlist
        participant_idrequired: true
          namemetadata: K8sParticipant0
          versioncommon: 1.0.0true
        participantTypeentry_schema:
          nametype: org.onap.k8sdatatypes.controlloop.K8SControlLoopParticipantToscaConceptIdentifier
          versiondescription: 2.3.4
        chart:
          chartIdSpecifies a list of automation composition element definitions that make up this automation composition definition
  org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement:
    version: 1.0.1
    derived_from: org.onap.policy.clamp.acm.AutomationCompositionElement
    nameproperties:
  message-generator
    chart:
        versiontype: 0.1.0string
          releaseNamerequired: message-generatortrue
      configs:
    repository:
    type: list
        repoNamerequired: chartmuseumfalse
      requirements:
        namespacetype: nonrtricstring
        requred: false
  overrideParams:
    templates:
        image.repositorytype: registry.nordix.org/onap/message-generator
list
        required: false
      image.tag: 1.0.0  entry_schema:
      values:
      messagerouter.host: http://message-router.onap  type: string
        requred: true
topology_template:
   messagerouter.port: 3904node_templates:
    org.onap.policy.domainclamp.linkmonitoracm.SdnrSimulatorK8SMicroserviceControlLoopElementKubernetesParticipant:
      version: 1.2.3.4
      type: org.onap.policy.clamp.controlloopacm.K8SMicroserviceControlLoopElementParticipant
      type_version: 1.0.1
      description: Control loop elementParticipant for sdnr-simulatorK8S
      properties:
        provider: ONAPEricsson
        participant_idorg.onap.domain.linkmonitor.OruAppK8SMicroserviceAutomationCompositionElement:
      # Chart from new name: K8sParticipant0
    repository
      version: 1.02.03
        participantType:type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement
      type_version: 1.0.0
      description: Automation composition element for the K8S microservice for PMSH
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.policy.k8sclamp.controlloopacm.K8SControlLoopParticipantKubernetesParticipant
          version: 2.3.4
        chart:
          chartId:
            name: sdnroru-simulatorapp
            version: 0.1.0
          releaseName: sdnroru-simulatorapp
          repository:
             repoName: chartmuseumrepoName: nginx-proxy 
            address: https://nginx-proxy:443 
          namespace: nonrtric
          overrideParams:
            image.repository: registry.nordixnexus3.o-ran-sc.org/onap/sdnr-simulator:10004/o-ran-sc/nonrtric-rapp-orufhrecovery
            image.tag: 1.01.0
            messagerouter.host: http://message-router.onap
            messagerouter.port: 3904

            sdnr.host: http://sdnr-simulator
            sdnr.port: 9990
    org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceAutomationCompositionElement:
      # Chart from new repository
      version: 1.2.3
      type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement
      type_version: 1.0.0
      description: Automation composition element for the K8S microservice for PMSH
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.policy.clamp.acm.KubernetesParticipant
          version: 2.3.4
        chart:
          chartId:
            name: message-generator
            version: 0.1.0
          releaseName: message-generator
          repository:
            repoName: nginx-proxy 
            address: https://nginx-proxy:443 
          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.SdnrSimulatorK8SK8SMicroserviceAutomationCompositionElement:
      # Chart from new repository
      version: 1.2.3
      type: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement
      type_version: 1.0.0
      description: Automation composition element for the K8S microservice for PMSH
      properties:
        provider: ONAP
        participant_id:
          name: K8sParticipant0
          version: 1.0.0
        participantType:
          name: org.onap.policy.clamp.acm.KubernetesParticipant
          version: 2.3.4
        chart:
          chartId:
            name: sdnr-simulator
            version: 0.1.0
          releaseName: sdnr-simulator
          repository:
            repoName: nginx-proxy 
            address: https://nginx-proxy:443 
          namespace: nonrtric
          overrideParams:
            image.repository: registry.nordix.org/onap/sdnr-simulator 
            image.tag: 1.1.0
            messagerouter.host: http://message-router.onap
            messagerouter.port: 3904
    org.onap.domain.sample.GenericK8s_AutomationCompositionDefinition:
      version: 1.2.3
      type: org.onap.policy.clamp.acm.AutomationComposition
      type_version: 1.0.1
      description: Automation composition for Hello World
      properties:
        provider: ONAP
        elements:
          - name: org.onap.domain.linkmonitor.OruAppK8SMicroserviceAutomationCompositionElement
            version: 1.2.3
          - name: org.onap.domain.linkmonitor.MessageGeneratorK8SMicroserviceAutomationCompositionElement
            version: 1.2.3
          - name: org.onap.domain.linkmonitor.SdnrSimulatorK8SK8SMicroserviceAutomationCompositionElement
            version: 1.2.3

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

...

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

component of the clamp.

  • First Next step is to copy the helm charts of all three components into the kuberneteskube config file of the cluster inside the kubernetes-participant. The helm charts are located in the nonrtric repo of OSC.Find the pod-name of this component using:
Code Block
languagebash
cd orufhrecovery/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 orufhrecovery/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 orufhrecovery/scriptversion/helm/oru-app/
helm package .
kubectl cp ./oru-app-0.1.0.tgz-n onap get pod | grep k8s-ppnt

Log into the k8s-ppnt pod and create the following directories

Code Block
languagebash
mkdir -p ~/.kube
mkdir ~/ssl

Copy the config file using this command:

Code Block
languagebash
kubectl cp ~/.kube/config onap/<POD-NAME-k8s-ppnt>:/home/policy/local-charts/oru-app-0.1.0.tgz

...

/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
mkdirkubectl get ns

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

Next step is setup a https proxy from chartmuseum and push the charts

  • Create tls certs using onap cet manager  kubectl apply -f certificate.yaml (Replace NodeIP with your control plane IP)
  • Install the nginx proxy to run in front of ONAP chartmuseum: kubectl apply -f nginx.yaml
  • Retrieve chartmuseum username and password using kubectl get secret onap-chartmuseum-registrycred -o=go-template='{{$login := .data.login| base64decode}}{{$pw := .data.password| base64decode}}{{printf "%s:%s" $login $pw }}'

Create the helm charts for all 3 components and push them to chartmuseum 

Code Block
languagetext
titlecommand
cd orufhrecovery/scriptversion/helm/sdnr-simulator/
helm package .
curl -u <username>:<password> --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@sdnr-charts/sdnr-simulator-0.1.0.tgz" http://localhost<NodeIP>:808030088/api/charts

cd orufhrecovery/scriptversion/helm/message-generator/
helm package .
curl -u <username>:<password> --data-binary "@local-charts/message@message-generator-0.1.0.tgz" http://localhost<NodeIP>:808030088/api/charts

cd orufhrecovery/scriptversion/helm/oru-app/
helm package .
curl -u <username>:<password> --data-binary "@local-charts/oru@oru-app-0.1.0.tgz" http://localhost<NodeIP>:808030088/api/charts


Retrieve the ca.crt from the secret and copy it to the k8s-ppnt pod : 

Code Block
languagebash
kubectl get secret nginx-tls -o jsonpath="{.data.ca\.crt}" | base64 -d > ca.crt 
cp ~/certs/ca.crt onap/<POD-NAME-k8s-ppnt>:/home/policy/ssl


Log into the k8s-ppnt pod using "kubectl -n onap exec -it <POD-NAME-k8s-ppnt> sh" and run the following commands:

Code Block
languagebash
helm repo add chartmuseumnginx-proxy httphttps://localhost:8080nginx-proxy:443 --ca-file /home/policy/ssl/ca.crt
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 PASSIVE state, check that all three micro-services have been created in the nonrtric namespace.

...