## Database support
-From Oslo version onwards, this docker compose setup uses Postgres database as default; MariaDB is
-still available, but support might be limited.
+From Paris version onwards, this docker compose setup uses Postgres database; MariaDB support has
+been removed.
-To start docker compose with MariaDB, add a flag to use it:
-
-```sh
-# that will start apex-pdp and its dependencies (pap, api, mariadb, simulator)
-./start-compose.sh apex-pdp --mariadb
-# that will start apex-pdp and its dependencies (pap, api, postgres, simulator)
-./start-compose.sh apex-pdp
-```
### Docker compose files
- Metrics services (prometheus, grafana, jaeger)
- compose.postgres.yml
- Postgres database and policy-db-migrator working towards it
-- compose.mariadb.yml
- - MariaDB database and policy-db-migrator working towards it
- compose.yml
- All the policy components.
+++ /dev/null
-#
-# ===========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 running against mariadb
-
-services:
-
- mariadb:
- image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER}
- container_name: mariadb
- hostname: mariadb
- command: [ '--lower-case-table-names=1', '--wait_timeout=28800', '--default-authentication-plugin=mysql_native_password' ]
- env_file: config/db/db.conf
- volumes:
- - ./config/db:/docker-entrypoint-initdb.d:ro
- ports:
- - "3306:3306"
-
- policy-db-migrator:
- image: ${CONTAINER_LOCATION}onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
- container_name: policy-db-migrator
- hostname: policy-db-migrator
- depends_on:
- - mariadb
- expose:
- - 6824
- env_file: config/db/db.conf
- environment:
- SQL_DB: policyadmin clampacm pooling operationshistory
- SQL_HOST: mariadb
- volumes:
- - ./config/db-migrator/init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh: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',
- '/opt/app/policy/bin/db_migrator_policy_init.sh',
- 'mariadb', '3306'
- ]
path-mapping:
-metrics: plain-metrics
-prometheus: metrics
-
----
-
-spring:
- config:
- activate:
- on-profile: mariadb
- datasource:
- url: jdbc:mariadb://mariadb:3306/policyadmin
- driverClassName: org.mariadb.jdbc.Driver
- username: policy_user
- password: policy_user
-
-database:
- name: PolicyProviderParameterGroup
- implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
- driver: org.mariadb.jdbc.Driver
- url: jdbc:mariadb://mariadb:3306/policyadmin
- user: policy_user
- password: policy_user
- persistenceUnit: PolicyDb
acmParameters:
toscaElementName: org.onap.policy.clamp.acm.AutomationCompositionElement
toscaCompositionName: org.onap.policy.clamp.acm.AutomationComposition
-
----
-# mariadb config
-spring:
- config:
- activate:
- on-profile: mariadb
- datasource:
- url: jdbc:mariadb://${mariadb.host:mariadb}:${mariadb.port:3306}/clampacm
- driverClassName: org.mariadb.jdbc.Driver
+++ /dev/null
-#!/bin/sh
-# ============LICENSE_START====================================================
-# Copyright (C) 2021, 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======================================================
-
-export POLICY_HOME=/opt/app/policy
-export SQL_USER=${MYSQL_USER}
-export SQL_PASSWORD=${MYSQL_PASSWORD}
-export SCRIPT_DIRECTORY=sql
-
-for schema in ${SQL_DB}; do
- echo "Initializing $schema..."
- /opt/app/policy/bin/prepare_upgrade.sh ${schema}
-
- /opt/app/policy/bin/db-migrator -s ${schema} -o report
-
- /opt/app/policy/bin/db-migrator -s ${schema} -o upgrade
- rc=$?
-
- /opt/app/policy/bin/db-migrator -s ${schema} -o report
-
- if [ "$rc" != 0 ]; then
- break
- fi
-done
-
-nc -l -p 6824
-
-exit $rc
+++ /dev/null
-# Copyright 2019,2021 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
-MYSQL_CMD=mysql
+++ /dev/null
-#!/bin/bash -xv
-# Copyright 2019,2021 AT&T Intellectual Property. All rights reserved
-# Modifications Copyright (c) 2022, 2024 Nordix Foundation.
-#
-# Licensed under the Apache License, Version 2.0 (the "License");
-# you may not use this file except in compliance with the License.
-# You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-
-for db in migration pooling policyadmin operationshistory clampacm policyclamp
-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;"
+++ /dev/null
-# ============LICENSE_START==================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
-# Modification Copyright 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====================================================
-
-# JVM options
-
-JVM_OPTIONS=-server -Xms512m -Xmx512m
-
-# SYSTEM software configuration
-
-DEBUG=y
-POLICY_HOME=/opt/app/policy
-POLICY_LOGS=/var/log/onap/policy/pdpd
-KEYSTORE_PASSWD=Pol1cy_0nap
-TRUSTSTORE_PASSWD=Pol1cy_0nap
-
-# Telemetry credentials
-
-TELEMETRY_PORT=9696
-TELEMETRY_HOST=0.0.0.0
-TELEMETRY_USER=demo@people.osaaf.org
-TELEMETRY_PASSWORD=demo123456!
-
-# nexus repository
-
-SNAPSHOT_REPOSITORY_ID=
-SNAPSHOT_REPOSITORY_URL=
-RELEASE_REPOSITORY_ID=
-RELEASE_REPOSITORY_URL=
-REPOSITORY_USERNAME=
-REPOSITORY_PASSWORD=
-REPOSITORY_OFFLINE=true
-
-# Relational (SQL) DB access
-
-SQL_HOST=mariadb
-SQL_USER=policy_user
-SQL_PASSWORD=policy_user
-SQL_PORT=3306
-JDBC_URL=jdbc:mariadb://mariadb:3306/
-JDBC_OPTS=
-JDBC_DRIVER=org.mariadb.jdbc.Driver
-MYSQL_CMD=
-
-# HTTP Servers
-
-HTTP_SERVER_HTTPS=false
-PROMETHEUS=true
-
-# kafka server
-
-KAFKA_SERVERS=kafka:9092
-KAFKA_HTTPS=false
-
-# LIVENESS Checks
-
-LIVENESS_CONTROLLERS=*
-
-# PDP-D Kafka configuration channel
-
-PDPD_CONFIGURATION_TOPIC=pdpd-configuration
-PDPD_CONFIGURATION_SERVERS=kafka:9092
-PDPD_CONFIGURATION_API_KEY=
-PDPD_CONFIGURATION_API_SECRET=
-PDPD_CONFIGURATION_CONSUMER_GROUP=
-PDPD_CONFIGURATION_CONSUMER_INSTANCE=
-PDPD_CONFIGURATION_PARTITION_KEY=
-
-# PAP-PDP configuration channel
-
-POLICY_PDP_PAP_TOPIC=policy-pdp-pap
-POLICY_PDP_PAP_API_KEY=
-POLICY_PDP_PAP_API_SECRET=
-POLICY_PDP_PAP_POLICYTYPES=onap.policies.controlloop.operational.common.Drools
-
-# PAP
-
-PAP_HOST=policy-pap
-PAP_USERNAME=policyadmin
-PAP_PASSWORD=zb!XztG34
-
-# PDP-X
-
-GUARD_DISABLED=false
-PDP_HOST=policy-xacml-pdp
-PDP_PORT=6969
-PDP_CONTEXT_URI=policy/pdpx/v1/
-PDP_USERNAME=policyadmin
-PDP_PASSWORD=zb!XztG34
-PDP_HTTPS=false
-
-# DCAE Kafka
-
-DCAE_TOPIC=dcae_topic
-DCAE_SERVERS=kafka:9092
-DCAE_CONSUMER_GROUP=dcae.policy.shared
-
-# AAI
-
-AAI_HOST=aai-sim
-AAI_PORT=6666
-AAI_CONTEXT_URI=
-AAI_USERNAME=policy@policy.onap.org
-AAI_PASSWORD=demo123456!
-AAI_HTTPS=false
-
-# MSO
-
-SO_HOST=so-sim
-SO_PORT=6669
-SO_CONTEXT_URI=
-SO_URL=http://so-sim:6669/
-SO_USERNAME=InfraPortalClient
-SO_PASSWORD='password1$'
-
-# VFC
-
-VFC_HOST=vfc-sim
-VFC_PORT=6670
-VFC_CONTEXT_URI=
-VFC_USERNAME=
-VFC_PASSWORD=
-
-# SDNC
-
-SDNC_HOST=sdnc-sim
-SDNC_PORT=6668
-SDNC_CONTEXT_URI=
-SDNC_USERNAME=
-SDNC_PASSWORD=
-
-# CDS
-
-CDS_GRPC_HOST=grpc-sim
-CDS_GRPC_PORT=6680
-CDS_GRPC_USERNAME="ccsdkapps"
-CDS_GRPC_PASSWORD="ccsdkapps"
+++ /dev/null
-# ============LICENSE_START=======================================================
-# Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
-# Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
-# Modification Copyright 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=========================================================
-
-# JVM options
-
-JVM_OPTIONS=-server -Xms512m -Xmx512m
-
-# SYSTEM software configuration
-
-DEBUG=y
-POLICY_HOME=/opt/app/policy
-POLICY_LOGS=/var/log/onap/policy/pdpd
-KEYSTORE_PASSWD=Pol1cy_0nap
-TRUSTSTORE_PASSWD=Pol1cy_0nap
-
-# Telemetry credentials
-
-TELEMETRY_PORT=9696
-TELEMETRY_HOST=0.0.0.0
-TELEMETRY_USER=demo@people.osaaf.org
-TELEMETRY_PASSWORD=demo123456!
-
-# nexus repository
-
-SNAPSHOT_REPOSITORY_ID=policy-nexus-snapshots
-SNAPSHOT_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/snapshots/
-RELEASE_REPOSITORY_ID=policy-nexus-releases
-RELEASE_REPOSITORY_URL=http://nexus:8081/nexus/content/repositories/releases/
-REPOSITORY_USERNAME=admin
-REPOSITORY_PASSWORD=admin123
-REPOSITORY_OFFLINE=false
-
-# Relational (SQL) DB access
-
-SQL_HOST=mariadb
-SQL_USER=policy_user
-SQL_PASSWORD=policy_user
-SQL_PORT=3306
-JDBC_URL=jdbc:mariadb://mariadb:3306/
-JDBC_OPTS=
-MYSQL_CMD=
-
-# HTTP Servers
-
-HTTP_SERVER_HTTPS=false
-PROMETHEUS=true
-
-# PDP-D Kafka configuration channel
-
-PDPD_CONFIGURATION_TOPIC=pdpd-configuration
-PDPD_CONFIGURATION_API_KEY=
-PDPD_CONFIGURATION_API_SECRET=
-PDPD_CONFIGURATION_CONSUMER_GROUP=
-PDPD_CONFIGURATION_CONSUMER_INSTANCE=
-PDPD_CONFIGURATION_PARTITION_KEY=
-
-# PAP-PDP configuration channel
-
-POLICY_PDP_PAP_TOPIC=policy-pdp-pap
-POLICY_PDP_PAP_API_KEY=
-POLICY_PDP_PAP_API_SECRET=
-
-# PAP
-
-PAP_HOST=
-PAP_USERNAME=
-PAP_PASSWORD=
-
-# PDP-X
-
-PDP_HOST=
-PDP_PORT=
-PDP_CONTEXT_URI=policy/pdpx/v1/
-PDP_USERNAME=
-PDP_PASSWORD=
-PDP_CLIENT_USERNAME=
-PDP_CLIENT_PASSWORD=
-PDP_ENVIRONMENT=
-GUARD_DISABLED=false
-
-# DCAE Kafka
-
-DCAE_TOPIC=dcae_topic
-DCAE_SERVERS=
-DCAE_CONSUMER_GROUP=dcae.policy.shared
-
-# kafka server
-
-KAFKA_SERVERS=kafka:9092
-KAFKA_HTTPS=false
-
-# AAI
-
-AAI_HOST=aai.api.simpledemo.onap.org
-AAI_PORT=8443
-AAI_CONTEXT_URI=
-AAI_USERNAME=policy@policy.onap.org
-AAI_PASSWORD=demo123456!
-
-# MSO
-
-SO_HOST=vm1.mso.simpledemo.onap.org
-SO_PORT=8080
-SO_CONTEXT_URI=onap/so/infra/
-SO_URL=http://vm1.mso.simpledemo.onap.org:8080/onap/so/infra
-SO_USERNAME=InfraPortalClient
-SO_PASSWORD='password1$'
-
-# VFC
-
-VFC_HOST=
-VFC_PORT=
-VFC_CONTEXT_URI=api/nslcm/v1/
-VFC_USERNAME=
-VFC_PASSWORD=
-
-# SDNC
-
-SDNC_HOST=
-SDNC_PORT=
-SDNC_CONTEXT_URI=restconf/operations/
-SDNC_USERNAME=
-SDNC_PASSWORD=
stateChangeParameters:
maxRetryCount: 1
maxWaitMs: 30000
- savePdpStatisticsInDb: true
topicParameterGroup:
topicSources:
- topic: ${pap.topic.pdp-pap.name}
path-mapping:
-metrics: plain-metrics
-prometheus: metrics
-
----
-
-spring:
- config:
- activate:
- on-profile: mariadb
- datasource:
- url: jdbc:mariadb://mariadb:3306/policyadmin
- driverClassName: org.mariadb.jdbc.Driver
- username: policy_user
- password: policy_user
-
-database:
- name: PolicyProviderParameterGroup
- implementation: org.onap.policy.models.provider.impl.DatabasePolicyModelsProviderImpl
- driver: org.mariadb.jdbc.Driver
- url: jdbc:mariadb://mariadb:3306/policyadmin
- user: policy_user
- password: policy_user
- persistenceUnit: PolicyDb
+++ /dev/null
-#
-# Properties that the embedded PDP engine uses to configure and load
-#
-# Standard API Factories
-#
-xacml.dataTypeFactory=com.att.research.xacml.std.StdDataTypeFactory
-xacml.pdpEngineFactory=com.att.research.xacmlatt.pdp.ATTPDPEngineFactory
-xacml.pepEngineFactory=com.att.research.xacml.std.pep.StdEngineFactory
-xacml.pipFinderFactory=com.att.research.xacml.std.pip.StdPIPFinderFactory
-xacml.traceEngineFactory=com.att.research.xacml.std.trace.LoggingTraceEngineFactory
-#
-# AT&T PDP Implementation Factories
-#
-xacml.att.evaluationContextFactory=com.att.research.xacmlatt.pdp.std.StdEvaluationContextFactory
-xacml.att.combiningAlgorithmFactory=com.att.research.xacmlatt.pdp.std.StdCombiningAlgorithmFactory
-xacml.att.functionDefinitionFactory=com.att.research.xacmlatt.pdp.std.StdFunctionDefinitionFactory
-#
-# ONAP PDP Implementation Factories
-#
-xacml.att.policyFinderFactory=org.onap.policy.pdp.xacml.application.common.OnapPolicyFinderFactory
-
-#
-# Use a root combining algorithm
-#
-xacml.att.policyFinderFactory.combineRootPolicies=urn:oasis:names:tc:xacml:3.0:policy-combining-algorithm:deny-overrides
-
-#
-# PIP Engine Definitions
-#
-count-recent-operations.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.CountRecentOperationsPip
-count-recent-operations.issuer=urn:org:onap:xacml:guard:count-recent-operations
-count-recent-operations.name=CountRecentOperations
-count-recent-operations.description=Returns operation counts based on time window
-count-recent-operations.persistenceunit=OperationsHistoryPU
-
-get-operation-outcome.classname=org.onap.policy.pdp.xacml.application.common.operationshistory.GetOperationOutcomePip
-get-operation-outcome.issuer=urn:org:onap:xacml:guard:get-operation-outcome
-get-operation-outcome.name=GetOperationOutcome
-get-operation-outcome.description=Returns operation outcome
-get-operation-outcome.persistenceunit=OperationsHistoryPU
-
-#
-# Make pips available to finder
-#
-xacml.pip.engines=count-recent-operations,get-operation-outcome
-
-#
-# JPA Properties
-#
-eclipselink.target-database=MySQL
-jakarta.persistence.jdbc.driver=org.mariadb.jdbc.Driver
-jakarta.persistence.jdbc.url=jdbc:mariadb://mariadb:3306/operationshistory
-jakarta.persistence.jdbc.user=policy_user
-jakarta.persistence.jdbc.password=policy_user
fi
#default values
-export POLICY_MARIADB_VER=10.10.2
-echo POLICY_MARIADB_VER=${POLICY_MARIADB_VER}
-
export POLICY_POSTGRES_VER=16.4
echo POLICY_POSTGRES_VER=${POLICY_POSTGRES_VER}