1 .. This work is licensed under a Creative Commons Attribution 4.0 International License.
2 .. http://creativecommons.org/licenses/by/4.0
4 **********************************************************
6 **********************************************************
11 There are two methods you can use to run a PDP-D for testing purposes:
19 **Step 1:** Clone the integration/csit repository.
21 You can find the repo here: https://gerrit.onap.org/r/admin/repos/integration/csit.
22 Although this repository is used for CSIT testing, we can use this as a means to get a PDP-D up and running with docker.
26 git clone "https://gerrit.onap.org/r/integration/csit"
28 **Step 2:** Note the "docker-compose" commands that will be used.
32 docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml up -d
34 docker-compose -f ${WORKSPACE}/scripts/policy/docker-compose-drools-apps.yml down -v
36 Note that ${WORKSPACE} refers to the local path where the csit repository is.
38 **Step 3:** Edit the "docker-compose-drools-apps.yml" file.
40 Take a look at the "csit/scripts/policy/docker-compose-drools-apps.yml" file. It should look similar to this:
42 .. image:: img/docker/yamlClone.png
44 The following changes need to be made based on which version you are running and your local setup.
48 ${POLICY_MARIADB_VER} should be "10.2.14" (without quotes, version subject to change)
50 ${WORKSPACE} should be the absolute path to the cloned "csit" repository.
52 ${POLICY_DROOLS_APPS_VERSION} should be "1.6.0" (without quotes, version subject to change).
54 If you are using MacOS, you will also need to make the following changes:
62 will need to be changed to:
68 **Step 4:** Start containers and interact with PDP-D.
72 docker-compose -f scripts/policy/docker-compose-drools-apps.yml up -d
74 docker exec -it drools bash
76 .. image:: img/docker/dockerComposeUp.png
82 .. image:: img/docker/policyStatus.png
86 # launches subshell where telemetry commands can be executed
93 # Get the current controllers
96 .. image:: img/docker/telemetryCmd.png
100 # Get information about the "frankfurt" controller
103 .. image:: img/docker/getFrankfurt.png
108 docker-compose -f scripts/policy/docker-compose-drools-apps.yml down -v
110 .. image:: img/docker/dockerComposeDown.png
112 In the next section, you will see more about using telemetry commands and interacting with the PDP-D.
117 **Step 1:** Clone 'drools-pdp' repository and create a new directory for eclipse workspace.
119 Link to repository: https://gerrit.onap.org/r/admin/repos/policy/drools-pdp
120 For the purposes of this demo, we will create an new directory to use as a workspace for eclipse.
124 $ git clone "https://gerrit.onap.org/r/policy/drools-pdp"
125 Cloning into 'drools-pdp'...
126 remote: Counting objects: 59, done
127 remote: Finding sources: 100% (30/30)
128 remote: Total 14406 (delta 0), reused 14399 (delta 0)
129 Receiving objects: 100% (14406/14406), 3.23 MiB | 628.00 KiB/s, done.
130 Resolving deltas: 100% (6630/6630), done.
131 Checking out files: 100% (588/588), done.
133 $ mkdir workspace-drools-pdp
136 drools-pdp/ workspace-drools-pdp/
138 The "drools-pdp/" directory contains the cloned repository and "workspace-drools-pdp/" is an empty directory.
140 **Step 2:** Import "drools-pdp" as an existing maven project.
142 Open Eclipse. Hit the **browse** button and navigate to the "workspace-drools-pdp/" directory. Select that folder as the workspace directory and hit **launch**.
144 .. image:: img/eclipse/selectDirectory.png
146 Select File -> Import -> Maven -> Existing Maven Projects -> Next
148 .. image:: img/eclipse/importMavenProject.png
150 Select **Browse** and navigate to the root directory of the cloned project. Hit **Select All** to make sure all projects are included and select **Finish**.
152 .. image:: img/eclipse/selectProjectsToImport.png
154 **Step 3:** Run "policy-management" as a java application
156 All of the projects will appear in the package explorer after they finish importing. Right click on "policy-management", select "Run As", and select "Java Application".
158 .. image:: img/eclipse/runAsJavaApp.png
160 Type "main" and select the option "Main - org.onap.policy.drools.system" then hit **OK**.
162 .. image:: img/eclipse/mainAppSelection.png
164 If everything is successful, the PDP-D will start running and you will notice output displayed in the console. In the next section, you will see how to interact with the PDP-D using telemetry commands.