7f038934186b9f08b442a60bd9494605a33691fb
[policy/parent.git] / docs / installation / docker.rst
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
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
89 Building the ONAP Policy Framework Docker Images
90 ************************************************
91 If you want to use your own local images, you can build them following these instructions:
92
93 **Step 1:** Build the Policy API Docker image
94
95 .. code-block:: bash
96
97   cd ~/git/onap/policy/api/packages
98   mvn clean install -P docker
99
100 **Step 2:** Build the Policy PAP Docker image
101
102 .. code-block:: bash
103
104   cd ~/git/onap/policy/pap/packages
105   mvn clean install -P docker
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
113   cd ~/git/onap/policy/drools-pdp/
114   mvn clean install -P docker
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
122   cd ~/git/onap/policy/drools-applications
123   mvn clean install -P docker
124
125 **Step 5:** Build the Apex PDP docker image:
126
127 .. code-block:: bash
128
129   cd ~/git/onap/policy/apex-pdp
130   mvn clean install -P docker
131
132 **Step 6:** Build the XACML PDP docker image:
133
134 .. code-block:: bash
135
136   cd ~/git/onap/policy/xacml-pdp/packages
137   mvn clean install -P docker
138
139 **Step 7:** Build the Policy SDC Distribution docker image:
140
141 .. code-block:: bash
142
143   cd ~/git/onap/policy/distribution/packages
144   mvn clean install -P docker
145