summaryrefslogtreecommitdiffstats
path: root/auth/docker
diff options
context:
space:
mode:
authorvarun gudisena <vg411h@att.com>2018-07-12 18:02:57 +0000
committerGerrit Code Review <gerrit@onap.org>2018-07-12 18:02:57 +0000
commit9af4623faed6fd0bda1567cbf28899b5b5363be0 (patch)
treee55c0eaf5f724ddda3b7050760de137155874a35 /auth/docker
parent656c303eeb020d0763996a71d8a9705357013eb6 (diff)
parent9ec2895301056a9e8967eadb139e56f03776fe26 (diff)
Merge "Configuration Agent and MS for AAF"
Diffstat (limited to 'auth/docker')
-rw-r--r--auth/docker/.gitignore1
-rw-r--r--auth/docker/Dockerfile.config17
-rw-r--r--auth/docker/Dockerfile.core10
-rw-r--r--auth/docker/Dockerfile.ms19
-rw-r--r--auth/docker/agent.sh9
-rw-r--r--auth/docker/d.props.init (renamed from auth/docker/d.props)5
-rwxr-xr-xauth/docker/dbuild.sh30
-rw-r--r--auth/docker/dclean.sh4
-rw-r--r--auth/docker/drun.sh14
-rw-r--r--auth/docker/dstart.sh1
10 files changed, 99 insertions, 11 deletions
diff --git a/auth/docker/.gitignore b/auth/docker/.gitignore
new file mode 100644
index 00000000..f08acc75
--- /dev/null
+++ b/auth/docker/.gitignore
@@ -0,0 +1 @@
+d.props
diff --git a/auth/docker/Dockerfile.config b/auth/docker/Dockerfile.config
new file mode 100644
index 00000000..a5811e09
--- /dev/null
+++ b/auth/docker/Dockerfile.config
@@ -0,0 +1,17 @@
+FROM rmannfv/aaf-base:xenial
+MAINTAINER AAF Team, AT&T 2018
+ENV VERSION=${AAF_VERSION}
+
+LABEL description="aaf_agent"
+LABEL version=${AAF_VERSION}
+
+COPY data/sample.identities.dat /opt/app/aaf_config/data/
+COPY etc /opt/app/aaf_config/etc
+COPY local/*.props /opt/app/aaf_config/local/
+COPY public /opt/app/aaf_config/public
+COPY logs /opt/app/aaf_config/logs
+COPY bin /opt/app/aaf_config/bin
+
+ENTRYPOINT ["/bin/bash","/opt/app/aaf_config/bin/agent.sh"]
+CMD []
+
diff --git a/auth/docker/Dockerfile.core b/auth/docker/Dockerfile.core
new file mode 100644
index 00000000..c4e8a461
--- /dev/null
+++ b/auth/docker/Dockerfile.core
@@ -0,0 +1,10 @@
+FROM rmannfv/aaf-base:xenial
+MAINTAINER AAF Team, AT&T 2018
+ENV VERSION=${AAF_VERSION}
+
+LABEL description="aaf_core"
+LABEL version=${AAF_VERSION}
+
+COPY lib /opt/app/aaf/lib
+COPY bin /opt/app/aaf/bin
+
diff --git a/auth/docker/Dockerfile.ms b/auth/docker/Dockerfile.ms
new file mode 100644
index 00000000..121bd06c
--- /dev/null
+++ b/auth/docker/Dockerfile.ms
@@ -0,0 +1,19 @@
+FROM onap/aaf/aaf_core:${AAF_VERSION}
+MAINTAINER AAF Team, AT&T 2018
+ENV VERSION=${AAF_VERSION}
+
+LABEL description="aaf_${AAF_COMPONENT}"
+LABEL version=${AAF_VERSION}
+
+CMD ["/bin/bash","-c","/opt/app/aaf/bin/${AAF_COMPONENT}"]
+
+# For Debugging installation
+# CMD ["/bin/bash","-c","pwd;cd /opt/app/osaaf;find /opt/app/osaaf -depth;df -k; cat /opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT};cat /etc/hosts;/opt/app/aaf/${AAF_COMPONENT}/bin/${AAF_COMPONENT}"]
+# Java Debugging VM Args
+# "-Xdebug",\
+# "-Xnoagent",\
+# "-Xrunjdwp:transport=dt_socket,server=y,suspend=n,address=8000",\
+
+# TLS Debugging VM Args
+# "-Djavax.net.debug","ssl", \
+
diff --git a/auth/docker/agent.sh b/auth/docker/agent.sh
new file mode 100644
index 00000000..68027947
--- /dev/null
+++ b/auth/docker/agent.sh
@@ -0,0 +1,9 @@
+#!/bin/bash
+. ./d.props
+docker run \
+ -it \
+ --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \
+ --name aaf_agent_$USER \
+ ${ORG}/${PROJECT}/aaf_config:${VERSION} \
+ /bin/bash $*
+docker container rm aaf_agent_$USER > /dev/null
diff --git a/auth/docker/d.props b/auth/docker/d.props.init
index e56d4597..d65c11bb 100644
--- a/auth/docker/d.props
+++ b/auth/docker/d.props.init
@@ -2,9 +2,7 @@
ORG=onap
PROJECT=aaf
DOCKER_REPOSITORY=nexus3.onap.org:10003
-OLD_VERSION=2.1.0-SNAPSHOT
-NEW_VERSION=2.1.1
-VERSION=2.1.1-SNAPSHOT
+VERSION=2.1.2-SNAPSHOT
CONF_ROOT_DIR=/opt/app/osaaf
# Local Env info
@@ -12,4 +10,3 @@ HOSTNAME=
HOST_IP=
CASS_HOST=
-
diff --git a/auth/docker/dbuild.sh b/auth/docker/dbuild.sh
index ce299171..ec5cd5cb 100755
--- a/auth/docker/dbuild.sh
+++ b/auth/docker/dbuild.sh
@@ -3,8 +3,30 @@
# Docker Building Script. Reads all the components generated by install, on per-version basis
#
# Pull in Variables from d.props
+if [ ! -e ./d.props ]; then
+ cp d.props.init d.props
+fi
+
. ./d.props
-# TODO add ability to do DEBUG settings
+
+# Create the Config (Security) Image
+sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.config > ../sample/Dockerfile
+cd ..
+cp ../cadi/aaf/target/aaf-cadi-aaf-${VERSION}-full.jar sample/bin
+docker build -t ${ORG}/${PROJECT}/aaf_config:${VERSION} sample
+rm sample/Dockerfile sample/bin/aaf-cadi-aaf-${VERSION}-full.jar
+cd -
+
+exit
+
+# Second, build a core Docker Image
+echo Building aaf_$AAF_COMPONENT...
+# Apply currrent Properties to Docker file, and put in place.
+sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.core > ../aaf_${VERSION}/Dockerfile
+cd ..
+docker build -t ${ORG}/${PROJECT}/aaf_core:${VERSION} aaf_${VERSION}
+rm aaf_${VERSION}/Dockerfile
+cd -
if ["$1" == ""]; then
AAF_COMPONENTS=`ls ../aaf_*HOT/bin | grep -v '\.'`
@@ -14,11 +36,9 @@ fi
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
echo Building aaf_$AAF_COMPONENT...
- sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile > ../aaf_${VERSION}/Dockerfile
+ sed -e 's/${AAF_VERSION}/'${VERSION}'/g' -e 's/${AAF_COMPONENT}/'${AAF_COMPONENT}'/g' Dockerfile.ms > ../aaf_${VERSION}/Dockerfile
cd ..
- docker build -t ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
- docker tag ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${OLD_VERSION}
- docker tag ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${NEW_VERSION}
+ docker build -t ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION} aaf_${VERSION}
rm aaf_${VERSION}/Dockerfile
cd -
done
diff --git a/auth/docker/dclean.sh b/auth/docker/dclean.sh
index 7887b677..163272d0 100644
--- a/auth/docker/dclean.sh
+++ b/auth/docker/dclean.sh
@@ -8,8 +8,10 @@ else
AAF_COMPONENTS=$1
fi
+docker image rm $ORG/$PROJECT/aaf_core:${VERSION}
+
echo "Y" | docker container prune
for AAF_COMPONENT in ${AAF_COMPONENTS}; do
- docker image rm $DOCKER_REPOSITORY/$ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
+ docker image rm $ORG/$PROJECT/aaf_$AAF_COMPONENT:${VERSION}
done
echo "Y" | docker image prune
diff --git a/auth/docker/drun.sh b/auth/docker/drun.sh
index 7aee605c..a7378b75 100644
--- a/auth/docker/drun.sh
+++ b/auth/docker/drun.sh
@@ -2,6 +2,18 @@
# Pull in Variables from d.props
. ./d.props
+# Create Volumes, if not exist already
+for VOL in aaf_config aaf_cass_data; do
+ HAS_VOLUME=`docker volume ls | grep $VOL`
+ if [ "$HAS_VOLUME" = "" ]; then
+ docker volume create --name $VOL
+ fi
+done
+ docker run \
+ -d \
+ --name aaf_config \
+ --mount 'type=volume,src=aaf_config,dst=/opt/app/osaaf,volume-driver=local' \
+ ${ORG}/${PROJECT}/aaf_agent:${VERSION}
if [ "$1" == "" ]; then
AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
@@ -49,5 +61,5 @@ for AAF_COMPONENT in ${AAF_COMPONENTS}; do
${LINKS} \
--publish $PORTMAP \
--mount type=bind,source=$CONF_ROOT_DIR,target=/opt/app/osaaf \
- ${DOCKER_REPOSITORY}/${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
+ ${ORG}/${PROJECT}/aaf_${AAF_COMPONENT}:${VERSION}
done
diff --git a/auth/docker/dstart.sh b/auth/docker/dstart.sh
index 0fb993ae..ae6ed02d 100644
--- a/auth/docker/dstart.sh
+++ b/auth/docker/dstart.sh
@@ -2,6 +2,7 @@
# Pull in Props
. ./d.props
+
if [ "$1" == "" ]; then
AAF_COMPONENTS=`ls -r ../aaf_${VERSION}/bin | grep -v '\.'`
else