aboutsummaryrefslogtreecommitdiffstats
path: root/docs/installation/docker.rst
blob: 78e7f903700fc9c9cd30667b80764d243c21575b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
.. This work is licensed under a
.. Creative Commons Attribution 4.0 International License.
.. http://creativecommons.org/licenses/by/4.0

.. _docker-label:

Policy Docker Installation
--------------------------

.. contents::
    :depth: 2


Starting the ONAP Policy Framework Docker Images
************************************************
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.

Clone the read-only version of policy/docker repo from gerrit:

.. code-block:: bash

  git clone "https://gerrit.onap.org/r/policy/docker"


Start the containers automatically
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. 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.

.. code-block:: bash

  export CONTAINER_LOCATION=nexus3.onap.org:10001/
  export PROJECT=pap
  ./start-all.sh


To stop them use ./stop-all.sh

.. code-block:: bash

  ./stop-all.sh


Start the containers manually
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

**Step 1:** Set the containers location and project.

For *local* images, set CONTAINER_LOCATION="" (or don't set it at all)
*You will need to build locally all the images using the steps in the next chapter*

For *remote* images set CONTAINER_LOCATION="nexus3.onap.org:10001/"

.. code-block:: bash

  export CONTAINER_LOCATION=nexus3.onap.org:10001/
  export PROJECT=pap


**Step 2:** Set gerrit branch

Set GERRIT_BRANCH="master"

Or use the script get-branch.sh

.. code-block:: bash

  source ./get-branch.sh


**Step 3:** Get all the images versions

Use the script get-versions.sh

.. code-block:: bash

  source ./get-versions.sh


**Step 4:** Run the system using docker-compose

.. code-block:: bash

  docker-compose -f docker-compose-all.yml up <image> <image>


**You now have a full standalone ONAP Policy framework up and running!**


Building the ONAP Policy Framework Docker Images
************************************************
If you want to use your own local images, you can build them following these instructions:

**Step 1:** Build the Policy API Docker image

.. code-block:: bash

  cd ~/git/onap/policy/api/packages
  mvn clean install -P docker

**Step 2:** Build the Policy PAP Docker image

.. code-block:: bash

  cd ~/git/onap/policy/pap/packages
  mvn clean install -P docker

**Step 3:** Build the Drools PDP docker image.

This image is a standalone vanilla Drools engine, which does not contain any pre-built drools rules or applications.

.. code-block:: bash

  cd ~/git/onap/policy/drools-pdp/
  mvn clean install -P docker

**Step 4:** Build the Drools Application Control Loop image.

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.

.. code-block:: bash

  cd ~/git/onap/policy/drools-applications
  mvn clean install -P docker

**Step 5:** Build the Apex PDP docker image:

.. code-block:: bash

  cd ~/git/onap/policy/apex-pdp
  mvn clean install -P docker

**Step 6:** Build the XACML PDP docker image:

.. code-block:: bash

  cd ~/git/onap/policy/xacml-pdp/packages
  mvn clean install -P docker

**Step 7:** Build the Policy SDC Distribution docker image:

.. code-block:: bash

  cd ~/git/onap/policy/distribution/packages
  mvn clean install -P docker