aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJorge Hernandez <jh1730@att.com>2017-08-02 09:58:13 -0500
committerJorge Hernandez <jh1730@att.com>2017-08-02 10:25:43 -0500
commit9eb6ad5b26c1fd6d1f320c7a2c47448cd0449fd8 (patch)
tree361f2bf8df3e30d7ae20043ddc967ad8407753e3
parent1fbd3d87bc246e670a236dc0711fb09862f32fd1 (diff)
[POLICY-66] healtcheck feature config and db prep
initial commit pre-introduction of db support on per feature basis Change-Id: Ie5aec06d38a84be849386fc76d8f1c804213c803 Signed-off-by: Jorge Hernandez <jh1730@att.com>
-rw-r--r--config/drools/base.conf59
-rwxr-xr-xconfig/drools/drools-tweaks.sh23
-rw-r--r--config/drools/feature-healthcheck.conf2
-rw-r--r--policy-drools/Dockerfile13
-rw-r--r--policy-drools/docker-install.sh9
5 files changed, 78 insertions, 28 deletions
diff --git a/config/drools/base.conf b/config/drools/base.conf
index b8e0d0a4..611e1f7b 100644
--- a/config/drools/base.conf
+++ b/config/drools/base.conf
@@ -1,14 +1,39 @@
+###
+# ============LICENSE_START=======================================================
+# ONAP POLICY
+# ================================================================================
+# Copyright (C) 2017 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.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+# ============LICENSE_END=========================================================
+###
+
+
+# SYSTEM software configuration
+
POLICY_HOME=/opt/app/policy
JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
KEYSTORE_PASSWD=PolicyR0ck$
+# Telemetry credentials
+
ENGINE_MANAGEMENT_PORT=9696
ENGINE_MANAGEMENT_HOST=localhost
ENGINE_MANAGEMENT_USER=@1b3rt
-ENGINE_MANAGEMENT_PASSWORD=31nst@1n
+ENGINE_MANAGEMENT_PASSWORD=31nst31n
+
+# nexus repository
-# To use a Nexus repository for rules artifacts,
-# following properties must be uncommented and set:
snapshotRepositoryID=policy-nexus-snapshots
snapshotRepositoryUrl=http://nexus:8081/nexus/content/repositories/snapshots/
releaseRepositoryID=policy-nexus-releases
@@ -16,6 +41,14 @@ releaseRepositoryUrl=http://nexus:8081/nexus/content/repositories/releases/
repositoryUsername=admin
repositoryPassword=admin123
+# Relational (SQL) DB access
+
+SQL_HOST=mariadb
+SQL_USER=policy_user
+SQL_PASSWORD=policy_user
+
+# PDP-D DMaaP configuration channel
+
PDPD_CONFIGURATION_TOPIC=PDPD-CONFIGURATION
PDPD_CONFIGURATION_SERVERS=vm1.mr.simpledemo.openecomp.org
PDPD_CONFIGURATION_API_KEY=
@@ -24,3 +57,23 @@ PDPD_CONFIGURATION_CONSUMER_GROUP=
PDPD_CONFIGURATION_CONSUMER_INSTANCE=
PDPD_CONFIGURATION_PARTITION_KEY=
+# PAP
+
+PAP_HOST=pap
+PAP_USERNAME=testpap
+PAP_PASSWORD=alpha123
+
+# PDP-X
+
+PDP_HOST=pdp
+PDP_USERNAME=testpdp
+PDP_PASSWORD=alpha123
+
+# DCAE DMaaP
+
+DCAE_TOPIC=unauthenticated.TCA_EVENT_OUTPUT
+DCAE_SERVERS=10.0.4.102
+
+# Open DMaaP
+
+DMAAP_SERVERS=vm1.mr.simpledemo.openecomp.org
diff --git a/config/drools/drools-tweaks.sh b/config/drools/drools-tweaks.sh
index ab9f3697..09d13416 100755
--- a/config/drools/drools-tweaks.sh
+++ b/config/drools/drools-tweaks.sh
@@ -1,29 +1,6 @@
#! /bin/bash
-# changes for health check
${POLICY_HOME}/bin/features enable healthcheck
-sedArgs=("-i")
-while read var value ; do
- if [[ "${var}" == "" ]] ; then
- continue
- fi
- sedArgs+=("-e" "s@\${{${var}}}@${value}@g")
-done <<-EOF
- PAP_HOST pap
- PAP_USERNAME testpap
- PAP_PASSWORD alpha123
- PDP_HOST pdp
- PDP_USERNAME testpdp
- PDP_PASSWORD alpha123
-EOF
-
-# convert file
-sed "${sedArgs[@]}" ${POLICY_HOME}/config/*health*
-
-cat >>${POLICY_HOME}/config/*health* <<-'EOF'
- http.server.services.HEALTHCHECK.userName=healthcheck
- http.server.services.HEALTHCHECK.password=zb!XztG34
-EOF
sed -i -e 's/DCAE-CL-EVENT/unauthenticated.TCA_EVENT_OUTPUT/' \
-e '/TCA_EVENT_OUTPUT\.servers/s/servers=.*$/servers=10.0.4.102/' \
diff --git a/config/drools/feature-healthcheck.conf b/config/drools/feature-healthcheck.conf
new file mode 100644
index 00000000..3351b78f
--- /dev/null
+++ b/config/drools/feature-healthcheck.conf
@@ -0,0 +1,2 @@
+HEALTHCHECK_USER=healthcheck
+HEALTHCHECK_PASSWORD=zb!XztG3
diff --git a/policy-drools/Dockerfile b/policy-drools/Dockerfile
index 9ee0f488..a360b012 100644
--- a/policy-drools/Dockerfile
+++ b/policy-drools/Dockerfile
@@ -1,12 +1,21 @@
FROM onap/policy/policy-base
RUN pip install http-prompt
-RUN mkdir -p /opt/app/policy /tmp/policy-install && chown policy /opt/app/policy /tmp/policy-install
+RUN mkdir -p /opt/app/policy/opt /tmp/policy-install && \
+ chown -R policy /opt/app/policy /tmp/policy-install
+
WORKDIR /tmp/policy-install
COPY install-drools.zip apps.zip docker-install.sh do-start.sh wait-for-port.sh ./
+ADD http://repo1.maven.org/maven2/org/flywaydb/flyway-commandline/4.2.0/flyway-commandline-4.2.0.tar.gz /opt/app
-RUN unzip install-drools.zip && unzip apps.zip && rm install-drools.zip apps.zip && chown -R policy * && chmod +x *.sh
+RUN unzip install-drools.zip && \
+ unzip apps.zip && \
+ rm install-drools.zip apps.zip && \
+ chown -R policy * && \
+ chmod +x *.sh && \
+ ln -s /opt/app/flyway-4.2.0 /opt/app/flyway && \
+ ln -s /opt/app/flyway/flyway /usr/local/bin
USER policy
CMD ./do-start.sh
diff --git a/policy-drools/docker-install.sh b/policy-drools/docker-install.sh
index 8bc85c86..281ace10 100644
--- a/policy-drools/docker-install.sh
+++ b/policy-drools/docker-install.sh
@@ -814,8 +814,17 @@ function installFeatures
name="${name%-[0-9]*\.zip}"
mkdir -p "${FEATURES_HOME}/${name}" > /dev/null 2>&1
(cd "${FEATURES_HOME}/${name}"; jar xf ${SOURCE_DIR}/${feature})
+ featureConf="feature-${name}.conf"
+ if [[ -r "${featureConf}" ]]; then
+ configure_component "${featureConf}" "${FEATURES_HOME}"
+ cp "${featureConf}" "${POLICY_HOME}"/etc/profile.d
+ echo "feature ${name} has been installed (configuration present)"
+ else
+ echo "feature ${name} has been installed (no configuration present)"
+ fi
done
+ echo "applying base configuration to features"
configure_component "${BASE_CONF}" "${FEATURES_HOME}"
else
echo "error: aborting ${FEATURES_HOME} is not accessible"