aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--compose/config/clamp/legacy/AcRuntimeParameters.yaml74
-rw-r--r--compose/config/clamp/legacy/HttpParticipantParameters.yaml45
-rw-r--r--compose/config/clamp/legacy/KubernetesParticipantParameters.yaml66
-rw-r--r--compose/config/clamp/legacy/PolicyParticipantParameters.yaml63
-rw-r--r--compose/config/clamp/legacy/SimulatorParticipantParameters.yaml50
-rw-r--r--compose/config/nginx/nginx-acm.conf17
-rw-r--r--compose/docker-compose.acm.scale.yml147
-rw-r--r--compose/docker-compose.gui.yml63
-rw-r--r--compose/docker-compose.pdp.scale.yml23
-rw-r--r--compose/docker-compose.postgres.yml25
-rw-r--r--compose/docker-compose.yml13
-rwxr-xr-xcompose/export-ports.sh1
-rwxr-xr-xcompose/get-versions.sh220
-rwxr-xr-xcompose/start-acm-replica.sh40
-rwxr-xr-xcompose/start-compose.sh20
-rwxr-xr-xcompose/start-multiple-pdp.sh8
-rw-r--r--compose/start-postgres-tests.sh7
-rwxr-xr-xcsit/run-acm-regression.sh124
-rwxr-xr-xcsit/run-k8s-csit.sh2
-rwxr-xr-xcsit/run-project-csit.sh33
-rw-r--r--policy-db-migrator/pom.xml2
-rw-r--r--policy-db-migrator/smoke-test/mariadb-clamp-tests.sh219
-rw-r--r--policy-db-migrator/smoke-test/postgres-clamp-tests.sh206
-rw-r--r--policy-db-migrator/src/main/docker/Dockerfile2
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql2
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql20
-rw-r--r--policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql20
-rw-r--r--policy-jdk/alpine/pom.xml2
-rw-r--r--policy-jdk/pom.xml2
-rw-r--r--policy-jre/alpine/pom.xml2
-rw-r--r--policy-jre/pom.xml2
-rw-r--r--policy-regression-tests/pom.xml2
-rw-r--r--pom.xml4
-rw-r--r--releases/4.0.0-container.yaml12
-rw-r--r--version.properties2
41 files changed, 1400 insertions, 260 deletions
diff --git a/compose/config/clamp/legacy/AcRuntimeParameters.yaml b/compose/config/clamp/legacy/AcRuntimeParameters.yaml
new file mode 100644
index 00000000..656b3f9f
--- /dev/null
+++ b/compose/config/clamp/legacy/AcRuntimeParameters.yaml
@@ -0,0 +1,74 @@
+spring:
+ security:
+ user:
+ name: runtimeUser
+ password: zb!XztG34
+ mvc:
+ converters:
+ preferred-json-mapper: gson
+ datasource:
+ url: jdbc:mariadb://${mariadb.host:mariadb}:${mariadb.port:3306}/clampacm
+ driverClassName: org.mariadb.jdbc.Driver
+ username: policy_user
+ password: policy_user
+ hikari:
+ connectionTimeout: 30000
+ idleTimeout: 600000
+ maxLifetime: 1800000
+ maximumPoolSize: 10
+ jpa:
+ hibernate:
+ ddl-auto: none
+ naming:
+ physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
+ implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
+ properties:
+ hibernate:
+ format_sql: true
+
+security:
+ enable-csrf: false
+
+server:
+ servlet:
+ context-path: /onap/policy/clamp/acm
+ port: 6969
+ ssl:
+ enabled: false
+ error:
+ path: /error
+
+runtime:
+ participantParameters:
+ heartBeatMs: 20000
+ maxStatusWaitMs: 200000
+ topicParameterGroup:
+ topicSources:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ fetchTimeout: 15000
+ useHttps: false
+ topicSinks:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ useHttps: false
+ acmParameters:
+ toscaElementName: org.onap.policy.clamp.acm.AutomationCompositionElement
+ toscaCompositionName: org.onap.policy.clamp.acm.AutomationComposition
+
+management:
+ endpoints:
+ web:
+ base-path: /
+ exposure:
+ include: health, metrics, prometheus
+
+metrics:
+ security:
+ disabled: false
diff --git a/compose/config/clamp/legacy/HttpParticipantParameters.yaml b/compose/config/clamp/legacy/HttpParticipantParameters.yaml
new file mode 100644
index 00000000..a26a81d0
--- /dev/null
+++ b/compose/config/clamp/legacy/HttpParticipantParameters.yaml
@@ -0,0 +1,45 @@
+spring:
+ security:
+ user:
+ name: participantUser
+ password: zb!XztG34
+ autoconfigure:
+ exclude: >
+ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,
+ org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,
+ org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+security:
+ enable-csrf: false
+participant:
+ intermediaryParameters:
+ reportingTimeIntervalMs: 120000
+ description: Participant Description
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c01
+ clampAutomationCompositionTopics:
+ topicSources:
+ - topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ fetchTimeout: 15000
+ useHttps: false
+ topicSinks:
+ - topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ useHttps: false
+ participantSupportedElementTypes:
+ - typeName: org.onap.policy.clamp.acm.HttpAutomationCompositionElement
+ typeVersion: 1.0.0
+management:
+ endpoints:
+ web:
+ exposure:
+ include: health, metrics, prometheus
+server:
+ port: 6969
+ ssl:
+ enabled: false
+ servlet:
+ context-path: /onap/policy/clamp/acm/httpparticipant
diff --git a/compose/config/clamp/legacy/KubernetesParticipantParameters.yaml b/compose/config/clamp/legacy/KubernetesParticipantParameters.yaml
new file mode 100644
index 00000000..449e9617
--- /dev/null
+++ b/compose/config/clamp/legacy/KubernetesParticipantParameters.yaml
@@ -0,0 +1,66 @@
+spring:
+ security:
+ user:
+ name: participantUser
+ password: zb!XztG34
+ autoconfigure:
+ exclude: >
+ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,
+ org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,
+ org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+security:
+ enable-csrf: false
+
+participant:
+ localChartDirectory: /home/policy/local-charts
+ infoFileName: CHART_INFO.json
+ intermediaryParameters:
+ reportingTimeIntervalMs: 120000
+ description: Participant Description
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c02
+ clampAutomationCompositionTopics:
+ topicSources:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ fetchTimeout: 15000
+ useHttps: false
+ topicSinks:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ useHttps: false
+ participantSupportedElementTypes:
+ - typeName: org.onap.policy.clamp.acm.K8SMicroserviceAutomationCompositionElement
+ typeVersion: 1.0.0
+
+management:
+ endpoints:
+ web:
+ exposure:
+ include: health, metrics, prometheus
+server:
+ port: 6969
+ ssl:
+ enabled: false
+ servlet:
+ context-path: /onap/policy/clamp/acm/k8sparticipant
+
+logging:
+ # Configuration of logging
+ level:
+ ROOT: ERROR
+ org.springframework: ERROR
+ org.springframework.data: ERROR
+ org.springframework.web.reactive.function.client.ExchangeFunctions: ERROR
+ org.onap.policy.clamp.acm.participant.kubernetes: INFO
+ file:
+ name: /var/log/onap/policy/clamp/application.log
+
+chart:
+ api:
+ enabled: false
diff --git a/compose/config/clamp/legacy/PolicyParticipantParameters.yaml b/compose/config/clamp/legacy/PolicyParticipantParameters.yaml
new file mode 100644
index 00000000..307e0b60
--- /dev/null
+++ b/compose/config/clamp/legacy/PolicyParticipantParameters.yaml
@@ -0,0 +1,63 @@
+spring:
+ security:
+ user:
+ name: participantUser
+ password: zb!XztG34
+ autoconfigure:
+ exclude: >
+ org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration,
+ org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration,
+ org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+participant:
+ pdpGroup: defaultGroup
+ pdpType: apex
+ policyApiParameters:
+ clientName: api
+ hostname: policy-api
+ port: 6969
+ userName: policyadmin
+ password: zb!XztG34
+ useHttps: false
+ allowSelfSignedCerts: true
+ policyPapParameters:
+ clientName: pap
+ hostname: policy-pap
+ port: 6969
+ userName: policyadmin
+ password: zb!XztG34
+ useHttps: false
+ allowSelfSignedCerts: true
+ intermediaryParameters:
+ reportingTimeIntervalMs: 120000
+ description: Participant Description
+ participantId: 101c62b3-8918-41b9-a747-d21eb79c6c03
+ clampAutomationCompositionTopics:
+ topicSources:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ fetchTimeout: 15000
+ useHttps: false
+ topicSinks:
+ -
+ topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ useHttps: false
+ participantSupportedElementTypes:
+ - typeName: org.onap.policy.clamp.acm.PolicyAutomationCompositionElement
+ typeVersion: 1.0.0
+management:
+ endpoints:
+ web:
+ exposure:
+ include: health, metrics, prometheus
+server:
+ port: 6969
+ ssl:
+ enabled: false
+ servlet:
+ context-path: /onap/policy/clamp/acm/policyparticipant
diff --git a/compose/config/clamp/legacy/SimulatorParticipantParameters.yaml b/compose/config/clamp/legacy/SimulatorParticipantParameters.yaml
new file mode 100644
index 00000000..acc1db66
--- /dev/null
+++ b/compose/config/clamp/legacy/SimulatorParticipantParameters.yaml
@@ -0,0 +1,50 @@
+spring:
+ security:
+ user:
+ name: participantUser
+ password: zb!XztG34
+ autoconfigure:
+ exclude:
+ - org.springframework.boot.autoconfigure.orm.jpa.HibernateJpaAutoConfiguration
+ - org.springframework.boot.autoconfigure.jdbc.DataSourceAutoConfiguration
+ - org.springframework.boot.autoconfigure.jdbc.DataSourceTransactionManagerAutoConfiguration
+ - org.springframework.boot.autoconfigure.data.web.SpringDataWebAutoConfiguration
+
+security:
+ enable-csrf: false
+participant:
+ intermediaryParameters:
+ reportingTimeIntervalMs: 120000
+ description: Participant Description
+ participantId: ${participantId:101c62b3-8918-41b9-a747-d21eb79c6c90}
+ clampAutomationCompositionTopics:
+ topicSources:
+ - topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ fetchTimeout: 15000
+ useHttps: false
+ topicSinks:
+ - topic: policy-acruntime-participant
+ servers:
+ - ${topicServer:kafka:9092}
+ topicCommInfrastructure: kafka
+ useHttps: false
+ participantSupportedElementTypes:
+ -
+ typeName: ${supportedElementTypeName:org.onap.policy.clamp.acm.SimAutomationCompositionElement}
+ typeVersion: ${supportedElementTypeVersion:1.0.0}
+
+management:
+ endpoints:
+ web:
+ base-path: /
+ exposure:
+ include: health, metrics, prometheus
+server:
+ port: 6969
+ ssl:
+ enabled: false
+ servlet:
+ context-path: /onap/policy/simparticipant
diff --git a/compose/config/nginx/nginx-acm.conf b/compose/config/nginx/nginx-acm.conf
new file mode 100644
index 00000000..59d12109
--- /dev/null
+++ b/compose/config/nginx/nginx-acm.conf
@@ -0,0 +1,17 @@
+user nginx;
+
+events {
+ worker_connections 1000;
+}
+
+http {
+ upstream runtime {
+ server policy-clamp-runtime-acm-replica:6969;
+ }
+ server {
+ listen 30007;
+ location / {
+ proxy_pass http://runtime;
+ }
+ }
+}
diff --git a/compose/docker-compose.acm.scale.yml b/compose/docker-compose.acm.scale.yml
new file mode 100644
index 00000000..676ffa2d
--- /dev/null
+++ b/compose/docker-compose.acm.scale.yml
@@ -0,0 +1,147 @@
+#
+# ===========LICENSE_START====================================================
+# Copyright (C) 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:
+ policy-clamp-runtime-acm-replica:
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-runtime-acm:${POLICY_CLAMP_VERSION}
+ hostname: policy-clamp-runtime-acm
+ depends_on:
+ - policy-db-migrator-clamp
+ - kafka
+ - jaeger
+ - policy-clamp-ac-http-ppnt-replica
+ - policy-clamp-ac-k8s-ppnt-replica
+ - policy-clamp-ac-pf-ppnt-replica
+ - policy-clamp-ac-sim-ppnt
+ - apex-pdp
+ expose:
+ - 6969
+ deploy:
+ mode: replicated
+ replicas: ${REPLICAS}
+ environment:
+ OTEL_SERVICE_NAME: acm-r
+ OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
+ # Tracing can be configured for grpc or http - default is http
+ #OTEL_EXPORTER_OTLP_PROTOCOL: grpc
+ #OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: grpc
+ #OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
+ volumes:
+ - ./config/clamp/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
+ - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
+ - ./config/clamp/acm-runtime.sh:/opt/app/policy/clamp/bin/acm-runtime.sh:rw
+ - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+ entrypoint: /opt/app/policy/bin/wait_for_port.sh
+ command: [
+ '-c', './acm-runtime.sh',
+ 'mariadb', '3306',
+ 'kafka', '9092',
+ 'policy-clamp-ac-http-ppnt', '6969',
+ 'policy-clamp-ac-k8s-ppnt', '6969',
+ 'policy-clamp-ac-pf-ppnt', '6969',
+ 'policy-clamp-ac-sim-ppnt', '6969'
+ ]
+ policy-clamp-ac-http-ppnt-replica:
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-http-ppnt:${POLICY_CLAMP_PPNT_VERSION}
+ hostname: policy-clamp-ac-http-ppnt
+ depends_on:
+ - kafka
+ - jaeger
+ expose:
+ - 6969
+ deploy:
+ mode: replicated
+ replicas: ${REPLICAS}
+ environment:
+ OTEL_SERVICE_NAME: http-ppnt
+ OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
+ volumes:
+ - ./config/clamp/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml
+ - ./config/clamp/http-participant.sh:/opt/app/policy/clamp/bin/http-participant.sh:rw
+ - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
+ - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+ entrypoint: /opt/app/policy/bin/wait_for_port.sh
+ command: [
+ '-c', './http-participant.sh',
+ 'kafka', '9092'
+ ]
+ policy-clamp-ac-k8s-ppnt-replica:
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-k8s-ppnt:${POLICY_CLAMP_PPNT_VERSION}
+ hostname: policy-clamp-ac-k8s-ppnt
+ depends_on:
+ - kafka
+ - jaeger
+ environment:
+ OTEL_SERVICE_NAME: k8s-ppnt
+ OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
+ expose:
+ - 6969
+ deploy:
+ mode: replicated
+ replicas: ${REPLICAS}
+ volumes:
+ - ./config/clamp/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml
+ - ./config/clamp/kubernetes-participant.sh:/opt/app/policy/clamp/bin/kubernetes-participant.sh:rw
+ - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
+ - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+ entrypoint: /opt/app/policy/bin/wait_for_port.sh
+ command: [
+ '-c', './kubernetes-participant.sh',
+ 'kafka', '9092'
+ ]
+ policy-clamp-ac-pf-ppnt-replica:
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-pf-ppnt:${POLICY_CLAMP_PPNT_VERSION}
+ hostname: policy-clamp-ac-pf-ppnt
+ depends_on:
+ - kafka
+ - jaeger
+ expose:
+ - 6969
+ deploy:
+ mode: replicated
+ replicas: ${REPLICAS}
+ environment:
+ OTEL_SERVICE_NAME: policy-ppnt
+ OTEL_EXPORTER_OTLP_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
+ OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
+ volumes:
+ - ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro
+ - ./config/clamp/policy-participant.sh:/opt/app/policy/clamp/bin/policy-participant.sh:rw
+ - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
+ - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
+ entrypoint: /opt/app/policy/bin/wait_for_port.sh
+ command: [
+ '-c', './policy-participant.sh',
+ 'kafka', '9092'
+ ]
+ nginx:
+ image: ${CONTAINER_LOCATION}library/nginx:latest
+ volumes:
+ - ./config/nginx/nginx-acm.conf:/etc/nginx/nginx.conf:ro
+ depends_on:
+ - policy-clamp-runtime-acm-replica
+ ports:
+ - ${ACM_PORT}:${ACM_PORT}
+
diff --git a/compose/docker-compose.gui.yml b/compose/docker-compose.gui.yml
deleted file mode 100644
index e2e98b54..00000000
--- a/compose/docker-compose.gui.yml
+++ /dev/null
@@ -1,63 +0,0 @@
-#
-# ===========LICENSE_START====================================================
-# Copyright 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=====================================================
-#
-
-services:
- policy-gui:
- image: ${CONTAINER_LOCATION}onap/policy-gui:latest
- container_name: policy-gui
- depends_on:
- - policy-clamp-backend
- hostname: policy-gui
- environment:
- CLAMP_URL: http://policy-clamp-backend:8445
- CLAMP_DISABLE_SSL_VALIDATION: "true"
- ports:
- - "2445:2445"
- volumes:
- - ./config/policy-gui/application.yaml:/opt/app/policy/gui/etc/application.yml
- - ./config/policy-gui/logback.xml:/opt/app/policy/gui/etc/logback.xml:ro
- - ./wait_for_port.sh:/opt/app/policy/gui/bin/wait_for_port.sh:ro
- entrypoint: ./policy-gui.sh
- working_dir: /opt/app/policy/gui/bin
- command: ./policy-gui.sh
- policy-clamp-backend:
- image: ${CONTAINER_LOCATION}onap/policy-clamp-backend:latest
- container_name: policy-clamp-backend
- depends_on:
- - policy-clamp-runtime-acm
- - distribution
- hostname: policy-clamp-backend
- environment:
- POLICY_API_HOST: api
- POLICY_PAP_HOST: pap
- MARIADB_HOST: mariadb
- RUNTIME_HOST: policy-clamp-runtime-acm
- ports:
- - "8445:8445"
- volumes:
- - ./config/clamp/ClampBackend.properties:/opt/policy/clamp/config/ClampBackend.properties:ro
- - ./config/clamp/logback-backend.xml:/opt/policy/clamp/config/logback.xml:ro
- working_dir: /opt/policy/clamp
- command: java
- -Djava.security.egd=file:/dev/./urandom
- -XX:MinRAMPercentage=50
- -XX:MaxRAMPercentage=75
- -jar ./policy-clamp-backend.jar
- --spring.config.name=ClampBackend
- --spring.config.location=/opt/policy/clamp/config/ClampBackend.properties
- \ No newline at end of file
diff --git a/compose/docker-compose.pdp.scale.yml b/compose/docker-compose.pdp.scale.yml
index a10264a5..242cb3d8 100644
--- a/compose/docker-compose.pdp.scale.yml
+++ b/compose/docker-compose.pdp.scale.yml
@@ -50,25 +50,4 @@ services:
- apexpdp
ports:
- ${APEX_PORT}:${APEX_PORT}
- zookeeper:
- image: confluentinc/cp-zookeeper:latest
- environment:
- ZOOKEEPER_CLIENT_PORT: 2181
- ZOOKEEPER_TICK_TIME: 2000
- ports:
- - 2181:2181
- kafka:
- image: confluentinc/cp-kafka:latest
- container_name: kafka
- depends_on:
- - zookeeper
- ports:
- - 29092:29092
- - 9092:9092
- environment:
- KAFKA_BROKER_ID: 1
- KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
- KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
- KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
- KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
- KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
+
diff --git a/compose/docker-compose.postgres.yml b/compose/docker-compose.postgres.yml
index fee55d97..ca96f562 100644
--- a/compose/docker-compose.postgres.yml
+++ b/compose/docker-compose.postgres.yml
@@ -104,7 +104,7 @@ services:
- ${PAP_PORT}:6969
volumes:
- ./config/pap/papParametersPostgres.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
- - ./config/${PROJECT}/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
+ - ./config/${component}/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
- ./config/pap/logback.xml:/opt/app/policy/pap/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
entrypoint: ./wait_for_port.sh
@@ -137,6 +137,28 @@ services:
'kafka', '9092',
'pap', '6969'
]
+ xacml-pdp:
+ image: ${CONTAINER_LOCATION}onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION}
+ container_name: policy-xacml-pdp
+ hostname: policy-xacml-pdp
+ depends_on:
+ - postgres
+ - kafka
+ - pap
+ ports:
+ - ${XACML_PORT}:6969
+ - "30999:3904"
+ volumes:
+ - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
+ - ./config/xacml-pdp/logback.xml:/opt/app/policy/pdpx/etc/logback.xml:ro
+ - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro
+ entrypoint: ./wait_for_port.sh
+ command: [
+ '-c', './policy-pdpx-pg.sh',
+ 'postgres', '5432',
+ 'kafka', '9092',
+ 'pap', '6969'
+ ]
prometheus:
image: nexus3.onap.org:10001/prom/prometheus:latest
container_name: prometheus
@@ -148,6 +170,7 @@ services:
zookeeper:
image: confluentinc/cp-zookeeper:latest
+ container_name: zookeeper
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
diff --git a/compose/docker-compose.yml b/compose/docker-compose.yml
index 49c63779..b44da88f 100644
--- a/compose/docker-compose.yml
+++ b/compose/docker-compose.yml
@@ -282,7 +282,7 @@ services:
#OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: grpc
#OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4317
volumes:
- - ./config/clamp/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
+ - ./${CLAMP_CONFIG_PATH:-config/clamp}/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- ./config/clamp/acm-runtime.sh:/opt/app/policy/clamp/bin/acm-runtime.sh:rw
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
@@ -312,7 +312,7 @@ services:
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
volumes:
- - ./config/clamp/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml
+ - ./${PPNT_CONFIG_PATH:-config/clamp}/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml
- ./config/clamp/http-participant.sh:/opt/app/policy/clamp/bin/http-participant.sh:rw
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
@@ -336,7 +336,7 @@ services:
ports:
- "30295:6969"
volumes:
- - ./config/clamp/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml
+ - ./${PPNT_CONFIG_PATH:-config/clamp}/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml
- ./config/clamp/kubernetes-participant.sh:/opt/app/policy/clamp/bin/kubernetes-participant.sh:rw
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
@@ -361,7 +361,7 @@ services:
OTEL_EXPORTER_OTLP_TRACES_PROTOCOL: http/protobuf
OTEL_EXPORTER_OTLP_ENDPOINT: http://jaeger:4318
volumes:
- - ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro
+ - ./${PPNT_CONFIG_PATH:-config/clamp}/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro
- ./config/clamp/policy-participant.sh:/opt/app/policy/clamp/bin/policy-participant.sh:rw
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
@@ -420,7 +420,7 @@ services:
'kafka', '9092'
]
policy-clamp-ac-sim-ppnt:
- image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-sim-ppnt:${POLICY_CLAMP_VERSION}
+ image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-sim-ppnt:${POLICY_CLAMP_PPNT_VERSION}
container_name: policy-clamp-ac-sim-ppnt
hostname: policy-clamp-ac-sim-ppnt
depends_on:
@@ -434,7 +434,7 @@ services:
ports:
- ${SIM_PARTICIPANT_PORT}:6969
volumes:
- - ./config/clamp/SimulatorParticipantParameters.yaml:/opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml:ro
+ - ./${PPNT_CONFIG_PATH:-config/clamp}/SimulatorParticipantParameters.yaml:/opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml:ro
- ./config/clamp/sim-participant.sh:/opt/app/policy/clamp/bin/sim-participant.sh:rw
- ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
- ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
@@ -509,3 +509,4 @@ services:
- 16686:16686
environment:
- COLLECTOR_OTLP_ENABLED=true
+
diff --git a/compose/export-ports.sh b/compose/export-ports.sh
index a3422daa..aa97f493 100755
--- a/compose/export-ports.sh
+++ b/compose/export-ports.sh
@@ -25,6 +25,7 @@ then
head -1 |
sed 's/onap\/policy-api.*$//'
)
+ export LOCAL_IMAGES="true"
else
export CONTAINER_LOCATION="nexus3.onap.org:10001/"
fi
diff --git a/compose/get-versions.sh b/compose/get-versions.sh
index 13dc3653..a51ccef9 100755
--- a/compose/get-versions.sh
+++ b/compose/get-versions.sh
@@ -25,115 +25,129 @@ if [ -z "${WORKSPACE}" ]; then
export WORKSPACE
fi
-GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
- "${WORKSPACE}"/.gitreview)
-
-echo GERRIT_BRANCH="${GERRIT_BRANCH}"
-
+#default values
export POLICY_MARIADB_VER=10.10.2
echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
export POLICY_POSTGRES_VER=11.1
echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER}
-function getDockerVersion
-{
- REPO=${1}
- DEFAULT_DOCKER_IMAGE_NAME=${2:-}
- DEFAULT_DOCKER_IMAGE_VERSION=${3:-}
-
- REPO_RELEASE_DATA=$(
- curl -qL --silent \
- "https://github.com/onap/policy-parent/raw/$GERRIT_BRANCH/integration/src/main/resources/release/pf_release_data.csv" |
- grep "^policy/$REPO"
- )
-
- # shellcheck disable=SC2034
- read -r repo \
- latest_released_tag \
- latest_snapshot_tag \
- changed_files \
- docker_images \
- <<< "$(echo "$REPO_RELEASE_DATA" | tr ',' ' ' )"
-
- if [[ -z "$docker_images" ]]
- then
- if [[ -z "$DEFAULT_DOCKER_IMAGE_NAME" ]]
+if [ -n "$LOCAL_IMAGES" ] && [ "$LOCAL_IMAGES" = "true" ]; then
+ echo "Running with local images."
+ export POLICY_DOCKER_VERSION="latest"
+ export POLICY_MODELS_VERSION="latest"
+ export POLICY_API_VERSION="latest"
+ export POLICY_PAP_VERSION="latest"
+ export POLICY_APEX_PDP_VERSION="latest"
+ export POLICY_DROOLS_PDP_VERSION="latest"
+ export POLICY_XACML_PDP_VERSION="latest"
+ export POLICY_DISTRIBUTION_VERSION="latest"
+ export POLICY_CLAMP_VERSION="latest"
+ export POLICY_CLAMP_PPNT_VERSION=$POLICY_CLAMP_VERSION
+ export POLICY_DROOLS_APPS_VERSION="latest"
+
+else
+ GERRIT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
+ "${WORKSPACE}"/.gitreview)
+
+ echo GERRIT_BRANCH="${GERRIT_BRANCH}"
+
+ function getDockerVersion
+ {
+ REPO=${1}
+ DEFAULT_DOCKER_IMAGE_NAME=${2:-}
+ DEFAULT_DOCKER_IMAGE_VERSION=${3:-}
+
+ REPO_RELEASE_DATA=$(
+ curl -qL --silent \
+ "https://github.com/onap/policy-parent/raw/$GERRIT_BRANCH/integration/src/main/resources/release/pf_release_data.csv" |
+ grep "^policy/$REPO"
+ )
+
+ # shellcheck disable=SC2034
+ read -r repo \
+ latest_released_tag \
+ latest_snapshot_tag \
+ changed_files \
+ docker_images \
+ <<< "$(echo "$REPO_RELEASE_DATA" | tr ',' ' ' )"
+
+ if [[ -z "$docker_images" ]]
then
- echo "repo $REPO does not produce a docker image, execution terminated"
- exit 1
+ if [[ -z "$DEFAULT_DOCKER_IMAGE_NAME" ]]
+ then
+ echo "repo $REPO does not produce a docker image, execution terminated"
+ exit 1
+ else
+ docker_images="$DEFAULT_DOCKER_IMAGE_NAME"
+ fi
+ fi
+
+ # docker_image_version=$(echo "$latest_snapshot_tag" | awk -F \. '{print $1"."$2"-SNAPSHOT-latest"}')
+ docker_image_version=$latest_snapshot_tag
+ docker_image_name=$(echo "$docker_images" | sed -e "s/^.*://" -e "s/^.//" -e "s/.$//")
+
+ if \
+ curl -qL --silent \
+ "https://nexus3.onap.org/service/rest/repository/browse/docker.snapshot/v2/onap/$docker_image_name/tags/" |
+ grep -q "$docker_image_version"
+ then
+ echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
+ return
+ fi
+
+ docker_image_version="$latest_released_tag"
+ if \
+ curl -qL --silent \
+ "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
+ grep -q "$docker_image_version"
+ then
+ echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
+ return
+ fi
+
+ docker_image_version="$DEFAULT_DOCKER_IMAGE_VERSION"
+ if \
+ curl -qL --silent \
+ "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
+ grep -q "$docker_image_version"
+ then
+ echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
+ return
else
- docker_images="$DEFAULT_DOCKER_IMAGE_NAME"
+ echo "docker image \"$docker_image_name:$docker_image_version\" not found for repo \"$repo\""
+ exit 1
fi
- fi
-
- # docker_image_version=$(echo "$latest_snapshot_tag" | awk -F \. '{print $1"."$2"-SNAPSHOT-latest"}')
- docker_image_version=$latest_snapshot_tag
- docker_image_name=$(echo "$docker_images" | sed -e "s/^.*://" -e "s/^.//" -e "s/.$//")
-
- if \
- curl -qL --silent \
- "https://nexus3.onap.org/service/rest/repository/browse/docker.snapshot/v2/onap/$docker_image_name/tags/" |
- grep -q "$docker_image_version"
- then
- echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
- return
- fi
-
- docker_image_version="$latest_released_tag"
- if \
- curl -qL --silent \
- "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
- grep -q "$docker_image_version"
- then
- echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
- return
- fi
-
- docker_image_version="$DEFAULT_DOCKER_IMAGE_VERSION"
- if \
- curl -qL --silent \
- "https://nexus3.onap.org/service/rest/repository/browse/docker.release/v2/onap/$docker_image_name/tags/" |
- grep -q "$docker_image_version"
- then
- echo "using \"$docker_image_name:$docker_image_version\" docker image for repo \"$repo\""
- return
- else
- echo "docker image \"$docker_image_name:$docker_image_version\" not found for repo \"$repo\""
- exit 1
- fi
-}
-
-getDockerVersion docker
-export POLICY_DOCKER_VERSION="$docker_image_version"
-
-getDockerVersion models "'policy-models-simulator'" 3.0.1
-export POLICY_MODELS_VERSION="$docker_image_version"
-
-getDockerVersion api
-export POLICY_API_VERSION="$docker_image_version"
-
-getDockerVersion pap
-export POLICY_PAP_VERSION="$docker_image_version"
-
-getDockerVersion apex-pdp
-export POLICY_APEX_PDP_VERSION="$docker_image_version"
-
-getDockerVersion drools-pdp
-export POLICY_DROOLS_PDP_VERSION="$docker_image_version"
-
-getDockerVersion xacml-pdp
-export POLICY_XACML_PDP_VERSION="$docker_image_version"
-
-getDockerVersion distribution
-export POLICY_DISTRIBUTION_VERSION="$docker_image_version"
-
-getDockerVersion clamp
-export POLICY_CLAMP_VERSION="$docker_image_version"
-export POLICY_CLAMP_PPNT_VERSION=$POLICY_CLAMP_VERSION
-
-getDockerVersion gui
-export POLICY_GUI_VERSION="$docker_image_version"
-
-getDockerVersion drools-applications
-export POLICY_DROOLS_APPS_VERSION="$docker_image_version"
+ }
+
+ getDockerVersion docker
+ export POLICY_DOCKER_VERSION="$docker_image_version"
+
+ getDockerVersion models "'policy-models-simulator'" 3.0.1
+ export POLICY_MODELS_VERSION="$docker_image_version"
+
+ getDockerVersion api
+ export POLICY_API_VERSION="$docker_image_version"
+
+ getDockerVersion pap
+ export POLICY_PAP_VERSION="$docker_image_version"
+
+ getDockerVersion apex-pdp
+ export POLICY_APEX_PDP_VERSION="$docker_image_version"
+
+ getDockerVersion drools-pdp
+ export POLICY_DROOLS_PDP_VERSION="$docker_image_version"
+
+ getDockerVersion xacml-pdp
+ export POLICY_XACML_PDP_VERSION="$docker_image_version"
+
+ getDockerVersion distribution
+ export POLICY_DISTRIBUTION_VERSION="$docker_image_version"
+
+ getDockerVersion clamp
+ export POLICY_CLAMP_VERSION="$docker_image_version"
+ export POLICY_CLAMP_PPNT_VERSION=$POLICY_CLAMP_VERSION
+
+ getDockerVersion drools-applications
+ export POLICY_DROOLS_APPS_VERSION="$docker_image_version"
+fi \ No newline at end of file
diff --git a/compose/start-acm-replica.sh b/compose/start-acm-replica.sh
new file mode 100755
index 00000000..373261e6
--- /dev/null
+++ b/compose/start-acm-replica.sh
@@ -0,0 +1,40 @@
+#!/bin/bash
+#
+# ============LICENSE_START====================================================
+# Copyright (C) 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+
+if [ -z "${WORKSPACE}" ]; then
+ WORKSPACE=$(git rev-parse --show-toplevel)
+ export WORKSPACE
+fi
+
+if [ -z "$ROBOT_LOG_DIR" ]; then
+ export ROBOT_LOG_DIR=/tmp/
+fi
+
+COMPOSE_FOLDER="${WORKSPACE}"/compose
+
+cd ${COMPOSE_FOLDER}
+
+echo "Configuring docker compose..."
+source export-ports.sh > /dev/null 2>&1
+source get-versions.sh > /dev/null 2>&1
+
+export REPLICAS=${1}
+docker compose -f docker-compose.yml -f docker-compose.acm.scale.yml up -d nginx
+cd ${WORKSPACE}
diff --git a/compose/start-compose.sh b/compose/start-compose.sh
index a6ada298..671927ba 100755
--- a/compose/start-compose.sh
+++ b/compose/start-compose.sh
@@ -32,7 +32,6 @@ COMPOSE_FOLDER="${WORKSPACE}"/compose
# Set default values for the options
grafana=false
-gui=false
# Parse the command-line arguments
while [[ $# -gt 0 ]]
@@ -44,11 +43,6 @@ do
grafana=true
shift
;;
- --gui)
- gui=true
- shift 2
- break;
- ;;
*)
component="$1"
shift
@@ -84,24 +78,14 @@ if [ -n "$component" ]; then
docker compose up -d "${component}" grafana
echo "Prometheus server: http://localhost:${PROMETHEUS_PORT}"
echo "Grafana server: http://localhost:${GRAFANA_PORT}"
- elif [ "$gui" = true ]; then
- echo "Starting application with gui..."
- docker compose -f docker-compose.yml -f docker-compose.gui.yml up -d "${component}" policy-gui
- echo "Clamp GUI: https://localhost:2445/clamp"
else
echo "Starting ${component} application"
docker compose up -d "${component}"
fi
else
export PROJECT=api # api has groups.json complete with all 3 pdps
- if [ "$gui" = true ]; then
- echo "Starting application with gui..."
- docker compose -f docker-compose.yml -f docker-compose.gui.yml up -d
- echo "Clamp GUI: https://localhost:2445/clamp"
- else
- echo "Starting all components..."
- docker compose up -d
- fi
+ echo "Starting all components..."
+ docker compose up -d
fi
cd ${WORKSPACE}
diff --git a/compose/start-multiple-pdp.sh b/compose/start-multiple-pdp.sh
index 30572875..b97760e7 100755
--- a/compose/start-multiple-pdp.sh
+++ b/compose/start-multiple-pdp.sh
@@ -24,6 +24,10 @@ if [ -z "${WORKSPACE}" ]; then
fi
COMPOSE_FOLDER="${WORKSPACE}"/compose
+if [ -z "$ROBOT_LOG_DIR" ]; then
+ export ROBOT_LOG_DIR=/tmp/
+fi
+
cd ${COMPOSE_FOLDER}
echo "Configuring docker compose..."
@@ -31,6 +35,6 @@ source export-ports.sh > /dev/null 2>&1
source get-versions.sh > /dev/null 2>&1
export REPLICAS=${1}
-docker-compose -f docker-compose.yml -f docker-compose.pdp.scale.yml up -d apexpdp nginx grafana
+docker compose -f docker-compose.yml -f docker-compose.pdp.scale.yml up -d apexpdp nginx grafana
-cd ${WORKSPACE} \ No newline at end of file
+cd ${WORKSPACE}
diff --git a/compose/start-postgres-tests.sh b/compose/start-postgres-tests.sh
index 1c08600a..2d695911 100644
--- a/compose/start-postgres-tests.sh
+++ b/compose/start-postgres-tests.sh
@@ -1,7 +1,7 @@
#!/bin/bash
#
# ============LICENSE_START====================================================
-# Copyright (C) 2023 Nordix Foundation.
+# 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.
@@ -30,7 +30,8 @@ echo "Configuring docker compose..."
source export-ports.sh > /dev/null 2>&1
source get-versions.sh > /dev/null 2>&1
-export REPLICAS=${1}
-docker-compose -f docker-compose.postgres.yml up -d apex-pdp prometheus
+export component=${1}
+export REPLICAS=${2}
+docker-compose -f docker-compose.postgres.yml up -d ${component} prometheus
cd ${WORKSPACE} \ No newline at end of file
diff --git a/csit/run-acm-regression.sh b/csit/run-acm-regression.sh
index 5f77d214..677c2630 100755
--- a/csit/run-acm-regression.sh
+++ b/csit/run-acm-regression.sh
@@ -16,23 +16,50 @@
#
# Script to run the ACM regression test suite in cucumber.
-# Deploys ACM-R and participants in two different release versions for testing backward compatibility.
-
-if [ $# -eq 0 ]
-then
- echo "No release versions provided. Testing ACM-R and participants with the default version"
- echo "Usage: $0 <acm_release> <compatibility_test_release>"
- ACM_RELEASE=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
- "${WORKSPACE}"/.gitreview)
- PPNT_RELEASE=$ACM_RELEASE
-fi
-
-if [ $1 ]; then
- ACM_RELEASE=$1
-fi
-
-if [ $2 ]; then
- PPNT_RELEASE=$2
+# Deploys ACM-R and participants in two different release branch/versions for testing backward compatibility.
+
+function usage() {
+ echo "Usage: $0 --release <acmr-release_branch> <ppnt-release_branch> | --version <acmr-version> <ppnt-version>"
+ exit 1
+}
+
+# Legacy config files for releases up to 'newdelhi'
+function release_config_path() {
+ if [ $1 == 'master' ] || [[ "$(echo "$1" | cut -c1 )" > 'n' ]]; then
+ echo "config/clamp"
+ else
+ echo "config/clamp/legacy"
+ fi
+}
+
+# Legacy config files for versions before 8.0.0
+function version_config_path() {
+ if [[ "$(printf '%s\n' "$1" "8.0.0" | sort -V | head -n 1)" == "8.0.0" ]]; then
+ echo "config/clamp"
+ else
+ echo "config/clamp/legacy"
+ fi
+}
+
+function validate_version() {
+ local version=$1
+ if [[ ! $version =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
+ echo "Invalid version format: $version. Expected format: x.y.z where x, y, and z are numbers."
+ usage
+ fi
+}
+
+function validate_release() {
+ local release=$1
+ if [[ ! $release =~ ^[a-zA-Z._-]+$ ]]; then
+ echo "Invalid release format: $release. Expected a string release name"
+ usage
+ fi
+}
+
+# Invalid input
+if [ "$#" -ne 0 ] && [ "$#" -ne 3 ]; then
+ usage
fi
if [ -z "${WORKSPACE}" ]; then
@@ -40,24 +67,68 @@ if [ -z "${WORKSPACE}" ]; then
export WORKSPACE
fi
+if [ -z "$ROBOT_LOG_DIR" ]; then
+ export ROBOT_LOG_DIR=/tmp/
+fi
export SCRIPTS="${WORKSPACE}/csit/resources/scripts"
-
COMPOSE_FOLDER="${WORKSPACE}"/compose
REGRESSION_FOLDER="${WORKSPACE}"/policy-regression-tests/policy-clamp-regression/
export PROJECT='clamp'
+DEFAULT_BRANCH=$(awk -F= '$1 == "defaultbranch" { print $2 }' \
+ "${WORKSPACE}"/.gitreview)
-# Sign in to nexus3 docker repo
-docker login -u docker -p docker nexus3.onap.org:10001
+# Run from default branch
+if [ $# -eq 0 ]
+then
+ echo "Usage: $0 --release <acmr-release_branch> <ppnt-release_branch> | --version <acmr-version> <ppnt-version>"
+ echo "*** No release_branch/versions provided. Default branch will be used."
+ echo "Fetching image versions for all components..."
+ source ${COMPOSE_FOLDER}/get-versions-regression.sh $DEFAULT_BRANCH $DEFAULT_BRANCH > /dev/null 2>&1
+ echo "Starting Regression with ACM-R and PPNT from the default release branch $DEFAULT_BRANCH ***"
+ export CLAMP_CONFIG_PATH=$(release_config_path "$DEFAULT_BRANCH")
+ export PPNT_CONFIG_PATH="$CLAMP_CONFIG_PATH"
+ echo "Using configuration file located at $CLAMP_CONFIG_PATH for ACM-R and $PPNT_CONFIG_PATH for PPNTS."
+
+# Run with specific release/version
+elif [ "$#" -gt 0 ]
+then
+ case $1 in
+ --release)
+ validate_release $2
+ validate_release $3
+ echo "Fetching image versions for all components..."
+ source ${COMPOSE_FOLDER}/get-versions-regression.sh $2 $3 > /dev/null 2>&1
+ echo "*** Starting Regression with ACM-R from branch $2 and PPNT from branch $3 ***"
+ export CLAMP_CONFIG_PATH=$(release_config_path $2)
+ export PPNT_CONFIG_PATH=$(release_config_path $3)
+ echo "Using configuration file located at $CLAMP_CONFIG_PATH for ACM-R and $PPNT_CONFIG_PATH for PPNTS."
+ ;;
+ --version)
+ validate_version $2
+ validate_version $3
+ echo "Fetching image versions for all components..."
+ source ${COMPOSE_FOLDER}/get-versions-regression.sh $DEFAULT_BRANCH $DEFAULT_BRANCH > /dev/null 2>&1
+ export POLICY_CLAMP_VERSION=$2
+ export POLICY_CLAMP_PPNT_VERSION=$3
+ echo "*** Starting Regression with ACM-R version $2 and PPNT version $3 ***"
+ export CLAMP_CONFIG_PATH=$(version_config_path "$2")
+ export PPNT_CONFIG_PATH=$(version_config_path "$3")
+ echo "Using configuration file located at $CLAMP_CONFIG_PATH for ACM-R and $PPNT_CONFIG_PATH for PPNTS."
+ ;;
+ *)
+ echo "Unknown parameter: $1"
+ usage
+ ;;
+ esac
+fi
+echo "*** Configure docker compose and trigger deployment***"
cd ${COMPOSE_FOLDER}
-
-echo "Configuring docker compose..."
-
+docker login -u docker -p docker nexus3.onap.org:10001 > /dev/null 2>&1
source export-ports.sh > /dev/null 2>&1
-source get-versions-regression.sh $ACM_RELEASE $PPNT_RELEASE > /dev/null 2>&1
-docker-compose -f docker-compose.yml up -d "policy-clamp-runtime-acm"
+docker compose -f docker-compose.yml up -d "policy-clamp-runtime-acm"
# wait for the app to start up
"${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
@@ -65,4 +136,5 @@ docker-compose -f docker-compose.yml up -d "policy-clamp-runtime-acm"
cd ${REGRESSION_FOLDER}
# Invoke the regression test cases
-mvn clean test -Dtests.skip=false \ No newline at end of file
+mvn clean test -Dtests.skip=false
+
diff --git a/csit/run-k8s-csit.sh b/csit/run-k8s-csit.sh
index 7a5fe03c..6502c348 100755
--- a/csit/run-k8s-csit.sh
+++ b/csit/run-k8s-csit.sh
@@ -431,7 +431,7 @@ if [ $OPERATION == "install" ]; then
sudo helm dependency build policy
sudo helm install csit-policy policy ${SET_VALUES}
sudo helm install prometheus prometheus
- wait_for_pods_running default 600 ${READINESS_CONTAINERS[@]}
+ wait_for_pods_running default 900 ${READINESS_CONTAINERS[@]}
echo "Policy chart installation completed"
echo "-------------------------------------------"
fi
diff --git a/csit/run-project-csit.sh b/csit/run-project-csit.sh
index bd2a33eb..36bad1ff 100755
--- a/csit/run-project-csit.sh
+++ b/csit/run-project-csit.sh
@@ -47,6 +47,14 @@ function setup_clamp() {
bash "${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
}
+function setup_clamp_replica() {
+ export ROBOT_FILES="policy-clamp-test.robot"
+ export TEST_ENV="docker"
+ source "${WORKSPACE}"/compose/start-acm-replica.sh 2
+ sleep 30
+ bash "${SCRIPTS}"/wait_for_rest.sh localhost "${ACM_PORT}"
+}
+
function setup_api() {
export ROBOT_FILES="api-test.robot api-slas.robot"
source "${WORKSPACE}"/compose/start-compose.sh api --grafana
@@ -72,7 +80,7 @@ function setup_apex() {
function setup_apex_postgres() {
export ROBOT_FILES="apex-pdp-test.robot"
- source "${WORKSPACE}"/compose/start-postgres-tests.sh 1
+ source "${WORKSPACE}"/compose/start-postgres-tests.sh apex-pdp 1
sleep 10
bash "${SCRIPTS}"/wait_for_rest.sh localhost ${PAP_PORT}
bash "${SCRIPTS}"/wait_for_rest.sh localhost ${APEX_PORT}
@@ -133,6 +141,13 @@ function setup_xacml_pdp() {
bash "${SCRIPTS}"/wait_for_rest.sh localhost "${XACML_PORT}"
}
+function setup_xacml_pdp_postgres() {
+ export ROBOT_FILES="xacml-pdp-test.robot"
+ source "${WORKSPACE}"/compose/start-postgres-tests.sh xacml-pdp 1
+ sleep 10
+ bash "${SCRIPTS}"/wait_for_rest.sh localhost "${XACML_PORT}"
+}
+
function setup_drools_pdp() {
export ROBOT_FILES="drools-pdp-test.robot"
source "${WORKSPACE}"/compose/start-compose.sh drools-pdp
@@ -172,6 +187,10 @@ function set_project_config() {
setup_clamp
;;
+ clamp-replica | policy-clamp-replica)
+ setup_clamp_replica
+ ;;
+
api | policy-api)
setup_api
;;
@@ -185,21 +204,25 @@ function set_project_config() {
;;
apex-pdp-postgres | policy-apex-pdp-postgres)
- setup_apex
+ setup_apex_postgres
;;
apex-pdp-medium | policy-apex-pdp-medium)
- setup_apex
+ setup_apex_medium
;;
apex-pdp-large | policy-apex-pdp-large)
- setup_apex
+ setup_apex_large
;;
xacml-pdp | policy-xacml-pdp)
setup_xacml_pdp
;;
+ xacml-pdp-postgres | policy-xacml-pdp-postgres)
+ setup_xacml_pdp_postgres
+ ;;
+
drools-pdp | policy-drools-pdp)
setup_drools_pdp
;;
@@ -241,6 +264,8 @@ export PROJECT="${1}"
export ROBOT_LOG_DIR=${WORKSPACE}/csit/archives/${PROJECT}
export SCRIPTS="${WORKSPACE}/csit/resources/scripts"
export ROBOT_FILES=""
+# always 'docker' if running docker compose
+export TEST_ENV="docker"
cd "${WORKSPACE}"
diff --git a/policy-db-migrator/pom.xml b/policy-db-migrator/pom.xml
index c068eb33..776a1c71 100644
--- a/policy-db-migrator/pom.xml
+++ b/policy-db-migrator/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-db-migrator</artifactId>
diff --git a/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh b/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh
new file mode 100644
index 00000000..052128d0
--- /dev/null
+++ b/policy-db-migrator/smoke-test/mariadb-clamp-tests.sh
@@ -0,0 +1,219 @@
+#!/bin/sh
+# ============LICENSE_START====================================================
+# Copyright (C) 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+# shellcheck disable=SC2039
+# shellcheck disable=SC2086
+# shellcheck disable=SC2012
+echo "Start of test $(date +%F-%T)"
+
+export POLICY_HOME=/opt/app/policy
+export SQL_USER=${MYSQL_USER}
+export SQL_PASSWORD=${MYSQL_PASSWORD}
+export SCRIPT_DIRECTORY=sql
+export SCHEMA=clampacm
+
+# Test variables
+TOTAL_COUNT=0
+A_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1400/upgrade/*.sql | wc -l)
+A_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1400/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$A_UPGRADE_COUNT
+TOTAL_SQLS_DOWNGRADE=$A_DOWNGRADE_COUNT
+
+B_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1500/upgrade/*.sql | wc -l)
+B_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1500/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$B_UPGRADE_COUNT))
+TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$B_DOWNGRADE_COUNT))
+
+C_UPGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1600/upgrade/*.sql | wc -l)
+C_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/sql/1600/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$C_UPGRADE_COUNT))
+TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$C_DOWNGRADE_COUNT))
+
+NEW_SQL_EXECUTIONS=0
+START_VERSION=""
+PREVIOUS_SQL_EXECUTIONS=0
+END_VERSION=""
+RECENT_SQL_EXECUTIONS=0
+END_STATUS=0
+TEST_STATUS="FAIL"
+TEST_MSG=""
+TESTS=0
+PASSED=0
+FAILED=0
+
+run_sql() {
+ local user="${1}" password="${2}" schema="${3}" sql="${4}"
+ MYSQL="mysql -u${user} -p${password} -h ${SQL_HOST} ${schema}"
+ ${MYSQL} --execute "${sql}"
+ return $?
+}
+
+start_test() {
+ echo ""
+ echo "############################################################################################################"
+ echo ""
+ let TESTS=$TESTS+1
+ reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2)
+ echo "Starting test $TESTS"
+ echo "$reportStatus"
+ START_VERSION=$(echo $reportStatus | cut -f13 -d' ')
+ PREVIOUS_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ')
+
+ if [ "${START_VERSION}" == "" ]; then
+ START_VERSION="0"
+ PREVIOUS_SQL_EXECUTIONS=0
+ fi
+}
+
+end_test() {
+ reportStatus=$(/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report | tail -2)
+ echo "Ending test $TESTS"
+ echo "$reportStatus"
+ END_VERSION=$(echo $reportStatus | cut -f13 -d' ')
+ RECENT_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ')
+ END_STATUS=$(echo $reportStatus | cut -f7 -d' ')
+}
+
+check_results() {
+ local status="${1}" operation="${2}" startVer="${3}" endVer="${4}" newRecords="${5}" filesRan="${6}"
+
+ echo ""
+ echo "Test summary: status:$status, operation:$operation, from:$startVer, to:$endVer, new executions:$newRecords, sqlFiles:$filesRan"
+ # Convert to number
+ startVer=$(echo ${startVer} | awk '{$0=int($0)}1')
+ endVer=$(echo ${endVer} | awk '{$0=int($0)}1')
+
+ if [ ${startVer} -eq ${endVer} ] && [ $newRecords -eq $filesRan ] && [ $newRecords -eq 0 ]; then
+ TEST_MSG="No ${operation} required"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ elif [ $status -eq 1 ] && [ "${operation}" == "upgrade" ] && [ ${startVer} -le ${endVer} ] && [ $newRecords -eq $filesRan ]; then
+ TEST_MSG="Successful ${operation}"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ elif [ $status -eq 1 ] && [ "${operation}" == "downgrade" ] && [ ${startVer} -ge ${endVer} ] && [ $newRecords -eq $filesRan ]; then
+ TEST_MSG="Successful ${operation}"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ else
+ TEST_MSG="Errors occurred during ${operation}"
+ TEST_STATUS="FAIL"
+ let FAILED=$FAILED+1
+ fi
+ echo ""
+ echo "*** Test $TESTS: $TEST_STATUS , $TEST_MSG, current version: $END_VERSION ***"
+ echo ""
+}
+
+# Test 1 - Upgrade to 1600
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 1600
+end_test
+let TOTAL_COUNT=$A_UPGRADE_COUNT+$B_UPGRADE_COUNT+$C_UPGRADE_COUNT
+check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $RECENT_SQL_EXECUTIONS $TOTAL_COUNT
+
+sleep 5
+
+# Test 2 - downgrade to 1500
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 1500
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $C_DOWNGRADE_COUNT
+
+sleep 5
+
+# Test 3 - downgrade to 1400
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1500 -t 1400
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'downgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $B_DOWNGRADE_COUNT
+
+sleep 5
+
+# Test 4 - upgrade to 1500
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 1400 -t 1500
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $B_UPGRADE_COUNT
+
+sleep 5
+
+# Test 5 - upgrade to 1600
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -f 1500 -t 1600
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'upgrade' "${START_VERSION}" "${END_VERSION}" $NEW_SQL_EXECUTIONS $C_UPGRADE_COUNT
+
+sleep 5
+
+# Test 6 - run upgrade on db where tables already exist and migration schema is empty
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 1400
+run_sql "root" "${MYSQL_ROOT_PASSWORD}" "${SCHEMA}" "DROP DATABASE IF EXISTS migration;"
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade -t 1600
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+let TOTAL_COUNT=$C_DOWNGRADE_COUNT+$C_UPGRADE_COUNT+$B_DOWNGRADE_COUNT+$B_UPGRADE_COUNT
+check_results $END_STATUS 'upgrade' "1400" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_COUNT
+
+sleep 5
+
+# Test 7 - Full downgrade
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o downgrade -f 1600 -t 0
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'downgrade' "${START_VERSION}" "0" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_DOWNGRADE
+
+sleep 5
+
+# Test 8 - Full upgrade
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results $END_STATUS 'upgrade' "0" "${END_VERSION}" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_UPGRADE
+
+# Install database
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o upgrade
+/opt/app/policy/bin/db-migrator -s ${SQL_DB} -o report
+
+echo
+echo "-----------------------------------------------------------------------"
+echo "Number of Tests: $TESTS, Tests Passed: $PASSED, Tests Failed: $FAILED"
+echo "-----------------------------------------------------------------------"
+
+echo "End of test $(date +%F-%T)"
+
+nc -lk -p 6824
+
+exit 0
diff --git a/policy-db-migrator/smoke-test/postgres-clamp-tests.sh b/policy-db-migrator/smoke-test/postgres-clamp-tests.sh
new file mode 100644
index 00000000..98832520
--- /dev/null
+++ b/policy-db-migrator/smoke-test/postgres-clamp-tests.sh
@@ -0,0 +1,206 @@
+#!/bin/sh
+# ============LICENSE_START====================================================
+# Copyright (C) 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.
+#
+# SPDX-License-Identifier: Apache-2.0
+# ============LICENSE_END======================================================
+# shellcheck disable=SC2039
+# shellcheck disable=SC2086
+# shellcheck disable=SC2012
+echo "Start of test $(date +%F-%T)"
+
+export POLICY_HOME=/opt/app/policy
+export SQL_USER=${MYSQL_USER}
+export SQL_PASSWORD=${MYSQL_PASSWORD}
+export SCRIPT_DIRECTORY=postgres
+export SCHEMA=clampacm
+
+# Test variables
+TOTAL_COUNT=0
+A_UPGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1400/upgrade/*.sql | wc -l)
+A_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1400/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$A_UPGRADE_COUNT
+TOTAL_SQLS_DOWNGRADE=$A_DOWNGRADE_COUNT
+
+B_UPGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1500/upgrade/*.sql | wc -l)
+B_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1500/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$B_UPGRADE_COUNT))
+TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$B_DOWNGRADE_COUNT))
+
+C_UPGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1600/upgrade/*.sql | wc -l)
+C_DOWNGRADE_COUNT=$(ls /home/${SQL_DB}/postgres/1600/downgrade/*.sql | wc -l)
+TOTAL_SQLS_UPGRADE=$(($TOTAL_SQLS_UPGRADE+$C_UPGRADE_COUNT))
+TOTAL_SQLS_DOWNGRADE=$(($TOTAL_SQLS_DOWNGRADE+$C_DOWNGRADE_COUNT))
+
+NEW_SQL_EXECUTIONS=0
+PREVIOUS_SQL_EXECUTIONS=0
+RECENT_SQL_EXECUTIONS=0
+TEST_STATUS="FAIL"
+TEST_MSG=""
+TESTS=0
+PASSED=0
+FAILED=0
+
+run_sql() {
+ local user="${1}" schema="${2}" sql="${3}"
+ PGSQL="psql -U ${user} -d ${schema} -h ${SQL_HOST}"
+ ${PGSQL} --command "${sql}"
+ return $?
+}
+
+start_test() {
+ echo ""
+ echo "############################################################################################################"
+ echo ""
+ let TESTS=$TESTS+1
+ echo "Starting test $TESTS"
+ PREVIOUS_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS
+}
+
+end_test() {
+ echo "Ending test $TESTS"
+ reportStatus=$(/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o report | tail -3)
+ echo "Status: $reportStatus"
+ RECENT_SQL_EXECUTIONS=$(echo $reportStatus | cut -f1 -d' ' | sed 's/(//')
+}
+
+check_results() {
+ local operation="${1}" startVer="${2}" endVer="${3}" newRecords="${4}" filesRan="${5}"
+
+ echo ""
+ echo "Test summary: operation:$operation, from:$startVer, to:$endVer, new executions:$newRecords, sqlFiles:$filesRan"
+ # Convert to number
+ startVer=$(echo ${startVer} | awk '{$0=int($0)}1')
+ endVer=$(echo ${endVer} | awk '{$0=int($0)}1')
+
+ if [ ${startVer} -eq ${endVer} ] && [ $newRecords -eq $filesRan ] && [ $newRecords -eq 0 ]; then
+ TEST_MSG="No ${operation} required"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ elif [ "${operation}" == "upgrade" ] && [ ${startVer} -le ${endVer} ] && [ $newRecords -eq $filesRan ]; then
+ TEST_MSG="Successful ${operation}"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ elif [ "${operation}" == "downgrade" ] && [ ${startVer} -ge ${endVer} ] && [ $newRecords -eq $filesRan ]; then
+ TEST_MSG="Successful ${operation}"
+ TEST_STATUS="PASS"
+ let PASSED=$PASSED+1
+ else
+ TEST_MSG="Errors occurred during ${operation}"
+ TEST_STATUS="FAIL"
+ let FAILED=$FAILED+1
+ fi
+ echo ""
+ echo "*** Test $TESTS: $TEST_STATUS , $TEST_MSG, current version: $END_VERSION ***"
+ echo ""
+}
+
+# Test 1 - Upgrade to 1600
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade -t 1600
+end_test
+let TOTAL_COUNT=$A_UPGRADE_COUNT+$B_UPGRADE_COUNT+$C_UPGRADE_COUNT
+check_results 'upgrade' "0" "1600" $RECENT_SQL_EXECUTIONS $TOTAL_COUNT
+
+sleep 5
+
+# Test 2 - downgrade to 1500
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o downgrade -f 1600 -t 1500
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'downgrade' "1600" "1500" $NEW_SQL_EXECUTIONS $C_DOWNGRADE_COUNT
+
+sleep 5
+
+# Test 3 - downgrade to 1400
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o downgrade -f 1500 -t 1400
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'downgrade' "1500" "1400" $NEW_SQL_EXECUTIONS $B_DOWNGRADE_COUNT
+
+sleep 5
+
+# Test 4 - upgrade to 1500
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade -f 1400 -t 1500
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'upgrade' "1400" "1500" $NEW_SQL_EXECUTIONS $B_UPGRADE_COUNT
+
+sleep 5
+
+# Test 5 - upgrade to 1600
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade -f 1500 -t 1600
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'upgrade' "1500" "1600" $NEW_SQL_EXECUTIONS $C_UPGRADE_COUNT
+
+sleep 5
+
+# Test 6 - run upgrade on db where tables already exist and migration schema is empty
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o downgrade -f 1600 -t 1400
+run_sql $SQL_USER "migration" "DROP TABLE IF EXISTS migration;"
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade -t 1600
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+let TOTAL_COUNT=$B_UPGRADE_COUNT+$B_DOWNGRADE_COUNT+$C_UPGRADE_COUNT+$C_DOWNGRADE_COUNT
+check_results 'upgrade' "1600" "1600" $NEW_SQL_EXECUTIONS $TOTAL_COUNT
+
+#sleep 5
+
+# Test 7 - Full downgrade
+start_test
+/opt/app/policy/bin/prepare_downgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o downgrade -f 1600 -t 0
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'downgrade' "1600" "0" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_DOWNGRADE
+
+sleep 5
+
+# Test 6 - Full upgrade
+start_test
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade
+end_test
+let NEW_SQL_EXECUTIONS=$RECENT_SQL_EXECUTIONS-$PREVIOUS_SQL_EXECUTIONS
+check_results 'upgrade' "0" "1600" $NEW_SQL_EXECUTIONS $TOTAL_SQLS_UPGRADE
+
+# Install database
+/opt/app/policy/bin/prepare_upgrade.sh ${SQL_DB}
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o upgrade
+/opt/app/policy/bin/db-migrator-pg -s ${SQL_DB} -o report
+
+echo
+echo "-----------------------------------------------------------------------"
+echo "Number of Tests: $TESTS, Tests Passed: $PASSED, Tests Failed: $FAILED"
+echo "-----------------------------------------------------------------------"
+
+echo "End of test $(date +%F-%T)"
+
+nc -lk -p 6824
+
+exit 0
diff --git a/policy-db-migrator/src/main/docker/Dockerfile b/policy-db-migrator/src/main/docker/Dockerfile
index 06b7beae..8f632c87 100644
--- a/policy-db-migrator/src/main/docker/Dockerfile
+++ b/policy-db-migrator/src/main/docker/Dockerfile
@@ -19,7 +19,7 @@
# SPDX-License-Identifier: Apache-2.0
# ============LICENSE_END=========================================================
#-------------------------------------------------------------------------------
-FROM onap/policy-jre-alpine:3.1.4-SNAPSHOT
+FROM onap/policy-jre-alpine:4.0.1-SNAPSHOT
LABEL maintainer="Policy Team"
LABEL org.opencontainers.image.title="Policy db-migrator"
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..f0897cfe
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0100-automationcomposition.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcomposition DROP subState;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..ef6f3c79
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/downgrade/0200-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcompositionelement DROP subState, DROP stage;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..b3ec5f96
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0100-automationcomposition.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcomposition ADD subState SMALLINT DEFAULT NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..3e91bbf7
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/postgres/1600/upgrade/0200-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcompositionelement ADD subState SMALLINT DEFAULT NULL, ADD stage SMALLINT DEFAULT NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql
index cadcea93..a699e565 100644
--- a/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1400/downgrade/0700-ac_compositionId_index.sql
@@ -17,4 +17,4 @@
* ============LICENSE_END=========================================================
*/
-DROP INDEX ac_element_fk ON clampacm.automationcompositionelement; \ No newline at end of file
+DROP INDEX ac_compositionId ON clampacm.automationcomposition;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..f0897cfe
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0100-automationcomposition.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcomposition DROP subState;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..ef6f3c79
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/downgrade/0200-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcompositionelement DROP subState, DROP stage;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql
new file mode 100644
index 00000000..7e0fd078
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0100-automationcomposition.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcomposition ADD subState TINYINT DEFAULT NULL NULL;
diff --git a/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql
new file mode 100644
index 00000000..06ce9a9d
--- /dev/null
+++ b/policy-db-migrator/src/main/docker/config/clampacm/sql/1600/upgrade/0200-automationcompositionelement.sql
@@ -0,0 +1,20 @@
+/*
+ * ============LICENSE_START=======================================================
+ * Copyright (C) 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.
+ *
+ * SPDX-License-Identifier: Apache-2.0
+ * ============LICENSE_END=========================================================
+ */
+
+ALTER TABLE automationcompositionelement ADD subState TINYINT DEFAULT NULL NULL, ADD stage TINYINT DEFAULT NULL NULL;
diff --git a/policy-jdk/alpine/pom.xml b/policy-jdk/alpine/pom.xml
index ca310255..a6e47af0 100644
--- a/policy-jdk/alpine/pom.xml
+++ b/policy-jdk/alpine/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>policy-jdk</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
diff --git a/policy-jdk/pom.xml b/policy-jdk/pom.xml
index 410ec374..dced9b41 100644
--- a/policy-jdk/pom.xml
+++ b/policy-jdk/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-jdk</artifactId>
diff --git a/policy-jre/alpine/pom.xml b/policy-jre/alpine/pom.xml
index 9d60d4b0..a1fb46d7 100644
--- a/policy-jre/alpine/pom.xml
+++ b/policy-jre/alpine/pom.xml
@@ -27,7 +27,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>policy-jre</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<packaging>pom</packaging>
diff --git a/policy-jre/pom.xml b/policy-jre/pom.xml
index eeaff490..57f39c29 100644
--- a/policy-jre/pom.xml
+++ b/policy-jre/pom.xml
@@ -24,7 +24,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<artifactId>policy-jre</artifactId>
diff --git a/policy-regression-tests/pom.xml b/policy-regression-tests/pom.xml
index d0dcdade..ffc5176b 100644
--- a/policy-regression-tests/pom.xml
+++ b/policy-regression-tests/pom.xml
@@ -7,7 +7,7 @@
<parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
</parent>
<groupId>org.onap.policy.regression</groupId>
diff --git a/pom.xml b/pom.xml
index d363bc66..3910ab8d 100644
--- a/pom.xml
+++ b/pom.xml
@@ -25,13 +25,13 @@
<parent>
<groupId>org.onap.policy.parent</groupId>
<artifactId>integration</artifactId>
- <version>5.0.0-SNAPSHOT</version>
+ <version>5.0.1-SNAPSHOT</version>
<relativePath />
</parent>
<groupId>org.onap.policy.docker</groupId>
<artifactId>docker</artifactId>
- <version>4.0.0-SNAPSHOT</version>
+ <version>4.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<name>policy-docker</name>
diff --git a/releases/4.0.0-container.yaml b/releases/4.0.0-container.yaml
new file mode 100644
index 00000000..bab7d393
--- /dev/null
+++ b/releases/4.0.0-container.yaml
@@ -0,0 +1,12 @@
+distribution_type: 'container'
+container_release_tag: '4.0.0'
+project: 'policy-docker'
+log_dir: 'policy-docker-maven-docker-stage-master/1047'
+ref: 8e03046e2b07df88c2356c86116111d8fb22dc6a
+containers:
+ - name: 'policy-jre-alpine'
+ version: '4.0.0-20240712T0754'
+ - name: 'policy-jdk-alpine'
+ version: '4.0.0-20240712T0754'
+ - name: 'policy-db-migrator'
+ version: '4.0.0-20240712T0754'
diff --git a/version.properties b/version.properties
index 19e0714b..bac52448 100644
--- a/version.properties
+++ b/version.properties
@@ -4,7 +4,7 @@
major=4
minor=0
-patch=0
+patch=1
base_version=${major}.${minor}.${patch}