Update doc CLAMP Automation Composition Smoke Tests
[policy/parent.git] / docs / development / devtools / smoke / clamp-smoke.rst
similarity index 64%
rename from docs/development/devtools/clamp-smoke.rst
rename to docs/development/devtools/smoke/clamp-smoke.rst
index 3a1efa9..19f4a21 100644 (file)
@@ -49,8 +49,7 @@ ONAP Policy Framework has dependencies to the ONAP Parent *oparent* module, the
     policy/parent \
     policy/common \
     policy/models \
-    policy/clamp \
-    policy/docker "
+    policy/clamp "
 
     ##
     ## Help screen and exit condition (i.e. too few arguments)
@@ -139,7 +138,6 @@ Execution of the script above results in the following directory hierarchy in yo
     *  ~/git/onap/policy/common
     *  ~/git/onap/policy/models
     *  ~/git/onap/policy/clamp
-    *  ~/git/onap/policy/docker
 
 
 Building CLAMP automation composition and all dependency
@@ -165,7 +163,7 @@ Building CLAMP automation composition and all dependency
         <version>1.0.0-SNAPSHOT</version>
         <packaging>pom</packaging>
         <name>${project.artifactId}</name>
-        <inceptionYear>2017</inceptionYear>
+        <inceptionYear>2023</inceptionYear>
         <organization>
             <name>ONAP</name>
         </organization>
@@ -186,7 +184,7 @@ Build java artifacts only:
     .. code-block:: bash
 
        cd ~/git/onap/policy
-       mvn -pl '!org.onap.policy.clamp:policy-clamp-runtime' install
+       mvn clean install
 
 Build with docker images:
 
@@ -195,6 +193,9 @@ Build with docker images:
        cd ~/git/onap/policy/clamp/packages/
        mvn clean install -P docker
 
+       cd ~/git/onap/policy/models/models-sim/packages
+       mvn clean install -P docker
+
 Running MariaDb and DMaaP Simulator
 ***********************************
 
@@ -221,8 +222,9 @@ Execution of the command above results in the creation and start of the *mariadb
        docker run --name mariadb-smoke-test  \
         -p 3306:3306 \
         -e MYSQL_ROOT_PASSWORD=my-secret-pw  \
-        --mount type=bind,source=~/git/mariadb.sql,target=/docker-entrypoint-initdb.d/data.sql \
-        mariadb:10.5.8
+        --mount type=bind,source=$HOME/git/mariadb.sql,target=/docker-entrypoint-initdb.d/data.sql \
+        -d mariadb:10.10.2 \
+        --lower-case-table-names=1
 
 
 Running the DMaaP Simulator during Development
@@ -230,7 +232,7 @@ Running the DMaaP Simulator during Development
 The second requirement for the Clamp automation composition component to run is to run the DMaaP simulator. You can run it from the command line using Maven.
 
 
-Change the local configuration file *src/test/resources/simParameters.json* using the below code:
+Create a new configuration file *~/git/onap/policy/models/models-sim/policy-models-simulators/src/test/resources/newParameters.json* using the below code:
 
 .. code-block:: json
 
@@ -255,7 +257,7 @@ Run the following commands:
    .. code-block:: bash
 
       cd ~/git/onap/policy/models/models-sim/policy-models-simulators
-      mvn exec:java  -Dexec.mainClass=org.onap.policy.models.simulators.Main -Dexec.args="src/test/resources/simParameters.json"
+      mvn exec:java  -Dexec.mainClass=org.onap.policy.models.simulators.Main -Dexec.args="src/test/resources/newParameters.json"
 
 
 Developing and Debugging CLAMP automation composition
@@ -278,7 +280,7 @@ Running on the Command Line
    .. code-block:: bash
 
       cd ~/git/onap/policy/clamp/runtime-acm
-      java -jar target/policy-clamp-runtime-acm-6.2.2-SNAPSHOT.jar
+      java -jar target/policy-clamp-runtime-acm-6.4.2-SNAPSHOT.jar
 
 
 Running in Eclipse
