summaryrefslogtreecommitdiffstats
path: root/sdc-os-chef/scripts/docker_run.sh
diff options
context:
space:
mode:
authorAvi Ziv <avi.ziv@amdocs.com>2018-03-15 13:21:44 +0200
committerMichael Lando <ml636r@att.com>2018-04-24 07:50:44 +0000
commitc175a0de2f05d37c1c774684318a525eb96bb59b (patch)
tree0c8bd736fdbcb512fefce93ec841fd3537336206 /sdc-os-chef/scripts/docker_run.sh
parent08d85958f46d1de9aec9cf459632b5be040063be (diff)
Create on boarding docker
Add BE and Cassandra init docker images Change-Id: Id9d767c73fc946819cec821b4634ce650cbb22fd Issue-ID: SDC-781 Signed-off-by: Michael Lando <ml636r@att.com>
Diffstat (limited to 'sdc-os-chef/scripts/docker_run.sh')
-rwxr-xr-xsdc-os-chef/scripts/docker_run.sh54
1 files changed, 52 insertions, 2 deletions
diff --git a/sdc-os-chef/scripts/docker_run.sh b/sdc-os-chef/scripts/docker_run.sh
index b7d96d5c62..2c12fffd7d 100755
--- a/sdc-os-chef/scripts/docker_run.sh
+++ b/sdc-os-chef/scripts/docker_run.sh
@@ -6,6 +6,7 @@ SDC_PASSWORD="Aa1234%^!"
JETTY_BASE="/var/lib/jetty"
BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4000,server=y,suspend=n -Xmx1536m -Xms1536m"
FE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=6000,server=y,suspend=n -Xmx256m -Xms256m"
+ONBOARD_BE_JAVA_OPTIONS="-Xdebug -agentlib:jdwp=transport=dt_socket,address=4001,server=y,suspend=n -Xmx1g -Xms1g"
SIM_JAVA_OPTIONS=" -Xmx128m -Xms128m -Xss1m"
API_TESTS_JAVA_OPTIONS="-Xmx512m -Xms512m"
UI_TESTS_JAVA_OPTIONS="-Xmx1024m -Xms1024m"
@@ -38,6 +39,7 @@ function dir_perms {
mkdir -p ${WORKSPACE}/data/logs/BE/SDC/SDC-BE
mkdir -p ${WORKSPACE}/data/logs/FE/SDC/SDC-FE
mkdir -p ${WORKSPACE}/data/logs/sdc-api-tests/ExtentReport
+ mkdir -p ${WORKSPACE}/data/logs/ONBOARD/SDC/ONBOARD-BE
mkdir -p ${WORKSPACE}/data/logs/sdc-api-tests/target
mkdir -p ${WORKSPACE}/data/logs/sdc-ui-tests/ExtentReport
mkdir -p ${WORKSPACE}/data/logs/sdc-ui-tests/target
@@ -69,19 +71,31 @@ function probe_be {
be_stat=false
docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1
rc=$?
-if [[ $rc == 200 ]]; then
+if [[ $rc == 0 ]]; then
echo DOCKER start finished in $2 seconds
be_stat=true
fi
}
+function probe_sdc_onboard_be {
+
+sdc_onboard_be_stat=false
+docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1
+rc=$?
+if [[ $rc == 0 ]]; then
+ echo DOCKER start finished in $2 seconds
+ sdc_onboard_be_stat=true
+fi
+
+}
+
function probe_fe {
fe_stat=false
docker exec $1 /var/lib/ready-probe.sh > /dev/null 2>&1
rc=$?
-if [[ $rc == 200 ]]; then
+if [[ $rc == 0 ]]; then
echo DOCKER start finished in $2 seconds
fe_stat=true
fi
@@ -144,6 +158,10 @@ function monitor_docker {
elif [ "$1" == "sdc-FE" ]; then
probe_fe $1 $TIME
if [[ $fe_stat == true ]]; then break; fi
+ elif [ "$1" == "sdc-onboard-BE" ]; then
+ probe_sdc_onboard_be $1 $TIME
+ if [[ $sdc_onboard_be_stat == true ]]; then break; fi
+
else
probe_docker $1 $TIME
if [[ $match_result == true ]]; then break; fi
@@ -189,6 +207,7 @@ RELEASE=latest
LOCAL=false
RUNTESTS=false
DEBUG_PORT="--publish 4000:4000"
+ONBOARD_DEBUG_PORT="--publish 4001:4000"
while [ $# -gt 0 ]; do
case $1 in
@@ -319,6 +338,18 @@ docker_logs sdc-cs-init
if [[ $rc != 0 ]]; then exit $rc; fi
}
+#Onboard Cassandra-init
+function sdc-cs-onboard-init {
+echo "docker run sdc-cs-onboard-init..."
+if [ ${LOCAL} = false ]; then
+ docker pull ${PREFIX}/sdc-onboard-cassandra-init:${RELEASE}
+fi
+docker run --name sdc-cs-onboard-init --env RELEASE="${RELEASE}" --env CS_HOST_IP=${IP} --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env CS_PASSWORD="${CS_PASSWORD}" --env ENVNAME="${DEP_ENV}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/CS:/var/lib/cassandra --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --volume ${WORKSPACE}/data/CS-Init:/root/chef-solo/cache ${PREFIX}/sdc-onboard-cassandra-init:${RELEASE}
+rc=$?
+docker_logs sdc-onboard-cs-init
+if [[ $rc != 0 ]]; then exit $rc; fi
+}
+
#Kibana
function sdc-kbn {
echo "docker run sdc-kibana..."
@@ -355,6 +386,23 @@ docker_logs sdc-BE-init
if [[ $rc != 0 ]]; then exit $rc; fi
}
+# Onboard Back-End
+function sdc-onboard-BE {
+
+dir_perms
+# Back-End
+echo "docker run sdc-onboard-BE ..."
+if [ ${LOCAL} = false ]; then
+ docker pull ${PREFIX}/sdc-onboard-backend:${RELEASE}
+else
+ ADDITIONAL_ARGUMENTS=${ONBOARD_DEBUG_PORT}
+fi
+docker run --detach --name sdc-onboard-BE --env HOST_IP=${IP} --env ENVNAME="${DEP_ENV}" --env cassandra_ssl_enabled="false" --env SDC_CLUSTER_NAME="SDC-CS-${DEP_ENV}" --env SDC_USER="${SDC_USER}" --env SDC_PASSWORD="${SDC_PASSWORD}" --env JAVA_OPTIONS="${ONBOARD_BE_JAVA_OPTIONS}" --log-driver=json-file --log-opt max-size=100m --log-opt max-file=10 --ulimit memlock=-1:-1 --ulimit nofile=4096:100000 --volume /etc/localtime:/etc/localtime:ro --volume ${WORKSPACE}/data/logs/ONBOARD:/var/lib/jetty/logs --volume ${WORKSPACE}/data/environments:/root/chef-solo/environments --publish 8445:8445 --publish 8081:8081 ${ADDITIONAL_ARGUMENTS} ${PREFIX}/sdc-onboard-backend:${RELEASE}
+
+echo "please wait while sdc-onboard-BE is starting..."
+monitor_docker sdc-onboard-BE
+}
+
# Front-End
function sdc-FE {
@@ -431,6 +479,8 @@ if [ -z "${DOCKER}" ]; then
sdc-cs
sdc-cs-init
# sdc-kbn
+ sdc-cs-onboard-init
+ sdc-onboard-BE
sdc-BE
sdc-BE-init
sdc-FE