1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
4 Installation of Beijing Controller and Policies
5 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
10 This article explains how to install the Beijing policy controller and the Beijing policies on a raw ONAP Policy Framework installation running in Docker.
12 To build a raw Policy Framework installation, please follow either of the HowTo articles below prior to using this HowTo:
14 * `Standalone Quick Start <installation.html>`_
15 * `Standalone installation in Virtual Machine <installationVM.html>`_
17 You should have the ONAP Policy Framework running in Docker and started the Policy Framework with *docker-compose*.
20 Test that the ONAP Policy Framework is up and is empty
21 ------------------------------------------------------
23 **Step 1:** Run the command below.
27 curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/beijing | python -m json.tool
29 You should get a response similar to the following:
34 "error": "beijing not found"
37 Install the Beijing policy controller
38 ---------------------------------------
40 **Step 1:** Log onto the Drools PDP.
44 docker exec -it drools bash
46 You now have a shell open in the Drools PDP container running in docker
49 **Step 2:** Create a temporary directory for controller installation
53 mkdir /tmp/apps-controlloop
54 cd /tmp/apps-controlloop
56 **Step 3:** Download the latest controller from Nexus (1.2.0 at the time of writing)
60 wget https://nexus.onap.org/content/repositories/releases/org/onap/policy/drools-applications/controlloop/packages/apps-controlloop/1.2.0/apps-controlloop-1.2.0.zip
62 Alternatively, you can build the drools-applications component of the Policy Framework from source and install it from the following location on your build host
66 ~/.m2/repository/org/onap/policy/drools-applications/controlloop/packages/apps-controlloop/1.2.0/apps-controlloop-1.2.0.zip
69 **Step 4:** Unzip the controller
73 unzip apps-controlloop-1.2.0.zip
75 **Step 5:** Update the installation script to install the Beijing controller
79 vi apps-controlloop-installer
82 # "features enable controlloop-amsterdam"
84 # "features enable controlloop-beijing"
87 **Step 6:** Stop the policy engine
93 **Step 7:** Install the controller by running the controller installation script
97 ./apps-controlloop-installer
99 **Step 8:** Install the *controlloop-utils* Drools PDP feature to allow standalone execution of control loop policies
103 features install controlloop-utils
104 features enable controlloop-utils
106 **Step 9:** Start the policy engine
112 Monitor the CPU for a few minutes with the top command until it settles down after the policy start.
114 **Step 10:** Check if the Beijing controller is loaded
117 curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/beijing | python -m json.tool
119 You should get a response similar to the following:
122 :caption: Beijing Controller JSON Response
128 "artifactId": "controller-beijing",
130 "groupId": "org.onap.policy.drools-applications.controlloop.common",
132 "modelClassLoaderHash": 1562533966,
133 "recentSinkEvents": [],
134 "recentSourceEvents": [],
135 "sessionCoordinates": [
136 "org.onap.policy.drools-applications.controlloop.common:controller-beijing:1.2.0:beijing"
148 "allowSelfSignedCerts": false,
152 "partitionKey": "86d1234b-e431-4191-b7c6-56d2d2909a97",
155 "vm1.mr.simpledemo.openecomp.org"
158 "topicCommInfrastructure": "UEB",
163 "allowSelfSignedCerts": false,
167 "partitionKey": "dea0f440-0232-4f63-b79e-6d51f3674d35",
170 "vm1.mr.simpledemo.openecomp.org"
172 "topic": "APPC-LCM-READ",
173 "topicCommInfrastructure": "UEB",
178 "allowSelfSignedCerts": false,
182 "partitionKey": "2918d779-870d-429b-b469-78677d027deb",
185 "vm1.mr.simpledemo.openecomp.org"
187 "topic": "POLICY-CL-MGT",
188 "topicCommInfrastructure": "UEB",
195 "allowSelfSignedCerts": false,
198 "consumerGroup": "31740f8e-f878-4347-849e-3b3352c28dff",
199 "consumerInstance": "drools",
201 "fetchTimeout": 15000,
205 "vm1.mr.simpledemo.openecomp.org"
207 "topic": "PDPD-CONFIGURATION",
208 "topicCommInfrastructure": "UEB",
213 "allowSelfSignedCerts": false,
216 "consumerGroup": "429aa858-633e-43dc-8619-7004e133d650",
217 "consumerInstance": "drools",
219 "fetchTimeout": 15000,
223 "vm1.mr.simpledemo.openecomp.org"
225 "topic": "unauthenticated.DCAE_CL_OUTPUT",
226 "topicCommInfrastructure": "UEB",
231 "allowSelfSignedCerts": false,
234 "consumerGroup": "1bf6854d-a0f1-4d03-baaf-084e6f365a86",
235 "consumerInstance": "drools",
237 "fetchTimeout": 15000,
241 "vm1.mr.simpledemo.openecomp.org"
244 "topicCommInfrastructure": "UEB",
249 "allowSelfSignedCerts": false,
252 "consumerGroup": "3f0d7fdf-956d-4749-be54-1adb32ccfa4f",
253 "consumerInstance": "drools",
255 "fetchTimeout": 15000,
259 "vm1.mr.simpledemo.openecomp.org"
261 "topic": "APPC-LCM-WRITE",
262 "topicCommInfrastructure": "UEB",
270 Install the Beijing vCPE Policy
271 ---------------------------------
273 We now install the Beijing policies for the vCPE, vFirewall, vDNS & VOLTE use cases.
275 **Step 1:** Log onto (or remain logged onto) the Drools PDP.
279 docker exec -it drools bash
281 You now have a shell open in the Drools PDP container running in docker
283 **Step 2:** Check that the Beijing policies are not loaded by querying for Drools facts
287 curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/beijing/drools/facts/beijing | python -m json.tool
289 Expect the response {} indicating no policies are loaded.
291 **Step 3:** Create a temporary directory for policy installation
295 mkdir /tmp/basex-controlloop
296 cd /tmp/basex-controlloop
298 **Step 4:** Extract the policies from the control loop zip file previously downloaded from Nexus and expanded in steps 3 and 4 above.
302 tar zxvf /tmp/apps-controlloop/basex-controlloop-1.2.0.tar.gz
304 **Step 5:** Install the Beijing policy rules, the script asks for a number of input parameters, accept the default for all parameters
308 bin/create-cl-beijing
310 # - Type Y when asked for confirmation of parameters
311 # - Accept /tmp as the install directory
312 # - Type Y to agree to creation of a Maven Artifact
315 **Step 6:** Maven artifact creation now proceeds. After some minutes, confirmation is requested for deployment of rules into Maven.
318 # - Type Y to deploy the rules.
320 The rules are deployed into Maven. Expect the rule deployment process to take a number of minutes, perhaps 10 minutes.
323 **Step 7:** Copy the Beijing properties file into the Drools PDP configuration directory. This file configures the Drools PDP with the Beijing policies
327 cp /tmp/beijing/beijing-controller.properties /opt/app/policy/config
329 **Step 8:** Stop and start the Drools PDP
336 Again, monitor the processes with top and wait for the PDP to fully start.
338 **Step 9:** Push the Beijing policy facts to the Drools PDP
342 bin/push-policies-beijing
344 # When the script prompts for the path to the properties file, enter the following:
345 # /opt/app/policy/config/beijing-controller.properties
348 **Step 10:** Now verify that the Beijing policies are loaded, there should be four facts (one per use case) in the Drools PDP
352 curl --silent --user @1b3rt:31nst31n -X GET http://localhost:9696/policy/pdp/engine/controllers/beijing/drools/facts/beijing | python -m json.tool
359 "org.onap.policy.controlloop.params.ControlLoopParams": 4
363 Execute the vCPE Use Case Manually
364 ----------------------------------
366 You can now run the vCPE Policy use case manually using the HowTos below:
367 * `Tutorial: Testing the vCPE use case in a standalone PDP-D <tutorial_vCPE.html>`_
368 * `Tutorial: Testing the vDNS Use Case in a standalone PDP-D <tutorial_vDNS.html>`_
369 * `Tutorial: Testing the vFW flow in a standalone PDP-D <tutorial_vFW.html>`_
370 * `Tutorial: Testing the VOLTE Use Case in a standalone PDP-D <tutorial_VOLTE.html>`_
374 1. You should check that the topic names you use match those in the Beijing configuration file */opt/app/policy/config/beijing-controller.properties*.
375 2. You should ensure that you change to the directory */tmp/beijing* prior to running those HowTos
379 .. Installation of Beijing Controller and Policies : https://wiki.onap.org/display/DW/ONAP+Policy+Framework%3A+Installation+of+Beijing+Controller+and+Policies