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