Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 1 | |
| 2 | .. This work is licensed under a Creative Commons Attribution 4.0 International License. |
| 3 | .. http://creativecommons.org/licenses/by/4.0 |
| 4 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 5 | ********************************************** |
| 6 | Testing, Deploying and Debugging the PDP-X/PAP |
| 7 | ********************************************** |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 8 | |
| 9 | .. contents:: |
| 10 | :depth: 3 |
| 11 | |
| 12 | PAP (Policy Administration Point) |
| 13 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 14 | |
| 15 | Accessing and Starting PAP |
| 16 | -------------------------- |
| 17 | |
| 18 | - To access the PAP docker use |
| 19 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 20 | .. code-block:: bash |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 21 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 22 | docker exec -it -u 0 pap su - policy |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 23 | |
| 24 | - All Policy related software are installed under the policy account, the policy root directory is under *${POLICY_HOME}* environment variable and it may be changed on a per installation basis. It is typically set up under the */opt/app/policy* directory but can be changed during installation. All Policy software runs with non-root privileges as *policy* is a regular user account. |
| 25 | |
| 26 | - Once within the PAP Container the running status can be checked using the following policy status command. |
| 27 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 28 | .. code-block:: bash |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 29 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 30 | policy.sh [--debug] status|start|stop |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 31 | |
| 32 | - To get the current status of Policy use *policy.sh status* |
| 33 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 34 | .. code-block:: bash |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 35 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 36 | policy@pap:~$ policy.sh status |
| 37 | pap: UP: running with pid 2114 |
| 38 | console: UP: running with pid 2135 |
| 39 | paplp: UP: running with pid 2155 |
| 40 | 3 cron jobs installed. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 41 | |
| 42 | - To Stop the components use *policy.sh stop* |
| 43 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 44 | .. code-block:: bash |
| 45 | |
| 46 | policy@pap:~$ policy.sh stop |
| 47 | paplp: STOPPING .. |
| 48 | console: STOPPING .. |
| 49 | pap: STOPPING .. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 50 | |
| 51 | - To Start use *policy.sh start* |
| 52 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 53 | .. code-block:: bash |
| 54 | |
| 55 | policy@pap:~$ policy.sh start |
| 56 | pap: STARTING .. |
| 57 | console: STARTING .. |
| 58 | paplp: STARTING .. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 59 | |
| 60 | Healthcheck |
| 61 | ----------- |
| 62 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 63 | - The Healthcheck feature resides in the PDP-D that proxies for PAP, PDP-X, etc. To perform the Healthcheck on policy components you can follow the generic procedure documented as below, these commands must be executed within the PDP-D container. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 64 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 65 | .. code-block:: bash |
| 66 | |
| 67 | # Assuming the healthcheck service credentials have not been changed |
| 68 | # post-installation within the drools container |
| 69 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 70 | source /opt/app/policy/config/feature-healthcheck.conf.environment |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 71 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 72 | curl -k --silent --user "${HEALTHCHECK_USER}:${HEALTHCHECK_PASSWORD}" |
| 73 | -X GET https://localhost:6969/healthcheck | python -m json.tool |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 74 | |
| 75 | - Additional information can be found in the documentation for Testing, Deploying, and debugging on a PDP-D Healthcheck. |
| 76 | |
| 77 | Logs |
| 78 | ---- |
| 79 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 80 | - The main application logs for PAP are located at */var/log/onap/policy/pap/* location. The catalina.out can be found at *$POLICY_HOME/servers/pap/logs/* location. |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 81 | |
| 82 | * Policy PAP uses EELF logging framework for logging and if needed to be modified can be modified at *$POLICY_HOME/servers/pap/webapps/pap/WEB-INF/classes/logback.xml*. This change needs a restart of the PAP component in order to be in effect. |
| 83 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 84 | - The logs are divided into separate files and debug logs can be found in *debug.log* and error logs in *error.log* file which are two different files under application logs directory. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 85 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 86 | PDP-X (XACML Policy Decision Point) |
| 87 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 88 | |
| 89 | Accessing and Starting PDP |
| 90 | -------------------------- |
| 91 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 92 | - To access the PDP-X docker : |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 93 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 94 | .. code-block:: bash |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 95 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 96 | docker exec -it -u 0 pdp su - policy |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 97 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 98 | - To start and stop the PDP-X components the same procedure can be followed as documented for PAP. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 99 | |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 100 | .. code-block:: bash |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 101 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 102 | policy.sh [--debug] status|start|stop |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 103 | |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 104 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 105 | Swagger UI Testing (Only for HEAT installations) |
| 106 | ------------------------------------------------ |
Saryu Shah | 3198d6d | 2017-11-07 21:40:27 +0000 | [diff] [blame] | 107 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 108 | - The PDP-X provides the swagger UI from which PDP-X REST APIs can be tested and used, this also lets us know the PDP Status. |
| 109 | - In order to access PDP's swagger UI visit ``https://{PDP_URL}:8081/pdp/swagger-ui.html.`` |
| 110 | - NOTE: This feature is only available for HEAT installation as it is disabled in OOM installations. |
Saryu Shah | 7d861e6 | 2018-04-26 18:04:45 +0000 | [diff] [blame] | 111 | |
Michael Mokry | 9146f55 | 2018-11-07 16:28:44 -0600 | [diff] [blame] | 112 | Logs |
| 113 | ---- |
| 114 | |
| 115 | - The main application logs for PDP are located at */var/log/onap/policy/pdpx/* location. The catalina.out can be found at *$POLICY_HOME/servers/pdp/logs/* location. |
| 116 | |
| 117 | * Policy PDP uses EELF logging framework for logging and if needed to be modified can be modified at *$POLICY_HOME/servers/pap/webapps/pdp/WEB-INF/classes/logback.xml*. This change needs a restart of the PDP component in order to be in effect. |
| 118 | |
| 119 | - The logs are divided into separate files and debug logs can be found in *debug.log* and error logs in *error.log* file which are two different files under application logs directory. |
| 120 | |
| 121 | |
| 122 | BRMSGW (Business Rule Management System Gateway) |
| 123 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 124 | |
| 125 | Accessing and Starting BRMSGW |
| 126 | ----------------------------- |
| 127 | |
| 128 | - To access the BRMSGW docker : |
| 129 | |
| 130 | .. code-block:: bash |
| 131 | |
| 132 | docker exec -it -u 0 brmsgw su - policy |
| 133 | |
| 134 | - To start and stop the BRMSGW components the same procedure can be followed as documented for PAP and PDP-X. |
| 135 | |
| 136 | .. code-block:: bash |
| 137 | |
| 138 | policy.sh [--debug] status|start|stop |
| 139 | |
| 140 | Logs |
| 141 | ---- |
| 142 | |
| 143 | - The main application logs for BRMSGW are located at */var/log/onap/policy/policyapi/* location. The logs are divided into separate files; debug logs can be found in *debug.log* and error logs in *error.log* file which are two different files under application logs directory. |
| 144 | |
| 145 | * The brmsgw.log can be found at */var/log/onap/policy/brmsgw* location. |
Saryu Shah | 83f3ae3 | 2017-11-06 23:18:08 +0000 | [diff] [blame] | 146 | |
| 147 | |
| 148 | End of Document |
| 149 | |
| 150 | .. SSNote: Wiki page ref. https://wiki.onap.org/pages/viewpage.action?pageId=16003633 |
| 151 | |