@@ -286,129 +288,75 @@ Running in Eclipse
 
 1. Check out the policy models repository
 2. Go to the *policy-clamp-runtime-acm* module in the clamp repo
-3. Specify a run configuration using the class *org.onap.policy.clamp.acm.runtime.Application* as the main class
-4. Run the configuration
-
-Swagger UI of Automation composition is available at *http://localhost:6969/onap/policy/clamp/acm/swagger-ui/*, and swagger JSON at *http://localhost:6969/onap/policy/clamp/acm/v2/api-docs/*
-
-
-Running one or more participant simulators
-++++++++++++++++++++++++++++++++++++++++++
+3. Where necessary Add as Source Folder 'target/generated-sources/swagger'
+4. Specify a run configuration using the class *org.onap.policy.clamp.acm.runtime.Application* as the main class
+5. Run the configuration
 
-Into *docker\csit\clamp\tests\data* you can find a test case with policy-participant. In order to use that test you can use particpant-simulator.
-Copy the file *src/main/resources/config/application.yaml* and paste into *src/test/resources/*, after that change *participantId* and *participantType* as showed below:
+Swagger UI of Automation composition is available at *http://localhost:6969/onap/policy/clamp/acm/swagger-ui/index.html*
 
-   .. code-block:: yaml
-
-      participantId:
-        name: org.onap.PM_Policy
-        version: 1.0.0
-      participantType:
-        name: org.onap.policy.clamp.acm.PolicyParticipant
-        version: 2.3.1
-
-Run the following commands:
 
-   .. code-block:: bash
-
-      cd ~/git/onap/policy/clamp/participant/participant-impl/participant-impl-simulator
-      java -jar target/policy-clamp-participant-impl-simulator-6.2.2-SNAPSHOT.jar --spring.config.location=src/main/resources/config/application.yaml
-
-
-Creating self-signed certificate
+Running one or more participants
 ++++++++++++++++++++++++++++++++
 
-There is an additional requirement for the Clamp automation composition docker image to run, is creating the SSL self-signed certificate.
+Into :ref:`HTTP Participant <clamp-acm-http-participant>` you can find a test case with http-participant.
 
 Run the following commands:
 
    .. code-block:: bash
 
-      cd ~/git/onap/policy/docker/csit/
-      ./gen_truststore.sh
-      ./gen_keystore.sh
-
-Execution of the commands above results additional files into the following directory *~/git/onap/policy/docker/csit/config*:
-
-    *  ~/git/onap/policy/docker/csit/config/cakey.pem
-    *  ~/git/onap/policy/docker/csit/config/careq.pem
-    *  ~/git/onap/policy/docker/csit/config/caroot.cer
-    *  ~/git/onap/policy/docker/csit/config/ks.cer
-    *  ~/git/onap/policy/docker/csit/config/ks.csr
-    *  ~/git/onap/policy/docker/csit/config/ks.jks
+      cd ~/git/onap/policy/clamp/participant/participant-impl/participant-impl-http
+      java -jar target/policy-clamp-participant-impl-http-6.4.2-SNAPSHOT.jar
 
 
 Running the CLAMP automation composition docker image
 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 
-Run the following command:
-
-   .. code-block:: bash
-
-      docker run --name runtime-smoke-test \
-       -p 6969:6969 \
-       -e mariadb.host=host.docker.internal \
-       -e topicServer=host.docker.internal \
-       --mount type=bind,source=~/git/onap/policy/docker/csit/config/ks.jks,target=/opt/app/policy/clamp/etc/ssl/policy-keystore  \
-       --mount type=bind,source=~/git/onap/policy/clamp/runtime-acm/src/main/resources/application.yaml,target=/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml  \
-       onap/policy-clamp-runtime-acm
-
-
-Swagger UI of automation composition is available at *https://localhost:6969/onap/policy/clamp/acm/swagger-ui/*, and swagger JSON at *https://localhost:6969/onap/policy/clamp/acm/v2/api-docs/*
-
-
-Using CLAMP runtime to connect to CLAMP automation composition
-**************************************************************
-
-Build CLAMP runtime image:
-
-    .. code-block:: bash
-
-       cd ~/git/onap/policy/clamp/runtime
-       mvn clean install -P docker -DskipTests
-
-
-Run the following docker composition:
+Create the '*docker-composition.yaml*' using following code:
 
    .. code-block:: yaml
 
       version: '3.1'
 
       services:
-        db:
-          image: mariadb:10.5.8
+        mariadb:
+          image: mariadb:10.10.2
           volumes:
-             - "~/git/onap/policy/clamp/runtime/extra/sql/:/docker-entrypoint-initdb.d:rw"
+            - type: bind
+              source: ./mariadb.sql
+              target: /docker-entrypoint-initdb.d/data.sql
           environment:
-            - MYSQL_ROOT_PASSWORD=strong_pitchou
+            - MYSQL_ROOT_PASSWORD=my-secret-pw
+            - lower-case-table-names=1
           ports:
             - "3306:3306"
 
-        policy-clamp-backend:
-          image: onap/policy-clamp-backend
-          depends_on:
-            - db
-            - third-party-proxy
+        runtime-acm:
+          image: onap/policy-clamp-runtime-acm
           environment:
-            - SPRING_DATASOURCE_URL=jdbc:mariadb:sequential://db:3306/cldsdb4?autoReconnect=true&connectTimeout=10000&socketTimeout=10000&retriesAllDown=3
-            - SPRING_PROFILES_ACTIVE=clamp-default,clamp-default-user,clamp-sdc-controller,clamp-ssl-config,clamp-policy-controller,default-dictionary-elements
-            - CLAMP_CONFIG_POLICY_API_URL=http://third-party-proxy:8085
-            - CLAMP_CONFIG_ACM_RUNTIME_URL=http://host.docker.internal:6969
-            - CLAMP_CONFIG_POLICY_PAP_URL=http://third-party-proxy:8085
-            - CLAMP_CONFIG_DCAE_INVENTORY_URL=http://third-party-proxy:8085
-            - CLAMP_CONFIG_DCAE_DEPLOYMENT_URL=http://third-party-proxy:8085
-            - SPRING_CONFIG_LOCATION=classpath:/application.properties
+            - mariadb.host=mariadb
+            - topicServer=message-router
+          volumes:
+            - type: bind
+              source: ./onap/policy/clamp/runtime-acm/src/main/resources/application.yaml
+              target: /opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
           ports:
-            - "10443:8443"
+            - "6969:6969"
 
-        third-party-proxy:
-          image: python:2-slim
+        message-router:
+          image: onap/policy-models-simulator
           volumes:
-            - "~/git/onap/policy/clamp/runtime/src/test/resources/http-cache/example/:/thirdparty:rw"
-            - "~/git/onap/policy/clamp/runtime/src/test/resources/http-cache/:/script/:ro"
+            - type: bind
+              source: ./onap/policy/models/models-sim/policy-models-simulators/src/test/resources/newParameters.json
+              target: /opt/app/policy/simulators/etc/mounted/simParameters.json
           ports:
-            - "8085:8085"
-          command: /bin/sh -c "pip install --no-cache-dir requests &&  pip install --no-cache-dir simplejson && python -u /script/third_party_proxy.py -v true --port 8085 --root /thirdparty --proxyaddress third-party-proxy:8085"
+            - "3904:3904"
+
+Run the docker composition:
+
+   .. code-block:: bash
+
+      cd ~/git/
+      docker-compose up
 
 
-Run DMaaP simulator, and then run CLAMP Acm using java.
+Swagger UI of automation composition is available at *http://localhost:6969/onap/policy/clamp/acm/swagger-ui/index.html*