From: danielhanrahan Date: Tue, 11 Feb 2025 18:34:57 +0000 (+0000) Subject: Move SDNC and PNFSim into docker-compose for CSITs X-Git-Tag: 3.6.2~16^2 X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=88e2a82e5bb6181efbc054a210c4f3ed655b4528;p=cps.git Move SDNC and PNFSim into docker-compose for CSITs To improve reliability of healthchecks in CSITs, they are implemented in docker-compose. This commit moves SDNC and dependencies into main docker-compose and adds healthchecks to them. This improves the CSIT in that tests will quickly fail if SDNC or PNFsim containers fail to start (currently tests run anyway even if containers are not ready). - Move SDNC, MariaDB and PNFSim containers to main docker-compose - Add healthchecks and timeouts for those containers - Move node mounting script as a sidecar container so it is protected by healthchecks Issue-ID: CPS-2632 Signed-off-by: danielhanrahan Change-Id: Ib53522c2f756d3ce2c6d6b7472cb4c65359fe355 --- diff --git a/csit/plans/cps/pnfsim/docker-compose.yml b/csit/plans/cps/pnfsim/docker-compose.yml deleted file mode 100644 index 869df22789..0000000000 --- a/csit/plans/cps/pnfsim/docker-compose.yml +++ /dev/null @@ -1,27 +0,0 @@ -# ============LICENSE_START======================================================= -# Modifications Copyright (C) 2022-2024 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========================================================= - -services: - netconf-pnp-simulator: - image: blueonap/netconf-pnp-simulator:v2.8.6 - container_name: netconf-simulator - restart: always - ports: - - "831:830" - - "6512:6513" - volumes: - - ./netconf-config:/config/modules/stores - - ./tls:/config/tls diff --git a/csit/plans/cps/sdnc/check_sdnc_mount_node.sh b/csit/plans/cps/sdnc/check_sdnc_mount_node.sh deleted file mode 100644 index e92cec717f..0000000000 --- a/csit/plans/cps/sdnc/check_sdnc_mount_node.sh +++ /dev/null @@ -1,82 +0,0 @@ -# ============LICENSE_START======================================================= -# Copyright (C) 2023-2024 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========================================================= - -# WAIT 10 minutes maximum and test every 30 seconds if SDNC is up using HealthCheck API -TIME_OUT=600 -INTERVAL=30 -TIME=0 -while [ "$TIME" -lt "$TIME_OUT" ]; do - response=$(curl --write-out '%{http_code}' --silent --output /dev/null -H "Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==" -X POST -H "X-FromAppId: csit-sdnc" -H "X-TransactionId: csit-sdnc" -H "Accept: application/json" -H "Content-Type: application/json" http://$SDNC_HOST:$SDNC_PORT/restconf/operations/SLI-API:healthcheck ); - echo $response - - if [ "$response" == "200" ]; then - echo SDNC started in $TIME seconds - break; - fi - - echo Sleep: $INTERVAL seconds before testing if SDNC is up. Total wait time up now is: $TIME seconds. Timeout is: $TIME_OUT seconds - sleep $INTERVAL - TIME=$(($TIME+$INTERVAL)) -done - -if [ "$TIME" -ge "$TIME_OUT" ]; then - echo TIME OUT: karaf session not started in $TIME_OUT seconds... Could cause problems for testing activities... -fi - -###################### mount pnf-sim as PNFDemo ########################## -SDNC_TIME_OUT=250 -SDNC_INTERVAL=10 -SDNC_TIME=0 - -while [ "$SDNC_TIME" -le "$SDNC_TIME_OUT" ]; do - - # Mount netconf node - curl --location --request PUT 'http://'$SDNC_HOST:$SDNC_PORT'/restconf/config/network-topology:network-topology/topology/topology-netconf/node/ietfYang-PNFDemo' \ - --header 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' \ - --header 'Content-Type: application/json' \ - --data-raw '{ - "node": [ - { - "node-id": "ietfYang-PNFDemo", - "netconf-node-topology:protocol": { - "name": "TLS" - }, - "netconf-node-topology:host": "'$LOCAL_IP'", - "netconf-node-topology:key-based": { - "username": "netconf", - "key-id": "ODL_private_key_0" - }, - "netconf-node-topology:port": 6512, - "netconf-node-topology:tcp-only": false, - "netconf-node-topology:max-connection-attempts": 5 - } - ] - }' - - # Verify node has been mounted - - RESPONSE=$( curl --location --request GET 'http://'$SDNC_HOST:$SDNC_PORT'/restconf/config/network-topology:network-topology/topology/topology-netconf' --header 'Authorization: basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==') - - if [[ "$RESPONSE" == *"ietfYang-PNFDemo"* ]]; then - echo "Node mounted in $SDNC_TIME" - sleep 10 - break; - fi - - sleep $SDNC_INTERVAL - SDNC_TIME=$((SDNC_TIME + SDNC_INTERVAL)) - -done \ No newline at end of file diff --git a/csit/plans/cps/sdnc/docker-compose.yml b/csit/plans/cps/sdnc/docker-compose.yml deleted file mode 100644 index 29e8293fde..0000000000 --- a/csit/plans/cps/sdnc/docker-compose.yml +++ /dev/null @@ -1,71 +0,0 @@ -# ============LICENSE_START======================================================= -# Modifications Copyright (C) 2022 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========================================================= - -services: - mariadb: - image: mariadb:10.5 - ports: - - "3306:3306" - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password} - - MYSQL_ROOT_HOST=% - - MYSQL_USER=${MYSQL_USER:-sdnc} - - MYSQL_PASSWORD=${MYSQL_PASSWORD:-password} - - MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" - - sdnc: - image: onap/sdnc-image:${VERSION:-2.2.3} - container_name: sdnc - depends_on : - - mariadb - entrypoint: ["/opt/onap/sdnc/bin/startODL.sh"] - ports: - - "8282:8181" - hostname: - sdnc - links: - - mariadb:dbhost - - mariadb:sdnctldb01 - - mariadb:sdnctldb02 - environment: - - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password} - - MYSQL_USER=${MYSQL_USER:-sdnc} - - MYSQL_PASSWORD=${MYSQL_PASSWORD:-password} - - MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} - - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties - - SDNC_BIN=/opt/onap/sdnc/bin - - ODL_CERT_DIR=/opt/opendaylight/certs - - ODL_ADMIN_USERNAME=${ODL_USER:-admin} - - ODL_ADMIN_PASSWORD=${ODL_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} - - SDNC_DB_INIT=true - - SQL_CRYPTKEY=${SQL_CRYPTKEY:-fakECryptKey} - - volumes: - - ./certs/certs.properties:/opt/opendaylight/certs/certs.properties - - ./certs/keys0.zip:/opt/opendaylight/certs/keys0.zip - - dns: - - ${DNS_IP_ADDR-10.0.100.1} - logging: - driver: "json-file" - options: - max-size: "30m" - max-file: "5" \ No newline at end of file diff --git a/csit/plans/cps/sdnc/sdnc_setup.sh b/csit/plans/cps/sdnc/sdnc_setup.sh deleted file mode 100644 index 61c61fc289..0000000000 --- a/csit/plans/cps/sdnc/sdnc_setup.sh +++ /dev/null @@ -1,27 +0,0 @@ -#!/bin/bash -# -# ============LICENSE_START======================================================= -# Copyright (C) 2021-2022 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========================================================= - -# @author Rahul Tyagi (rahul.tyagi@est.tech) -# setup sdnc - -export SDNC_CERT_PATH=$WORKSPACE/plans/cps/sdnc/certs - -#start SDNC containers with docker compose and configuration from docker-compose.yml -docker-compose -f $WORKSPACE/plans/cps/sdnc/docker-compose.yml up -d \ No newline at end of file diff --git a/csit/plans/cps/setup.sh b/csit/plans/cps/setup.sh index 332be8c461..f22173a9fd 100755 --- a/csit/plans/cps/setup.sh +++ b/csit/plans/cps/setup.sh @@ -5,7 +5,7 @@ # Modifications copyright (c) 2020-2021 Samsung Electronics Co., Ltd. # Modifications Copyright (C) 2021 Pantheon.tech # Modifications Copyright (C) 2021 Bell Canada. -# Modifications Copyright (C) 2021-2025 Nordix Foundation. +# Modifications Copyright (C) 2021-2025 OpenInfra Foundation Europe. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -24,7 +24,7 @@ ###################### setup env ############################ # Set env variables for docker compose -export LOCAL_IP=$((ip -4 addr show docker0 | grep -Po 'inet \K[\d.]+') || hostname -I | awk '{print $1}') +export LOCAL_IP=localhost source $WORKSPACE/plans/cps/test.properties export $(cut -d= -f1 $WORKSPACE/plans/cps/test.properties) @@ -33,14 +33,17 @@ export $(cut -d= -f1 $WORKSPACE/plans/cps/test.properties) cd $CPS_HOME/docker-compose # start CPS/NCMP, DMI Plugin, and PostgreSQL containers with docker compose, waiting for all containers to be healthy -docker-compose --profile dmi-service up -d --quiet-pull --wait || exit 1 - -###################### setup sdnc ####################################### -source $WORKSPACE/plans/cps/sdnc/sdnc_setup.sh - -###################### setup pnfsim ##################################### -docker-compose -f $WORKSPACE/plans/cps/pnfsim/docker-compose.yml up -d +docker-compose --profile dmi-service --profile dmi-stub up -d --quiet-pull --wait || exit 1 ###################### ROBOT Configurations ########################## # Pass variables required for Robot test suites in ROBOT_VARIABLES -ROBOT_VARIABLES="-v CPS_CORE_HOST:$CPS_CORE_HOST -v CPS_CORE_PORT:$CPS_CORE_PORT -v DMI_HOST:$LOCAL_IP -v DMI_PORT:$DMI_PORT -v DMI_VERSION:$DMI_VERSION -v DMI_CSIT_STUB_HOST:$LOCAL_IP -v DMI_CSIT_STUB_PORT:$DMI_DEMO_STUB_PORT -v DMI_AUTH_ENABLED:$DMI_AUTH_ENABLED -v DATADIR_CPS_CORE:$WORKSPACE/data/cps-core -v DATADIR_NCMP:$WORKSPACE/data/ncmp -v DATADIR_SUBS_NOTIFICATION:$WORKSPACE/data/subscription-notification --exitonfailure" +ROBOT_VARIABLES="\ +-v CPS_CORE_HOST:$CPS_CORE_HOST \ +-v CPS_CORE_PORT:$CPS_CORE_PORT \ +-v DMI_HOST:$DMI_HOST \ +-v DMI_PORT:$DMI_PORT \ +-v DMI_CSIT_STUB_HOST:$DMI_DEMO_STUB_HOST \ +-v DMI_CSIT_STUB_PORT:$DMI_DEMO_STUB_PORT \ +-v DATADIR_CPS_CORE:$WORKSPACE/data/cps-core \ +-v DATADIR_NCMP:$WORKSPACE/data/ncmp \ +-v DATADIR_SUBS_NOTIFICATION:$WORKSPACE/data/subscription-notification" diff --git a/csit/plans/cps/test.properties b/csit/plans/cps/test.properties index 52e82bdb85..ce218320af 100644 --- a/csit/plans/cps/test.properties +++ b/csit/plans/cps/test.properties @@ -1,9 +1,9 @@ -DB_HOST=$LOCAL_IP +DB_HOST=dbpostgresql DB_USERNAME=cps DB_PASSWORD=cps -SDNC_HOST=$LOCAL_IP -SDNC_PORT=8282 +SDNC_HOST=sdnc +SDNC_PORT=8181 SDNC_USERNAME=admin SDNC_PASSWORD=Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U @@ -12,23 +12,24 @@ CPS_CORE_PORT=8883 CPS_CORE_USERNAME=cpsuser CPS_CORE_PASSWORD=cpsr0cks! -DMI_HOST=$LOCAL_IP -DMI_PORT=8783 +DMI_HOST=ncmp-dmi-plugin +DMI_PORT=8080 DMI_USERNAME=cpsuser DMI_PASSWORD=cpsr0cks! -DMI_SERVICE_URL=http://$LOCAL_IP:$DMI_PORT +DMI_SERVICE_URL=http://$DMI_HOST:$DMI_PORT DOCKER_REPO=nexus3.onap.org:10003 CPS_VERSION=latest DMI_VERSION=latest +DMI_DEMO_STUB_VERSION=latest ADVISED_MODULES_SYNC_SLEEP_TIME_MS=2000 CMHANDLE_DATA_SYNC_SLEEP_TIME_MS=2000 CPS_HOME=$CPS_HOME -DMI_DEMO_STUB_PORT=8784 -DMI_DEMO_STUB_VERSION=latest +DMI_DEMO_STUB_HOST=ncmp-dmi-plugin-demo-and-csit-stub +DMI_DEMO_STUB_PORT=8092 DMI_AUTH_ENABLED=true diff --git a/csit/plans/cps/pnfsim/netconf-config/LICENSE b/docker-compose/config/pnfsim/netconf-config/LICENSE similarity index 100% rename from csit/plans/cps/pnfsim/netconf-config/LICENSE rename to docker-compose/config/pnfsim/netconf-config/LICENSE diff --git a/csit/plans/cps/pnfsim/netconf-config/stores.yang b/docker-compose/config/pnfsim/netconf-config/stores.yang similarity index 100% rename from csit/plans/cps/pnfsim/netconf-config/stores.yang rename to docker-compose/config/pnfsim/netconf-config/stores.yang diff --git a/csit/plans/cps/pnfsim/netconf-config/subscriber.py b/docker-compose/config/pnfsim/netconf-config/subscriber.py similarity index 100% rename from csit/plans/cps/pnfsim/netconf-config/subscriber.py rename to docker-compose/config/pnfsim/netconf-config/subscriber.py diff --git a/csit/plans/cps/pnfsim/tls/ca.pem b/docker-compose/config/pnfsim/tls/ca.pem similarity index 100% rename from csit/plans/cps/pnfsim/tls/ca.pem rename to docker-compose/config/pnfsim/tls/ca.pem diff --git a/csit/plans/cps/pnfsim/tls/server_cert.pem b/docker-compose/config/pnfsim/tls/server_cert.pem similarity index 100% rename from csit/plans/cps/pnfsim/tls/server_cert.pem rename to docker-compose/config/pnfsim/tls/server_cert.pem diff --git a/csit/plans/cps/pnfsim/tls/server_key.pem b/docker-compose/config/pnfsim/tls/server_key.pem similarity index 100% rename from csit/plans/cps/pnfsim/tls/server_key.pem rename to docker-compose/config/pnfsim/tls/server_key.pem diff --git a/csit/plans/cps/sdnc/certs/certs.properties b/docker-compose/config/sdnc/certs/certs.properties similarity index 100% rename from csit/plans/cps/sdnc/certs/certs.properties rename to docker-compose/config/sdnc/certs/certs.properties diff --git a/csit/plans/cps/sdnc/certs/keys0.zip b/docker-compose/config/sdnc/certs/keys0.zip similarity index 100% rename from csit/plans/cps/sdnc/certs/keys0.zip rename to docker-compose/config/sdnc/certs/keys0.zip diff --git a/docker-compose/config/sdnc/check_sdnc_mount_node.sh b/docker-compose/config/sdnc/check_sdnc_mount_node.sh new file mode 100644 index 0000000000..8fa4bee8cf --- /dev/null +++ b/docker-compose/config/sdnc/check_sdnc_mount_node.sh @@ -0,0 +1,61 @@ +#!/bin/sh +# ============LICENSE_START======================================================= +# Copyright (C) 2025 OpenInfra Foundation Europe. 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========================================================= + +set -x # Enable command echoing +apk --no-cache add curl + +SDNC_HOST=${SDNC_HOST:-'sdnc'} +SDNC_PORT=${SDNC_PORT:-8181} +SDNC_AUTH_HEADER=${SDNC_AUTH_HEADER:-'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ=='} +PNF_SIM_HOST=${PNF_SIM_HOST:-'pnf-simulator'} +PNF_SIM_PORT=${PNF_SIM_PORT:-6513} +NODE_ID=${NODE_ID:-'ietfYang-PNFDemo'} + +echo "Attempting to mount node with id '$NODE_ID' to SDNC using RestConf" +curl --request PUT "http://$SDNC_HOST:$SDNC_PORT/restconf/config/network-topology:network-topology/topology/topology-netconf/node/$NODE_ID" \ +--silent --location \ +--header "$SDNC_AUTH_HEADER" \ +--header 'Content-Type: application/json' \ +--data-raw '{ + "node": [ + { + "node-id": "'$NODE_ID'", + "netconf-node-topology:protocol": { + "name": "TLS" + }, + "netconf-node-topology:host": "'$PNF_SIM_HOST'", + "netconf-node-topology:key-based": { + "username": "netconf", + "key-id": "ODL_private_key_0" + }, + "netconf-node-topology:port": '$PNF_SIM_PORT', + "netconf-node-topology:tcp-only": false, + "netconf-node-topology:max-connection-attempts": 5 + } + ] +}' + +# Verify node has been mounted +RESPONSE=$(curl --silent --location --request GET "http://$SDNC_HOST:$SDNC_PORT/restconf/config/network-topology:network-topology/topology/topology-netconf" --header "$SDNC_AUTH_HEADER") + +if echo "$RESPONSE" | grep -q "$NODE_ID"; then + echo "Node mounted successfully" + exit 0 +else + echo "Could not mount node to SNDC" + exit 1 +fi diff --git a/docker-compose/docker-compose.yml b/docker-compose/docker-compose.yml index 49646731e2..568fab4810 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/docker-compose.yml @@ -1,7 +1,7 @@ # ============LICENSE_START======================================================= # Copyright (c) 2020 Pantheon.tech. # Modifications Copyright (C) 2021 Bell Canada. -# Modifications Copyright (C) 2022-2025 Nordix Foundation. +# Modifications Copyright (C) 2022-2025 OpenInfra Foundation Europe. # ================================================================================ # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. @@ -154,11 +154,14 @@ services: image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/ncmp-dmi-plugin:${DMI_VERSION:-1.7.0-SNAPSHOT-latest} ports: - ${DMI_PORT:-8783}:8080 + depends_on: + - sdnc + - pnf-simulator environment: CPS_USERNAME: ${CPS_CORE_USERNAME:-cpsuser} CPS_PASSWORD: ${CPS_CORE_PASSWORD:-cpsr0cks!} - CPS_CORE_HOST: ${CPS_CORE_HOST:-cps-and-ncmp} - CPS_CORE_PORT: ${CPS_CORE_PORT:-8080} + CPS_CORE_HOST: ${CPS_CORE_HOST:-nginx} + CPS_CORE_PORT: ${CPS_CORE_PORT:-80} CPS_CORE_USERNAME: ${CPS_CORE_USERNAME:-cpsuser} CPS_CORE_PASSWORD: ${CPS_CORE_PASSWORD:-cpsr0cks!} SDNC_HOST: ${SDNC_HOST:-sdnc} @@ -197,7 +200,6 @@ services: restart: unless-stopped profiles: - dmi-stub - - dmi-service healthcheck: test: wget -q -O - http://localhost:8092/actuator/health/readiness | grep -q '{"status":"UP"}' || exit 1 interval: 10s @@ -205,6 +207,98 @@ services: retries: 3 start_period: 30s + sdnc: + container_name: sdnc + image: onap/sdnc-image:${SDNC_VERSION:-2.2.3} + entrypoint: /opt/onap/sdnc/bin/startODL.sh + ports: + - 8181:8181 + depends_on: + sdnc-db: + condition: service_healthy + hostname: sdnc + links: + - sdnc-db:dbhost + - sdnc-db:sdnctldb01 + - sdnc-db:sdnctldb02 + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password} + - MYSQL_USER=${MYSQL_USER:-sdnc} + - MYSQL_PASSWORD=${MYSQL_PASSWORD:-password} + - MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} + - SDNC_CONFIG_DIR=/opt/onap/sdnc/data/properties + - SDNC_BIN=/opt/onap/sdnc/bin + - ODL_CERT_DIR=/opt/opendaylight/certs + - ODL_ADMIN_USERNAME=${SDNC_USERNAME:-admin} + - ODL_ADMIN_PASSWORD=${SDNC_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} + - SDNC_DB_INIT=true + - SQL_CRYPTKEY=${SQL_CRYPTKEY:-fakECryptKey} + volumes: + - ./config/sdnc/certs/certs.properties:/opt/opendaylight/certs/certs.properties + - ./config/sdnc/certs/keys0.zip:/opt/opendaylight/certs/keys0.zip + profiles: + - dmi-service + healthcheck: + test: "wget -q -O - --header 'Authorization: Basic YWRtaW46S3A4Yko0U1hzek0wV1hsaGFrM2VIbGNzZTJnQXc4NHZhb0dHbUp2VXkyVQ==' http://localhost:8181/restconf/operational/network-topology:network-topology || exit 1" + interval: 10s + timeout: 10s + retries: 6 + start_period: 60s + + sdnc-sidecar: # This container runs a script to mount the PNFDemo node to SDNC, needed for CSITs. + container_name: sdnc-sidecar + image: alpine:latest + volumes: + - ./config/sdnc/check_sdnc_mount_node.sh:/root/check_sdnc_mount_node.sh + command: sh /root/check_sdnc_mount_node.sh + depends_on: + sdnc: + condition: service_healthy + pnf-simulator: + condition: service_healthy + profiles: + - dmi-service + # Note: This container does not need a health-check as it immediately exits with status 0 or 1. + + sdnc-db: + container_name: sdnc-db + image: mariadb:10.5 + ports: + - 3306:3306 + environment: + - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password} + - MYSQL_ROOT_HOST=% + - MYSQL_USER=${MYSQL_USER:-sdnc} + - MYSQL_PASSWORD=${MYSQL_PASSWORD:-password} + - MYSQL_DATABASE=${MYSQL_DATABASE:-sdncdb} + profiles: + - dmi-service + healthcheck: + test: healthcheck.sh --connect --innodb_initialized || exit 1 + interval: 10s + timeout: 10s + retries: 3 + start_period: 30s + + pnf-simulator: + container_name: pnf-simulator + image: blueonap/netconf-pnp-simulator:v2.8.6 + restart: always + ports: + - 830:830 + - 6513:6513 + volumes: + - ./config/pnfsim/netconf-config:/config/modules/stores + - ./config/pnfsim/tls:/config/tls + profiles: + - dmi-service + healthcheck: + test: nc -z 127.0.0.1 6513 || exit 1 + interval: 10s + timeout: 10s + retries: 3 + start_period: 30s + policy-executor-stub: container_name: ${POLICY_EXECUTOR_STUB_CONTAINER_NAME:-policy-executor-stub} image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/policy-executor-stub:latest