From 71d3d0925874247de5e657821638b1c08360f571 Mon Sep 17 00:00:00 2001 From: efiacor Date: Thu, 8 Apr 2021 16:40:06 +0100 Subject: [DMAAP-BC] Consolidate bus controller repos Migrate BC CSITs to the repo Fix documentation Signed-off-by: efiacor Change-Id: I874ed61be1b61187e233e9fd0937f6658f0ec0f0 Issue-ID: DMAAP-1544 --- csit/scripts/dmaap-buscontroller/dmaapbc-init.sh | 58 ++++ csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh | 27 ++ .../docker-compose/buscontroller.env | 2 + .../cadi_aaf/org.onap.dmaap-bc.cred.props | 17 + .../docker-compose/cadi_aaf/org.onap.dmaap-bc.jks | Bin 0 -> 4719 bytes .../cadi_aaf/org.onap.dmaap-bc.location.props | 8 + .../cadi_aaf/org.onap.dmaap-bc.props | 24 ++ .../docker-compose/cadi_aaf/truststore.jks | Bin 0 -> 3234 bytes .../docker-compose/dmaapbc.properties | 150 +++++++++ .../docker-compose/docker-compose-bc.yml | 46 +++ .../dmaap-buscontroller/docker-compose/logback.xml | 356 +++++++++++++++++++++ csit/scripts/dmaap-datarouter/datarouter-launch.sh | 76 +++++ .../dmaap-datarouter/datarouter-teardown.sh | 25 ++ .../docker-compose/docker-compose.yml | 92 ++++++ .../docker-compose/node.properties | 82 +++++ .../docker-compose/provserver.properties | 55 ++++ .../docker-compose/subscriber.properties | 35 ++ .../dr_certs/dr_node/org.onap.dmaap-dr-node.p12 | Bin 0 -> 4596 bytes .../dr_certs/dr_node/org.onap.dmaap-dr.cred.props | 17 + .../dr_certs/dr_node/truststore.jks | Bin 0 -> 3234 bytes .../dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12 | Bin 0 -> 4596 bytes .../dr_certs/dr_prov/org.onap.dmaap-dr.cred.props | 17 + .../dr_certs/dr_prov/truststore.jks | Bin 0 -> 3234 bytes .../dmaap-message-router/dmaap-mr-launch.sh | 72 +++++ .../dmaap-message-router/dmaap-mr-teardown.sh | 26 ++ .../docker-compose/docker-compose.yml | 76 +++++ .../docker-compose/kafka/zk_client_jaas.conf | 5 + .../docker-compose/mr/MsgRtrApi.properties | 166 ++++++++++ .../docker-compose/mr/cadi.properties | 19 ++ .../docker-compose/mr/logback.xml | 208 ++++++++++++ .../docker-compose/zk/zk_server_jaas.conf | 4 + csit/scripts/get-instance-ip.sh | 17 + csit/scripts/kill-instance.sh | 31 ++ 33 files changed, 1711 insertions(+) create mode 100755 csit/scripts/dmaap-buscontroller/dmaapbc-init.sh create mode 100755 csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/buscontroller.env create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml create mode 100644 csit/scripts/dmaap-buscontroller/docker-compose/logback.xml create mode 100644 csit/scripts/dmaap-datarouter/datarouter-launch.sh create mode 100755 csit/scripts/dmaap-datarouter/datarouter-teardown.sh create mode 100644 csit/scripts/dmaap-datarouter/docker-compose/docker-compose.yml create mode 100644 csit/scripts/dmaap-datarouter/docker-compose/node.properties create mode 100755 csit/scripts/dmaap-datarouter/docker-compose/provserver.properties create mode 100644 csit/scripts/dmaap-datarouter/docker-compose/subscriber.properties create mode 100644 csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr-node.p12 create mode 100644 csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr.cred.props create mode 100644 csit/scripts/dmaap-datarouter/dr_certs/dr_node/truststore.jks create mode 100755 csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12 create mode 100644 csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr.cred.props create mode 100644 csit/scripts/dmaap-datarouter/dr_certs/dr_prov/truststore.jks create mode 100755 csit/scripts/dmaap-message-router/dmaap-mr-launch.sh create mode 100755 csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh create mode 100644 csit/scripts/dmaap-message-router/docker-compose/docker-compose.yml create mode 100644 csit/scripts/dmaap-message-router/docker-compose/kafka/zk_client_jaas.conf create mode 100644 csit/scripts/dmaap-message-router/docker-compose/mr/MsgRtrApi.properties create mode 100644 csit/scripts/dmaap-message-router/docker-compose/mr/cadi.properties create mode 100644 csit/scripts/dmaap-message-router/docker-compose/mr/logback.xml create mode 100644 csit/scripts/dmaap-message-router/docker-compose/zk/zk_server_jaas.conf create mode 100755 csit/scripts/get-instance-ip.sh create mode 100755 csit/scripts/kill-instance.sh (limited to 'csit/scripts') diff --git a/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh b/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh new file mode 100755 index 0000000..5e9cbb1 --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/dmaapbc-init.sh @@ -0,0 +1,58 @@ +#!/bin/bash + +# $1 is the IP address of the buscontroller + +# INITIALIZE: dmaap object +JSON=/tmp/$$.dmaap +cat << EOF > $JSON +{ + "version": "1", + "topicNsRoot": "org.onap.dmaap", + "drProvUrl": "https://dmaap-dr-prov:8443", + "dmaapName": "onapCSIT", + "bridgeAdminTopic": "MM_AGENT_PROV" + +} +EOF + +echo "Initializing /dmaap endpoint" +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dmaap + + +# INITIALIZE: dcaeLocation object +JSON=/tmp/$$.loc +cat << EOF > $JSON +{ + "dcaeLocationName": "csit-sanfrancisco", + "dcaeLayer": "central-cloud", + "clli": "CSIT12345", + "zone": "zoneA" + +} +EOF + +echo "Initializing /dcaeLocations endpoint" +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/dcaeLocations + + +# INITIALIZE: MR object in 1 site +# since MR is currently deployed via docker-compose, its IP doesn't seem +# to be routable from DBCL. Fortunately, the MR port is mapped from the docker bridge IP address. +# Found this article for how to deterine the docker bridge IP so using it as a workaround. +# https://stackoverflow.com/questions/22944631/how-to-get-the-ip-address-of-the-docker-host-from-inside-a-docker-container +# Used the following snippet found buried in a comment to an answer and then modified for only 1 value. +DOCKER_HOST=$(ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+' | head -1 ) +# Perhaps there is a better way... +JSON=/tmp/$$.mrc +cat << EOF > $JSON +{ + "dcaeLocationName": "csit-sanfrancisco", + "fqdn": "message-router", + "topicProtocol" : "http", + "topicPort": "3904" + +} +EOF + +echo "Initializing /mr_clusters endpoint" +curl -v -k -X POST -d @${JSON} -H "Content-Type: application/json" https://$1:8443/webapi/mr_clusters diff --git a/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh b/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh new file mode 100755 index 0000000..6f46845 --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/dmaapbc-launch.sh @@ -0,0 +1,27 @@ +#!/bin/bash + +# script to launch DMaaP buscontroller docker container +# sets global var IP with assigned IP address + +function dmaapbc_launch() { + if [ $# == 1 ]; then + export dmaap_prov_ip=$1 + export dmaap_mr_ip=$2 + else + export dmaap_prov_ip=$1 + export dmaap_mr_ip=$1 + fi + + docker-compose -f ${WORKSPACE}/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml up -d + + sleep 10 + + DMAAP_BC_IP=`get-instance-ip.sh dmaap-bc` + + # Wait for initialization + for i in 1 2 3 4 5 6 7 8 9 10; do + curl -sS ${DMAAP_BC_IP}:8080 && break + echo sleep ${i} + sleep ${i} + done +} diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/buscontroller.env b/csit/scripts/dmaap-buscontroller/docker-compose/buscontroller.env new file mode 100644 index 0000000..50ce43f --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/buscontroller.env @@ -0,0 +1,2 @@ +DMAAPBC_WAIT_TO_EXIT=Y +DMAAPBC_KSTOREFILE=/opt/app/osaaf/local/org.onap.dmaap-bc.jks \ No newline at end of file diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props new file mode 100644 index 0000000..52536a1 --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.cred.props @@ -0,0 +1,17 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:38:49.244+0000 +# @copyright 2019, AT&T +############################################################ +Challenge=secret +cadi_alias=dmaap-bc@dmaap-bc.onap.org +cadi_key_password=secret +#cadi_keyfile=/opt/app/osaaf/local/org.onap.dmaap-dr.keyfile +cadi_keystore=/opt/app/osaaf/local/org.onap.dmaap-bc.jks +cadi_keystore_password=secret +cadi_keystore_password_jks=secret +cadi_keystore_password_p12=secret +cadi_truststore=/opt/app/osaaf/local/truststore.jks +cadi_truststore_password=secret +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks new file mode 100644 index 0000000..ca8301c Binary files /dev/null and b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.jks differ diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props new file mode 100644 index 0000000..a8374dc --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.location.props @@ -0,0 +1,8 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.608+0000 +# @copyright 2019, AT&T +############################################################ +cadi_latitude=38.0 +cadi_longitude=-72.0 diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props new file mode 100644 index 0000000..f3747fa --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/org.onap.dmaap-bc.props @@ -0,0 +1,24 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:25:54.617+0000 +# @copyright 2019, AT&T +############################################################ +aaf_env=DEV +aaf_id=dmaap-bc@dmaap-bc.onap.org +aaf_locate_url=https://aaf-locate.onap:8095 +aaf_locator_app_ns=org.osaaf.aaf +aaf_locator_container=oom +aaf_locator_container_ns=onap +aaf_locator_fqdn=dmaap-bc +aaf_locator_public_fqdn=aaf.osaaf.org +aaf_oauth2_introspect_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.introspect:2.1/introspect +aaf_oauth2_token_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.token:2.1/token +aaf_url=https://AAF_LOCATE_URL/%CNS.%AAF_NS.service:2.1 +aaf_url_cm=https://AAF_LOCATE_URL/%CNS.%AAF_NS.cm:2.1 +aaf_url_fs=https://AAF_LOCATE_URL/%CNS.%AAF_NS.fs:2.1 +aaf_url_gui=https://AAF_LOCATE_URL/%CNS.%AAF_NS.gui:2.1 +aaf_url_hello=https://aaf-locate.onap:8095/locate/onap.org.osaaf.aaf.hello:2.1 +aaf_url_oauth=https://AAF_LOCATE_URL/%CNS.%AAF_NS.oauth:2.1 +cadi_prop_files=/opt/app/osaaf/local/org.onap.dmaap-bc.location.props:/opt/app/osaaf/local/org.onap.dmaap-bc.cred.props +cadi_protocols=TLSv1.1,TLSv1.2 diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks new file mode 100644 index 0000000..91547c6 Binary files /dev/null and b/csit/scripts/dmaap-buscontroller/docker-compose/cadi_aaf/truststore.jks differ diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties b/csit/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties new file mode 100644 index 0000000..32c67fb --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/dmaapbc.properties @@ -0,0 +1,150 @@ + +##################################################### +# +# Hooks for specific environment configurations +# +##################################################### +# Indicator for whether to use AAF for authentication +UseAAF: false + +# Stub out southbound calls for Unit Test cases to run. e.g. not timeout +# Comment out in other environments to get default (No) +#UnitTest: Yes + + +##################################################### +# +# Settings for Southbound API: Datarouter +# +##################################################### + +# URI to retrieve dynamic DR configuration +ProvisioningURI: /internal/prov + +# indicator for handling feed delete: +# DeleteOnDR - means use the DR API to DELETE a feed. (default for backwards compatibility) +# SimulateDelete - means preserve the feed on DR (after cleaning it up), and mark as DELETED in DBCL. Better for cloudify environments. +Feed.deleteHandling: SimulateDelete + +########################################################### +# The following properties default to match ONAP DR instance. +# However, there are some non-ONAP DR instances that require other values. +# Sets the X-DR-ON-BEHALF-OF HTTP Header value +#DR.onBehalfHeader: +# Value for the Content-Type Header in DR Feed API +#DR.feedContentType: +# Value for the Content-Type Header in DR Subscription API +#DR.subContentType: +# +# END OF properties helpful for non-ONAP DR instance. +############################################################ + +##################################################### +# +# Settings for Soutbound API: Postgresql +# +##################################################### +# flag indicates if we are using postgresql +UsePGSQL: true + +# postgres host name +# Need to connect to PG primary service, designated by service.name2 +DB.host: dbc-pg + +# postgres schema name +DB.schema: dmaapbc + +# postgres user name +DB.user: dmaapbc + +# postgres user password +DB.cred: secret + +##################################################### +# +# Settings for Soutbound API: Message Router +# +##################################################### +# indicator for multi-site (locations) deployment. Give clue to buscontroller whether +# there is a need for message replication between edge and central. +# ONAP Casablanca is a single site deployment +MR.multisite: false + +# FQDN of primary message router. +# In ONAP Casablanca, there is only 1 message router service, so use that. +# In a multi-site, MR cluster deployment, use the CNAME DNS entry which resolves to the primary central MR +MR.CentralCname: message-router + +# Indicator for whether we want hostname verification on SSL connection to MR +MR.hostnameVerify: false + + +# MR Client Delete Level thoroughness: +# 0 = don't delete +# 1 = delete from persistent store +# 2 = delete from persistent store (DB) and authorization store (AAF) +MR.ClientDeleteLevel: 1 + +# namespace of MR Topic Factory +MR.TopicFactoryNS: org.onap.dmaap.mr.topicFactory + +# AAF Role assigned to Topic Manager Identity +MR.TopicMgrRole: org.onap.dmaap-bc-topic-mgr.client + +# MR topic ProjectID (used in certain topic name generation formats) +MR.projectID: mr + +# Use Basic Authentication when provisioning topics +MR.authentication: basicAuth + +# MR topic name style (default is FQTN_LEGACY_FORMAT) +#MR.topicStyle: FQTN_LEGACY_FORMAT +# +# end of MR Related Properties +################################################################################ + +##################################################### +# +# Settings for authorization of DBCAPI +# +##################################################### +# Namespace for URI values for the API used to create AAF permissions +# e.g. if ApiNamespace is X.Y.dmaapbc.api then for URI /mr_clients we create AAF perm X.Y.dmaapbc.api.mr_clients +ApiNamespace: org.onap.dmaap-bc.api + +# If API authorization is required, then implement a class to enforce it. +# This overrides the Class used for API permission check. +ApiPermission.Class: org.onap.dmaap.dbcapi.authentication.AllowAll + + +##################################################### +# +# Certificate Management +# +##################################################### + +# Indicates how we are expecting certificates to be provided: +# cadi - a set of artifacts will be downloaded from AAF at deployment time, and details will be in a cadi properties file +# legacy (default) - artifacts will be installed manually or some other way and details will be in this file +CertificateManagement: cadi + +# When CertificateManagement is cadi, then this is where all the cadi properties will be. +# Note that the cadi properties include where the cert is, and the encrypted passwords to read. +cadi.properties: /opt/app/osaaf/local/org.onap.dmaap-bc.props + + +##################################################### +# +# HTTP Server Configuration +# +##################################################### + +# Allow http access to dbcapi +HttpAllowed: true + +# listen to http port within this container (server) +IntHttpPort: 8080 + +# listen to https port within this container (server) +# set to 0 if no certificates are available. +IntHttpsPort: 8443 diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml b/csit/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml new file mode 100644 index 0000000..458d06f --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/docker-compose-bc.yml @@ -0,0 +1,46 @@ +version: '3.3' +services: + dbc-pg-primary: + container_name: dbc-pg + image: nexus3.onap.org:10001/crunchydata/crunchy-postgres:centos8-13.2-4.6.1 + ports: + - "5432:5432" + environment: + - PGHOST=/tmp + - PG_MODE=primary + - MODE=postgres + - PG_PRIMARY_USER=dmaapbc + - PG_PRIMARY_PASSWORD=secret + - PG_DATABASE=dmaap + - PG_USER=dmaapbc + - PG_PASSWORD=secret + - PG_ROOT_PASSWORD=secret + - PG_PRIMARY_PORT=5432 + networks: + docker-compose_net: + aliases: + - dbc-pg + + dmaap-bc: + container_name: dmaap-bc + hostname: dmaap-bc + image: onap/dmaap/dmaap-bc + ports: + - "30241:8080" + - "30242:8443" + volumes: + - ./buscontroller.env:/opt/app/config/conf/buscontroller.env + - ./dmaapbc.properties:/opt/app/config/conf/dmaapbc.properties + - ./cadi_aaf:/opt/app/osaaf/local + - ./logback.xml:/opt/app/dmaapbc/etc/logback.xml + networks: + docker-compose_net: + aliases: + - dmaap-bc + extra_hosts: + - dmaap-dr-prov:$dmaap_prov_ip + - message-router:$dmaap_prov_ip + +networks: + docker-compose_net: + external: true diff --git a/csit/scripts/dmaap-buscontroller/docker-compose/logback.xml b/csit/scripts/dmaap-buscontroller/docker-compose/logback.xml new file mode 100644 index 0000000..f0ba2b1 --- /dev/null +++ b/csit/scripts/dmaap-buscontroller/docker-compose/logback.xml @@ -0,0 +1,356 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ${defaultPattern} + + + + + + + + + + + + ${logDirectory}/${generalLogName}.log + + ${logDirectory}/${generalLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + + 256 + + + + + + ${logDirectory}/${securityLogName}.log + + ${logDirectory}/${securityLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + + 256 + 0 + + + + + + ${logDirectory}/${performanceLogName}.log + + ${logDirectory}/${performanceLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + ${logDirectory}/${serverLogName}.log + + ${logDirectory}/${serverLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + + ${logDirectory}/${policyLogName}.log + + ${logDirectory}/${policyLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${defaultPattern} + + + + 256 + + + + + + + + ${logDirectory}/${auditLogName}.log + + ${logDirectory}/${auditLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${auditLoggerPattern} + + + + 256 + + + + + ${logDirectory}/${metricsLogName}.log + + ${logDirectory}/${metricsLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${metricsLoggerPattern} + + + + + + 256 + + + + + ${logDirectory}/${errorLogName}.log + + ${logDirectory}/${errorLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${errorLoggerPattern} + + + + + 256 + + + + + ${debugLogDirectory}/${debugLogName}.log + + ${debugLogDirectory}/${debugLogName}.%i.log.zip + + 1 + 9 + + + 5MB + + + ${debugLoggerPattern} + + + + + 256 + + true + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/csit/scripts/dmaap-datarouter/datarouter-launch.sh b/csit/scripts/dmaap-datarouter/datarouter-launch.sh new file mode 100644 index 0000000..94a4595 --- /dev/null +++ b/csit/scripts/dmaap-datarouter/datarouter-launch.sh @@ -0,0 +1,76 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# Copyright (C) 2021 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# + +function dmaap_dr_launch() { + + mkdir -p ${WORKSPACE}/archives/dmaap/last_run_logs + + # start DMaaP DR containers with docker compose and configuration from docker-compose.yml + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml up -d + + # Wait for initialization of Docker container for datarouter-node, datarouter-prov and mariadb + for i in 1 2 3 4 5 6 7 8 9 10; do + if [[ $(docker inspect --format '{{ .State.Running }}' datarouter-node) ]] && \ + [[ $(docker inspect --format '{{ .State.Running }}' datarouter-prov) ]] && \ + [[ $(docker inspect --format '{{ .State.Running }}' mariadb) ]] + then + echo "DR Service Running" + break + else + echo sleep ${i} + sleep ${i} + fi + done + + # Wait for healthy container datarouter-prov + for i in 1 2 3 4 5 6 7 8 9 10; do + if [[ "$(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov)" = 'healthy' ]] + then + echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) + echo "DR Service Running, datarouter-prov container is healthy" + break + else + echo datarouter-prov.State.Health.Status is $(docker inspect --format '{{ .State.Health.Status }}' datarouter-prov) + echo sleep ${i} + sleep ${i} + if [[ ${i} = 10 ]] + then + echo datarouter-prov container is not in healthy state - the test is not made, teardown... + docker-compose rm -sf + exit 1 + fi + fi + done + + DR_PROV_IP=`get-instance-ip.sh datarouter-prov` + DR_NODE_IP=`get-instance-ip.sh datarouter-node` + #DR_GATEWAY_IP=$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.Gateway}}{{end}}' datarouter-prov) + echo DR_PROV_IP=${DR_PROV_IP} + echo DR_NODE_IP=${DR_NODE_IP} + #echo DR_GATEWAY_IP=${DR_GATEWAY_IP} + +# docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/NODES?val=dmaap-dr-node\|$DR_GATEWAY_IP" +# docker exec -i datarouter-prov sh -c "curl -k -X PUT https://$DR_PROV_IP:8443/internal/api/PROV_AUTH_ADDRESSES?val=dmaap-dr-prov\|$DR_GATEWAY_IP" + + #Pass any variables required by Robot test suites in ROBOT_VARIABLES + ROBOT_VARIABLES="-v DR_PROV_IP:${DR_PROV_IP} -v DR_NODE_IP:${DR_NODE_IP} -v DR_SUB_IP:${DR_SUB_IP} -v DR_SUB2_IP:${DR_SUB2_IP}" +} \ No newline at end of file diff --git a/csit/scripts/dmaap-datarouter/datarouter-teardown.sh b/csit/scripts/dmaap-datarouter/datarouter-teardown.sh new file mode 100755 index 0000000..ad05194 --- /dev/null +++ b/csit/scripts/dmaap-datarouter/datarouter-teardown.sh @@ -0,0 +1,25 @@ +#!/bin/bash +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 Nordix Foundation. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== + +function teardown_dmaap_dr (){ + docker cp datarouter-prov:/opt/app/datartr/logs ${WORKSPACE}/archives/dmaap/last_run_logs/prov_logs + docker cp datarouter-node:/opt/app/datartr/logs ${WORKSPACE}/archives/dmaap/last_run_logs/node_event_logs + docker cp datarouter-node:/var/log/onap/datarouter ${WORKSPACE}/archives/dmaap/last_run_logs/node_server_logs + docker-compose -f ${WORKSPACE}/scripts/dmaap-datarouter/docker-compose/docker-compose.yml rm -sf +} \ No newline at end of file diff --git a/csit/scripts/dmaap-datarouter/docker-compose/docker-compose.yml b/csit/scripts/dmaap-datarouter/docker-compose/docker-compose.yml new file mode 100644 index 0000000..2518db6 --- /dev/null +++ b/csit/scripts/dmaap-datarouter/docker-compose/docker-compose.yml @@ -0,0 +1,92 @@ +# +# ============LICENSE_START======================================================= +# Copyright (C) 2019-21 Nordix Foundation. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END========================================================= +# +# +version: '2.1' +services: + datarouter-prov: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-prov:2.1.8 + container_name: datarouter-prov + hostname: dmaap-dr-prov + ports: + - "443:8443" + - "8443:8443" + - "8080:8080" + volumes: + - ./provserver.properties:/opt/app/datartr/etc/provserver.properties + - ../dr_certs/dr_prov/truststore.jks:/opt/app/osaaf/local/truststore.jks + - ../dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12:/opt/app/osaaf/local/org.onap.dmaap-dr-prov.p12 + - ../dr_certs/dr_prov/org.onap.dmaap-dr.cred.props:/opt/app/osaaf/local/org.onap.dmaap-dr.cred.props + depends_on: + mariadb: + condition: service_healthy + healthcheck: + test: ["CMD", "curl", "-f", "http://dmaap-dr-prov:8080/internal/prov"] + interval: 10s + timeout: 30s + retries: 5 + networks: + net: + aliases: + - dmaap-dr-prov + + datarouter-node: + image: nexus3.onap.org:10001/onap/dmaap/datarouter-node:2.1.8 + container_name: datarouter-node + hostname: dmaap-dr-node + ports: + - "9443:8443" + - "9090:8080" + volumes: + - ./node.properties:/opt/app/datartr/etc/node.properties + - ../dr_certs/dr_node/truststore.jks:/opt/app/osaaf/local/truststore.jks + - ../dr_certs/dr_node/org.onap.dmaap-dr-node.p12:/opt/app/osaaf/local/org.onap.dmaap-dr-node.p12 + - ../dr_certs/dr_node/org.onap.dmaap-dr.cred.props:/opt/app/osaaf/local/org.onap.dmaap-dr.cred.props + depends_on: + datarouter-prov: + condition: service_healthy + networks: + net: + aliases: + - dmaap-dr-node + + mariadb: + image: nexus3.onap.org:10001/library/mariadb:10.2.14 + container_name: mariadb + hostname: datarouter-mariadb + ports: + - "3306:3306" + environment: + MYSQL_ROOT_PASSWORD: datarouter + MYSQL_DATABASE: datarouter + MYSQL_USER: datarouter + MYSQL_PASSWORD: datarouter + healthcheck: + test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost", "-u", "datarouter", "-pdatarouter", "--silent"] + interval: 10s + timeout: 30s + retries: 5 + networks: + net: + aliases: + - datarouter-mariadb + +networks: + net: + driver: bridge diff --git a/csit/scripts/dmaap-datarouter/docker-compose/node.properties b/csit/scripts/dmaap-datarouter/docker-compose/node.properties new file mode 100644 index 0000000..58639cf --- /dev/null +++ b/csit/scripts/dmaap-datarouter/docker-compose/node.properties @@ -0,0 +1,82 @@ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 Nordix Foundation. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== +# +# Configuration parameters set at startup for the DataRouter node +# +# URL to retrieve dynamic configuration +ProvisioningURL = https://dmaap-dr-prov:8443/internal/prov +# +# URL to upload PUB/DEL/EXP logs +LogUploadURL = https://dmaap-dr-prov:8443/internal/logs +# +# The port number for http as seen within the server +IntHttpPort = 8080 +# +# The port number for https as seen within the server +IntHttpsPort = 8443 +# +# The external port number for https taking port mapping into account +ExtHttpsPort = 443 +# +# The minimum interval between fetches of the dynamic configuration from the provisioning server +MinProvFetchInterval = 10000 +# +# The minimum interval between saves of the redirection data file +MinRedirSaveInterval = 10000 +# +# The path to the directory where log files are stored +LogDir = /opt/app/datartr/logs +# +# The retention interval (in days) for log files +LogRetention = 30 +# +# The path to the directories where data and meta data files are stored +SpoolDir = /opt/app/datartr/spool +# +# The path to the redirection data file +RedirectionFile = etc/redirections.dat +# +# The type of keystore for https +KeyStoreType = PKCS12 +# +# The type of truststore for https +TrustStoreType = jks +# +# The path to the file used to trigger an orderly shutdown +QuiesceFile = etc/SHUTDOWN +# +# The key used to generate passwords for node to node transfers +NodeAuthKey = Node123! +# +# DR_NODE DEFAULT ENABLED TLS PROTOCOLS +NodeHttpsProtocols = TLSv1.1|TLSv1.2 +# +# AAF type to generate permission string +AAFType = org.onap.dmaap-dr.feed +# +# AAF default instance to generate permission string - default should be legacy +AAFInstance = legacy +# +# AAF action to generate permission string - default should be publish +AAFAction = publish +# +# AAF CADI enabled flag +CadiEnabled = false +# +# AAF Props file path +AAFPropsFilePath = /opt/app/osaaf/local/org.onap.dmaap-dr.props diff --git a/csit/scripts/dmaap-datarouter/docker-compose/provserver.properties b/csit/scripts/dmaap-datarouter/docker-compose/provserver.properties new file mode 100755 index 0000000..b54868e --- /dev/null +++ b/csit/scripts/dmaap-datarouter/docker-compose/provserver.properties @@ -0,0 +1,55 @@ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 Nordix Foundation. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== + +#Jetty Server properties +org.onap.dmaap.datarouter.provserver.http.port = 8080 +org.onap.dmaap.datarouter.provserver.https.port = 8443 +org.onap.dmaap.datarouter.provserver.https.relaxation = true + +org.onap.dmaap.datarouter.provserver.aafprops.path = /opt/app/osaaf/local/org.onap.dmaap-dr.props + +org.onap.dmaap.datarouter.provserver.accesslog.dir = /opt/app/datartr/logs +org.onap.dmaap.datarouter.provserver.spooldir = /opt/app/datartr/spool +org.onap.dmaap.datarouter.provserver.dbscripts = /opt/app/datartr/etc/misc +org.onap.dmaap.datarouter.provserver.logretention = 30 + +#DMAAP-597 (Tech Dept) REST request source IP auth +# relaxation to accommodate OOM kubernetes deploy +org.onap.dmaap.datarouter.provserver.isaddressauthenabled = false + +#Localhost address config +org.onap.dmaap.datarouter.provserver.localhost = 127.0.0.1 + +# Database access +org.onap.dmaap.datarouter.db.driver = org.mariadb.jdbc.Driver +org.onap.dmaap.datarouter.db.url = jdbc:mariadb://datarouter-mariadb:3306/datarouter +org.onap.dmaap.datarouter.db.login = datarouter +org.onap.dmaap.datarouter.db.password = datarouter + +# PROV - DEFAULT ENABLED TLS PROTOCOLS +org.onap.dmaap.datarouter.provserver.https.include.protocols = TLSv1.1|TLSv1.2 + +# AAF config +org.onap.dmaap.datarouter.provserver.cadi.enabled = false + +org.onap.dmaap.datarouter.provserver.passwordencryption = PasswordEncryptionKey#@$%^&1234# +org.onap.dmaap.datarouter.provserver.aaf.feed.type = org.onap.dmaap-dr.feed +org.onap.dmaap.datarouter.provserver.aaf.sub.type = org.onap.dmaap-dr.sub +org.onap.dmaap.datarouter.provserver.aaf.instance = legacy +org.onap.dmaap.datarouter.provserver.aaf.action.publish = publish +org.onap.dmaap.datarouter.provserver.aaf.action.subscribe = subscribe \ No newline at end of file diff --git a/csit/scripts/dmaap-datarouter/docker-compose/subscriber.properties b/csit/scripts/dmaap-datarouter/docker-compose/subscriber.properties new file mode 100644 index 0000000..311bbe5 --- /dev/null +++ b/csit/scripts/dmaap-datarouter/docker-compose/subscriber.properties @@ -0,0 +1,35 @@ +# ============LICENSE_START=================================================== +# Copyright (C) 2019-2021 Nordix Foundation. +# ============================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# SPDX-License-Identifier: Apache-2.0 +# ============LICENSE_END===================================================== + +#Subscriber properties +org.onap.dmaap.datarouter.subscriber.http.port = 7070 +org.onap.dmaap.datarouter.subscriber.https.port = 7443 +org.onap.dmaap.datarouter.subscriber.auth.user = LOGIN +org.onap.dmaap.datarouter.subscriber.auth.password = PASSWORD +org.onap.dmaap.datarouter.subscriber.delivery.dir = /opt/app/subscriber/delivery + +org.onap.dmaap.datarouter.subscriber.https.relaxation = true +org.onap.dmaap.datarouter.subscriber.keystore.type = jks +org.onap.dmaap.datarouter.subscriber.keymanager.password = changeit +org.onap.dmaap.datarouter.subscriber.keystore.path = /opt/app/datartr/self_signed/keystore.jks +org.onap.dmaap.datarouter.subscriber.keystore.password = changeit +org.onap.dmaap.datarouter.subscriber.truststore.path = /opt/app/datartr/self_signed/cacerts.jks +org.onap.dmaap.datarouter.subscriber.truststore.password = changeit + + + diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr-node.p12 b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr-node.p12 new file mode 100644 index 0000000..3793a9d Binary files /dev/null and b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr-node.p12 differ diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr.cred.props b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr.cred.props new file mode 100644 index 0000000..e32e728 --- /dev/null +++ b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/org.onap.dmaap-dr.cred.props @@ -0,0 +1,17 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:38:49.244+0000 +# @copyright 2019, AT&T +############################################################ +Challenge=secret +cadi_alias=dmaap-dr-node@dmaap-dr.onap.org +cadi_key_password=secret +#cadi_keyfile=/opt/app/osaaf/local/org.onap.dmaap-dr.keyfile +cadi_keystore=/opt/app/osaaf/local/org.onap.dmaap-dr-node.p12 +cadi_keystore_password=secret +cadi_keystore_password_jks=secret +cadi_keystore_password_p12=secret +cadi_truststore=/opt/app/osaaf/local/truststore.jks +cadi_truststore_password=secret +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_node/truststore.jks b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/truststore.jks new file mode 100644 index 0000000..91547c6 Binary files /dev/null and b/csit/scripts/dmaap-datarouter/dr_certs/dr_node/truststore.jks differ diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12 b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12 new file mode 100755 index 0000000..1393fb0 Binary files /dev/null and b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr-prov.p12 differ diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr.cred.props b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr.cred.props new file mode 100644 index 0000000..18f91ba --- /dev/null +++ b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/org.onap.dmaap-dr.cred.props @@ -0,0 +1,17 @@ +############################################################ +# Properties Generated by AT&T Certificate Manager +# by root +# on 2021-03-12T11:29:50.699+0000 +# @copyright 2019, AT&T +############################################################ +Challenge=secret +cadi_alias=dmaap-dr-prov@dmaap-dr.onap.org +cadi_key_password=secret +#cadi_keyfile=/opt/app/osaaf/local/org.onap.dmaap-dr.keyfile +cadi_keystore=/opt/app/osaaf/local/org.onap.dmaap-dr-prov.p12 +cadi_keystore_password=secret +cadi_keystore_password_jks=secret +cadi_keystore_password_p12=secret +cadi_truststore=/opt/app/osaaf/local/truststore.jks +cadi_truststore_password=secret +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US diff --git a/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/truststore.jks b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/truststore.jks new file mode 100644 index 0000000..91547c6 Binary files /dev/null and b/csit/scripts/dmaap-datarouter/dr_certs/dr_prov/truststore.jks differ diff --git a/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh b/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh new file mode 100755 index 0000000..ae91f5b --- /dev/null +++ b/csit/scripts/dmaap-message-router/dmaap-mr-launch.sh @@ -0,0 +1,72 @@ +#!/bin/bash +# +# ============LICENSE_START======================================================= +# ONAP DMAAP MR +# ================================================================================ +# Copyright (C) 2018 AT&T Intellectual Property. All rights reserved. +# Modifications copyright (C) 2021 Nordix Foundation.. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END============================================ +# =================================================================== +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +# This script is a copy of plans/dmaap/mrpubsub/setup.sh, placed in the scripts +# dir, and edited to be a callable function from other plans. e.g. dmaap-buscontroller needs it. + + +# function to launch DMaaP MR docker containers. +# sets global var IP with assigned IP address of MR container. +# (kafka and zk containers are not called externally) + +function dmaap_mr_launch() { + + mkdir -p ${WORKSPACE}/archives/dmaap/last_run_logs + + # start DMaaP MR containers with docker compose and configuration from docker-compose.yml + docker login -u docker -p docker nexus3.onap.org:10001 + docker-compose -f "${WORKSPACE}"/scripts/dmaap-message-router/docker-compose/docker-compose.yml up -d + docker ps + + # Wait for initialization of Docker containers for DMaaP MR, Kafka and Zookeeper + for i in {1..50}; do + if [ $(docker inspect --format '{{ .State.Running }}' dmaap-mr) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' zookeeper) ] && \ + [ $(docker inspect --format '{{ .State.Running }}' kafka) ] + then + echo "DMaaP Service Running" + break + else + echo sleep $i + sleep $i + fi + done + + DMAAP_MR_IP=$(get-instance-ip.sh dmaap-mr) + IP=${DMAAP_MR_IP} + KAFKA_IP=$(get-instance-ip.sh kafka) + ZOOKEEPER_IP=$(get-instance-ip.sh zookeeper) + + echo DMAAP_MR_IP="${DMAAP_MR_IP}" + echo IP="${IP}" + echo KAFKA_IP="${KAFKA_IP}" + echo ZOOKEEPER_IP="${ZOOKEEPER_IP}" + + # Wait for initialization of docker services + for i in {1..50}; do + curl -sS -m 1 "${DMAAP_MR_IP}":3904/events/TestTopic && break + echo sleep $i + sleep $i + done +} + diff --git a/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh b/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh new file mode 100755 index 0000000..dae8e9f --- /dev/null +++ b/csit/scripts/dmaap-message-router/dmaap-mr-teardown.sh @@ -0,0 +1,26 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# Modifications copyright (c) 2018 AT&T Intellectual Property +# Modifications copyright (C) 2021 Nordix Foundation.. +# + +function dmaap_mr_teardown() { +kill-instance.sh dmaap-mr +kill-instance.sh kafka +kill-instance.sh zookeeper +docker-compose -f ${WORKSPACE}/scripts/dmaap-message-router/docker-compose/docker-compose.yml rm -sf +} diff --git a/csit/scripts/dmaap-message-router/docker-compose/docker-compose.yml b/csit/scripts/dmaap-message-router/docker-compose/docker-compose.yml new file mode 100644 index 0000000..94765f4 --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/docker-compose.yml @@ -0,0 +1,76 @@ +version: '2.1' +services: + zookeeper: + image: nexus3.onap.org:10001/onap/dmaap/zookeeper:6.0.3 + container_name: zookeeper + ports: + - "2181:2181" + environment: + ZOOKEEPER_REPLICAS: 1 + ZOOKEEPER_TICK_TIME: 2000 + ZOOKEEPER_SYNC_LIMIT: 5 + ZOOKEEPER_INIT_LIMIT: 10 + ZOOKEEPER_MAX_CLIENT_CNXNS: 200 + ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3 + ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24 + ZOOKEEPER_CLIENT_PORT: 2181 + KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl + ZOOKEEPER_SERVER_ID: 1 + volumes: + - ./zk/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf + networks: + net: + aliases: + - zookeeper + + kafka: + image: nexus3.onap.org:10001/onap/dmaap/kafka111:1.0.5 + container_name: kafka + ports: + - "9092:9092" + environment: + enableCadi: 'false' + KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181 + 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://kafka:9092 + KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092 + 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 + KAFKA_ZOOKEEPER_SET_ACL: 'true' + KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1 + # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment + KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1 + volumes: + - ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf + networks: + net: + aliases: + - kafka + depends_on: + - zookeeper + + dmaap: + image: nexus3.onap.org:10001/onap/dmaap/dmaap-mr:1.1.20 + container_name: dmaap-mr + ports: + - "3904:3904" + - "3905:3905" + environment: + enableCadi: 'false' + volumes: + - ./mr/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties + - ./mr/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml + - ./mr/cadi.properties:/appl/dmaapMR1/etc/cadi.properties + networks: + net: + aliases: + - dmaap + depends_on: + - zookeeper + - kafka +networks: + net: + driver: bridge diff --git a/csit/scripts/dmaap-message-router/docker-compose/kafka/zk_client_jaas.conf b/csit/scripts/dmaap-message-router/docker-compose/kafka/zk_client_jaas.conf new file mode 100644 index 0000000..d4ef1eb --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/kafka/zk_client_jaas.conf @@ -0,0 +1,5 @@ +Client { + org.apache.zookeeper.server.auth.DigestLoginModule required + username="kafka" + password="kafka_secret"; + }; \ No newline at end of file diff --git a/csit/scripts/dmaap-message-router/docker-compose/mr/MsgRtrApi.properties b/csit/scripts/dmaap-message-router/docker-compose/mr/MsgRtrApi.properties new file mode 100644 index 0000000..7aede4f --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/mr/MsgRtrApi.properties @@ -0,0 +1,166 @@ +############################################################################### +# ============LICENSE_START======================================================= +# org.onap.dmaap +# ================================================================================ +# Copyright � 2017 AT&T Intellectual Property. All rights reserved. +# ================================================================================ +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ============LICENSE_END========================================================= +# +# ECOMP is a trademark and service mark of AT&T Intellectual Property. +# +############################################################################### +############################################################################### +## +## Cambria API Server config +## +## - Default values are shown as commented settings. +## + +############################################################################### +## +## HTTP service +## +## - 3904 is standard as of 7/29/14. +# +## Zookeeper Connection +## +## Both Cambria and Kafka make use of Zookeeper. +## +config.zk.servers=zookeeper + +############################################################################### +## +## Kafka Connection +## +## Items below are passed through to Kafka's producer and consumer +## configurations (after removing "kafka.") +## if you want to change request.required.acks it can take this one value +kafka.metadata.broker.list=kafka:9092 +##kafka.request.required.acks=-1 +#kafka.client.zookeeper=${config.zk.servers} +consumer.timeout.ms=100 +zookeeper.connection.timeout.ms=6000 +zookeeper.session.timeout.ms=20000 +zookeeper.sync.time.ms=2000 +auto.commit.interval.ms=1000 +fetch.message.max.bytes =1000000 +auto.commit.enable=false + +#(backoff*retries > zksessiontimeout) +kafka.rebalance.backoff.ms=10000 +kafka.rebalance.max.retries=6 + + +############################################################################### +## +## Secured Config +## +## Some data stored in the config system is sensitive -- API keys and secrets, +## for example. to protect it, we use an encryption layer for this section +## of the config. +## +## The key is a base64 encode AES key. This must be created/configured for +## each installation. +#cambria.secureConfig.key= +## +## The initialization vector is a 16 byte value specific to the secured store. +## This must be created/configured for each installation. +#cambria.secureConfig.iv= + +## Southfield Sandbox +cambria.secureConfig.key=b/7ouTn9FfEw2PQwL0ov/Q== +cambria.secureConfig.iv=wR9xP5k5vbz/xD0LmtqQLw== +authentication.adminSecret=fe3cCompound +#cambria.secureConfig.key[pc569h]=YT3XPyxEmKCTLI2NK+Sjbw== +#cambria.secureConfig.iv[pc569h]=rMm2jhR3yVnU+u2V9Ugu3Q== + + +############################################################################### +## +## Consumer Caching +## +## Kafka expects live connections from the consumer to the broker, which +## obviously doesn't work over connectionless HTTP requests. The Cambria +## server proxies HTTP requests into Kafka consumer sessions that are kept +## around for later re-use. Not doing so is costly for setup per request, +## which would substantially impact a high volume consumer's performance. +## +## This complicates Cambria server failover, because we often need server +## A to close its connection before server B brings up the replacement. +## + +## The consumer cache is normally enabled. +#cambria.consumer.cache.enabled=true + +## Cached consumers are cleaned up after a period of disuse. The server inspects +## consumers every sweepFreqSeconds and will clean up any connections that are +## dormant for touchFreqMs. +#cambria.consumer.cache.sweepFreqSeconds=15 +cambria.consumer.cache.touchFreqMs=120000 +##stickforallconsumerrequests=false +## The cache is managed through ZK. The default value for the ZK connection +## string is the same as config.zk.servers. +#cambria.consumer.cache.zkConnect=${config.zk.servers} + +## +## Shared cache information is associated with this node's name. The default +## name is the hostname plus the HTTP service port this host runs on. (The +## hostname is determined via InetAddress.getLocalHost ().getCanonicalHostName(), +## which is not always adequate.) You can set this value explicitly here. +## +#cambria.api.node.identifier= + +#cambria.rateLimit.maxEmptyPollsPerMinute=30 +#cambria.rateLimitActual.delay.ms=10 + +############################################################################### +## +## Metrics Reporting +## +## This server can report its metrics periodically on a topic. +## +#metrics.send.cambria.enabled=true +#metrics.send.cambria.topic=cambria.apinode.metrics +#msgrtr.apinode.metrics.dmaap +#metrics.send.cambria.sendEverySeconds=60 + +cambria.consumer.cache.zkBasePath=/fe3c/cambria/consumerCache +consumer.timeout=17 + +############################################################################## +#100mb +maxcontentlength=10000 + + +############################################################################## +#AAF Properties +msgRtr.namespace.aaf=org.onap.dmaap.mr.topic +msgRtr.topicfactory.aaf=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +enforced.topic.name.AAF=org.onap.dmaap.mr +forceAAF=false +transidUEBtopicreqd=false +defaultNSforUEB=org.onap.dmaap.mr +############################################################################## +#Mirror Maker Agent +msgRtr.mirrormakeradmin.aaf=org.onap.dmaap.mr.mirrormaker|*|admin +msgRtr.mirrormakeruser.aaf=org.onap.dmaap.mr.mirrormaker|*|user +msgRtr.mirrormakeruser.aaf.create=org.onap.dmaap.mr.topicFactory|:org.onap.dmaap.mr.topic: +msgRtr.mirrormaker.timeout=15000 +msgRtr.mirrormaker.topic=org.onap.dmaap.mr.mmagent +msgRtr.mirrormaker.consumergroup=mmagentserver +msgRtr.mirrormaker.consumerid=1 + +kafka.max.poll.interval.ms=300000 +kafka.heartbeat.interval.ms=60000 +kafka.session.timeout.ms=240000 +kafka.max.poll.records=1000 \ No newline at end of file diff --git a/csit/scripts/dmaap-message-router/docker-compose/mr/cadi.properties b/csit/scripts/dmaap-message-router/docker-compose/mr/cadi.properties new file mode 100644 index 0000000..e7d056b --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/mr/cadi.properties @@ -0,0 +1,19 @@ +aaf_locate_url=https://aaf-onap-test.osaaf.org:8095\ +aaf_url=https://AAF_LOCATE_URL/onap.org.osaaf.aaf.service:2.1 +aaf_env=DEV +aaf_lur=org.onap.aaf.cadi.aaf.v2_0.AAFLurPerm + +cadi_truststore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.trust.jks +cadi_truststore_password=8FyfX+ar;0$uZQ0h9*oXchNX + +cadi_keyfile=/appl/dmaapMR1/etc/org.onap.dmaap.mr.keyfile + +cadi_alias=dmaapmr@mr.dmaap.onap.org +cadi_keystore=/appl/dmaapMR1/etc/org.onap.dmaap.mr.p12 +cadi_keystore_password=GDQttV7)BlOvWMf6F7tz&cjy +cadi_x509_issuers=CN=intermediateCA_1, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_7, OU=OSAAF, O=ONAP, C=US:CN=intermediateCA_9, OU=OSAAF, O=ONAP, C=US + +cadi_loglevel=INFO +cadi_protocols=TLSv1.1,TLSv1.2 +cadi_latitude=37.78187 +cadi_longitude=-122.26147 \ No newline at end of file diff --git a/csit/scripts/dmaap-message-router/docker-compose/mr/logback.xml b/csit/scripts/dmaap-message-router/docker-compose/mr/logback.xml new file mode 100644 index 0000000..f02a2db --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/mr/logback.xml @@ -0,0 +1,208 @@ + + + + ${module.ajsc.namespace.name} + + + + + ERROR + ACCEPT + DENY + + + %d{HH:mm:ss.SSS} [%thread] %-5level %logger{1024} - %msg%n + + + + + + + INFO + ACCEPT + DENY + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + class="ch.qos.logback.core.ConsoleAppender"> + + ERROR + ACCEPT + DENY + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + + + + "%d [%thread] %-5level %logger{1024} - %msg%n" + + + + 1000 + 0 + + + + + + + + + + + 1000 + 0 + + + + + + + + + + + + + + + + diff --git a/csit/scripts/dmaap-message-router/docker-compose/zk/zk_server_jaas.conf b/csit/scripts/dmaap-message-router/docker-compose/zk/zk_server_jaas.conf new file mode 100644 index 0000000..26bf460 --- /dev/null +++ b/csit/scripts/dmaap-message-router/docker-compose/zk/zk_server_jaas.conf @@ -0,0 +1,4 @@ +Server { + org.apache.zookeeper.server.auth.DigestLoginModule required + user_kafka=kafka_secret; +}; \ No newline at end of file diff --git a/csit/scripts/get-instance-ip.sh b/csit/scripts/get-instance-ip.sh new file mode 100755 index 0000000..a236c02 --- /dev/null +++ b/csit/scripts/get-instance-ip.sh @@ -0,0 +1,17 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' $1 diff --git a/csit/scripts/kill-instance.sh b/csit/scripts/kill-instance.sh new file mode 100755 index 0000000..5997098 --- /dev/null +++ b/csit/scripts/kill-instance.sh @@ -0,0 +1,31 @@ +#!/bin/bash +# +# Copyright 2016-2017 Huawei Technologies Co., Ltd. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# +# $1 nickname for the instance + +mkdir -p $WORKSPACE/archives + +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 + -- cgit 1.2.3-korg