From a234fdb5b6b61bbf1dbb8a730208199f1fdb2a16 Mon Sep 17 00:00:00 2001 From: "halil.cakal" Date: Fri, 9 May 2025 11:13:07 +0100 Subject: [PATCH] Split big docker-compose into smaller ones - split the big docker-compose and remove - two new docker-compose: cps-base and dmi-services - remove monitoring profile from: kafka-ui, prometheus, and grafana since they are not an overhead to performance - kept 'tracing' profile for 'jaeger-service' because it reduced the performance by around 4 times (see the jira for more details) - documentation updated Issue-ID: CPS-2730 Change-Id: I4d9cdd82c96c2864c8eb7415b6857a4d2df898fc Signed-off-by: halil.cakal --- csit/plans/cps/setup.sh | 8 +- docker-compose/README.md | 68 ++------- .../{docker-compose.yml => cps-base.yml} | 170 +++------------------ docker-compose/dmi-services.yml | 137 +++++++++++++++++ k6-tests/README.md | 9 +- k6-tests/setup.sh | 5 +- k6-tests/teardown.sh | 4 +- test-tools/perf-test-ncmp-passthrough-read.sh | 4 +- 8 files changed, 186 insertions(+), 219 deletions(-) rename docker-compose/{docker-compose.yml => cps-base.yml} (60%) create mode 100644 docker-compose/dmi-services.yml diff --git a/csit/plans/cps/setup.sh b/csit/plans/cps/setup.sh index 5591e474c7..b16a07d246 100755 --- a/csit/plans/cps/setup.sh +++ b/csit/plans/cps/setup.sh @@ -29,14 +29,14 @@ export LOCAL_IP=localhost source $WORKSPACE/plans/cps/test.properties export $(cut -d= -f1 $WORKSPACE/plans/cps/test.properties) -###################### setup cps-ncmp ############################ +###################### setup cps-and-ncmp with dmi-services ############################ 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 --profile dmi-stub up -d --quiet-pull --wait || exit 1 +# Start cps-base and dmi-services with docker compose, and wait for all containers to be healthy. +docker-compose -f cps-base.yml -f dmi-services.yml up -d --quiet-pull --wait || exit 1 ###################### ROBOT Configurations ########################## -# Pass variables required for Robot test suites in ROBOT_VARIABLES +# 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 \ diff --git a/docker-compose/README.md b/docker-compose/README.md index b321c80edf..91f0bc5ac4 100644 --- a/docker-compose/README.md +++ b/docker-compose/README.md @@ -21,7 +21,7 @@ ============LICENSE_END========================================================= --> -# Building and running CPS locally +# Building and Running CPS Locally ## Building Java Archive only @@ -32,7 +32,7 @@ without generating any docker images: mvn clean install -Pcps-docker -Pncmp-docker -Pcps-ncmp-docker -Djib.skip ``` -## Building Java Archive and Docker images +## Building Java Archive and Docker Images * Following command builds the JAR file and also generates the Docker image for all CPS components: @@ -47,66 +47,28 @@ mvn clean install -Pcps-docker -Pncmp-docker -Pcps-ncmp-docker mvn clean install -P ``` -## Running Docker containers +## Running Docker Containers -`docker-compose/docker-compose.yml` file is provided to be run with `docker-compose` tool and images previously built. -It starts both Postgres database and CPS services. - -1. Edit `docker-compose.yml` - 1. uncomment desired service to be deployed, by default `cps-and-ncmp` is enabled. You can comment it and uncomment `cps-standalone` or `ncmp-standalone`. - 2. To send data-updated events to kafka, - * uncomment the `zookeeper` and `kafka` services. - * uncomment environment variables - * `KAFKA_BOOTSTRAP_SERVER: kafka:9092` -2. Execute following command from `docker-compose` folder: - -Use one of the below version type that has been generated in the local system's docker image list after the build. +`docker-compose/cps-base.yml` contains the base services required to run CPS and NCMP. +This deployment can also be used for KPI test. Please run the following command from `docker-compose` folder: ```bash -VERSION=latest DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d +docker-compose -f cps-base.yml up -d or -VERSION= DB_USERNAME=cps DB_PASSWORD=cps docker-compose up -d +docker-compose -f cps-base.yml --profile tracing up -d ``` -## Running Docker containers with profile: monitoring - -Run docker-compose with profile, monitoring, then it will start monitoring services: -* prometheus -* grafana -* kafka-ui - +`docker-compose/dmi-services.yml` contains the DMI services including SDNC and PNF Simulator. +This deployment is required for the CSIT test. ```bash -docker-compose --profile monitoring up -d +docker-compose -f cps-base.yml -f dmi-services.yml up -d ``` -### prometheus service -It collects and stores metrics as time series data, recording information with a timestamp. - -The environment variable, PROMETHEUS_RETENTION_TIME, is used to set the retention time for the metrics -in the prometheus database. The default value is 15d, but can be changed to any value. - -To be able to use the historical data, the prometheus container should not be removed. -Instead, it can be stopped and started using the following commands: - -```bash -docker-compose start prometheus -``` - -```bash -docker-compose stop prometheus -``` - -## Running or debugging Java built code - -Before running CPS, a Postgres database instance needs to be started. This can be done with following -command: - +To deploy services that are required for Endurance test, please use the following command: ```bash -docker run --name postgres -p 5432:5432 -d \ - -e POSTGRES_DB=cpsdb -e POSTGRES_USER=cps -e POSTGRES_PASSWORD=cps \ - postgres:12.4-alpine +docker-compose -f cps-base.yml --project-name endurance --env-file env/endurance.env up -d ``` -Then CPS can be started either using a Java Archive previously built or directly from Intellij IDE. +To stop any deployment, please replace `up -d` flag with `down` in the above commands. ### Running from Jar Archive @@ -136,7 +98,7 @@ Swagger UI and Open API specifications are available to discover service endpoin * `http://localhost:/api-docs/cps-ncmp/openapi.yaml` * `http://localhost:/api-docs/cps-ncmp/openapi-inventory.yaml` -with being either `8080` if running the plain Java build or retrieved using following command +with is being either `8080` if running the plain Java build or retrieved using following command if running from `docker-compose`: ```bash @@ -145,4 +107,4 @@ docker inspect \ ``` -Enjoy CPS ! +Enjoy CPS! diff --git a/docker-compose/docker-compose.yml b/docker-compose/cps-base.yml similarity index 60% rename from docker-compose/docker-compose.yml rename to docker-compose/cps-base.yml index 38dcb5d237..2391fb2441 100644 --- a/docker-compose/docker-compose.yml +++ b/docker-compose/cps-base.yml @@ -18,14 +18,13 @@ services: - ### docker-compose --profile dmi-service up -d --wait -> run CPS services incl. dmi-plugin - ### docker-compose --profile dmi-stub --profile monitoring up -d -> run CPS with stubbed dmi-plugin (for registration performance testing) - ### docker-compose --profile dmi-stub --profile tracing up -d -> run CPS with stubbed dmi-plugin (for open telemetry tracing testing make ONAP_TRACING_ENABLED "true" later "http://localhost:16686" can be accessed from browser) - ### docker-compose --profile dmi-stub --profile policy-executor-stub up -d -> run CPS with stubbed dmi-plugin and policy executor stub (for policy executor service testing make POLICY_SERVICE_ENABLED "true") - ### to disable notifications make notification.enabled to false & comment out kafka/zookeeper services + ### docker-compose -f cps-base.yml up -d -> run CPS with stubbed dmi-plugin (DMI-stub, and monitoring services for k6 testing) + ### docker-compose -f cps-base.yml --profile tracing up -d -> run CPS with stubbed dmi-plugin (DMI-stub for k6 testing with jaeger tracing) + ### docker-compose -f cps-base.yml -f dmi-services.yml up -d -> run CPS with dmi-plugin (cps-base, and ONAP-DMI services for CSIT testing) + ### docker-compose -f cps-base.yml --project-name endurance --env-file env/endurance.env up -d -> run CPS with DMI-stub for Endurance testing + ### docker-compose -f cps-base.yml --project-name endurance down --volumes -> stop and remove containers and volumes + ### To disable notification make notification.enabled to false and comment out kafka/zookeeper services ### DEBUG: Look for '### DEBUG' comments to enable CPS-NCMP debugging - ### docker-compose --profile dmi-stub --project-name endurance --env-file env/endurance.env up -d -> run CPS with stubbed dmi-plugin for endurance testing - ### docker-compose --profile dmi-stub --project-name endurance down --volumes dbpostgresql: container_name: ${DB_CONTAINER_NAME:-dbpostgresql} @@ -52,12 +51,12 @@ services: interval: 10s # How often the health is run. retries: 3 # If 3 health checks fail, the container is unhealthy. start_period: 30s # Ignore failed health checks for first 30 seconds, to give system time to start - # Full start up time allowed = 30 seconds start period + 3 tries * 10 seconds interval = 60 seconds + ### Full start-up time allowed = 30 seconds start period + 3 tries * 10 seconds interval = 60 seconds cps-and-ncmp-template: image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/cps-and-ncmp:${CPS_VERSION:-latest} - ### DEBUG: Uncomment next line to enable java debugging (ensure 'ports' aligns with 'deploy') - ### - ${CPS_CORE_DEBUG_PORT:-5005}:5005- + ### DEBUG: Uncomment next line to enable java debugging (ensure 'ports' aligns with 'deploy') + ### - ${CPS_CORE_DEBUG_PORT:-5005}:5005- environment: DB_HOST: ${DB_HOST:-dbpostgresql} DB_USERNAME: ${DB_USERNAME:-cps} @@ -74,10 +73,8 @@ services: CPS_MONITORING_MICROMETER_JVM_EXTRAS: 'true' JAVA_TOOL_OPTIONS: "-XX:InitialRAMPercentage=70.0 -XX:MaxRAMPercentage=70.0" ### DEBUG: Uncomment next line to enable java debugging - # JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 + ### JAVA_TOOL_OPTIONS: -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=*:5005 restart: on-failure:3 - depends_on: - - dbpostgresql deploy: replicas: 0 resources: @@ -101,6 +98,8 @@ services: hostname: cps-ncmp-0 ports: - ${CPS_INSTANCE_0_REST_PORT:-8698}:8080 + depends_on: + - dbpostgresql ### DEBUG: For easier debugging use just 1 instance and comment out below cps-and-ncmp-1: @@ -112,6 +111,8 @@ services: hostname: cps-ncmp-1 ports: - ${CPS_INSTANCE_1_REST_PORT:-8699}:8080 + depends_on: + - dbpostgresql nginx: container_name: ${NGINX_CONTAINER_NAME:-nginx-loadbalancer} @@ -132,7 +133,7 @@ services: retries: 3 start_period: 60s - ### if kafka is not required comment out zookeeper and kafka ### + ### if kafka is not required, comment out zookeeper and kafka zookeeper: image: confluentinc/cp-zookeeper:7.8.0 container_name: ${ZOOKEEPER_CONTAINER_NAME:-zookeeper} @@ -167,40 +168,6 @@ services: retries: 3 start_period: 30s - ncmp-dmi-plugin: - container_name: ${NCMP_DMI_PLUGIN_CONTAINER_NAME:-ncmp-dmi-plugin} - 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:-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} - SDNC_PORT: ${SDNC_PORT:-8181} - SDNC_USERNAME: ${SDNC_USERNAME:-admin} - SDNC_PASSWORD: ${SDNC_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} - DMI_SERVICE_URL: ${DMI_SERVICE_URL:-http://ncmp-dmi-plugin:8783} - DMI_SERVICE_NAME: ${DMI_SERVICE_NAME:-dminame1} - DMI_USERNAME: ${DMI_USERNAME:-cpsuser} - DMI_PASSWORD: ${DMI_PASSWORD:-cpsr0cks!} - KAFKA_BOOTSTRAP_SERVER: kafka:29092 - restart: unless-stopped - profiles: - - dmi-service - healthcheck: - test: wget -q -O - http://localhost:8080/actuator/health/readiness | grep -q '{"status":"UP"}' || exit 1 - interval: 10s - timeout: 10s - retries: 3 - start_period: 30s - ncmp-dmi-plugin-demo-and-csit-stub: container_name: ${NCMP_DMI_PLUGIN_DEMO_AND_CSIT_STUB_CONTAINER_NAME:-ncmp-dmi-plugin-demo-and-csit-stub} image: ${DOCKER_REPO:-nexus3.onap.org:10003}/onap/dmi-stub:${DMI_DEMO_STUB_VERSION:-latest} @@ -216,8 +183,6 @@ services: READ_DATA_FOR_CM_HANDLE_DELAY_MS: 300 WRITE_DATA_FOR_CM_HANDLE_DELAY_MS: 670 restart: unless-stopped - profiles: - - dmi-stub healthcheck: test: wget -q -O - http://localhost:8092/actuator/health/readiness | grep -q '{"status":"UP"}' || exit 1 interval: 10s @@ -225,106 +190,12 @@ 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 ports: - ${POLICY_EXECUTOR_STUB_PORT:-8785}:8093 restart: unless-stopped - profiles: - - policy-executor-stub # Note policy-executor-stub does not have a healthcheck as it does not expose /actuator/health endpoint prometheus: @@ -338,8 +209,7 @@ services: - prometheus_data:/prometheus environment: - PROMETHEUS_RETENTION_TIME=${PROMETHEUS_RETENTION_TIME:-30d} - profiles: - - monitoring + grafana: image: grafana/grafana:latest @@ -359,8 +229,7 @@ services: environment: - GF_SECURITY_ADMIN_PASSWORD=admin - GF_SERVER_DOMAIN=localhost - profiles: - - monitoring + kafka-ui: container_name: ${KAFKA_UI_CONTAINER_NAME:-kafka-ui} @@ -371,8 +240,7 @@ services: DYNAMIC_CONFIG_ENABLED: 'true' KAFKA_CLUSTERS_0_NAME: 'cps-kafka-local' KAFKA_CLUSTERS_0_BOOTSTRAPSERVERS: kafka:29092 - profiles: - - monitoring + jaeger-service: container_name: ${JAEGER_SERVICE_CONTAINER_NAME:-jaeger-service} @@ -397,4 +265,4 @@ volumes: grafana: driver: local prometheus_data: - driver: local + driver: local \ No newline at end of file diff --git a/docker-compose/dmi-services.yml b/docker-compose/dmi-services.yml new file mode 100644 index 0000000000..75434cc20f --- /dev/null +++ b/docker-compose/dmi-services.yml @@ -0,0 +1,137 @@ +# ============LICENSE_START======================================================= +# Copyright (C) 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. +# 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: + + ### docker-compose -f dmi-services.yml up -d -> run ONAP-DMI plugin, and related services such as SDNC, and PNF-Simulator + ### docker-compose -f dmi-services.yml down -> stop ONAP-DMI plugin, and related services + ### docker-compose -f cps-base.yml -f dmi-services.yml up -d -> run cps-and-ncmp with ONAP dmi-plugin + + 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} + healthcheck: + test: healthcheck.sh --connect --innodb_initialized || exit 1 + interval: 10s + timeout: 10s + 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 + 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 + + 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 + healthcheck: + test: nc -z 127.0.0.1 6513 || exit 1 + interval: 10s + timeout: 10s + retries: 3 + start_period: 30s + + 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 + # Note: This container does not need a health-check as it immediately exits with status 0 or 1. + + ncmp-dmi-plugin: + container_name: ${NCMP_DMI_PLUGIN_CONTAINER_NAME:-ncmp-dmi-plugin} + 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:-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} + SDNC_PORT: ${SDNC_PORT:-8181} + SDNC_USERNAME: ${SDNC_USERNAME:-admin} + SDNC_PASSWORD: ${SDNC_PASSWORD:-Kp8bJ4SXszM0WXlhak3eHlcse2gAw84vaoGGmJvUy2U} + DMI_SERVICE_URL: ${DMI_SERVICE_URL:-http://ncmp-dmi-plugin:8783} + DMI_SERVICE_NAME: ${DMI_SERVICE_NAME:-dminame1} + DMI_USERNAME: ${DMI_USERNAME:-cpsuser} + DMI_PASSWORD: ${DMI_PASSWORD:-cpsr0cks!} + KAFKA_BOOTSTRAP_SERVER: kafka:29092 + restart: unless-stopped + healthcheck: + test: wget -q -O - http://localhost:8080/actuator/health/readiness | grep -q '{"status":"UP"}' || exit 1 + interval: 10s + timeout: 10s + retries: 3 + start_period: 30s \ No newline at end of file diff --git a/k6-tests/README.md b/k6-tests/README.md index 506e6a78a7..84c5e032af 100644 --- a/k6-tests/README.md +++ b/k6-tests/README.md @@ -8,8 +8,9 @@ Follow the instructions in the [build from source guide](https://github.com/most ## Running the k6 test suites These tests measure the system capabilities as per requirements. -There are two test profiles can be run with either: kpi or endurance. -Simply run the main script. (The script assumes k6 and the relevant docker-compose have been installed). +There are two test profiles that can be run with either: kpi or endurance. +Run the main script. +(The script assumes k6 and the relevant docker-compose have been installed). ```shell ./run-k6-tests.sh kpi ``` @@ -17,10 +18,10 @@ Simply run the main script. (The script assumes k6 and the relevant docker-compo ## Running k6 tests manually Before running tests, ensure CPS/NCMP is running: ```shell -docker-compose -f docker-compose/docker-compose.yml --profile dmi-stub up +docker-compose -f docker-compose/cps-base.yml up -d ``` -To run an individual test from command line, use +To run an individual test from the command line, use ```shell k6 run ncmp/ncmp-test-runner.js ``` diff --git a/k6-tests/setup.sh b/k6-tests/setup.sh index d990475522..3d486a92c4 100755 --- a/k6-tests/setup.sh +++ b/k6-tests/setup.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2024-2025 Nordix Foundation. +# Copyright 2024-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. @@ -20,10 +20,9 @@ echo "Spinning off the CPS and NCMP containers for $testProfile testing..." ENV_FILE="../docker-compose/env/${testProfile}.env" docker-compose \ - --file "../docker-compose/docker-compose.yml" \ + --file "../docker-compose/cps-base.yml" \ --env-file "$ENV_FILE" \ --project-name "$testProfile" \ - --profile dmi-stub \ up --quiet-pull --detach --wait || exit 1 if [[ "$testProfile" == "kpi" ]]; then diff --git a/k6-tests/teardown.sh b/k6-tests/teardown.sh index 6716a0b931..bbe6c243b4 100755 --- a/k6-tests/teardown.sh +++ b/k6-tests/teardown.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# Copyright 2024-2025 Nordix Foundation. +# Copyright 2024-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. @@ -23,7 +23,7 @@ chmod +x make-logs.sh ./make-logs.sh testProfile=$1 -docker_compose_shutdown_cmd="docker-compose -f ../docker-compose/docker-compose.yml --profile dmi-stub --project-name $testProfile down --volumes" +docker_compose_shutdown_cmd="docker-compose -f ../docker-compose/cps-base.yml --project-name $testProfile down --volumes" remove_onap_docker_images_cmd="docker images | grep "onap" | awk '{print $3}' | xargs docker rmi" # Verify number of docker images after deletion on teardown of endurance testing diff --git a/test-tools/perf-test-ncmp-passthrough-read.sh b/test-tools/perf-test-ncmp-passthrough-read.sh index 3460dddcaa..08790629cc 100755 --- a/test-tools/perf-test-ncmp-passthrough-read.sh +++ b/test-tools/perf-test-ncmp-passthrough-read.sh @@ -33,8 +33,8 @@ WARMUP_REQUESTS=600 MEASUREMENT_REQUESTS=240 SCRIPT_DIR=$(dirname -- "${BASH_SOURCE[0]}") -# Read DMI delay from docker-compose.yml -DMI_DATA_DELAY=$(grep 'DATA_FOR_CM_HANDLE_DELAY_MS:' "$SCRIPT_DIR"/../docker-compose/docker-compose.yml | grep -oE '[0-9]+') +# Read DMI delay from cps-base.yml +DMI_DATA_DELAY=$(grep 'DATA_FOR_CM_HANDLE_DELAY_MS:' "$SCRIPT_DIR"/../docker-compose/cps-base.yml | grep -oE '[0-9]+') function cmHandleExists() { local cmHandleId=$1 -- 2.16.6