This page details how to execute the demo that was recorded on the 14th of April 2021 at the DCAE meeting. The demo illustrates the flow of the control loop participant architecture and how it will create and manage services. Specifically, this demo shows the use of the control loop runtime's commissioning and instantiation API to trigger the deployment of the PMSH policy through the policy participant and the instantiation of the PMSH service through the DCAE participant. The DCAE participant uses the existing CLAMP backend to send requests and relay responses to the other participants and the runtime. This demonstration is not to be considered a reflection of the final implemented flow but merely as an indication of the currently implemented progress. The flow of the demo is shown in the image below.
Prerequisites
- Local environment running Ubuntu. Tested with Ubuntu 20.04
- Access to a Kubernetes Cluster running an ONAP deployment (version 7 or 8).
- Docker and Docker Compose installed locally.
- Java 11.
- A running CLAMP backend (connected to the Kubernetes cluster) with a local MariaDB database. This is running from commit ebc6907968050189688a0b8ccc0e0c42419a9202 on the master branch.
Setup CLAMP and MariaDB
Alterations to CLAMP
Some files need to be added to CLAMP in order for the demo to run successfully. These files include configuration files for Springboot and scripts to pre-populate the database.
- Add the PMSH template file to "extra/sql/dump/k8s-pmsh-bp.yaml". The file is available here k8s-pmsh-bp.yaml.
- There should be an SQL script in "extra/sql/dump/poc-test-data.sql". The file is available here poc-test-data.sql.
- The file at "extra/sql/dump/load-fake-data.sh" needs to be altered to refer to "poc-test-data.sql". The altered version is here load-fake-data.sh.
- For conveneince, one can alter the docker-compose file at "extra/docker/clamp/docker-compose.yml" to match the one provided here docker-compose.yml. This is not strictly needed but makes it easier to delete volumes during the docker container deployment.
- The Springboot properties file at "src/main/resources/application-noaaf.properties" should be altered to reflect to addresses and ports of your own Kubernetes cluster. By default, this properties file does not point to any cluster. For our case, we altered our local "/etc/hosts" file to associate hostnames with ip addresses - we then manually entered the relevant NodePorts into the properties file. An example is here application-noaaf.properties.
Build CLAMP
Run the following from the command line in the CLAMP root directory.
mvn clean install
Or for a faster build and if you encounter build errors
mvn clean install -DskipITs
Run and Pre-populate MariaDB
cd extra/bin-for-dev ./start-db.sh test
This should start and pre-populate the database. You can check the database with a suitable client to make sure if you wish. You can make sure the DB is running with:
docker ps
That's all for the database.
Start the CLAMP Backend
cd extra/bin-for-dev ./start-backend.sh
Note that you may need to run this with sudo.
Setup and Run DMAAP Simulator
DMAAP is required for communication between the runtime and participants. Here we outline how to setup and run the simulator.
Clone, Build and Run DMAAP Simulator
git clone "ssh://saul.gill@gerrit.nordix.org:29418/onap/policy/models" cd models mvn clean install
Then to run it
cd models-sim/models-sim-dmaap mvn exec:java -Dexec.mainClass=org.onap.policy.models.sim.dmaap.startstop.Main -Dexec.args="-c src/main/resources/etc/DefaultConfig.json"
Setup and Run Policy API
The Policy Api is required locally by the Policy Participant.
Clone, Build and Run the Policy API
git clone "ssh://saul.gill@gerrit.nordix.org:29418/onap/policy/api" cd api mvn clean install
The default configuration file of the Policy Api has to be altered at "packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json". The new configuration has been provided here defaultConfig.json.
Then we can run the Policy API.
cd main mvn exec:java -Dexec.mainClass=org.onap.policy.api.main.startstop.Main -Dexec.args=" -c ../packages/policy-api-tarball/src/main/resources/etc/defaultConfig.json"