Add ability to turn off policy preload

You can now set environment variable to override whether or not the
policies are pre-loaded by the engines during docker image startup.

The README.md is updated with instructions. Each docker-compose has
a different default set.

The .env file is set to load policies by default to true. You can override
by either changing this file or setting the environment:

export PRELOAD_POLICIES=false

Issue-ID: POLICY-304
Change-Id: Ia96788ac3b8d47814eea1046d96c4e3e4a0b9664
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
5 files changed
tree: 9fef7238c992bcb75e0f1cc897ebd9cc98ac7d6e
  1. config/
  2. policy-base/
  3. policy-db/
  4. policy-drools/
  5. policy-nexus/
  6. policy-os/
  7. policy-pe/
  8. vagrant/
  9. .env
  10. .gitignore
  11. .gitreview
  12. docker-compose-integration.yml
  13. docker-compose.yml
  14. docker_build.sh
  15. docker_merge.sh
  16. docker_verify.sh
  17. LICENSE.txt
  18. pom.xml
  19. README.md
  20. version.properties
README.md

This source repository contains the files for building the ONAP Policy Engine Docker images.

To build it using Maven 3, first build 'policy/common', 'policy/engine', 'policy/drools-pdp', and 'policy/drools-applications' repositories, and then run: mvn prepare-package. This will pull the installation zip files needed for building the policy-pe and policy-drools Docker images into the target directory. It will not actually build the docker images; the following additional steps are needed to accomplish this:

  • Copy the files under policy-pe to target/policy-pe
  • Copy the files under policy-drools to target/policy-drools
  • Run the 'docker build' command on the following directories, in order: policy-os policy-db policy-nexus policy-base target/policy-pe target/policy-drools

For example: docker build -t onap/policy/policy-os policy-os docker build -t onap/policy/policy-db policy-db docker build -t onap/policy/policy-nexus policy-nexus docker build -t onap/policy/policy-base policy-base docker build -t onap/policy/policy-pe target/policy-pe docker build -t onap/policy/policy-drools target/policy-drools

In addition, the 'config' directory contains configuration files that are read during the startup of the containers; this directory is referenced by the docker-compose.yml file.

If you want to call the docker-compose, the following needs to be setup before doing so:

chmod +x config/drools/drools-tweaks.sh IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) echo $IP_ADDRESS > config/pe/ip_addr.txt

If you do not want the policies pre-loaded, then set this environment variable to false:

export PRELOAD_POLICIES=false

It will override the settings in the .env file. Which is set to true.