blob: 7f038934186b9f08b442a60bd9494605a33691fb [file] [log] [blame]
Pamela Dragosh5fc2fdb2019-05-17 09:42:27 -04001.. This work is licensed under a
2.. Creative Commons Attribution 4.0 International License.
3.. http://creativecommons.org/licenses/by/4.0
4
5
6Policy Docker Installation
7--------------------------
8
9.. contents::
10 :depth: 2
11
12
lapentafd95bb3d92022-09-26 12:29:39 +010013Starting the ONAP Policy Framework Docker Images
14************************************************
15In 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
17Clone 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
24Start 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
36To stop them use ./stop-all.sh
37
38.. code-block:: bash
39
40 ./stop-all.sh
41
42
43Start the containers manually
44^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
45
46**Step 1:** Set the containers location and project.
47
48For *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
51For *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
61Set GERRIT_BRANCH="master"
62
63Or 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
72Use 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 Dragoshba5f4d32019-06-25 13:11:07 -040089Building the ONAP Policy Framework Docker Images
90************************************************
lapentafd95bb3d92022-09-26 12:29:39 +010091If you want to use your own local images, you can build them following these instructions:
Pamela Dragoshba5f4d32019-06-25 13:11:07 -040092
93**Step 1:** Build the Policy API Docker image
94
95.. code-block:: bash
96
Pamela Dragoshc68e73d2019-06-27 09:37:20 -040097 cd ~/git/onap/policy/api/packages
98 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -040099
100**Step 2:** Build the Policy PAP Docker image
101
102.. code-block:: bash
103
Pamela Dragoshc68e73d2019-06-27 09:37:20 -0400104 cd ~/git/onap/policy/pap/packages
105 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400106
107**Step 3:** Build the Drools PDP docker image.
108
109This 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 Dragoshc68e73d2019-06-27 09:37:20 -0400113 cd ~/git/onap/policy/drools-pdp/
114 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400115
116**Step 4:** Build the Drools Application Control Loop image.
117
118This 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 Dragoshc68e73d2019-06-27 09:37:20 -0400122 cd ~/git/onap/policy/drools-applications
123 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400124
125**Step 5:** Build the Apex PDP docker image:
126
127.. code-block:: bash
128
Pamela Dragoshc68e73d2019-06-27 09:37:20 -0400129 cd ~/git/onap/policy/apex-pdp
130 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400131
Pamela Dragoshc68e73d2019-06-27 09:37:20 -0400132**Step 6:** Build the XACML PDP docker image:
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400133
134.. code-block:: bash
135
Pamela Dragoshc68e73d2019-06-27 09:37:20 -0400136 cd ~/git/onap/policy/xacml-pdp/packages
137 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400138
lapentafd95bb3d92022-09-26 12:29:39 +0100139**Step 7:** Build the Policy SDC Distribution docker image:
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400140
141.. code-block:: bash
142
Pamela Dragoshc68e73d2019-06-27 09:37:20 -0400143 cd ~/git/onap/policy/distribution/packages
144 mvn clean install -P docker
Pamela Dragoshba5f4d32019-06-25 13:11:07 -0400145