Support for kafka within xacml tutorial
[policy/xacml-pdp.git] / tutorials / tutorial-xacml-application / src / main / docker / README.md
1 # Running Docker XACML Tutorial
2
3 ## Building XACML Tutorial Docker Image
4
5  1. ```cd /policy-xacml-pdp/tutorials/tutorial-xacml-application```
6  2. ```mvn clean install -Dmaven.test.skip=true -DskipTests -DskipIntegrationTests -DskipUnitTests -Dcheckstyle.skip -P docker```
7
8 ## Running the Tutorial (Automatically)
9 ```./run-tutorial.sh```
10
11 ## Running the Tutorial (Manually)
12 ### Setting Up and Starting from policy/docker components
13
14  1. Clone ```https://git.onap.org/policy/docker/```
15  2. ```cd /docker```
16  3. Run the following to set the containers location, project, branch, and version:
17         - ```export CONTAINER_LOCATION=nexus3.onap.org:10001/```
18         - ```export PROJECT=pap```
19         - ```export GERRIT_BRANCH=master```
20         - ```get-branch.sh```
21         - ```get-versions.sh```
22  4. Run ```docker image ls```
23         - Take note of the REPOSITORY ```onap/policy/xacml-tutorial``` and its ```TAG```
24         - This refers to the image from our `mvn clean install` from above
25  5. Edit ```docker-compose-all.sh```
26         - Replace xacml-pdp image with the format "REPOSITORY:TAG" as noted in Step 4
27                 - ex. image: ```onap/policy-xacml-tutorial:3.1.1-SNAPSHOT```
28
29 ### Running the Containers and Testing
30
31 Run ```./compose/start-compose.sh xacml-pdp```
32
33 ### Triggering policy notification update
34
35 Run python script ```kafka_producer.py``` under docker repository with topic name and message as parameters.
36 i.e. ```python3 /docker/csit/resources/tests/kafka_producer.py POLICY-PDP-PAP "message"```
37 (update "message" to the usual json body)
38
39 ## Verification Example Calls
40
41 Verify that the components are accessible:
42
43  1. ```curl -k -u 'healthcheck:zb!XztG34' 'https://0.0.0.0:6969/policy/pdpx/v1/healthcheck'```
44     - Should return JSON similar to this: ```{"name":"Policy Xacml PDP","url":"self","healthy":true,"code":200,"message":"alive"}```
45
46  2. ```curl -k -u 'healthcheck:zb!XztG34' 'https://0.0.0.0:6767/policy/api/v1/healthcheck'```
47     - Should return JSON similar to this: ```{"name": "Policy API","url": "policy-api","healthy": true,"code": 200,"message": "alive"}```
48
49  3. ```curl -k -u 'healthcheck:zb!XztG34' 'https://0.0.0.0:6868/policy/pap/v1/healthcheck'```
50     - Should return JSON similar to this: ```{"name": "Policy PAP","url": "policy-pap","healthy": true,"code": 200,"message": "alive"}```
51
52 ## POSTMAN Collection
53
54 You can find the collection under ```/policy-xacml-pdp/tutorials/tutorial-xacml-application/postman/```