2 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
3 .. http://creativecommons.org/licenses/by/4.0
5 ***********************************************************************************************
6 Using the Control Loop PDP-D docker image for standalone testing
7 ***********************************************************************************************
12 In this tutorial will start a Control Loop PDP-D container to use to test Operational Policies
13 without companion components.
15 **Step 1:** Copy a template *base.conf* with configuration to instantiate the container.
21 wget https://git.onap.org/policy/docker/plain/config/drools/base.conf?h=dublin -O base.conf
24 **Step 2:** Simplify *base.conf* for a standalone configuration (by disabling db and nexus access):
29 sed -i "s/^SQL_HOST=.*$/SQL_HOST=/g" base.conf
30 sed -i "s/^SNAPSHOT_REPOSITORY_ID=.*$/SNAPSHOT_REPOSITORY_ID=/g" base.conf
31 sed -i "s/^SNAPSHOT_REPOSITORY_URL=.*$/SNAPSHOT_REPOSITORY_URL=/g" base.conf
32 sed -i "s/^RELEASE_REPOSITORY_ID=.*$/RELEASE_REPOSITORY_ID=/g" base.conf
33 sed -i "s/^RELEASE_REPOSITORY_URL=.*$/RELEASE_REPOSITORY_URL=/g" base.conf
35 **Step 3:** Open a *bash* shell into the PDP-D Control Loop container.
39 docker run --rm --env-file config/base.conf --env-file feature-healthcheck.conf -p 9696:9696 -p 6969:6969 -it --name pdpd -h pdpd nexus3.onap.org:10001/onap/policy-pdpd-cl:1.4.1 bash
41 **Step 4:** Disable the distributed-locking feature, since this is a single CL PDP-D instance.
45 features disable distributed-locking
47 **Step 5:** If using simulators (see tutorials), enable the *controlloop-utils* feature.
51 features enable controlloop-utils
53 **Step 6:** To reduce error logs due to being unable to communicate with DMaaP, change the official configuration to use *noop* topics instead (no network IO involved).
57 cd $POLICY_HOME/config
58 sed -i "s/^dmaap/noop/g" *.properties
60 **Step 7:** Disable PDP-X guard functionality.
64 cd $POLICY_HOME/config
65 sed -i "s/^guard.disabled=*$/guard.disabled=true/g" $POLICY_HOME/config/controlloop.properties.environment
66 sed -i "s/^aai.customQuery=*$/aai.customQuery=false/g" $POLICY_HOME/config/controlloop.properties.environment
68 **Step 5:** Start the CL PDP-D.
74 **Step 6:** Place the CL PDP-D in *ACTIVE* mode.
78 cat pdp-state-change.json
81 "messageName": "PDP_STATE_CHANGE",
82 "requestId": "385146af-adeb-4157-b97d-6ae85c1ddcb3",
83 "timestampMs": 1555791893587,
85 "pdpGroup": "controlloop",
86 "pdpSubgroup": "drools"
89 http --verify=no -a "${TELEMETRY_USER}:${TELEMETRY_PASSWORD}" PUT https://localhost:9696/policy/pdp/engine/topics/sources/noop/POLICY-PDP-PAP/events @pdp-state-change.json Content-Type:'text/plain'
92 > get lifecycle/fsm/state # verify that state is ACTIVE
94 Note that *name* in *pdp-state-change.json* can be obtained from running *hostname* in the container.
96 Proceed with testing your new policy as described in the specific tutorials:
98 • vCPE - `Tutorial: Testing the vCPE use case in a standalone PDP-D <tutorial_vCPE.html>`_
99 • vDNS - `Tutorial: Testing the vDNS Use Case in a standalone PDP-D <tutorial_vDNS.html>`_
100 • vFW - `Tutorial: Testing the vFW flow in a standalone PDP-D <tutorial_vFW.html>`_
102 .. seealso:: To deploy a control loop in Eclipse from the control loop archetype template, refer to `Modifying the Release Template <modAmsterTemplate.html>`_.