X-Git-Url: https://gerrit.onap.org/r/gitweb?a=blobdiff_plain;f=docker-compose%2FREADME.md;h=623968f33b2e1fc4ae9b626329be2096f7b6de1f;hb=refs%2Fheads%2Fmaster;hp=ca395df07a92ab9626b647a3aecdf8a7596f4b0f;hpb=b77bf2529f15e60c852cf83d5150e75d30068bb0;p=cps.git diff --git a/docker-compose/README.md b/docker-compose/README.md index ca395df07a..c1bbb4e640 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -1,19 +1,110 @@ -# Docker Compose deployment example for local enviroments, CPS deployment is done via OOM + + +# Building and Running CPS Locally + +## Building Java Archive only + +Following command builds all Java components to `cps-application/target/cps-application-x.y.z-SNAPSHOT.jar` JAR file +without generating any docker images: + +```bash +mvn clean install -Pcps-docker -Pncmp-docker -Pcps-ncmp-docker -Djib.skip +``` + +## Building Java Archive and Docker Images + +* Following command builds the JAR file and also generates the Docker image for all CPS components: ```bash -mvn clean install -Pcps-docker -Pxnf-docker -Pcps-xnf-docker +mvn clean install -Pcps-docker -Pncmp-docker -Pcps-ncmp-docker ``` -or for generate an specific type +* Following command builds the JAR file and generates the Docker image for specified CPS component: + (with `` being one of `cps-docker`, `ncmp-docker` or `cps-ncmp-docker`): + +```bash +mvn clean install -P +``` + +## Running Docker Containers + +`docker-compose/docker-compose.yml` contains the base services required to run CPS and NCMP. +This deployment can also be used for KPI test. Please run the following command from `docker-compose` folder: ```bash -mvn clean install -Pcps-docker +docker-compose up -d +or +docker-compose --profile tracing up -d ``` -Run the containers +`docker-compose/dmi-services.yml` contains the DMI services including SDNC and PNF Simulator. +This deployment is required for the CSIT test. ```bash -VERSION=0.0.1-SNAPSHOT DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d -``` \ No newline at end of file +docker-compose -f docker-compose.yml -f dmi-services.yml up -d +``` + +To deploy services that are required for Endurance test, please use the following command: +```bash +docker-compose --project-name endurance --env-file env/endurance.env up -d +``` + +To stop any deployment, please replace `up -d` flag with `down` in the above commands. + +### Running from Jar Archive + +Following command starts the application using JAR file: + +```bash +DB_HOST=localhost DB_USERNAME=cps DB_PASSWORD=cps \ + DMI_USERNAME=cpsuser DMI_PASSWORD=cpsr0cks! \ + java -jar cps-application/target/cps-application-x.y.z-SNAPSHOT.jar +``` + +### Running from IntelliJ IDE + +Here are the steps to run or debug the application from Intellij: + +1. Enable the desired maven profile form Maven Tool Window +2. Run a configuration from `Run -> Edit configurations` with following settings: + * `Environment variables`: `DB_HOST=localhost;DB_USERNAME=cps;DB_PASSWORD=cps + DMI_USERNAME=cpsuser DMI_PASSWORD=cpsr0cks!` + +## Accessing services + +Swagger UI and Open API specifications are available to discover service endpoints and send requests. + +* `http://localhost:/swagger-ui.html` +* `http://localhost:/api-docs/cps-core/openapi.yaml` +* `http://localhost:/api-docs/cps-ncmp/openapi.yaml` +* `http://localhost:/api-docs/cps-ncmp/openapi-inventory.yaml` + +with is being either `8080` if running the plain Java build or retrieved using following command +if running from `docker-compose`: + +```bash +docker inspect \ + --format='{{range $p, $conf := .NetworkSettings.Ports}} {{$p}} -> {{(index $conf 0).HostPort}} {{end}}' \ + +``` + +Enjoy CPS!