diff options
Diffstat (limited to 'docs/drools/pdpdApps.rst')
-rw-r--r-- | docs/drools/pdpdApps.rst | 179 |
1 files changed, 80 insertions, 99 deletions
diff --git a/docs/drools/pdpdApps.rst b/docs/drools/pdpdApps.rst index 6dceee5f..abcf2e69 100644 --- a/docs/drools/pdpdApps.rst +++ b/docs/drools/pdpdApps.rst @@ -28,47 +28,48 @@ Software Source Code repositories ~~~~~~~~~~~~~~~~~~~~~~~~ -The PDP-D Applications software resides on the `policy/drools-applications <https://git.onap.org/policy/drools-applications>`__ repository. The actor libraries introduced in the *frankfurt* release reside in -the `policy/models repository <https://git.onap.org/policy/models>`__. +The PDP-D Applications software resides on the +`policy/drools-applications <https://git.onap.org/policy/drools-applications>`_ repository. +The actor libraries introduced in the *Frankfurt* release reside in the +`policy/models repository <https://git.onap.org/policy/models>`_. At this time, the *control loop* application is the only application supported in ONAP. All the application projects reside under the -`controlloop directory <https://git.onap.org/policy/drools-applications/tree/controlloop>`__. +`controlloop directory <https://git.onap.org/policy/drools-applications/tree/controlloop>`_. Docker Image ~~~~~~~~~~~~ -See the *drools-applications* -`released versions <https://wiki.onap.org/display/DW/Policy+Framework+Project%3A+Component+Versions>`__ -for the latest images: +Check the *drools-applications* `released versions <https://github.com/onap/policy-parent/tree/master/integration/src/main/resources/release>`_ +page for the latest versions. At the time of this writing *3.0.1* is the latest version. .. code-block:: bash - docker pull onap/policy-pdpd-cl:3.0.0 + docker pull nexus3.onap.org:10001/onap/policy-pdpd-cl:3.0.1 -At the time of this writing *3.0.0* is the latest version. +At the time of this writing *3.0.1* is the latest version. -The *onap/policy-pdpd-cl* image extends the *onap/policy-drools* image with -the *usecases* controller that realizes the *control loop* application. +The *onap/policy-pdpd-cl* image extends the *onap/policy-drools* image with the *usecases* +controller that realizes the *control loop* application. Usecases Controller =================== -The `usecases <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases>`__ +The `usecases <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases>`_ controller is the *control loop* application in ONAP. There are three parts in this controller: -* The `drl rules <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/src/main/resources/usecases.drl>`__. -* The `kmodule.xml <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/src/main/resources/META-INF/kmodule.xml>`__. -* The `dependencies <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/pom.xml>`__. +* The `drl rules <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/src/main/resources/usecases.drl>`_. +* The `kmodule.xml <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/src/main/resources/META-INF/kmodule.xml>`_. +* The `dependencies <https://git.onap.org/policy/drools-applications/tree/controlloop/common/controller-usecases/pom.xml>`_. -The `kmodule.xml` specifies only one session, and declares in the *kbase* section the two operational policy types that -it supports. +The `kmodule.xml` specifies only one session, and declares in the *kbase* section the two +operational policy types that it supports. -The Usecases controller relies on the new Actor framework to interact with remote -components, part of a control loop transaction. The reader is referred to the -*Policy Platform Actor Development Guidelines* in the documentation for further information. +The Usecases controller relies on the new Actor framework to interact with remote components, part +of a control loop transaction. The reader is referred to the *Policy Platform Actor Development +Guidelines* in the documentation for further information. Operational Policy Types ======================== @@ -77,19 +78,20 @@ The *usecases* controller supports the following policy type: - *onap.policies.controlloop.operational.common.Drools*. -The *onap.policies.controlloop.operational.common.Drools* -is the Tosca compliant policy type introduced in *frankfurt*. +The *onap.policies.controlloop.operational.common.Drools* is the Tosca compliant policy type +introduced in *Frankfurt*. The Tosca Compliant Operational Policy Type is defined at the -`onap.policies.controlloop.operational.common.Drools <https://git.onap.org/policy/models/tree/models-examples/src/main/resources/policytypes/onap.policies.controlloop.operational.common.Drools.yaml>`__. +`onap.policies.controlloop.operational.common.Drools <https://git.onap.org/policy/models/tree/models-examples/src/main/resources/policytypes/onap.policies.controlloop.operational.common.Drools.yaml>`_. -An example of a Tosca Compliant Operational Policy can be found -`here <https://git.onap.org/policy/models/tree/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json>`__. +An example of a Tosca Compliant Operational Policy: +`vDNS <https://git.onap.org/policy/models/tree/models-examples/src/main/resources/policies/vDNS.policy.operational.input.tosca.json>`_. Policy Chaining =============== -The *usecases* controller supports chaining of multiple operations inside a Tosca Operational Policy. The next operation can be chained based on the result/output from an operation. +The *usecases* controller supports chaining of multiple operations inside a Tosca Operational +Policy. The next operation can be chained based on the result/output from an operation. The possibilities available for chaining are: - *success: chain after the result of operation is success* @@ -99,17 +101,17 @@ The possibilities available for chaining are: - *failure_exception: chain after the result of operation is failure due to exception* - *failure_guard: chain after the result of operation is failure due to guard not allowing the operation* -An example of policy chaining for VNF can be found -`here <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/vFirewall.cds.policy.operational.chaining.yaml>`__. +An example of policy chaining for VNF: +`vFirewall <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/vFirewall.cds.policy.operational.chaining.yaml>`_. -An example of policy chaining for PNF can be found -`here <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/pnf.cds.policy.operational.chaining.yaml>`__. +An example of policy chaining for PNF: +`pnf <https://github.com/onap/policy-models/blob/master/models-examples/src/main/resources/policies/pnf.cds.policy.operational.chaining.yaml>`_. Features ======== -Since the PDP-D Control Loop Application image was created from the PDP-D Engine one (*onap/policy-drools*), -it inherits all features and functionality. +Since the PDP-D Control Loop Application image was created from the PDP-D Engine one +(*onap/policy-drools*), it inherits all features and functionality. The enabled features in the *onap/policy-pdpd-cl* image are: @@ -118,29 +120,27 @@ The enabled features in the *onap/policy-pdpd-cl* image are: - **lifecycle**: enables the lifecycle APIs. - **controlloop-trans**: control loop transaction tracking. - **controlloop-management**: generic controller capabilities. -- **controlloop-usecases**: new *controller* introduced in the guilin release to realize the ONAP use cases. +- **controlloop-usecases**: new *controller* introduced in the Guilin release to realize the ONAP + use cases. Control Loops Transaction (controlloop-trans) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -It tracks Control Loop Transactions and Operations. These are recorded in -the *$POLICY_LOGS/audit.log* and *$POLICY_LOGS/metrics.log*, and accessible -through the telemetry APIs. +It tracks Control Loop Transactions and Operations. These are recorded in the +*$POLICY_LOGS/audit.log* and *$POLICY_LOGS/metrics.log*, and accessible through the telemetry APIs. Control Loops Management (controlloop-management) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -It installs common control loop application resources, and provides -telemetry API extensions. *Actor* configurations are packaged in this -feature. +It installs common control loop application resources, and provides telemetry API extensions. +*Actor* configurations are packaged in this feature. Usecases Controller (controlloop-usecases) ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -It is the *guilin* release implementation of the ONAP use cases. -It relies on the new *Actor* model framework to carry out a policy's -execution. +It is the *Guilin* release implementation of the ONAP use cases. It relies on the new *Actor* model +framework to carry out a policy's execution. Utilities (controlloop-utils) @@ -151,16 +151,15 @@ Enables *actor simulators* for testing purposes. Offline Mode ============ -The default ONAP installation in *onap/policy-pdpd-cl:1.8.2* is *OFFLINE*. -In this configuration, the *rules* artifact and the *dependencies* are all in the local -maven repository. This requires that the maven dependencies are preloaded in the local -repository. +The default ONAP installation in *onap/policy-pdpd-cl:1.8.2* is *OFFLINE*. In this configuration, +the *rules* artifact and the *dependencies* are all in the local maven repository. This requires +that the maven dependencies are preloaded in the local repository. An offline configuration requires two configuration items: -- *OFFLINE* environment variable set to true (see `values.yaml <https://git.onap.org/oom/tree/kubernetes/policy/values.yaml>`__. -- override of the default *settings.xml* (see - `settings.xml <https://git.onap.org/oom/tree/kubernetes/policy/components/policy-drools-pdp/resources/configmaps/settings.xml>`__) override. +- *OFFLINE* environment variable set to true (see `values.yaml <https://git.onap.org/oom/tree/kubernetes/policy/values.yaml>`_. +- override of the default *settings.xml* (see `settings.xml <https://git.onap.org/oom/tree/kubernetes/policy/components/policy-drools-pdp/resources/configmaps/settings.xml>`_) + override. Running the PDP-D Control Loop Application in a single container ================================================================ @@ -205,13 +204,7 @@ First create an environment file (in this example *env.conf*) to configure the P SQL_USER= SQL_PASSWORD= - # AAF - - AAF=false - AAF_NAMESPACE=org.onap.policy - AAF_HOST=aaf.api.simpledemo.onap.org - - # PDP-D DMaaP configuration channel + # PDP-D configuration channel PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION PDPD_CONFIGURATION_API_KEY= @@ -258,7 +251,7 @@ First create an environment file (in this example *env.conf*) to configure the P PDP_PASSWORD=password GUARD_DISABLED=true - # DCAE DMaaP + # DCAE Topic DCAE_TOPIC=unauthenticated.DCAE_CL_OUTPUT DCAE_SERVERS=localhost @@ -301,7 +294,8 @@ Configuration features.pre.sh """"""""""""""" -We can enable the *controlloop-utils* and disable the *distributed-locking* feature to avoid using the database. +We can enable the *controlloop-utils* and disable the *distributed-locking* feature to avoid using +the database. .. code-block:: bash @@ -310,22 +304,11 @@ We can enable the *controlloop-utils* and disable the *distributed-locking* feat bash -c "/opt/app/policy/bin/features disable distributed-locking" bash -c "/opt/app/policy/bin/features enable controlloop-utils" -active.post.sh -"""""""""""""" - -The *active.post.sh* script makes the PDP-D active. - -.. code-block:: bash - - #!/bin/bash -x - - bash -c "http --verify=no -a ${TELEMETRY_USER}:${TELEMETRY_PASSWORD} PUT https://localhost:9696/policy/pdp/engine/lifecycle/state/ACTIVE" - Actor Properties """""""""""""""" -In the *guilin* release, some *actors* configurations need to be overridden to support *http* for compatibility -with the *controlloop-utils* feature. +In the *Guilin* release, some *actors* configurations need to be overridden to support *http* for +compatibility with the *controlloop-utils* feature. AAI-http-client.properties """""""""""""""""""""""""" @@ -420,8 +403,9 @@ Bring up the PDP-D Control Loop Application To run the container in detached mode, add the *-d* flag. -Note that we are opening the *9696* telemetry API port to the outside world, mounting the *config* host directory, -and setting environment variables. +.. note:: + The *9696* telemetry API port is open to the outside world, the *config* host directory is mounted + as a volume and environment variables are set with an env-file option. To open a shell into the PDP-D: @@ -429,13 +413,12 @@ To open a shell into the PDP-D: docker exec -it pdp-d bash -Once in the container, run tools such as *telemetry*, *db-migrator*, *policy* to look at the system state: +Once in the container, run tools such as *telemetry*, *policy* to look at the system state: .. code-block:: bash docker exec -it PDPD bash -c "/opt/app/policy/bin/telemetry" docker exec -it PDPD bash -c "/opt/app/policy/bin/policy status" - docker exec -it PDPD bash -c "/opt/app/policy/bin/db-migrator -s ALL -o report" Controlled instantiation of the PDP-D Control Loop Appplication ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -565,11 +548,12 @@ To initiate a control loop transaction, simulate a DCAE ONSET to Policy: http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/DCAE_TOPIC/events @dcae.vdns.onset.json Content-Type:'text/plain' -This will trigger the scale out control loop transaction that will interact with the *SO* -simulator to complete the transaction. +This will trigger the scale out control loop transaction that will interact with the *SO* simulator +to complete the transaction. -Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the POLICY-CL-MGT channel. -An entry in the *$POLICY_LOGS/audit.log* should indicate successful completion as well. +Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the +POLICY-CL-MGT channel. An entry in the *$POLICY_LOGS/audit.log* should indicate successful +completion as well. vCPE use case testing ===================== @@ -661,8 +645,8 @@ To initiate a control loop transaction, simulate a DCAE ONSET to Policy: http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/DCAE_TOPIC/events @dcae.vcpe.onset.json Content-Type:'text/plain' -This will spawn a vCPE control loop transaction in the PDP-D. Policy will send a *restart* message over the -*APPC-LCM-READ* channel to APPC and wait for a response. +This will spawn a vCPE control loop transaction in the PDP-D. Policy will send a *restart* message +over the *APPC-LCM-READ* channel to APPC and wait for a response. Verify that you see this message in the network.log by looking for *APPC-LCM-READ* messages. @@ -705,8 +689,9 @@ Send a simulated APPC response back to the PDP-D over the *APPC-LCM-WRITE* chann http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/APPC-LCM-WRITE/events @appc.vcpe.success.json Content-Type:'text/plain' -Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the *POLICY-CL-MGT* channel, -and an entry is added to the *$POLICY_LOGS/audit.log* indicating successful completion. +Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the +*POLICY-CL-MGT* channel, and an entry is added to the *$POLICY_LOGS/audit.log* indicating successful +completion. vFirewall use case testing ========================== @@ -807,13 +792,14 @@ To initiate a control loop transaction, simulate a DCAE ONSET to Policy: http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/DCAE_TOPIC/events @dcae.vfw.onset.json Content-Type:'text/plain' -This will spawn a vFW control loop transaction in the PDP-D. Policy will send a *ModifyConfig* message over the -*APPC-CL* channel to APPC and wait for a response. This can be seen by searching the network.log for *APPC-CL*. +This will spawn a vFW control loop transaction in the PDP-D. Policy will send a *ModifyConfig* +message over the *APPC-CL* channel to APPC and wait for a response. This can be seen by searching +the network.log for *APPC-CL*. Note the *SubRequestId* field in the *ModifyConfig* message in the *APPC-CL* topic in the network.log -Send a simulated APPC response back to the PDP-D over the *APPC-CL* channel. -To do this, change the *REPLACEME* text in the *appc.vcpe.success.json* with this *SubRequestId*. +Send a simulated APPC response back to the PDP-D over the *APPC-CL* channel. To do this, change the +*REPLACEME* text in the *appc.vcpe.success.json* with this *SubRequestId*. appc.vcpe.success.json ~~~~~~~~~~~~~~~~~~~~~~ @@ -842,24 +828,19 @@ appc.vcpe.success.json http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/APPC-CL/events @appc.vcpe.success.json Content-Type:'text/plain' -Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the POLICY-CL-MGT channel, -and an entry is added to the *$POLICY_LOGS/audit.log* indicating successful completion. +Verify in *$POLICY_LOGS/network.log* that a *FINAL: SUCCESS* notification is sent over the +POLICY-CL-MGT channel, and an entry is added to the *$POLICY_LOGS/audit.log* indicating successful +completion. Running PDP-D Control Loop Application with other components ============================================================ -The reader can also look at the `policy/docker repository <https://github.com/onap/policy-docker/tree/master/csit>`__. +The reader can also look at the `policy/docker repository <https://github.com/onap/policy-docker/tree/master/csit>`_. More specifically, these directories have examples of other PDP-D Control Loop configurations: -* `plans <https://github.com/onap/policy-docker/tree/master/compose>`__: startup & teardown scripts. -* `scripts <https://github.com/onap/policy-docker/blob/master/compose/compose.yaml>`__: docker-compose file. -* `tests <https://github.com/onap/policy-docker/blob/master/csit/resources/tests/drools-applications-test.robot>`__: test plan. - -Additional information -====================== - -For additional information, please see the -`Drools PDP Development and Testing (In Depth) <https://wiki.onap.org/display/DW/2020-08+Frankfurt+Tutorials>`__ page. - +* `plans <https://github.com/onap/policy-docker/tree/master/compose>`_: startup & teardown scripts. +* `scripts <https://github.com/onap/policy-docker/blob/master/compose/compose.yaml>`_: docker-compose file. +* `tests <https://github.com/onap/policy-docker/blob/master/csit/resources/tests/drools-applications-test.robot>`_: test plan. +End of Document |