3 # ============LICENSE_START=======================================================
5 # ================================================================================
6 # Copyright (C) 2018 AT&T Intellectual Property. All rights reserved.
7 # Modifications copyright (C) 2021 Nordix Foundation..
8 # ================================================================================
9 # Licensed under the Apache License, Version 2.0 (the "License");
10 # you may not use this file except in compliance with the License.
11 # You may obtain a copy of the License at
13 # http://www.apache.org/licenses/LICENSE-2.0
15 # Unless required by applicable law or agreed to in writing, software
16 # distributed under the License is distributed on an "AS IS" BASIS,
17 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
18 # See the License for the specific language governing permissions and
19 # limitations under the License.
20 # ============LICENSE_END============================================
21 # ===================================================================
22 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
24 # This script is a copy of plans/dmaap/mrpubsub/setup.sh, placed in the scripts
25 # dir, and edited to be a callable function from other plans. e.g. dmaap-buscontroller needs it.
28 # function to launch DMaaP MR docker containers.
29 # sets global var IP with assigned IP address of MR container.
30 # (kafka and zk containers are not called externally)
32 function dmaap_mr_launch() {
34 mkdir -p ${WORKSPACE}/archives/dmaap/last_run_logs
36 # start DMaaP MR containers with docker compose and configuration from docker-compose.yml
37 docker login -u docker -p docker nexus3.onap.org:10001
38 docker-compose -f "${WORKSPACE}"/scripts/dmaap-message-router/docker-compose/docker-compose.yml up -d
41 # Wait for initialization of Docker containers for DMaaP MR, Kafka and Zookeeper
43 if [ $(docker inspect --format '{{ .State.Running }}' dmaap-mr) ] && \
44 [ $(docker inspect --format '{{ .State.Running }}' zookeeper) ] && \
45 [ $(docker inspect --format '{{ .State.Running }}' kafka) ]
47 echo "DMaaP Service Running"
55 DMAAP_MR_IP=$(get-instance-ip.sh dmaap-mr)
57 KAFKA_IP=$(get-instance-ip.sh kafka)
58 ZOOKEEPER_IP=$(get-instance-ip.sh zookeeper)
60 echo DMAAP_MR_IP="${DMAAP_MR_IP}"
62 echo KAFKA_IP="${KAFKA_IP}"
63 echo ZOOKEEPER_IP="${ZOOKEEPER_IP}"
65 # Wait for initialization of docker services
67 curl -sS -m 1 "${DMAAP_MR_IP}":3904/events/TestTopic && break