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 | |
lapentafd | 95bb3d9 | 2022-09-26 12:29:39 +0100 | [diff] [blame] | 13 | Starting the ONAP Policy Framework Docker Images |
| 14 | ************************************************ |
| 15 | In order to start the containers, you can use *docker-compose*. This uses the *docker-compose-all.yml* yaml file to bring up the ONAP Policy Framework. This file is located in the policy/docker repository. In the csit folder there are scripts to *automatically* bring up components in Docker, without the need to build all the images locally. |
| 16 | |
| 17 | Clone the read-only version of policy/docker repo from gerrit: |
| 18 | |
| 19 | .. code-block:: bash |
| 20 | |
| 21 | git clone "https://gerrit.onap.org/r/policy/docker" |
| 22 | |
| 23 | |
| 24 | Start the containers automatically |
| 25 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 26 | |
| 27 | .. note:: The start-all.sh script in policy/docker/csit will bring up all the Policy Framework components, and give the local ip for the GUI. The latest images will be downloaded from Nexus. |
| 28 | |
| 29 | .. code-block:: bash |
| 30 | |
| 31 | export CONTAINER_LOCATION=nexus3.onap.org:10001/ |
| 32 | export PROJECT=pap |
| 33 | ./start-all.sh |
| 34 | |
| 35 | |
| 36 | To stop them use ./stop-all.sh |
| 37 | |
| 38 | .. code-block:: bash |
| 39 | |
| 40 | ./stop-all.sh |
| 41 | |
| 42 | |
| 43 | Start the containers manually |
| 44 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ |
| 45 | |
| 46 | **Step 1:** Set the containers location and project. |
| 47 | |
| 48 | For *local* images, set CONTAINER_LOCATION="" (or don't set it at all) |
| 49 | *You will need to build locally all the images using the steps in the next chapter* |
| 50 | |
| 51 | For *remote* images set CONTAINER_LOCATION="nexus3.onap.org:10001/" |
| 52 | |
| 53 | .. code-block:: bash |
| 54 | |
| 55 | export CONTAINER_LOCATION=nexus3.onap.org:10001/ |
| 56 | export PROJECT=pap |
| 57 | |
| 58 | |
| 59 | **Step 2:** Set gerrit branch |
| 60 | |
| 61 | Set GERRIT_BRANCH="master" |
| 62 | |
| 63 | Or use the script get-branch.sh |
| 64 | |
| 65 | .. code-block:: bash |
| 66 | |
| 67 | source ./get-branch.sh |
| 68 | |
| 69 | |
| 70 | **Step 3:** Get all the images versions |
| 71 | |
| 72 | Use the script get-versions.sh |
| 73 | |
| 74 | .. code-block:: bash |
| 75 | |
| 76 | source ./get-versions.sh |
| 77 | |
| 78 | |
| 79 | **Step 4:** Run the system using docker-compose |
| 80 | |
| 81 | .. code-block:: bash |
| 82 | |
| 83 | docker-compose -f docker-compose-all.yml up <image> <image> |
| 84 | |
| 85 | |
| 86 | **You now have a full standalone ONAP Policy framework up and running!** |
| 87 | |
| 88 | |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 89 | Building the ONAP Policy Framework Docker Images |
| 90 | ************************************************ |
lapentafd | 95bb3d9 | 2022-09-26 12:29:39 +0100 | [diff] [blame] | 91 | If you want to use your own local images, you can build them following these instructions: |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 92 | |
| 93 | **Step 1:** Build the Policy API Docker image |
| 94 | |
| 95 | .. code-block:: bash |
| 96 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 97 | cd ~/git/onap/policy/api/packages |
| 98 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 99 | |
| 100 | **Step 2:** Build the Policy PAP Docker image |
| 101 | |
| 102 | .. code-block:: bash |
| 103 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 104 | cd ~/git/onap/policy/pap/packages |
| 105 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 106 | |
| 107 | **Step 3:** Build the Drools PDP docker image. |
| 108 | |
| 109 | This image is a standalone vanilla Drools engine, which does not contain any pre-built drools rules or applications. |
| 110 | |
| 111 | .. code-block:: bash |
| 112 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 113 | cd ~/git/onap/policy/drools-pdp/ |
| 114 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 115 | |
| 116 | **Step 4:** Build the Drools Application Control Loop image. |
| 117 | |
| 118 | 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. |
| 119 | |
| 120 | .. code-block:: bash |
| 121 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 122 | cd ~/git/onap/policy/drools-applications |
| 123 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 124 | |
| 125 | **Step 5:** Build the Apex PDP docker image: |
| 126 | |
| 127 | .. code-block:: bash |
| 128 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 129 | cd ~/git/onap/policy/apex-pdp |
| 130 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 131 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 132 | **Step 6:** Build the XACML PDP docker image: |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 133 | |
| 134 | .. code-block:: bash |
| 135 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 136 | cd ~/git/onap/policy/xacml-pdp/packages |
| 137 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 138 | |
lapentafd | 95bb3d9 | 2022-09-26 12:29:39 +0100 | [diff] [blame] | 139 | **Step 7:** Build the Policy SDC Distribution docker image: |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 140 | |
| 141 | .. code-block:: bash |
| 142 | |
Pamela Dragosh | c68e73d | 2019-06-27 09:37:20 -0400 | [diff] [blame] | 143 | cd ~/git/onap/policy/distribution/packages |
| 144 | mvn clean install -P docker |
Pamela Dragosh | ba5f4d3 | 2019-06-25 13:11:07 -0400 | [diff] [blame] | 145 | |