Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 23 Next »

Follow the steps below to setup the CPS environment. 

Checkout the project

Checkout https://gerrit.onap.org/r/admin/repos/cps

From docker-compose folder run the following after building the images locally :

VERSION=x.y.z-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d

This starts both cps and postgres containers.

Note: Checkout the README.md in docker-compose folder for detailed steps.

Setup schema in DB

Liquibase auto creates the schema on startup.

Set environment variables with relevant connection details which can be found in application.yml in docker-compose folder.

Building the project

When building the project run from the root cps folder :

mvn clean install

Running the project

This option is if you have  a local postgres running.

From the cps folder run the following command :

java -DDB_HOST=localhost -DDB_USERNAME=cps -DDB_PASSWORD=cps -jar cps-application/target/cps-application-x.y.z-SNAPSHOT.jar

NB. On Linux use IP address of a container instead of localhost

OR 

From the cps\cps-application folder run the following command:

mvn spring-boot:run

Running CPS via Helm charts on Minikube :

WSL Checks (when using WSL2 on MS Windows)

Check that your WSL 2 environment is running both linux distribution and docker using a windows command prompt/shell
*It might be needed to configure for Windows is configured for WSL 2 and WSL itself is set to use your linux distribution as default.

WSL Check
$ wsl -l -v
  NAME                   STATE           VERSION
* Ubuntu-20.04           Running         2
  docker-desktop         Running         2
  docker-desktop-data    Running         2

When using WSL 2ensure to open a WSL shell window ie. Command Prompt, wsl ...

Install MiniKube:

Install and Start MiniKube
curl -LO https://storage.googleapis.com/minikube/releases/latest/minikube-linux-amd64
sudo install minikube-linux-amd64 /usr/local/bin/minikube
minikube start

Install Kubectl and Help 

To setup kubectl and helm for ONAP locally  follow steps as outlined in the deploy section on - https://docs.onap.org/projects/onap-oom/en/latest/oom_user_guide.html#deploy

Please Note:

  • No Need to 'Paste kubectl config rom Rancher' (not sure why that is even in those instructions)
  • Skip 'helm install ons/onap' as the document mentions it is not available anymore

Deploy CPS

To install CPS only, run the following command from within the oom/kubernetes/cps folder :

Install CPS using Helm
cd <your git repo>/oom/kubernetes/cps
helm upgrade dev1 local/cps -i -f values.yaml --set global.masterPassword=mysecr

This was tested on windows using WSL2 with Ubuntu 20.04 but any similar environment should suffice.

FAQ

How to fix "Error: could not open `{argLine}'when running unit tests from Intellij IDE ?

If not able to run unit tests from Intellj unit tests tool because of this error

Error: could not open `{argLine}'

Process finished with exit code 1

Then review maven-surefire-plugin integration with Intellij:

  • Go to Settings-> Build,Execution,Deployment -> Build Tools -> Maven -> Running Tests
  • Uncheck argLine


  • No labels