Remove MariaDB support 41/139941/1
authoradheli.tavares <adheli.tavares@est.tech>
Thu, 16 Jan 2025 14:02:00 +0000 (14:02 +0000)
committeradheli.tavares <adheli.tavares@est.tech>
Thu, 16 Jan 2025 14:05:35 +0000 (14:05 +0000)
- change configurations to use PostgreSQL as default
- remove unused configurations

Issue-ID: POLICY-5196
Change-Id: I29711e33f0f137e19f35f2ca929aa8e0f00e6c88
Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
main/src/main/resources/application.yaml
packages/policy-api-tarball/src/main/resources/etc/apiParameters.yaml
testsuites/stability/src/main/resources/README.md [deleted file]
testsuites/stability/src/main/resources/apisetup/config/api/bin/policy-api.sh [deleted file]
testsuites/stability/src/main/resources/apisetup/config/api/etc/defaultConfig.json [deleted file]
testsuites/stability/src/main/resources/apisetup/setup_api.sh [deleted file]
testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf [deleted file]
testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh [deleted file]
testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh [deleted file]

index b7d3a8c..8b5dd57 100644 (file)
@@ -6,8 +6,8 @@ spring:
     password: zb!XztG34
   mvc.converters.preferred-json-mapper: gson
   datasource:
-    url: jdbc:mariadb://mariadb:3306/policyadmin
-    driverClassName: org.mariadb.jdbc.Driver
+    url: jdbc:postgresql://postgres:5432/policyadmin
+    driverClassName: org.postgresql.Driver
     username: policy_user
     password: policy_user
   jpa:
index 704dd64..8b5dd57 100644 (file)
@@ -1,14 +1,13 @@
-server:
-  port: 6969
-
 spring:
+  profiles:
+    active: default
   security.user:
     name: policyadmin
     password: zb!XztG34
   mvc.converters.preferred-json-mapper: gson
   datasource:
-    url: jdbc:mariadb://mariadb:3306/policyadmin
-    driverClassName: org.mariadb.jdbc.Driver
+    url: jdbc:postgresql://postgres:5432/policyadmin
+    driverClassName: org.postgresql.Driver
     username: policy_user
     password: policy_user
   jpa:
@@ -18,13 +17,18 @@ spring:
         physical-strategy: org.hibernate.boot.model.naming.PhysicalNamingStrategyStandardImpl
         implicit-strategy: org.onap.policy.common.spring.utils.CustomImplicitNamingStrategy
 
+server:
+  port: 6969
+  servlet:
+    context-path: /policy/api/v1
+
 policy-api:
   name: ApiGroup
-  aaf: false
 
 policy-preload:
   policyTypes:
     - policytypes/onap.policies.monitoring.tcagen2.yaml
+    - policytypes/onap.policies.monitoring.tcagen2.v2.yaml
     - policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml
     - policytypes/onap.policies.monitoring.dcae-restconfcollector.yaml
     - policytypes/onap.policies.monitoring.dcae-pm-subscription-handler.yaml
@@ -51,10 +55,12 @@ policy-preload:
     - policytypes/onap.policies.Match.yaml
     - policytypes/onap.policies.native.Drools.yaml
     - policytypes/onap.policies.native.Xacml.yaml
+    - policytypes/onap.policies.native.ToscaXacml.yaml
     - policytypes/onap.policies.native.Apex.yaml
     - policytypes/onap.policies.controlloop.operational.Common.yaml
     - policytypes/onap.policies.controlloop.operational.common.Apex.yaml
     - policytypes/onap.policies.controlloop.operational.common.Drools.yaml
+    - policytypes/onap.policies.native.opa.yaml
   policies:
     - policies/sdnc.policy.naming.input.tosca.yaml
 
