From: John Keeney Date: Wed, 24 Nov 2021 10:03:32 +0000 (+0000) Subject: Merge "Rename enrichment coordinator service to information coordinator service" X-Git-Tag: 1.2.0~31 X-Git-Url: https://gerrit.o-ran-sc.org/r/gitweb?a=commitdiff_plain;h=e85c7e3fd551f217d93357915594980441fc6062;hp=c6916032d124066c6009e0db070a0cebb9c1ea5f;p=nonrtric.git Merge "Rename enrichment coordinator service to information coordinator service" --- diff --git a/test/common/cr_api_functions.sh b/test/common/cr_api_functions.sh index a9acd6e5..1b82ea02 100644 --- a/test/common/cr_api_functions.sh +++ b/test/common/cr_api_functions.sh @@ -122,7 +122,11 @@ __CR_statisics_setup() { CR_INSTANCE_KUBE=$(($CR_INSTANCE-1)) echo -n " CR-$CR_INSTANCE_KUBE $CR_APP_NAME-$CR_INSTANCE_KUBE $KUBE_SIM_NAMESPACE " else - echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}_cr_$CR_INSTANCE " + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}_cr_$CR_INSTANCE " + else + echo -n " CR_$CR_INSTANCE ${CR_APP_NAME}-cr-$CR_INSTANCE " + fi fi done } @@ -161,7 +165,11 @@ __cr_set_protocoll() { for ((CR_INSTANCE=0; CR_INSTANCE<$MAX_CR_APP_COUNT; CR_INSTANCE++ )); do CR_DOCKER_INSTANCE=$(($CR_INSTANCE+1)) # CR_SERVICE_PATH is the base path to cr - __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"_cr_"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"_cr_"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + else + __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"-cr-"${CR_DOCKER_INSTANCE}":"$2 # docker access, container->container and script->container via proxy + fi if [ $RUNMODE == "KUBE" ]; then __CR_SERVICE_PATH=$1"://"$CR_APP_NAME"-"$CR_INSTANCE.$CR_APP_NAME"."$KUBE_SIM_NAMESPACE":"$3 # kube access, pod->svc and script->svc via proxy fi @@ -285,7 +293,11 @@ start_cr() { app_data="" cntr=1 while [ $cntr -le $CR_APP_COUNT ]; do - app=$CR_APP_NAME"_cr_"$cntr + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app=$CR_APP_NAME"_cr_"$cntr + else + app=$CR_APP_NAME"-cr-"$cntr + fi app_data="$app_data $app" let cntr=cntr+1 done @@ -297,7 +309,11 @@ start_cr() { cntr=1 #Counter for docker instance, starts on 1 cntr2=0 #Couter for env var name, starts with 0 to be compablible with kube while [ $cntr -le $CR_APP_COUNT ]; do - app=$CR_APP_NAME"_cr_"$cntr + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app=$CR_APP_NAME"_cr_"$cntr + else + app=$CR_APP_NAME"-cr-"$cntr + fi __dynvar="CR_SERVICE_PATH_"$cntr2 __check_service_start $app ${!__dynvar}$CR_ALIVE_URL let cntr=cntr+1 diff --git a/test/common/genstat.sh b/test/common/genstat.sh index 2adce1f2..e186f099 100755 --- a/test/common/genstat.sh +++ b/test/common/genstat.sh @@ -31,7 +31,6 @@ print_usage() { echo "or" echo "Usage: genstat.sh KUBE [ ]*" } -DD=$@ STARTTIME=-1 if [ $# -lt 4 ]; then @@ -67,7 +66,6 @@ fi echo "Name;Time;PIDS;CPU perc;Mem perc" > $LOGFILE -echo $DD >> $LOGFILE if [ "$STARTTIME" -ne -1 ]; then STARTTIME=$(($SECONDS-$STARTTIME)) diff --git a/test/common/mr_api_functions.sh b/test/common/mr_api_functions.sh index 20021316..c6feb459 100755 --- a/test/common/mr_api_functions.sh +++ b/test/common/mr_api_functions.sh @@ -372,6 +372,9 @@ __dmaapmr_export_vars() { export MR_KAFKA_SERVICE_PATH export MR_ZOOKEEPER_SERVICE_PATH + + export MR_KAFKA_KUBE_NODE_PORT + export MR_KAFKA_DOCKER_LOCALHOST_PORT } # Export env vars for config files, docker compose and kube resources @@ -509,6 +512,9 @@ start_mr() { __check_service_start $MR_DMAAP_APP_NAME $MR_DMAAP_PATH$MR_DMAAP_ALIVE_URL + echo " Kafka TCP node port $MR_KAFKA_KUBE_NODE_PORT" + + if [ $# -gt 0 ]; then if [ $(($#%3)) -eq 0 ]; then while [ $# -gt 0 ]; do @@ -608,6 +614,8 @@ start_mr() { __check_service_start $MR_DMAAP_APP_NAME $MR_DMAAP_PATH$MR_DMAAP_ALIVE_URL + echo " Kafka TCP node port $MR_KAFKA_DOCKER_LOCALHOST_PORT" + if [ $# -gt 0 ]; then if [ $(($#%3)) -eq 0 ]; then while [ $# -gt 0 ]; do diff --git a/test/common/pa_api_functions.sh b/test/common/pa_api_functions.sh index 53670605..219aedb3 100644 --- a/test/common/pa_api_functions.sh +++ b/test/common/pa_api_functions.sh @@ -533,7 +533,11 @@ prepare_consul_config() { ric_id=${ric%.*.*} #extract pod id from full hosthame ric_id=$(echo "$ric_id" | tr '-' '_') else - ric_id=$ric + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + ric_id=$ric + else + ric_id=$(echo "$ric" | tr '-' '_') #ric id still needs underscore as it is different from the container name + fi fi echo " Found a1 sim: "$ric_id config_json=$config_json"\n \"name\": \"$ric_id\"," diff --git a/test/common/ricsim_api_functions.sh b/test/common/ricsim_api_functions.sh index 0a1a8e36..435c208f 100644 --- a/test/common/ricsim_api_functions.sh +++ b/test/common/ricsim_api_functions.sh @@ -103,9 +103,15 @@ __RICSIM_statisics_setup() { echo -n " RICSIM_G2_$RICSIM_INSTANCE_KUBE ${RIC_SIM_PREFIX}-g2-$RICSIM_INSTANCE_KUBE $KUBE_A1SIM_NAMESPACE " echo -n " RICSIM_G3_$RICSIM_INSTANCE_KUBE ${RIC_SIM_PREFIX}-g3-$RICSIM_INSTANCE_KUBE $KUBE_A1SIM_NAMESPACE " else - echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g1_$RICSIM_INSTANCE " - echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g2_$RICSIM_INSTANCE " - echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g3_$RICSIM_INSTANCE " + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g1_$RICSIM_INSTANCE " + echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g2_$RICSIM_INSTANCE " + echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}_g3_$RICSIM_INSTANCE " + else + echo -n " RICSIM_G1_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g1-$RICSIM_INSTANCE " + echo -n " RICSIM_G2_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g2-$RICSIM_INSTANCE " + echo -n " RICSIM_G3_$RICSIM_INSTANCE ${RIC_SIM_PREFIX}-g3-$RICSIM_INSTANCE " + fi fi done } @@ -114,16 +120,10 @@ __RICSIM_statisics_setup() { RIC_SIM_HTTPX="http" -RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT -#Vars for A1 interface version and container count -G1_A1_VERSION="" -G2_A1_VERSION="" -G3_A1_VERSION="" -G4_A1_VERSION="" -G5_A1_VERSION="" +#Vars for container count G1_COUNT=0 G2_COUNT=0 G3_COUNT=0 @@ -139,7 +139,6 @@ use_simulator_http() { echo -e $BOLD"RICSIM protocol setting"$EBOLD echo -e " Using $BOLD http $EBOLD towards the simulators" RIC_SIM_HTTPX="http" - RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME RIC_SIM_PORT=$RIC_SIM_INTERNAL_PORT echo "" } @@ -148,7 +147,6 @@ use_simulator_https() { echo -e $BOLD"RICSIM protocol setting"$EBOLD echo -e " Using $BOLD https $EBOLD towards the simulators" RIC_SIM_HTTPX="https" - RIC_SIM_HOST=$RIC_SIM_HTTPX"://"$LOCALHOST_NAME RIC_SIM_PORT=$RIC_SIM_INTERNAL_SECURE_PORT echo "" } @@ -208,19 +206,14 @@ start_ric_simulators() { #Set env var for simulator count and A1 interface vesion for the given group if [ $1 == "$RIC1" ]; then G1_COUNT=$2 - G1_A1_VERSION=$3 elif [ $1 == "$RIC2" ]; then G2_COUNT=$2 - G2_A1_VERSION=$3 elif [ $1 == "$RIC3" ]; then G3_COUNT=$2 - G3_A1_VERSION=$3 elif [ $1 == "$RIC4" ]; then G4_COUNT=$2 - G4_A1_VERSION=$3 elif [ $1 == "$RIC5" ]; then G5_COUNT=$2 - G5_A1_VERSION=$3 else ((RES_CONF_FAIL++)) __print_err "need three args, $RIC1|$RIC2|$RIC3|$RIC4|$RIC5 " $@ @@ -275,22 +268,34 @@ start_ric_simulators() { # Create .env file to compose project, all ric container will get this prefix echo "COMPOSE_PROJECT_NAME="$RIC_SIM_PREFIX > $SIM_GROUP/$RIC_SIM_COMPOSE_DIR/.env - export G1_A1_VERSION - export G2_A1_VERSION - export G3_A1_VERSION - export G4_A1_VERSION - export G5_A1_VERSION + #extract service name (group), g1, g2, g3, g4 or g5 from var $1 + #E.g. ricsim_g1 -> g1 is the service name + TMP_GRP=$1 + RICSIM_COMPOSE_SERVICE_NAME=$(echo "${TMP_GRP##*_}") + + export RICSIM_COMPOSE_A1_VERSION=$3 + export RICSIM_COMPOSE_SERVICE_NAME export RIC_SIM_INTERNAL_PORT export RIC_SIM_INTERNAL_SECURE_PORT export RIC_SIM_CERT_MOUNT_DIR export DOCKER_SIM_NWNAME export RIC_SIM_DISPLAY_NAME - docker_args="--scale g1=$G1_COUNT --scale g2=$G2_COUNT --scale g3=$G3_COUNT --scale g4=$G4_COUNT --scale g5=$G5_COUNT" + docker_args="--no-recreate --scale $RICSIM_COMPOSE_SERVICE_NAME=$2" + + #Create a list of contsiner names + #Will be __ + # or + # -- app_data="" cntr=1 + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app_name_prefix=$RIC_SIM_PREFIX"_"$RICSIM_COMPOSE_SERVICE_NAME"_" + else + app_name_prefix=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-" + fi while [ $cntr -le $2 ]; do - app=$1"_"$cntr + app=$app_name_prefix$cntr app_data="$app_data $app" let cntr=cntr+1 done @@ -299,7 +304,11 @@ start_ric_simulators() { cntr=1 while [ $cntr -le $2 ]; do - app=$1"_"$cntr + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + app=$RIC_SIM_PREFIX"_"$RICSIM_COMPOSE_SERVICE_NAME"_"$cntr + else + app=$RIC_SIM_PREFIX"-"$RICSIM_COMPOSE_SERVICE_NAME"-"$cntr + fi __check_service_start $app $RIC_SIM_HTTPX"://"$app:$RIC_SIM_PORT$RIC_SIM_ALIVE_URL let cntr=cntr+1 done @@ -329,7 +338,12 @@ __find_sim_host() { ric_setname="${ricname%-*}" #Extract the stateful set name echo $RIC_SIM_HTTPX"://"$ricname.$ric_setname.$KUBE_A1SIM_NAMESPACE":"$RIC_SIM_PORT else - echo $RIC_SIM_HTTPX"://"$1":"$RIC_SIM_PORT + if [ $DOCKER_COMPOSE_VERION == "V1" ]; then + echo $RIC_SIM_HTTPX"://"$1":"$RIC_SIM_PORT + else + ricname=$(echo "$1" | tr '_' '-') + echo $RIC_SIM_HTTPX"://"$ricname":"$RIC_SIM_PORT + fi fi } diff --git a/test/common/test_env-onap-guilin.sh b/test/common/test_env-onap-guilin.sh index 4ae753c2..3254e062 100755 --- a/test/common/test_env-onap-guilin.sh +++ b/test/common/test_env-onap-guilin.sh @@ -212,6 +212,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/test_env-onap-honolulu.sh b/test/common/test_env-onap-honolulu.sh index 17d738f0..f82d54fe 100755 --- a/test/common/test_env-onap-honolulu.sh +++ b/test/common/test_env-onap-honolulu.sh @@ -256,6 +256,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/test_env-onap-istanbul.sh b/test/common/test_env-onap-istanbul.sh index 2a6268e7..b2b0d2ed 100644 --- a/test/common/test_env-onap-istanbul.sh +++ b/test/common/test_env-onap-istanbul.sh @@ -259,6 +259,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/test_env-oran-cherry.sh b/test/common/test_env-oran-cherry.sh index 513afaaa..b1204ccd 100755 --- a/test/common/test_env-oran-cherry.sh +++ b/test/common/test_env-oran-cherry.sh @@ -259,6 +259,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/test_env-oran-d-release.sh b/test/common/test_env-oran-d-release.sh index 7e495eee..cde9849b 100755 --- a/test/common/test_env-oran-d-release.sh +++ b/test/common/test_env-oran-d-release.sh @@ -278,6 +278,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/test_env-oran-e-release.sh b/test/common/test_env-oran-e-release.sh index fc547feb..cd0d0400 100755 --- a/test/common/test_env-oran-e-release.sh +++ b/test/common/test_env-oran-e-release.sh @@ -304,6 +304,8 @@ MR_DMAAP_COMPOSE_DIR="dmaapmr" # Dir in simulator_grou MR_STUB_COMPOSE_DIR="mrstub" # Dir in simulator_group for mr stub for - docker-compose MR_KAFKA_APP_NAME="message-router-kafka" # Kafka app name, if just named "kafka" the image will not start... MR_KAFKA_PORT=9092 # Kafka port number +MR_KAFKA_DOCKER_LOCALHOST_PORT=30098 # Kafka port number for docker localhost +MR_KAFKA_KUBE_NODE_PORT=30099 # Kafka node port number for kube MR_ZOOKEEPER_APP_NAME="zookeeper" # Zookeeper app name MR_ZOOKEEPER_PORT="2181" # Zookeeper port number MR_DMAAP_HOST_MNT_DIR="/mnt" # Basedir localhost for mounted files diff --git a/test/common/testcase_common.sh b/test/common/testcase_common.sh index b47413a6..e1c90d64 100755 --- a/test/common/testcase_common.sh +++ b/test/common/testcase_common.sh @@ -128,6 +128,11 @@ STOP_AT_ERROR=0 # Applies only to images defined in the test-env files with image names and tags defined as XXXX_RELEASE IMAGE_CATEGORY="DEV" +#Var to indicate docker-compose version, V1 or V2 +#V1 names replicated containers __ +#V2 names replicated containers -- +DOCKER_COMPOSE_VERION="V1" + # Function to indent cmd output with one space indent1() { sed 's/^/ /'; } @@ -783,34 +788,44 @@ echo -e $BOLD"Auto adding included apps"$EBOLD done echo "" +echo -e $BOLD"Test environment info"$EBOLD # Check needed installed sw + +tmp=$(which bash) +if [ $? -ne 0 ] || [ -z "$tmp" ]; then + echo -e $RED"bash is required to run the test environment, pls install"$ERED + exit 1 +fi +echo " bash is installed and using version:" +echo "$(bash --version)" | indent2 + tmp=$(which python3) -if [ $? -ne 0 ] || [ -z tmp ]; then +if [ $? -ne 0 ] || [ -z "$tmp" ]; then echo -e $RED"python3 is required to run the test environment, pls install"$ERED exit 1 fi +echo " python3 is installed and using version: $(python3 --version)" + tmp=$(which docker) -if [ $? -ne 0 ] || [ -z tmp ]; then +if [ $? -ne 0 ] || [ -z "$tmp" ]; then echo -e $RED"docker is required to run the test environment, pls install"$ERED exit 1 fi +echo " docker is installed and using versions:" +echo " $(docker version --format 'Client version {{.Client.Version}} Server version {{.Server.Version}}')" tmp=$(which docker-compose) -if [ $? -ne 0 ] || [ -z tmp ]; then +if [ $? -ne 0 ] || [ -z "$tmp" ]; then if [ $RUNMODE == "DOCKER" ]; then echo -e $RED"docker-compose is required to run the test environment, pls install"$ERED exit 1 fi fi -if [ $RUNMODE == "DOCKER" ]; then - tmp=$(docker-compose version | grep -i 'docker' | grep -i 'compose' | grep -i 'version') - if [[ "$tmp" == *'v2'* ]]; then - echo -e $RED"docker-compose is using docker-compose version 2"$ERED - echo -e $RED"The test environment only support version 1"$ERED - echo -e $RED"Disable version 2 by cmd 'docker-compose disable-v2' and re-run the script "$ERED - exit 1 - fi +tmp=$(docker-compose version --short) +echo " docker-compose installed and using version $tmp" +if [[ "$tmp" == *'v2'* ]]; then + DOCKER_COMPOSE_VERION="V2" fi tmp=$(which kubectl) @@ -821,6 +836,8 @@ if [ $? -ne 0 ] || [ -z tmp ]; then fi else if [ $RUNMODE == "KUBE" ]; then + echo " kubectl is installed and using versions:" + echo $(kubectl version --short=true) | indent2 res=$(kubectl cluster-info 2>&1) if [ $? -ne 0 ]; then echo -e "$BOLD$RED############################################# $ERED$EBOLD" @@ -852,6 +869,8 @@ else fi fi +echo "" + echo -e $BOLD"Checking configured image setting for this test case"$EBOLD #Temp var to check for image variable name errors @@ -1707,6 +1726,10 @@ __clean_containers() { for imagename in $APP_SHORT_NAMES; do docker ps -a --filter "label=nrttest_app=$imagename" --filter "network=$DOCKER_SIM_NWNAME" --format ' {{.Label "nrttest_dp"}}\n{{.Label "nrttest_app"}}\n{{.Names}}' >> $running_contr_file done + running_contr_file_empty="No docker containers running, started by previous test execution" + if [ -s $running_contr_file ]; then + running_contr_file_empty="" + fi # Kill all containers started by the test env - to speed up shut down docker kill $(docker ps -a --filter "label=nrttest_app" --format '{{.Names}}') &> /dev/null @@ -1754,37 +1777,41 @@ __clean_containers() { tab_heading3="$tab_heading3"" " done - echo " $tab_heading1$tab_heading2$tab_heading3"" Actions" - cntr=0 - while read p; do - if (( $cntr % 3 == 0 ));then - row="" - heading=$p - heading_len=$tab_heading1_len - fi - if (( $cntr % 3 == 1));then - heading=$p - heading_len=$tab_heading2_len - fi - if (( $cntr % 3 == 2));then - contr=$p - heading=$p - heading_len=$tab_heading3_len - fi - while (( ${#heading} < $heading_len)); do - heading="$heading"" " - done - row=$row$heading - if (( $cntr % 3 == 2));then - echo -ne $row$SAMELINE - echo -ne " $row ${GREEN}stopping...${EGREEN}${SAMELINE}" - docker stop $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null - echo -ne " $row ${GREEN}stopped removing...${EGREEN}${SAMELINE}" - docker rm --force $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null - echo -e " $row ${GREEN}stopped removed ${EGREEN}" - fi - let cntr=cntr+1 - done <$running_contr_file + if [ ! -z "$running_contr_file_empty" ]; then + echo $running_contr_file_empty | indent1 + else + echo " $tab_heading1$tab_heading2$tab_heading3"" Actions" + cntr=0 + while read p; do + if (( $cntr % 3 == 0 ));then + row="" + heading=$p + heading_len=$tab_heading1_len + fi + if (( $cntr % 3 == 1));then + heading=$p + heading_len=$tab_heading2_len + fi + if (( $cntr % 3 == 2));then + contr=$p + heading=$p + heading_len=$tab_heading3_len + fi + while (( ${#heading} < $heading_len)); do + heading="$heading"" " + done + row=$row$heading + if (( $cntr % 3 == 2));then + echo -ne $row$SAMELINE + echo -ne " $row ${GREEN}stopping...${EGREEN}${SAMELINE}" + docker stop $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null + echo -ne " $row ${GREEN}stopped removing...${EGREEN}${SAMELINE}" + docker rm --force $(docker ps -qa --filter name=${contr} --filter network=$DOCKER_SIM_NWNAME) &> /dev/null + echo -e " $row ${GREEN}stopped removed ${EGREEN}" + fi + let cntr=cntr+1 + done <$running_contr_file + fi echo "" diff --git a/test/simulator-group/consul_cbs/docker-compose.yml b/test/simulator-group/consul_cbs/docker-compose.yml index 105c8750..003dbfa6 100644 --- a/test/simulator-group/consul_cbs/docker-compose.yml +++ b/test/simulator-group/consul_cbs/docker-compose.yml @@ -19,9 +19,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} - + external: true + name: ${DOCKER_SIM_NWNAME} services: consul-server: diff --git a/test/simulator-group/control_panel/docker-compose.yml b/test/simulator-group/control_panel/docker-compose.yml index 94628fad..b860a89d 100644 --- a/test/simulator-group/control_panel/docker-compose.yml +++ b/test/simulator-group/control_panel/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: control-panel: image: ${CONTROL_PANEL_IMAGE} diff --git a/test/simulator-group/cr/docker-compose.yml b/test/simulator-group/cr/docker-compose.yml index 3b63451b..047ec45c 100644 --- a/test/simulator-group/cr/docker-compose.yml +++ b/test/simulator-group/cr/docker-compose.yml @@ -18,8 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: cr: scale: $CR_APP_COUNT diff --git a/test/simulator-group/dmaapadp/docker-compose.yml b/test/simulator-group/dmaapadp/docker-compose.yml index f9dee41c..cea605a9 100644 --- a/test/simulator-group/dmaapadp/docker-compose.yml +++ b/test/simulator-group/dmaapadp/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: dmaap-adapter-service: image: ${DMAAP_ADP_IMAGE} diff --git a/test/simulator-group/dmaapmed/docker-compose.yml b/test/simulator-group/dmaapmed/docker-compose.yml index d0672dfe..e4c9a00f 100644 --- a/test/simulator-group/dmaapmed/docker-compose.yml +++ b/test/simulator-group/dmaapmed/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: dmaap-mediator-service: image: ${DMAAP_MED_IMAGE} diff --git a/test/simulator-group/dmaapmr/app.yaml b/test/simulator-group/dmaapmr/app.yaml index 01c9014b..1a9d40a5 100644 --- a/test/simulator-group/dmaapmr/app.yaml +++ b/test/simulator-group/dmaapmr/app.yaml @@ -80,6 +80,8 @@ spec: ports: - name: http containerPort: $MR_KAFKA_PORT + - name: http-external + containerPort: $MR_KAFKA_KUBE_NODE_PORT env: - name: enableCadi value: 'false' @@ -90,11 +92,11 @@ spec: - name: KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS value: '40000' - name: KAFKA_LISTENER_SECURITY_PROTOCOL_MAP - value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT' + value: 'INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT' - name: KAFKA_ADVERTISED_LISTENERS - value: 'INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH' + value: 'INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH,PLAINTEXT_HOST://localhost:$MR_KAFKA_KUBE_NODE_PORT' - name: KAFKA_LISTENERS - value: 'INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT' + value: 'INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT,PLAINTEXT_HOST://0.0.0.0:$MR_KAFKA_KUBE_NODE_PORT' - name: KAFKA_INTER_BROKER_LISTENER_NAME value: INTERNAL_PLAINTEXT - name: KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE diff --git a/test/simulator-group/dmaapmr/docker-compose.yml b/test/simulator-group/dmaapmr/docker-compose.yml index 2060ce71..492fab1b 100644 --- a/test/simulator-group/dmaapmr/docker-compose.yml +++ b/test/simulator-group/dmaapmr/docker-compose.yml @@ -18,9 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} - + external: true + name: ${DOCKER_SIM_NWNAME} services: zookeeper: image: $ONAP_ZOOKEEPER_IMAGE @@ -51,14 +50,15 @@ services: container_name: $MR_KAFKA_APP_NAME ports: - "$MR_KAFKA_PORT:$MR_KAFKA_PORT" + - "$MR_KAFKA_DOCKER_LOCALHOST_PORT:$MR_KAFKA_DOCKER_LOCALHOST_PORT" environment: enableCadi: 'false' KAFKA_ZOOKEEPER_CONNECT: $MR_ZOOKEEPER_APP_NAME:$MR_ZOOKEEPER_PORT KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000 KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000 - KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT - KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH - KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT + KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT + KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://$MR_KAFKA_SERVICE_PATH,PLAINTEXT_HOST://localhost:$MR_KAFKA_DOCKER_LOCALHOST_PORT + KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:$MR_KAFKA_PORT,PLAINTEXT_HOST://0.0.0.0:$MR_KAFKA_DOCKER_LOCALHOST_PORT KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false' KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf diff --git a/test/simulator-group/dmaapmr/svc.yaml b/test/simulator-group/dmaapmr/svc.yaml index 446c59da..913b13e2 100644 --- a/test/simulator-group/dmaapmr/svc.yaml +++ b/test/simulator-group/dmaapmr/svc.yaml @@ -25,12 +25,17 @@ metadata: run: $MR_KAFKA_APP_NAME autotest: DMAAPMR spec: - type: ClusterIP + type: NodePort ports: - port: $MR_KAFKA_PORT targetPort: $MR_KAFKA_PORT protocol: TCP name: http + - port: $MR_KAFKA_KUBE_NODE_PORT + targetPort: $MR_KAFKA_KUBE_NODE_PORT + protocol: TCP + name: http-external + nodePort: $MR_KAFKA_KUBE_NODE_PORT selector: run: $MR_KAFKA_APP_NAME --- diff --git a/test/simulator-group/ecs/docker-compose.yml b/test/simulator-group/ecs/docker-compose.yml index b0577531..588f8c3e 100644 --- a/test/simulator-group/ecs/docker-compose.yml +++ b/test/simulator-group/ecs/docker-compose.yml @@ -16,8 +16,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: ecs: image: ${ECS_IMAGE} diff --git a/test/simulator-group/httpproxy/docker-compose.yml b/test/simulator-group/httpproxy/docker-compose.yml index c27ba5eb..2c8c61b6 100644 --- a/test/simulator-group/httpproxy/docker-compose.yml +++ b/test/simulator-group/httpproxy/docker-compose.yml @@ -18,8 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: httpproxy: networks: diff --git a/test/simulator-group/kubeproxy/docker-compose.yml b/test/simulator-group/kubeproxy/docker-compose.yml index 7f0f3496..2e644e02 100644 --- a/test/simulator-group/kubeproxy/docker-compose.yml +++ b/test/simulator-group/kubeproxy/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: kubeproxy: image: ${KUBE_PROXY_IMAGE} diff --git a/test/simulator-group/mrstub/docker-compose.yml b/test/simulator-group/mrstub/docker-compose.yml index a1c96c00..608f5c81 100644 --- a/test/simulator-group/mrstub/docker-compose.yml +++ b/test/simulator-group/mrstub/docker-compose.yml @@ -18,8 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: mr-stub: networks: diff --git a/test/simulator-group/ngw/docker-compose.yml b/test/simulator-group/ngw/docker-compose.yml index c897ba7a..7002eaf7 100644 --- a/test/simulator-group/ngw/docker-compose.yml +++ b/test/simulator-group/ngw/docker-compose.yml @@ -18,8 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: nonrtric-gateway: image: ${NRT_GATEWAY_IMAGE} diff --git a/test/simulator-group/policy_agent/docker-compose.yml b/test/simulator-group/policy_agent/docker-compose.yml index 22611516..4b42b42e 100644 --- a/test/simulator-group/policy_agent/docker-compose.yml +++ b/test/simulator-group/policy_agent/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: policy-agent: image: ${POLICY_AGENT_IMAGE} diff --git a/test/simulator-group/prodstub/docker-compose.yml b/test/simulator-group/prodstub/docker-compose.yml index e46c5467..e05d3ad0 100644 --- a/test/simulator-group/prodstub/docker-compose.yml +++ b/test/simulator-group/prodstub/docker-compose.yml @@ -18,8 +18,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: producer-stub: networks: diff --git a/test/simulator-group/rapp_catalogue/docker-compose.yml b/test/simulator-group/rapp_catalogue/docker-compose.yml index 3dbd45b7..7c644b9f 100644 --- a/test/simulator-group/rapp_catalogue/docker-compose.yml +++ b/test/simulator-group/rapp_catalogue/docker-compose.yml @@ -17,8 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: rapp-catalogue: image: ${RAPP_CAT_IMAGE} diff --git a/test/simulator-group/ric/docker-compose.yml b/test/simulator-group/ric/docker-compose.yml index a6358c7a..3515973d 100644 --- a/test/simulator-group/ric/docker-compose.yml +++ b/test/simulator-group/ric/docker-compose.yml @@ -21,11 +21,11 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} + external: true + name: ${DOCKER_SIM_NWNAME} services: - g1: + ${RICSIM_COMPOSE_SERVICE_NAME}: image: ${RIC_SIM_IMAGE} networks: - default @@ -33,7 +33,7 @@ services: - ${RIC_SIM_INTERNAL_PORT}/tcp - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp environment: - - A1_VERSION=${G1_A1_VERSION} + - A1_VERSION=${RICSIM_COMPOSE_A1_VERSION} - REMOTE_HOSTS_LOGGING=1 - ALLOW_HTTP=true - DUPLICATE_CHECK=1 @@ -42,75 +42,3 @@ services: labels: - "nrttest_app=RICSIM" - "nrttest_dp=${RIC_SIM_DISPLAY_NAME}" - - g2: - image: ${RIC_SIM_IMAGE} - networks: - - default - ports: - - ${RIC_SIM_INTERNAL_PORT}/tcp - - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp - environment: - - A1_VERSION=${G2_A1_VERSION} - - REMOTE_HOSTS_LOGGING=1 - - ALLOW_HTTP=true - - DUPLICATE_CHECK=1 - volumes: - - ${RIC_SIM_CERT_MOUNT_DIR}:/usr/src/app/cert:ro - labels: - - "nrttest_app=RICSIM" - - "nrttest_dp=${RIC_SIM_DISPLAY_NAME}" - - g3: - image: ${RIC_SIM_IMAGE} - networks: - - default - ports: - - ${RIC_SIM_INTERNAL_PORT}/tcp - - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp - environment: - - A1_VERSION=${G3_A1_VERSION} - - REMOTE_HOSTS_LOGGING=1 - - ALLOW_HTTP=true - - DUPLICATE_CHECK=1 - volumes: - - ${RIC_SIM_CERT_MOUNT_DIR}:/usr/src/app/cert:ro - labels: - - "nrttest_app=RICSIM" - - "nrttest_dp=${RIC_SIM_DISPLAY_NAME}" - - g4: - image: ${RIC_SIM_IMAGE} - networks: - - default - ports: - - ${RIC_SIM_INTERNAL_PORT}/tcp - - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp - environment: - - A1_VERSION=${G4_A1_VERSION} - - REMOTE_HOSTS_LOGGING=1 - - ALLOW_HTTP=true - - DUPLICATE_CHECK=1 - volumes: - - ${RIC_SIM_CERT_MOUNT_DIR}:/usr/src/app/cert:ro - labels: - - "nrttest_app=RICSIM" - - "nrttest_dp=${RIC_SIM_DISPLAY_NAME}" - - g5: - image: ${RIC_SIM_IMAGE} - networks: - - default - ports: - - ${RIC_SIM_INTERNAL_PORT}/tcp - - ${RIC_SIM_INTERNAL_SECURE_PORT}/tcp - environment: - - A1_VERSION=${G5_A1_VERSION} - - REMOTE_HOSTS_LOGGING=1 - - ALLOW_HTTP=true - - DUPLICATE_CHECK=1 - volumes: - - ${RIC_SIM_CERT_MOUNT_DIR}:/usr/src/app/cert:ro - labels: - - "nrttest_app=RICSIM" - - "nrttest_dp=${RIC_SIM_DISPLAY_NAME}" \ No newline at end of file diff --git a/test/simulator-group/sdnc/docker-compose-2.yml b/test/simulator-group/sdnc/docker-compose-2.yml index 03483a06..37c99b6a 100644 --- a/test/simulator-group/sdnc/docker-compose-2.yml +++ b/test/simulator-group/sdnc/docker-compose-2.yml @@ -17,9 +17,8 @@ version: '3.0' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} - + external: true + name: ${DOCKER_SIM_NWNAME} services: db: image: ${SDNC_DB_IMAGE} diff --git a/test/simulator-group/sdnc/docker-compose.yml b/test/simulator-group/sdnc/docker-compose.yml index 0b6f3577..505a54cc 100644 --- a/test/simulator-group/sdnc/docker-compose.yml +++ b/test/simulator-group/sdnc/docker-compose.yml @@ -17,9 +17,8 @@ version: '3' networks: default: - external: - name: ${DOCKER_SIM_NWNAME} - + external: true + name: ${DOCKER_SIM_NWNAME} services: db: image: ${SDNC_DB_IMAGE}