aboutsummaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorDaniel Rose <dr695h@att.com>2019-09-09 15:59:03 +0000
committerGerrit Code Review <gerrit@onap.org>2019-09-09 15:59:03 +0000
commit2455d20794f872f83b57c395aa0ecc094bf98f36 (patch)
tree5d7b98401f1729584c13f6786539cbe7c304577d /scripts
parent5fed29a9d3449ad46f5309b4ffa3e76a948881c2 (diff)
parente81736c80a95e8766f4305f5bb63e56f14dd798e (diff)
Merge "CSIT uplift for CBS, generalized DFC, bugfixes, stability, traceability"
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/dcaegen2-collectors-datafile/dfc-containers-clean.sh18
-rwxr-xr-xscripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh2
-rwxr-xr-xscripts/dcaegen2-collectors-datafile/dfc-management/dfc-restart.sh6
-rwxr-xr-xscripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh39
-rw-r--r--scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml20
-rwxr-xr-xscripts/kill-instance.sh13
6 files changed, 69 insertions, 29 deletions
diff --git a/scripts/dcaegen2-collectors-datafile/dfc-containers-clean.sh b/scripts/dcaegen2-collectors-datafile/dfc-containers-clean.sh
index 03919343..0e7c34ea 100755
--- a/scripts/dcaegen2-collectors-datafile/dfc-containers-clean.sh
+++ b/scripts/dcaegen2-collectors-datafile/dfc-containers-clean.sh
@@ -1,11 +1,15 @@
#!/bin/bash
-
# Kill dfc and all simulator
-docker kill dfc_app
-docker kill dfc_dr-sim
-docker kill dfc_dr-redir-sim
-docker kill dfc_mr-sim
-docker kill dfc_sftp-server
-docker kill dfc_ftpes-server-vsftpd
+running_containers=$(docker ps --filter name=dfc_ -q)
+
+
+if [ -z "$running_containers" ]
+then
+ echo "No container requires termination"
+else
+ echo "Stopping and removing containers"
+ docker stop $running_containers
+ docker rm $running_containers
+fi
diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh
index 39f2d0d7..491b6405 100755
--- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh
+++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-kill.sh
@@ -1,4 +1,4 @@
#!/bin/bash
-docker kill dfc_app \ No newline at end of file
+docker kill dfc_app0 \ No newline at end of file
diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-restart.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-restart.sh
index 8478bcb0..c79467a4 100755
--- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-restart.sh
+++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-restart.sh
@@ -1,10 +1,10 @@
#!/bin/bash
-#Restart DFC app
+#Restart DFC app
-docker restart dfc_app
+docker restart dfc_app0
-DFC_APP="$(docker ps -q --filter='name=dfc_app')"
+DFC_APP="$(docker ps -q --filter='name=dfc_app0')"
#Wait for initialization of docker container for dfc app
diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh
index 4bec4ff8..68e0745d 100755
--- a/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh
+++ b/scripts/dcaegen2-collectors-datafile/dfc-management/dfc-start.sh
@@ -1,20 +1,35 @@
#!/bin/bash
-#Start DFC app
+set -x
-docker-compose up -d
+#Start DFC app
-DFC_APP="$(docker ps -q --filter='name=dfc_app')"
+DOCKER_SIM_NWNAME="dfcnet"
+echo "Creating docker network $DOCKER_SIM_NWNAME, if needed"
+docker network ls| grep $DOCKER_SIM_NWNAME > /dev/null || docker network create $DOCKER_SIM_NWNAME
+
+docker-compose up -d
+
+DFC_APP="$(docker ps -q --filter='name=dfc_app0')"
#Wait for initialization of docker containers for dfc app and all simulators
for i in {1..10}; do
-if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ]
- then
- echo "DFC app Running"
- break
- else
- echo sleep $i
- sleep $i
- fi
-done
+ if [ $(docker inspect --format '{{ .State.Running }}' $DFC_APP) ]
+ then
+ echo "DFC app Running"
+
+ # enable TRACE logging of DFC
+ docker exec $DFC_APP /bin/sh -c " sed -i 's/org.onap.dcaegen2.collectors.datafile: WARN/org.onap.dcaegen2.collectors.datafile: TRACE/g' /opt/app/datafile/config/application.yaml"
+ #enable TRACE logging of spring-framework
+ docker exec $DFC_APP /bin/sh -c " sed -i 's/org.springframework.data: ERROR/org.springframework.data: TRACE/g' /opt/app/datafile/config/application.yaml"
+
+ docker restart $DFC_APP
+ sleep 10
+
+ break
+ else
+ echo sleep $i
+ sleep $i
+ fi
+done
diff --git a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml
index 28dfbbf8..9738bcde 100644
--- a/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml
+++ b/scripts/dcaegen2-collectors-datafile/dfc-management/docker-compose.yml
@@ -1,9 +1,23 @@
version: '2'
+networks:
+ dfcnet:
+ external:
+ name: dfcnet
services:
dfc:
- network_mode: "host"
- image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:latest
- container_name: dfc_app
+ #image fron Nexus
+ #image: nexus3.onap.org:10001/onap/org.onap.dcaegen2.collectors.datafile.datafile-app-server:latest
+ image: yanhuanwang/dfc:latest
+ #local image for test purposes
+ #image: org.onap.dcaegen2.collectors.datafile.datafile-app-server:latest
+ container_name: dfc_app0
ports:
- "8100:8100"
- "8433:8433"
+ networks:
+ dfcnet: null
+ environment:
+ CONSUL_HOST: "consul-server"
+ CONSUL_PORT: 8500
+ CONFIG_BINDING_SERVICE: "config-binding-service"
+ HOSTNAME: "dfc_app0"
diff --git a/scripts/kill-instance.sh b/scripts/kill-instance.sh
index 525f96e4..59970986 100755
--- a/scripts/kill-instance.sh
+++ b/scripts/kill-instance.sh
@@ -18,7 +18,14 @@
mkdir -p $WORKSPACE/archives
-docker logs $1 >> $WORKSPACE/archives/$1.log
-docker kill $1
-docker rm $1
+running_containers=$(docker ps --filter name=$1 -q)
+if [ -z "$running_containers" ]
+then
+ echo "$1 already terminated"
+else
+ echo "Stopping and removing containers"
+ docker logs $running_containers >> $WORKSPACE/archives/$1.log
+ docker stop $running_containers
+ docker rm $running_containers
+fi