Pamela Dragosh | 5fc2fdb | 2019-05-17 09:42:27 -0400 | [diff] [blame] | 1 | .. This work is licensed under a |
| 2 | .. Creative Commons Attribution 4.0 International License. |
| 3 | .. http://creativecommons.org/licenses/by/4.0 |
| 4 | |
| 5 | |
| 6 | Policy Docker Installation |
| 7 | -------------------------- |
| 8 | |
| 9 | .. contents:: |
| 10 | :depth: 2 |
| 11 | |
| 12 | |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 13 | Building the ONAP Policy Framework Docker Images |
| 14 | ************************************************ |
| 15 | The instructions here are based on the instructions in the file *~/git/onap/policy/docker/README.md*. |
| 16 | |
| 17 | **Step 1:** Build the Policy API Docker image |
| 18 | |
| 19 | .. code-block:: bash |
| 20 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 21 | cd ~/git/onap/policy/api/packages |
| 22 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 23 | |
| 24 | **Step 2:** Build the Policy PAP Docker image |
| 25 | |
| 26 | .. code-block:: bash |
| 27 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 28 | cd ~/git/onap/policy/pap/packages |
| 29 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 30 | |
| 31 | **Step 3:** Build the Drools PDP docker image. |
| 32 | |
| 33 | This image is a standalone vanilla Drools engine, which does not contain any pre-built drools rules or applications. |
| 34 | |
| 35 | .. code-block:: bash |
| 36 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 37 | cd ~/git/onap/policy/drools-pdp/ |
| 38 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 39 | |
| 40 | **Step 4:** Build the Drools Application Control Loop image. |
| 41 | |
| 42 | This image has the drools use case application and the supporting software built together with the Drools PDP engine. It is recommended to use this image if you are first working with ONAP Policy and wish to test or learn how the use cases work. |
| 43 | |
| 44 | .. code-block:: bash |
| 45 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 46 | cd ~/git/onap/policy/drools-applications |
| 47 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 48 | |
| 49 | **Step 5:** Build the Apex PDP docker image: |
| 50 | |
| 51 | .. code-block:: bash |
| 52 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 53 | cd ~/git/onap/policy/apex-pdp |
| 54 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 55 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 56 | **Step 6:** Build the XACML PDP docker image: |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 57 | |
| 58 | .. code-block:: bash |
| 59 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 60 | cd ~/git/onap/policy/xacml-pdp/packages |
| 61 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 62 | |
| 63 | **Step 7:** Build the policy engine docker image (If working with the legacy Policy Architecture/API): |
| 64 | |
| 65 | .. code-block:: bash |
| 66 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 67 | cd ~/git/onap/policy/engine/ |
| 68 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 69 | |
| 70 | **Step 8:** Build the Policy SDC Distribution docker image: |
| 71 | |
| 72 | .. code-block:: bash |
| 73 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 74 | cd ~/git/onap/policy/distribution/packages |
| 75 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 76 | |
| 77 | |
| 78 | Starting the ONAP Policy Framework Docker Images |
| 79 | ************************************************ |
| 80 | |
| 81 | In order to run the containers, you can use *docker-compose*. This uses the *docker-compose.yml* yaml file to bring up the ONAP Policy Framework. This file is located in the policy/docker repository. |
| 82 | |
| 83 | **Step 1:** Set the environment variable *MTU* to be a suitable MTU size for the application. |
| 84 | |
| 85 | .. code-block:: bash |
| 86 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 87 | export MTU=9126 |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 88 | |
| 89 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 90 | **Step 2:** Determine if you want the legacy Policy Engine to have policies pre-loaded or not. By default, all the configuration and operational policies will be pre-loaded by the docker compose script. If you do not wish for that to happen, then export this variable: |
| 91 | |
| 92 | .. note:: This applies ONLY to the legacy Engine and not the Policy Lifecycle polices |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 93 | |
| 94 | .. code-block:: bash |
| 95 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 96 | export PRELOAD_POLICIES=false |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 97 | |
| 98 | |
| 99 | **Step 3:** Run the system using *docker-compose*. Note that on some systems you may have to run the *docker-compose* command as root or using *sudo*. Note that this command takes a number of minutes to execute on a laptop or desktop computer. |
| 100 | |
| 101 | .. code-block:: bash |
| 102 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 103 | docker-compose up -d |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 104 | |
| 105 | |
| 106 | **You now have a full standalone ONAP Policy framework up and running!** |
| 107 | |