From b001c1ac5a0b4d938a69adb47f4613f64dc71c1a Mon Sep 17 00:00:00 2001 From: Jorge Hernandez Date: Thu, 28 Feb 2019 10:10:49 -0600 Subject: move all hard install config to environment vars + support multiple system properties files with variable interpolation loaded at initialization + support of configurable JVM options (-X, etc ..). + rearrange aaf configuration to avoid {{}} installation variables and use dynamic enviroment variables. + miscellaneous clean up in areas touched and checkstyle. Change-Id: I71ad839778e17eb57c098a2c5cc2bf96e468669a Issue-ID: POLICY-1524 Signed-off-by: Jorge Hernandez --- packages/docker/src/main/docker/Dockerfile | 4 - packages/docker/src/main/docker/do-start.sh | 147 +++++++++++++--------------- packages/install/src/files/base.conf | 6 +- 3 files changed, 72 insertions(+), 85 deletions(-) (limited to 'packages') diff --git a/packages/docker/src/main/docker/Dockerfile b/packages/docker/src/main/docker/Dockerfile index 087dcb47..829bb6b0 100644 --- a/packages/docker/src/main/docker/Dockerfile +++ b/packages/docker/src/main/docker/Dockerfile @@ -1,14 +1,10 @@ FROM ubuntu:14.04 -ARG HTTP_PROXY=${HTTP_PROXY} -ARG HTTPS_PROXY=${HTTPS_PROXY} ARG BUILD_VERSION=${BUILD_VERSION} ARG POLICY_HOME=/opt/app/policy ARG POLICY_LOGS=/var/log/onap/policy/pdpd ARG POLICY_INSTALL=/tmp/policy-install -ENV http_proxy $HTTP_PROXY -ENV https_proxy $HTTPS_PROXY ENV BUILD_VERSION ${BUILD_VERSION} ENV POLICY_INSTALL ${POLICY_INSTALL} ENV POLICY_HOME ${POLICY_HOME} diff --git a/packages/docker/src/main/docker/do-start.sh b/packages/docker/src/main/docker/do-start.sh index 91402e62..4687e421 100644 --- a/packages/docker/src/main/docker/do-start.sh +++ b/packages/docker/src/main/docker/do-start.sh @@ -1,9 +1,9 @@ #!/bin/bash ### # ============LICENSE_START======================================================= -# +# ONAP # ================================================================================ -# Copyright (C) 2017-2018 AT&T Intellectual Property. All rights reserved. +# Copyright (C) 2017-2019 AT&T Intellectual Property. All rights reserved. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -19,84 +19,71 @@ # ============LICENSE_END========================================================= ### -# skip installation if build.info file is present (restarting an existing container) -if [[ -f ${POLICY_HOME}/etc/build.info ]]; then - echo "Found existing installation, will not reinstall" - . ${POLICY_HOME}/etc/profile.d/env.sh -else - echo "installing .." - - # replace conf files from installer with environment-specific files - # mounted from the hosting VM - if [[ -d config ]]; then - cp config/*.conf . - fi - - if [[ -f config/drools-preinstall.sh ]] ; then - echo "found preinstallation script" - bash config/drools-preinstall.sh - fi - - # remove broken symbolic links if any in data directory - if [[ -d ${POLICY_HOME}/config ]]; then - echo "removing dangling symbolic links" - find -L ${POLICY_HOME}/config -type l -exec rm -- {} + - fi - - apps=$(ls config/apps*.zip 2> /dev/null) - for app in $apps - do - echo "Application found: ${app}" - unzip -o ${app} - done - - feats=$(ls config/feature*.zip 2> /dev/null) - for feat in $feats - do - echo "Feature found: ${feat}" - cp ${feat} . - done - - echo "docker install at ${PWD}" - - ./docker-install.sh - - . ${POLICY_HOME}/etc/profile.d/env.sh - - # allow user to override the key or/and the trust stores - - if [[ -f config/policy-keystore ]]; then - cp -f config/policy-keystore ${POLICY_HOME}/etc/ssl - fi - - if [[ -f config/policy-truststore ]]; then - cp -f config/policy-truststore ${POLICY_HOME}/etc/ssl - fi - - # allow user to override all or some aaf configuration - - if [[ -f config/aaf.properties ]]; then - cp -f config/aaf.properties ${POLICY_HOME}/config/aaf.properties - fi - - if [[ -f config/aaf-location.properties ]]; then - cp -f config/aaf-location.properties ${POLICY_HOME}/config/aaf-location.properties - fi - - if [[ -f config/aaf-credentials.properties ]]; then - cp -f config/aaf-credentials.properties ${POLICY_HOME}/config/aaf-credentials.properties - fi - - if [[ -f config/aaf-cadi.keyfile ]]; then - cp -f config/aaf-cadi.keyfile ${POLICY_HOME}/config/aaf-cadi.keyfile - fi - - if [[ -f config/drools-tweaks.sh ]] ; then - echo "Executing tweaks" - # file may not be executable; running it as an - # argument to bash avoids needing execute perms. - bash config/drools-tweaks.sh - fi +echo "installing .." + +# replace conf files from installer with environment-specific files +# mounted from the hosting VM + +if [[ -d config ]]; then + cp config/*.conf . +fi + +if [[ -f config/drools-preinstall.sh ]] ; then + echo "found preinstallation script" + bash config/drools-preinstall.sh +fi + +# remove broken symbolic links if any in data directory +if [[ -d ${POLICY_HOME}/config ]]; then + echo "removing dangling symbolic links" + find -L ${POLICY_HOME}/config -type l -exec rm -- {} + +fi + +apps=$(ls config/apps*.zip 2> /dev/null) +for app in $apps +do + echo "Application found: ${app}" + unzip -o ${app} +done + +feats=$(ls config/feature*.zip 2> /dev/null) +for feat in $feats +do + echo "Feature found: ${feat}" + cp ${feat} . +done + +echo "docker install at ${PWD}" + +./docker-install.sh + +source ${POLICY_HOME}/etc/profile.d/env.sh + +# allow user to override the key or/and the trust stores + +if [[ -f config/policy-keystore ]]; then + cp -f config/policy-keystore ${POLICY_HOME}/etc/ssl +fi + +if [[ -f config/policy-truststore ]]; then + cp -f config/policy-truststore ${POLICY_HOME}/etc/ssl +fi + +# allow user to override all or some aaf configuration + +if [[ -f config/aaf.properties ]]; then + cp -f config/aaf.properties ${POLICY_HOME}/config/aaf.properties +fi + +if [[ -f config/aaf-cadi.keyfile ]]; then + cp -f config/aaf-cadi.keyfile ${POLICY_HOME}/config/aaf-cadi.keyfile +fi + +if [[ -f config/drools-tweaks.sh ]] ; then + echo "Executing tweaks" + # file may not be executable; running it as an + # argument to bash avoids needing execute perms. + bash config/drools-tweaks.sh fi echo "Starting processes" diff --git a/packages/install/src/files/base.conf b/packages/install/src/files/base.conf index 4d38301b..70b165f2 100644 --- a/packages/install/src/files/base.conf +++ b/packages/install/src/files/base.conf @@ -18,6 +18,10 @@ # ============LICENSE_END========================================================= ### +# JVM options + +JVM_OPTIONS=-server -Xms512m -Xmx1024m + # SYSTEM software configuration POLICY_HOME=/opt/app/policy @@ -38,6 +42,7 @@ TELEMETRY_PASSWORD= SNAPSHOT_REPOSITORY_ID= SNAPSHOT_REPOSITORY_URL= RELEASE_REPOSITORY_ID= +RELEASE_REPOSITORY_URL= REPOSITORY_USERNAME= REPOSITORY_PASSWORD= @@ -56,7 +61,6 @@ AAF_HOST=aaf-onap-test.osaaf.org # PDP-D DMaaP configuration channel PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION -PDPD_CONFIGURATION_SERVERS= PDPD_CONFIGURATION_API_KEY= PDPD_CONFIGURATION_API_SECRET= PDPD_CONFIGURATION_CONSUMER_GROUP= -- cgit 1.2.3-korg