1 .. This work is licensed under a
2 .. Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
8 --------------------------
14 Starting the ONAP Policy Framework Docker Containers
15 ****************************************************
16 In order to start the containers, you can use *docker-compose*. This uses the *docker-compose.yml* yaml file to
17 bring up the ONAP Policy Framework. This file is located in the policy/docker repository. In the csit folder there
18 are scripts to *automatically* bring up components in Docker, without the need to build all the images locally.
20 Clone the read-only version of policy/docker repo from gerrit:
24 git clone "https://gerrit.onap.org/r/policy/docker"
27 The docker compose structure
28 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
30 After cloning the docker repository, the scripts and compose files are under the *compose/* folder.
36 config -- all the components configurations
37 metrics -- configuration for Prometheus server and Grafana dashboards
38 docker-compose.gui.yml -- compose file with gui services
39 docker-compose.yml -- compose file with policy components services, including simulator, prometheus and grafana
40 export-ports.sh -- script to export the http ports for all components and where the images are collected from
41 get-versions.sh -- script to get the latest SNAPSHOT version of images based on branch (master is default)
42 start-compose.sh -- script to start the containers / applications
43 stop-compose.sh -- script to stop the containers / applications
44 wait_for_port.sh -- helper script to allow some wait time before an application is completely up and running
47 Start the containers automatically
48 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
49 Assuming all the scripts are being executed from the compose folder.
51 To start all components without Policy GUI:
57 To start all components with Policy GUI:
61 ./start-compose.sh --gui
63 To start all components with Grafana dashboards and Prometheus server:
67 ./start-compose.sh --grafana
69 **You now have a full standalone ONAP Policy framework up and running!**
71 To stop all containers, use stop-compose.sh
78 .. _building-pf-docker-images-label:
80 Building the ONAP Policy Framework Docker Images
81 ************************************************
82 If you want to use your own local images, you can build them following these instructions:
84 **Step 1:** Build the Policy API Docker image
88 cd ~/git/onap/policy/api/packages
89 mvn clean install -P docker
91 **Step 2:** Build the Policy PAP Docker image
95 cd ~/git/onap/policy/pap/packages
96 mvn clean install -P docker
98 **Step 3:** Build the Drools PDP docker image.
100 This image is a standalone vanilla Drools engine, which does not contain any pre-built drools rules or applications.
104 cd ~/git/onap/policy/drools-pdp/
105 mvn clean install -P docker
107 **Step 4:** Build the Drools Application Control Loop image.
109 This image has the drools use case application and the supporting software built together with the Drools PDP engine.
110 It is recommended to use this image if you are first working with ONAP Policy and wish to test or learn how the use
115 cd ~/git/onap/policy/drools-applications
116 mvn clean install -P docker
118 **Step 5:** Build the Apex PDP docker image:
122 cd ~/git/onap/policy/apex-pdp
123 mvn clean install -P docker
125 **Step 6:** Build the XACML PDP docker image:
129 cd ~/git/onap/policy/xacml-pdp/packages
130 mvn clean install -P docker
132 **Step 7:** Build the Policy SDC Distribution docker image:
136 cd ~/git/onap/policy/distribution/packages
137 mvn clean install -P docker
139 **Step 8:** Build the Policy Message Router Simulator
143 cd ~/git/onap/policy/models/models-sim/packages
144 mvn clean install -P docker
146 Start the containers manually
147 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
149 **Step 1:** Set the containers location and project.
151 For *local* images, set CONTAINER_LOCATION="", located at the `export-ports.sh` script
152 *You will need to build locally all the images using the steps in the previous section*
154 For *remote* images set CONTAINER_LOCATION="nexus3.onap.org:10001/"
157 **Step 2:** Set gerrit branch
159 By default, the `start-compose.sh` script will use the `get-versions.sh` to bring up latest SNAPSHOT version.
160 To use a different branch, edit the variable GERRIT_BRANCH located at the start of `get-versions.sh` to the
164 **Step 3:** Get all the images versions
166 Use the script get-versions.sh
170 source ./get-versions.sh
173 **Step 4:** Run the system using the `start-compose.sh` script
177 ./start-compose.sh <component> [--grafana] [--gui]
179 The <component> input is any of the policy components available:
186 - drools-applications
191 Debugging docker containers
192 ^^^^^^^^^^^^^^^^^^^^^^^^^^^
194 To debug code against docker compose, the java parameters for jmxremote needs to be added to the start script
198 For Policy PAP, edit the `policy-pap.sh` script:
202 vi ~git/onap/policy/pap/packages/policy-pap-docker/src/main/docker/policy-pap.sh
205 Before the `-jar /app/pap.jar \ ` line, add the following block:
210 -Dcom.sun.management.jmxremote.rmi.port=5005 \
211 -Dcom.sun.management.jmxremote=true \
212 -Dcom.sun.management.jmxremote.port=5005 \
213 -Dcom.sun.management.jmxremote.ssl=false \
214 -Dcom.sun.management.jmxremote.authenticate=false \
215 -Dcom.sun.management.jmxremote.local.only=false \
217 On `docker-compose.yml` compose file, add to the port section the mapping 5005.
222 image: ${CONTAINER_LOCATION}onap/policy-pap:${POLICY_PAP_VERSION}
223 container_name: policy-pap
233 That should allow an IDE to connect remotely to the 5005 port.
234 Follow the instructions of the IDE being used to add a remote connection.
236 For Intellij, under Run/Debug Configurations, add a new Remote JVM Debug, point Use module classpath to the
237 <component>-main sub-project.