Change clamp CSIT to use replicas 94/141594/2
authorakenihan <adam.kenihan@est.tech>
Wed, 23 Jul 2025 21:32:18 +0000 (22:32 +0100)
committerAdam Kenihan <adam.kenihan@est.tech>
Tue, 29 Jul 2025 13:52:41 +0000 (13:52 +0000)
Issue-ID: POLICY-5427
Change-Id: I692569785daa45ac56e284b123fc7d5011a26514
Signed-off-by: akenihan <adam.kenihan@est.tech>
compose/start-acm-replica.sh
csit/run-project-csit.sh

index a9e95b8..656e5ab 100755 (executable)
@@ -1,7 +1,7 @@
 #!/bin/bash
 #
 # ============LICENSE_START====================================================
-#  Copyright (C) 2024 Nordix Foundation.
+#  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.
@@ -41,6 +41,10 @@ while [[ "$#" -gt 0 ]]; do
             REPLICAS="${1#*=}"
             shift
             ;;
+        --grafana)
+              grafana=true
+              shift
+              ;;
         *)
             echo "Unknown option: $1"
             exit 1
@@ -69,8 +73,16 @@ fi
 
 export database=postgres
 
+
 if [ "$START" = true ]; then
-    docker compose -f compose.acm.scale.yml up -d nginx
+    if [ "$grafana" = true ]; then
+        echo "Starting policy-clamp-runtime-acm using ${database} + Grafana/Prometheus"
+        docker compose -f compose.acm.scale.yml up -d nginx grafana --remove-orphans
+        echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}"
+        echo "Grafana server: http://localhost:${GRAFANA_PORT}"
+    else
+        docker compose -f compose.acm.scale.yml up -d nginx
+    fi
 else
     containers=$(docker compose -f compose.acm.scale.yml ps --all --format '{{.Service}}')
 
index 4f48c49..2c018bb 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright 2016-2017 Huawei Technologies Co., Ltd.
 # Modification Copyright 2019 © Samsung Electronics Co., Ltd.
 # Modification Copyright 2021 © AT&T Intellectual Property.
-# Modification Copyright 2021-2025 Nordix Foundation.
+# Modification Copyright 2021-2025 OpenInfra Foundation Europe.
 # Modifications Copyright 2024-2025 Deutsche Telekom
 #
 # Licensed under the Apache License, Version 2.0 (the "License");
@@ -96,19 +96,11 @@ function check_rest_endpoint() {
 }
 
 function setup_clamp() {
-    export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot"
-    source "${DOCKER_COMPOSE_DIR}"/start-compose.sh policy-clamp-runtime-acm --grafana
-    echo "Waiting 2 minutes acm-runtime and participants to start..."
-    sleep 120
-    check_rest_endpoint "${ACM_PORT}"
-}
-
-function setup_clamp_replica() {
     export ACM_REPLICA_TEARDOWN=true
-    export ROBOT_FILES="policy-clamp-test.robot"
+    export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot"
     export TEST_ENV="docker"
     export PROJECT=clamp
-    source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --start --replicas=2
+    source "${DOCKER_COMPOSE_DIR}"/start-acm-replica.sh --start --replicas=2 --grafana
     echo "Waiting 2 minutes for the replicas to be started..."
     sleep 120
     # checking on apex-pdp status because acm-r replicas only start after apex-pdp is running
@@ -118,6 +110,14 @@ function setup_clamp_replica() {
     check_rest_endpoint "${ACM_PORT}"
 }
 
+function setup_clamp_simple() {
+    export ROBOT_FILES="policy-clamp-test.robot clamp-slas.robot"
+    source "${DOCKER_COMPOSE_DIR}"/start-compose.sh policy-clamp-runtime-acm --grafana
+    echo "Waiting 2 minutes acm-runtime and participants to start..."
+    sleep 120
+    check_rest_endpoint "${ACM_PORT}"
+}
+
 function setup_api() {
     export ROBOT_FILES="api-test.robot api-slas.robot"
     source "${DOCKER_COMPOSE_DIR}"/start-compose.sh api --grafana
@@ -240,9 +240,9 @@ function set_project_config() {
         setup_clamp
         ;;
 
-    clamp-replica | policy-clamp-replica)
-        setup_clamp_replica
-       ;;
+    clamp-simple | policy-simple)
+        setup_clamp_simple
+        ;;
 
     api | policy-api)
         setup_api