From: Saryu Shah Date: Tue, 14 Nov 2017 03:00:56 +0000 (+0000) Subject: Policy Documention Eclipse, PDP-D, Sess Pers X-Git-Tag: v1.1.1~2^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?p=policy%2Fengine.git;a=commitdiff_plain;h=ef28b6dd662b9daebf120aef0c9b8d4387260c72 Policy Documention Eclipse, PDP-D, Sess Pers Documentation for Eclipse, PDP-D and Session Persistance. ------------------------------------------------------------- Change-Id: I2e988cf5cb64ea60c7173dcd716be5fa25855255 Issue-Id: POLICY-335 Signed-off-by: Saryu Shah --- diff --git a/docs/platform/RunEcl_console_output.png b/docs/platform/RunEcl_console_output.png new file mode 100755 index 000000000..c11abb707 Binary files /dev/null and b/docs/platform/RunEcl_console_output.png differ diff --git a/docs/platform/RunEcl_drools_pdp_project.png b/docs/platform/RunEcl_drools_pdp_project.png new file mode 100755 index 000000000..2bbb1b693 Binary files /dev/null and b/docs/platform/RunEcl_drools_pdp_project.png differ diff --git a/docs/platform/RunEcl_main.png b/docs/platform/RunEcl_main.png new file mode 100755 index 000000000..c1c647f78 Binary files /dev/null and b/docs/platform/RunEcl_main.png differ diff --git a/docs/platform/RunEcl_pdpd_200.png b/docs/platform/RunEcl_pdpd_200.png new file mode 100755 index 000000000..dc2b987e8 Binary files /dev/null and b/docs/platform/RunEcl_pdpd_200.png differ diff --git a/docs/platform/RunEcl_run_as.png b/docs/platform/RunEcl_run_as.png new file mode 100755 index 000000000..5c310bea2 Binary files /dev/null and b/docs/platform/RunEcl_run_as.png differ diff --git a/docs/platform/RunEcl_telemetry.png b/docs/platform/RunEcl_telemetry.png new file mode 100755 index 000000000..3ca4c9be1 Binary files /dev/null and b/docs/platform/RunEcl_telemetry.png differ diff --git a/docs/platform/feature_sesspersist.rst b/docs/platform/feature_sesspersist.rst new file mode 100644 index 000000000..4bb5ef62c --- /dev/null +++ b/docs/platform/feature_sesspersist.rst @@ -0,0 +1,49 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +************************************ +Feature: Session Persistence +************************************ + +The session persistence feature allows drools kie sessions to be persisted in a database surviving pdp-d restarts. + + .. code-block:: bash + :caption: Enable session persistence + :linenos: + + policy stop + features enable session-persistence + +The configuration is located at: + + - *$POLICY_HOME/config/feature-session-persistence.properties* + +Each controller that wants to be started with persistence should contain the following line in its *-controller.properties* + + - *persistence.type=auto* + + .. code-block:: bash + :caption: Start the PDP-D using session-persistence + :linenos: + + db-migrator -o upgrade -s ALL + policy start + +Facts will survive PDP-D restart using the native drools capabilities and introduce a performance overhead. + + .. code-block:: bash + :caption: Disable the session-persistence feature + :linenos: + + policy stop + features disable session-persistence + sed -i "/persistence.type=auto/d" -controller.properties + db-migrator -o erase -s sessionpersistence # delete all its database data (optional) + policy start + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Feature+Session+Persistence + + diff --git a/docs/platform/index.rst b/docs/platform/index.rst index ae01ff9db..f8fccd8dc 100644 --- a/docs/platform/index.rst +++ b/docs/platform/index.rst @@ -18,15 +18,16 @@ Policy Software Architecture .. toctree:: :maxdepth: 1 - swarch_pap.rst - swarch_pdpx.rst - swarch_brmsgw.rst + swarch_pdp.rst feature_eelf.rst - clsimulation.rst feature_testtransaction.rst feature_healthcheck.rst + feature_sesspersist.rst feature_statemgmt.rst feature_activestdbymgmt.rst + swarch_pdpx.rst + swarch_pap.rst + swarch_brmsgw.rst Policy Platform Tutorials ------------------------- @@ -37,6 +38,8 @@ Policy Platform Tutorials deployPDPPAP.rst guardpolicy.rst guardpdp.rst + runningEclipse.rst + clsimulation.rst tutorial_cl.rst tutorial_vDNS.rst tutorial_VOLTE.rst diff --git a/docs/platform/runningEclipse.rst b/docs/platform/runningEclipse.rst new file mode 100644 index 000000000..4d26fdac7 --- /dev/null +++ b/docs/platform/runningEclipse.rst @@ -0,0 +1,55 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +************************ +Running PDP-D in Eclipse +************************ + +.. contents:: + :depth: 3 + +This tutorial is intended for developers who would like to run the PDP-D in an Eclipse environment. It is assumed that the drools-pdp git project has been imported in an Eclipse workspace. + +Starting the PDP-D +^^^^^^^^^^^^^^^^^^ +For the Amsterdam release, the project directory will look as follows assuming all drools-pdp projects were selected when importing. + + .. image:: RunEcl_drools_pdp_project.png + +Right click on policy-management hover over "Run As" and select "Java Application" + + .. image:: RunEcl_run_as.png + +Search for "Main" in the pop up and select the Main with the package "org.onap.policy.drools.system" and click "OK". + + .. image:: RunEcl_main.png + +The PDP-D will start running; the console will display output. + + .. image:: RunEcl_console_output.png + +Interacting with the PDP-D +^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To interact with the PDP-D, the Telemetry API can be used. A simple GET on the engine will show that the PDP-D is running in Eclipse. + + .. code-block:: bash + + curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/ | python -m json.tool + + .. image:: RunEcl_telemetry.png + +An HTTP 200 message for the GET request will also appear in the console in Eclipse. + + .. image:: RunEcl_pdpd_200.png + +.. seealso:: To create a controller and run a control loop please refer to Modifying the Amsterdam release template. + + +End of Document + + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/Running+PDP-D+in+Eclipse + + diff --git a/docs/platform/swarch_pdp.rst b/docs/platform/swarch_pdp.rst new file mode 100644 index 000000000..03fb12dbe --- /dev/null +++ b/docs/platform/swarch_pdp.rst @@ -0,0 +1,71 @@ + +.. This work is licensed under a Creative Commons Attribution 4.0 International License. +.. http://creativecommons.org/licenses/by/4.0 + +*************************** +PDP-D Software Architecture +*************************** + +.. contents:: + :depth: 3 + +Overview +^^^^^^^^ + +In ONAP, PDP-D is the Policy component that executes Operational Policies (see `Control Loop Operational Policy`_ ). It uses `drools`_ as the underlying rule based engine to execute policies. + +The PDP-D name may not be reflective of its nature, as it is generic middleware, a maven based drools rules based application container. + +The PDP-D generic application container is maintained in the policy/drools-pdp repository (https://git.onap.org/policy/drools-pdp). + +The Control Loop Operational Policies and support libraries applications are maintained in the policy/drools-applications repository (https://git.onap.org/policy/drools-applications/). + + +PDP-D application container +^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The PDP-D lightweight application container provides generic services to the drools applications (0..n) running on it. (https://git.onap.org/policy/drools-pdp) + +There is the distinction of **core** software and optional **extensions** to the core functionality. + +Core Software +------------- + +The core critical functionality that always runs in any PDP-D container is maintained in those projects named with the "policy-" prefix. These are: +- policy-utils (utilities) +- policy-core (drools libraries interfaces) +- policy-endpoints (networking) +- policy-management. (management of the platform) + +This is the minimum set of services that any PDP-D application provides to their executing drools-applications. + +The intent is that this functionality is kept stable, fast, and minimal. As new development is added, the intent is that this functionality is resilient to breakage as side effects to new development. + +Extensions +---------- + +Extensions are optional modules that are commonly known as **features** that extends the PDP-D core functionality with new enhancements. + +**Features** can be enabled or disabled. When a feature is disabled, it is a *hard disable* with no side effects on the *core functionality*, meaning no additional libraries, configuration, etc. that may have side effects on the core functionality described above. + +The current extensions supported are: + +- Feature Test Transaction (disabled by default) +- Feature State Management (disabled by default) +- Feature EELF (disabled by default) +- Feature Healthcheck (enabled by default) +- Feature Session Persistence (disabled by default) +- Feature Active/Standby Management (disabled by default) + +.. seealso:: Please see the individual feature wiki pages for more information + + +.. _Control Loop Operational Policy: https://wiki.onap.org/display/DW/Control+Loop+Operational+Policy +.. _drools: https://www.drools.org + + +End of Document + +.. SSNote: Wiki page ref. https://wiki.onap.org/display/DW/PAP+Software+Architecture + +