1) Added the DB hostnames to map to the MySQL container's docker IP in APP-C Container's /etc/hosts, then 2) added installAppcDb.sh to create the "appcctl" database and its "transactions" table (in appcctl.dump) since it is needed to complete the LCM functionality, then 3) added some properties in appc.properties since they were used in local testing, but need to double check if they are absolutely necessary
Change-Id: I7be65412ea4a87f7295adc9b6a69fe7ad917d62c
Signed-off-by: Hector Anapan <ha076r@att.com>
Issue: [APPC-122]
Signed-off-by: Hector Anapan <ha076r@att.com>
</configuration>
</execution>
- <!-- Commented tags in case / when appc needs to add .dump mysql files or keystore files -->
- <!--<execution>
+ <execution>
<id>copy-data</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
- <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data</outputDirectory>
+ <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</configuration>
- </execution>-->
+ </execution>
<execution>
<id>copy-keystores</id>
</configuration>
</execution>
- <!-- Two commented execution tags below in case / when appc needs
- to add .dump mysql files or keystore files -->
- <!-- <execution>
+ <execution>
<id>copy-data</id>
<goals>
<goal>copy-resources</goal>
</goals>
<phase>validate</phase>
<configuration>
- <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/sdnc/data</outputDirectory>
+ <outputDirectory>${basedir}/target/docker-stage/opt/openecomp/appc/data</outputDirectory>
<resources>
<resource>
<directory>src/main/resources</directory>
</resource>
</resources>
</configuration>
- </execution> -->
+ </execution>
<execution>
<id>copy-keystores</id>
-# Base ubuntu with added packages needed for open ecomp
+# Base ubuntu with added packages needed for ONAP
FROM openecomp/sdnc-image:1.1.2-SNAPSHOT-STAGING-170625-122013
MAINTAINER APP-C Team (appc@lists.openecomp.org)
COPY opt /opt
RUN ln -s /opt/openecomp/appc /opt/appc
-#Expose port 8181 for ODL REST calls
+# Expose port 8181 for ODL REST calls
EXPOSE 8181
--- /dev/null
+--
+-- Table structure for table `transactions` for appcctl db
+--
+
+DROP TABLE IF EXISTS `transactions`;
+CREATE TABLE `transactions` (
+ `TIMESTAMP`
+ varchar(32) NOT NULL,
+ `REQUEST_ID`
+ varchar(256) DEFAULT NULL,
+ `START_TIME`
+ varchar(32) DEFAULT NULL,
+ `END_TIME`
+ varchar(32) DEFAULT NULL,
+ `TARGET_ID`
+ varchar(256) DEFAULT NULL,
+ `TARGET_TYPE`
+ varchar(256) DEFAULT NULL,
+ `SUB_COMPONENT`
+ varchar(256) DEFAULT NULL,
+ `OPERATION`
+ varchar(256) DEFAULT NULL,
+ `RESULT_CODE`
+ varchar(256) DEFAULT NULL,
+ `DESCRIPTION`
+ text
+) ENGINE = InnoDB DEFAULT CHARSET = latin1;
\ No newline at end of file
--- /dev/null
+###
+# ============LICENSE_START=======================================================
+# APPC
+# ================================================================================
+# 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=========================================================
+###
+
+SDNC_HOME=${SDNC_HOME:-/opt/openecomp/sdnc}
+APPC_HOME=${APPC_HOME:-/opt/openecomp/appc}
+MYSQL_PASSWD=${MYSQL_PASSWD:-openECOMP1.0}
+
+APPC_DB_USER=${APPC_DB_USER:-appcctl}
+APPC_DB_PASSWD=${APPC_DB_PASSWD:-appcctl}
+APPC_DB_DATABASE=${SDN_DB_DATABASE:-appcctl}
+
+
+# Create tablespace and user account
+mysql -h dbhost -u root -p${MYSQL_PASSWD} mysql <<-END
+CREATE DATABASE ${APPC_DB_DATABASE};
+CREATE USER '${APPC_DB_USER}'@'localhost' IDENTIFIED BY '${APPC_DB_PASSWD}';
+CREATE USER '${APPC_DB_USER}'@'%' IDENTIFIED BY '${APPC_DB_PASSWD}';
+GRANT ALL PRIVILEGES ON ${APPC_DB_DATABASE}.* TO '${APPC_DB_USER}'@'localhost' WITH GRANT OPTION;
+GRANT ALL PRIVILEGES ON ${APPC_DB_DATABASE}.* TO '${APPC_DB_USER}'@'%' WITH GRANT OPTION;
+commit;
+END
+
+if [ -f ${APPC_HOME}/data/appcctl.dump ]
+then
+ mysql -h dbhost -u root -p${MYSQL_PASSWD} appcctl < ${APPC_HOME}/data/appcctl.dump
+fi
# ECOMP is a trademark and service mark of AT&T Intellectual Property.
###
-# Install SDN-C & APP-C platform components if not already installed and start container
+#
+# This script takes care of installing the SDN-C & APP-C platform components
+# if not already installed, and starts the APP-C Docker Container
+#
ODL_HOME=${ODL_HOME:-/opt/opendaylight/current}
ODL_ADMIN_PASSWORD=${ODL_ADMIN_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U}
echo "DMAAP_TOPIC_ENV shell variable exists and it's $DMAAP_TOPIC_ENV"
fi
-
echo "Adding a value to property appc.asdc.env in appc.properties for appc-asdc-listener feature"
echo "" >> $APPC_HOME/data/properties/appc.properties
echo "appc.asdc.env=$DMAAP_TOPIC_ENV" >> $APPC_HOME/data/properties/appc.properties
+#
+# Add the DB hostnames in /etc/hosts (IP address is the MySQL DB IP)
+#
+RUN echo "172.19.0.2 dbhost sdnctldb01 sdnctldb02" >> /etc/hosts
+
+
+
#
# Wait for database to init properly
#
then
echo "Installing SDN-C database"
${SDNC_HOME}/bin/installSdncDb.sh
+ echo "Installing APP-C database"
+ ${APPC_HOME}/bin/installAppcDb.sh
echo "Starting OpenDaylight"
${ODL_HOME}/bin/start
echo "Waiting ${SLEEP_TIME} seconds for OpenDaylight to initialize"
appc.topology.dg.method=topology-operation-all
appc.topology.dg.version=2.0.0
+# TEMP - Properties that might be needed to make the AAI-APPC connection
+org.openecomp.appc.db.url.appcctl=jdbc:mysql://dbhost:3306/appcctl
+org.openecomp.appc.db.user.appcctl=appcctl
+org.openecomp.appc.db.pass.appcctl=appcctl
-
+org.openecomp.appc.db.url.sdnctl=jdbc:mysql://dbhost:3306/sdnctl
+org.openecomp.appc.db.user.sdnctl=sdnctl
+org.openecomp.appc.db.pass.sdnctl=gamma
### ###
DCAE.dmaap.appc.password=test
DCAE.dmaap.event.pool.members=10.0.11.1:3904
-#OAM Listener
+# OAM Listener
appc.OAM.disabled=true
appc.OAM.provider.url=http://localhost:8181/restconf/operations/appc-oam
appc.OAM.poolMembers=10.0.11.1:3904