diff --git a/testsuites/stability/src/main/resources/README.md b/testsuites/stability/src/main/resources/README.md
deleted file mode 100644 (file)
index 50297b4..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-Scripts and corresponding configurations under *apisetup* and *simulatorsetup* are not needed
-if stability test is planned to run over ONAP OOM based Policy deployment in lab.
-
-They are needed only if stability test is planned to run over component level deployment
-(i.e. two VMs, one for API while the other for MariaDB).
\ No newline at end of file
diff --git a/testsuites/stability/src/main/resources/apisetup/config/api/bin/policy-api.sh b/testsuites/stability/src/main/resources/apisetup/config/api/bin/policy-api.sh
deleted file mode 100644 (file)
index dc78ab1..0000000
+++ /dev/null
@@ -1,39 +0,0 @@
-#!/bin/bash
-#
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2019-2020 AT&T Intellectual Property. All rights reserved.
-#  Modifications Copyright (C) 2020-2022 Nordix Foundation.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-#
-
-POLICY_API_HOME=/opt/app/policy/api
-KEYSTORE="${POLICY_HOME}/etc/ssl/policy-keystore"
-TRUSTSTORE="${POLICY_HOME}/etc/ssl/policy-truststore"
-
-if [ "$#" -ge 1 ]; then
-    CONFIG_FILE=$1
-else
-    CONFIG_FILE=${CONFIG_FILE}
-fi
-
-if [ -z "$CONFIG_FILE" ]; then
-    CONFIG_FILE="$POLICY_API_HOME/etc/defaultConfig.json"
-fi
-
-echo "Policy api config file: $CONFIG_FILE"
-
-$JAVA_HOME/bin/java -cp "$POLICY_API_HOME/etc:$POLICY_API_HOME/lib/*" -Dlogback.configurationFile=$POLICY_API_HOME/etc/logback.xml -Djavax.net.ssl.keyStore="$KEYSTORE" -Djavax.net.ssl.keyStorePassword="${KEYSTORE_PASSWD:-Pol1cy_0nap}" -Djavax.net.ssl.trustStore="$TRUSTSTORE" -Djavax.net.ssl.trustStorePassword="${TRUSTSTORE_PASSWD:-Pol1cy_0nap}" -Dcom.sun.management.jmxremote.rmi.port=9090 -Dcom.sun.management.jmxremote=true -Dcom.sun.management.jmxremote.port=9090 -Dcom.sun.management.jmxremote.ssl=false -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.local.only=false -Djava.rmi.server.hostname=$API_HOST org.onap.policy.api.main.startstop.Main -c $CONFIG_FILE
diff --git a/testsuites/stability/src/main/resources/apisetup/config/api/etc/defaultConfig.json b/testsuites/stability/src/main/resources/apisetup/config/api/etc/defaultConfig.json
deleted file mode 100644 (file)
index c463ac6..0000000
+++ /dev/null
@@ -1,43 +0,0 @@
-{
-    "name": "ApiGroup",
-    "restServerParameters": {
-        "host": "0.0.0.0",
-        "port": 6969,
-        "userName": "policyadmin",
-        "password": "zb!XztG34",
-        "https": true,
-        "aaf": false
-    },
-    "preloadPolicyTypes": [
-        "policytypes/onap.policies.monitoring.cdap.tca.hi.lo.app.yaml",
-        "policytypes/onap.policies.monitoring.dcaegen2.collectors.datafile.datafile-app-server.yaml",
-        "policytypes/onap.policies.Optimization.yaml",
-        "policytypes/onap.policies.optimization.Resource.yaml",
-        "policytypes/onap.policies.optimization.Service.yaml",
-        "policytypes/onap.policies.optimization.resource.AffinityPolicy.yaml",
-        "policytypes/onap.policies.optimization.resource.DistancePolicy.yaml",
-        "policytypes/onap.policies.optimization.resource.HpaPolicy.yaml",
-        "policytypes/onap.policies.optimization.resource.OptimizationPolicy.yaml",
-        "policytypes/onap.policies.optimization.resource.PciPolicy.yaml",
-        "policytypes/onap.policies.optimization.service.QueryPolicy.yaml",
-        "policytypes/onap.policies.optimization.service.SubscriberPolicy.yaml",
-        "policytypes/onap.policies.optimization.resource.Vim_fit.yaml",
-        "policytypes/onap.policies.optimization.resource.VnfPolicy.yaml",
-        "policytypes/onap.policies.controlloop.guard.Common.yaml",
-        "policytypes/onap.policies.controlloop.guard.common.Blacklist.yaml",
-        "policytypes/onap.policies.controlloop.guard.common.FrequencyLimiter.yaml",
-        "policytypes/onap.policies.controlloop.guard.common.MinMax.yaml",
-        "policytypes/onap.policies.controlloop.guard.coordination.FirstBlocksSecond.yaml",
-        "policytypes/onap.policies.controlloop.Operational.yaml",
-        "policytypes/onap.policies.Naming.yaml",
-        "policytypes/onap.policies.native.Drools.yaml",
-        "policytypes/onap.policies.native.Xacml.yaml",
-        "policytypes/onap.policies.native.Apex.yaml",
-        "policytypes/onap.policies.controlloop.operational.Common.yaml",
-        "policytypes/onap.policies.controlloop.operational.common.Apex.yaml",
-        "policytypes/onap.policies.controlloop.operational.common.Drools.yaml"
-    ],
-    "preloadPolicies" : [
-        "policies/sdnc.policy.naming.input.tosca.yaml"
-    ]
-}
diff --git a/testsuites/stability/src/main/resources/apisetup/setup_api.sh b/testsuites/stability/src/main/resources/apisetup/setup_api.sh
deleted file mode 100644 (file)
index 9541406..0000000
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-# ============LICENSE_START=======================================================
-#  Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-# the directory of the script
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-echo ${DIR}
-
-if [ "$#" -lt 2 ]; then
-    echo "API and MariaDB IPs should be passed as two parameters. API IP goes first."
-    exit 1
-else
-    API=$1
-    echo "API IP: ${API}"
-    MARIADB=$2
-    echo "MariaDB IP: ${MARIADB}"
-fi
-
-docker run -p 9090:9090 -p 6969:6969 -e "API_HOST=${API}" -v ${DIR}/config/api/bin/policy-api.sh:/opt/app/policy/api/bin/policy-api.sh -v ${DIR}/config/api/etc/defaultConfig.json:/opt/app/policy/api/etc/defaultConfig.json --add-host mariadb:${MARIADB} --name policy-api -d --rm nexus3.onap.org:10001/onap/policy-api:2.2-SNAPSHOT-latest
diff --git a/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.conf
deleted file mode 100644 (file)
index 97cc853..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-MYSQL_ROOT_PASSWORD=secret
-MYSQL_USER=policy_user
-MYSQL_PASSWORD=policy_user
\ No newline at end of file
diff --git a/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh b/testsuites/stability/src/main/resources/simulatorsetup/config/db/db.sh
deleted file mode 100644 (file)
index 92ec09b..0000000
+++ /dev/null
@@ -1,22 +0,0 @@
-#!/bin/bash -xv
-# Copyright (C) 2019 AT&T Intellectual Property. All rights reserved.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#         http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-for db in policyadmin
-do
-   mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "CREATE DATABASE IF NOT EXISTS ${db};"
-   mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "GRANT ALL PRIVILEGES ON \`${db}\`.* TO '${MYSQL_USER}'@'%' ;"
-done
-
-mysql -uroot -p"${MYSQL_ROOT_PASSWORD}" --execute "FLUSH PRIVILEGES;"
diff --git a/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh b/testsuites/stability/src/main/resources/simulatorsetup/setup_components.sh
deleted file mode 100644 (file)
index 1dc6f4f..0000000
+++ /dev/null
@@ -1,24 +0,0 @@
-#!/bin/bash
-# ============LICENSE_START=======================================================
-#  Copyright (c) 2019 AT&T Intellectual Property. All rights reserved.
-# ================================================================================
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-#      http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-# SPDX-License-Identifier: Apache-2.0
-# ============LICENSE_END=========================================================
-
-# the directory of the script
-DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-echo ${DIR}
-
-docker run -p 3306:3306 -v ${DIR}/config/db:/docker-entrypoint-initdb.d --name mariadb  --env-file ${DIR}/config/db/db.conf -d --rm mariadb:10.2.14 --lower-case-table-names=1 --wait_timeout=28800
\ No newline at end of file