summaryrefslogtreecommitdiffstats
path: root/aai-traversal/src/main/resources/docker
diff options
context:
space:
mode:
Diffstat (limited to 'aai-traversal/src/main/resources/docker')
-rw-r--r--aai-traversal/src/main/resources/docker/Dockerfile85
-rw-r--r--aai-traversal/src/main/resources/docker/aai.sh42
-rw-r--r--aai-traversal/src/main/resources/docker/commonLibs/README1
-rw-r--r--aai-traversal/src/main/resources/docker/docker-entrypoint.sh34
-rw-r--r--aai-traversal/src/main/resources/docker/init-chef.sh32
5 files changed, 194 insertions, 0 deletions
diff --git a/aai-traversal/src/main/resources/docker/Dockerfile b/aai-traversal/src/main/resources/docker/Dockerfile
new file mode 100644
index 0000000..66cf412
--- /dev/null
+++ b/aai-traversal/src/main/resources/docker/Dockerfile
@@ -0,0 +1,85 @@
+FROM ubuntu:14.04
+
+ENV DEBIAN_FRONTEND noninteractive
+
+ENV HTTP_PROXY ${HTTP_PROXY}
+ENV HTTPS_PROXY ${HTTP_PROXY}
+ENV https_proxy ${HTTP_PROXY}
+ENV http_proxy ${HTTP_PROXY}
+
+# Setup JAVA_HOME, this is useful for docker commandline
+ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64
+
+# Install all the application requirements such as curl ksh and git
+# Also install the chef and then remove it in one RUN command
+# Because the docker files work like git commits and each command is committed
+# So removing the chef in a different command will still have its in its build image
+# Its good to be optimizing and removing any files that are not needed for docker images
+# for the best possible performance out of your image
+
+RUN if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::http::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+ if [ ! -z ${HTTP_PROXY} ]; then echo "Acquire::https::proxy \"${HTTP_PROXY}\";" >> /etc/apt/apt.conf; fi && \
+ apt-get update && \
+ apt-get install -y software-properties-common && \
+ apt-get install --reinstall ca-certificates && \
+ sudo -E add-apt-repository ppa:openjdk-r/ppa && \
+ apt-get update && \
+ apt-get -qq install -y openjdk-8-jre-headless git curl ksh && \
+ curl -k -LO https://packages.chef.io/stable/ubuntu/14.04/chefdk_0.17.17-1_amd64.deb || \
+ curl --tlsv1 -LO https://packages.chef.io/stable/ubuntu/14.04/chefdk_0.17.17-1_amd64.deb && \
+ dpkg -i chefdk_0.17.17-1_amd64.deb && \
+ rm chefdk_0.17.17-1_amd64.deb && \
+ rm -rf /var/lib/apt/lists/*
+
+# Add the proper files into the docker image from your build
+ADD ./opt/app /opt/app
+ADD ./commonLibs/ /opt/app/commonLibs/
+ADD init-chef.sh /init-chef.sh
+ADD docker-entrypoint.sh /docker-entrypoint.sh
+ADD aai.sh /etc/profile.d/aai.sh
+
+# Expose the ports for outside linux to use
+# 8446 is the important one to be used
+
+EXPOSE 8446
+
+# Create the /var/chef if it doesn't exist
+WORKDIR /var/chef
+
+# Create the directory structure of aai application resembling the development server
+# hard-coding path to match ajsc version
+
+RUN chmod 755 /init-chef.sh /docker-entrypoint.sh && chmod 644 /etc/profile.d/aai.sh && \
+ mkdir /opt/aaihome && \
+ useradd -r -ms /bin/bash -d /opt/aaihome/aaiadmin aaiadmin && \
+ mkdir -p /opt/app/${project.artifactId} && \
+ chown aaiadmin:aaiadmin /opt/app/${project.artifactId} && \
+ chown -R aaiadmin:aaiadmin /opt/app/${project.artifactId} && \
+ mkdir -p /opt/aai/logroot && \
+ chown -R aaiadmin:aaiadmin /opt/aai/logroot && \
+ ln -s /opt/app/${project.artifactId}/bin scripts && \
+ mkdir -p /opt/app/${project.artifactId}/extApps && chown -R aaiadmin:aaiadmin /opt/app/${project.artifactId}/extApps && \
+ find /opt/app/${project.artifactId}/bin -name "*.sh" -exec chmod 755 {} + && \
+ chown aaiadmin:aaiadmin /docker-entrypoint.sh && \
+ chown -R aaiadmin:aaiadmin /var/chef && \
+ mkdir -p /opt/aai/logroot/AAI-GQ && \
+ chown aaiadmin:aaiadmin /opt/aai/logroot/AAI-GQ && \
+ ln -s /opt/aai/logroot/AAI-GQ /opt/app/${project.artifactId}/logs && \
+ chown -R aaiadmin:aaiadmin /opt/app/${project.artifactId}/logs
+
+VOLUME /opt/aai/logroot/AAI-GQ
+
+WORKDIR /
+
+USER aaiadmin
+
+# When the container is started this is the entrypoint script
+# that docker will run. Make sure this script doesn't end abruptly
+# If you want the container running even if the main application stops
+# You can run a ever lasting process like tail -f /dev/null
+# Or something like that at the end of the docker-entrypoint script
+# So if the main application you are planning on running fails
+# the docker container keeps on running forever
+
+ENTRYPOINT ./docker-entrypoint.sh
+
diff --git a/aai-traversal/src/main/resources/docker/aai.sh b/aai-traversal/src/main/resources/docker/aai.sh
new file mode 100644
index 0000000..741076f
--- /dev/null
+++ b/aai-traversal/src/main/resources/docker/aai.sh
@@ -0,0 +1,42 @@
+###
+# ============LICENSE_START=======================================================
+# org.openecomp.aai
+# ================================================================================
+# 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=========================================================
+###
+
+PROJECT_HOME=/opt/app/aai-traversal
+export PROJECT_HOME
+
+JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
+export JAVA_HOME
+
+AAIENV=dev
+export AAIENV
+
+PATH=/usr/lib/jvm/java-8-openjdk-amd64:$PATH
+
+PROJECT_OWNER=aaiadmin
+PROJECT_GROUP=aaiadmin
+PROJECT_UNIXHOMEROOT=/opt/aaihome
+export PROJECT_OWNER PROJECT_GROUP PROJECT_UNIXHOMEROOT
+umask 0022
+
+export idns_api_url=
+export idnscred=
+export idnstenant=
+
+
diff --git a/aai-traversal/src/main/resources/docker/commonLibs/README b/aai-traversal/src/main/resources/docker/commonLibs/README
new file mode 100644
index 0000000..00e36c0
--- /dev/null
+++ b/aai-traversal/src/main/resources/docker/commonLibs/README
@@ -0,0 +1 @@
+// this file's presence ensures commonLibs folder is present when image is created \ No newline at end of file
diff --git a/aai-traversal/src/main/resources/docker/docker-entrypoint.sh b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh
new file mode 100644
index 0000000..d776343
--- /dev/null
+++ b/aai-traversal/src/main/resources/docker/docker-entrypoint.sh
@@ -0,0 +1,34 @@
+###
+# ============LICENSE_START=======================================================
+# org.openecomp.aai
+# ================================================================================
+# 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=========================================================
+###
+
+cd /opt/app/aai-traversal;
+
+TITAN_CACHED="/opt/app/aai-traversal/bundleconfig/etc/appprops/titan-cached.properties";
+TITAN_REALTIME="/opt/app/aai-traversal/bundleconfig/etc/appprops/titan-realtime.properties";
+SERVER_HOST=${SERVER_HOST:-localhost};
+SERVER_TABLE=${SERVER_TABLE:-aaigraph-dev02};
+
+sed -i 's/^storage.backend=inmemory/storage.backend=hbase/g' $TITAN_CACHED $TITAN_REALTIME;
+sed -i "s/^storage.hostname=.*$/storage.hostname=${SERVER_HOST}/g" $TITAN_CACHED $TITAN_REALTIME;
+sed -i "s/^storage.hbase.table=.*$/storage.hbase.table=${SERVER_TABLE}/g" $TITAN_CACHED $TITAN_REALTIME;
+
+/opt/app/aai-traversal/bin/createDBSchema.sh;
+
+java -cp ${CLASSPATH}:/opt/app/commonLibs/*:/opt/app/aai-traversal/etc:/opt/app/aai-traversal/lib/*:/opt/app/aai-traversal/extJars/logback-access-1.1.7.jar:/opt/app/aai-traversal/extJars/logback-core-1.1.7.jar:/opt/app/aai-traversal/extJars/aai-core-${AAI_CORE_VERSION}.jar -server -XX:NewSize=512m -XX:MaxNewSize=512m -XX:SurvivorRatio=8 -XX:+DisableExplicitGC -verbose:gc -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+CMSClassUnloadingEnabled -XX:+UseConcMarkSweepGC -XX:-UseBiasedLocking -XX:ParallelGCThreads=4 -XX:LargePageSizeInBytes=128m -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -Dsun.net.inetaddr.ttl=180 -XX:+HeapDumpOnOutOfMemoryError -Dhttps.protocols=TLSv1.1,TLSv1.2 -DSOACLOUD_SERVICE_VERSION=1.0.1 -DAJSC_HOME=/opt/app/aai-traversal/ -DAJSC_CONF_HOME=/opt/app/aai-traversal/bundleconfig -DAJSC_SHARED_CONFIG=/opt/app/aai-traversal/bundleconfig -DAFT_HOME=/opt/app/aai-traversal -DAAI_CORE_VERSION=${AAI_CORE_VERSION} -Daai-core.version=${AAI_CORE_VERSION} -Dlogback.configurationFile=/opt/app/aai-traversal/bundleconfig/etc/logback.xml -Xloggc:/opt/app/aai-traversal/logs/ajsc-jetty/gc/graph-query_gc.log com.att.ajsc.runner.Runner context=/ port=8086 sslport=8446
diff --git a/aai-traversal/src/main/resources/docker/init-chef.sh b/aai-traversal/src/main/resources/docker/init-chef.sh
new file mode 100644
index 0000000..112b0b3
--- /dev/null
+++ b/aai-traversal/src/main/resources/docker/init-chef.sh
@@ -0,0 +1,32 @@
+#!/bin/bash
+
+###
+# ============LICENSE_START=======================================================
+# org.openecomp.aai
+# ================================================================================
+# 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=========================================================
+###
+
+##############################################################################
+# Script to initialize the chef-repo branch and.chef
+#
+##############################################################################
+
+#echo "AAI_CHEF_ENV=${AAI_CHEF_ENV}" >> /etc/environment
+#echo "AAI_CHEF_LOC=${AAI_CHEF_LOC}" >> /etc/environment
+#touch /root/.bash_profile
+chef-solo -c /var/chef/aai-data/chef-config/dev/.knife/solo.rb -j /var/chef/aai-config/cookbooks/runlist-app-server.json -E ${AAI_CHEF_ENV}
+