diff options
Diffstat (limited to 'compose')
-rw-r--r-- | compose/config/clamp/legacy/AcRuntimeParameters.yaml | 74 | ||||
-rw-r--r-- | compose/config/clamp/legacy/HttpParticipantParameters.yaml | 45 | ||||
-rw-r--r-- | compose/config/clamp/legacy/KubernetesParticipantParameters.yaml | 66 | ||||
-rw-r--r-- | compose/config/clamp/legacy/PolicyParticipantParameters.yaml | 63 | ||||
-rw-r--r-- | compose/config/clamp/legacy/SimulatorParticipantParameters.yaml | 50 | ||||
-rw-r--r-- | compose/config/nginx/nginx-acm.conf | 17 | ||||
-rw-r--r-- | compose/docker-compose.acm.scale.yml | 147 | ||||
-rw-r--r-- | compose/docker-compose.gui.yml | 63 | ||||
-rw-r--r-- | compose/docker-compose.pdp.scale.yml | 23 | ||||
-rw-r--r-- | compose/docker-compose.postgres.yml | 25 | ||||
-rw-r--r-- | compose/docker-compose.yml | 13 | ||||
-rwxr-xr-x | compose/export-ports.sh | 1 | ||||
-rwxr-xr-x | compose/get-versions.sh | 220 | ||||
-rwxr-xr-x | compose/start-acm-replica.sh | 40 | ||||
-rwxr-xr-x | compose/start-compose.sh | 20 | ||||
-rwxr-xr-x | compose/start-multiple-pdp.sh | 8 | ||||
-rw-r--r-- | compose/start-postgres-tests.sh | 7 |
17 files changed, 664 insertions, 218 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 |