tree: 51bb4a7a138280979557d95cc23e0865c3aaab74 [path history] [tgz]
  1. config/
  2. metrics/
  3. compose.acm.scale.yml
  4. compose.common.yml
  5. compose.mariadb.yml
  6. compose.pdp.scale.yml
  7. compose.postgres.yml
  8. compose.yaml
  9. export-ports.sh
  10. get-k8s-versions.sh
  11. get-versions-regression.sh
  12. get-versions.sh
  13. loaddockerimage.sh
  14. README.md
  15. start-acm-replica.sh
  16. start-compose.sh
  17. start-multiple-pdp.sh
  18. stop-compose.sh
  19. wait_for_port.sh
compose/README.md

Policy Framework Docker Compose

The PF docker compose starts a small instance of docker containers for PF components.

Features

  • Starts all components, including Prometheus/Grafana dashboard
  • Can start specific components
  • Expose fixed ports so all the REST endpoints can be called with localhost:component_port

Tech

Things to be installed beforehand:

  • Linux VM if using Windows
  • Docker
  • Docker compose
  • Any editor

Installation

Assuming the docker repository has been cloned and workdir is ../docker/compose

  • Install all PF components
./start-compose.sh
  • Install an specific PF component (accepted options: api pap apex-pdp distribution drools-pdp drools-apps xacml-pdp policy-clamp-runtime-acm)
./start-compose.sh component

# that will start apex-pdp and its dependencies (pap, api, db, simulator)
./start-compose.sh apex-pdp
  • Install an specific PF component with Grafana dashboard (accepted options: api pap apex-pdp distribution drools-pdp drools-apps xacml-pdp policy-clamp-runtime-acm)
./start-compose.sh component --grafana

# that will start apex-pdp and its dependencies (pap, api, db, simulator) + grafana and prometheus server
./start-compose.sh apex-pdp --grafana

Docker image download localization

The docker images are always downloaded from nexus repository, but if needed to build a local image, edit the get-versions.sh script and change the variable LOCAL_IMAGES to true or edit the image tag in the docker compose file. Changing the variable to true will ensure that the newly built images locally are being used by not requesting a download from nexus and using the image tagged as latest.

Docker image versions

The start-compose script is always looking for the latest SNAPSHOT version available (will look locally first, then download from nexus if not available). Note: if latest Policy-API docker image is 2.8-SNAPSHOT-latest, but on nexus it was released 2 days ago and in local environment it's 3 months old - it will use the 3 months old image, so it's recommended to keep an eye on it.

If needed, the version can be edited on any docker compose yml file.

i.e: need to change db-migrator version from compose.{database}.yml: image: ${CONTAINER_LOCATION}onap/policy-db-migrator:${POLICY_DOCKER_VERSION}

replace the ${POLICY_DOCKER_VERSION} for the specific version needed

Logs

Use docker compose logs or docker logs ${container_name} instructions on how to collect logs.

Uninstall

Simply run the stop-compose.sh script. This will also generate logs from the services started with compose.

./stop-compose.sh

Database support

From Oslo version onwards, this docker compose setup uses Postgres database as default; MariaDB is still available, but support might be limited.

To start docker compose with MariaDB, add a flag to use it:

# that will start apex-pdp and its dependencies (pap, api, mariadb, simulator)
./start-compose.sh apex-pdp --mariadb
# that will start apex-pdp and its dependencies (pap, api, postgres, simulator)
./start-compose.sh apex-pdp

Docker compose files

To make it easier and clear how the docker compose system works, there are three files describing the services

  • compose.common.yml
    • Has policy services that don't connect directly to database: apex-pdp and distribution
    • Simulator service
    • ACM-R Participants that don't connect directly to database.
    • Messaging services (kafka, zookeeper)
    • Metrics services (prometheus, grafana, jaeger)
  • compose.postgres.yml
    • All policy services that connect directly to database with Postgres configurations
    • Postgres database and policy-db-migrator working towards it
  • compose.mariadb.yml
    • All policy services that connect directly to database with MariaDB configurations
    • MariaDB database and policy-db-migrator working towards it