Add kafka docker container for policy CSITs
[policy/docker.git] / compose / docker-compose.yml
1 #
2 # ===========LICENSE_START====================================================
3 #  Copyright (C) 2020-2021 AT&T Intellectual Property. All rights reserved.
4 #  Modifications Copyright (C) 2021 Bell Canada. All rights reserved.
5 #  Modification Copyright 2021-2023 Nordix Foundation.
6 # ============================================================================
7 # Licensed under the Apache License, Version 2.0 (the "License");
8 # you may not use this file except in compliance with the License.
9 # You may obtain a copy of the License at
10 #
11 #      http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 # ============LICENSE_END=====================================================
19 #
20 version: '2'
21 services:
22    mariadb:
23       image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER}
24       container_name: mariadb
25       hostname: mariadb
26       command: ['--lower-case-table-names=1', '--wait_timeout=28800', '--default-authentication-plugin=mysql_native_password']
27       env_file: ./config/db/db.conf
28       volumes:
29          - ./config/db:/docker-entrypoint-initdb.d:ro
30          - ./config/clamp/policy-clamp-create-tables.sql:/tmp/policy-clamp-create-tables.sql
31       ports:
32        - "3306:3306"
33    policy-db-migrator:
34       image: ${CONTAINER_LOCATION}onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
35       container_name: policy-db-migrator
36       hostname: policy-db-migrator
37       depends_on:
38         - mariadb
39       expose:
40        - 6824
41       env_file: ./config/db/db.conf
42       environment:
43         SQL_DB: policyadmin
44         SQL_HOST: mariadb
45       volumes:
46          - ./config/db-migrator/init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro
47          - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
48       entrypoint: /opt/app/policy/bin/wait_for_port.sh
49       command: [
50               '-c',
51                 '/opt/app/policy/bin/db_migrator_policy_init.sh',
52                 'mariadb', '3306'
53                ]
54    simulator:
55       image: ${CONTAINER_LOCATION}onap/policy-models-simulator:${POLICY_MODELS_VERSION}
56       container_name: simulator
57       hostname: simulator
58       networks:
59           default:
60               aliases:
61                   - message-router
62                   - aai-sim
63                   - grpc-sim
64                   - sdnc-sim
65                   - so-sim
66                   - vfc-sim
67       volumes:
68        - ./config/sim-all:/opt/app/policy/simulators/etc/mounted:ro
69        - ./config/sim-all/logback.xml:/opt/app/policy/simulators/etc/mounted/logback.xml:ro
70       expose:
71        - 6666
72        - 6668
73        - 6669
74        - 6670
75        - 3904
76        - 6680
77       ports:
78        - ${DMAAP_PORT}:3904
79    api:
80       image: ${CONTAINER_LOCATION}onap/policy-api:${POLICY_API_VERSION}
81       container_name: policy-api
82       depends_on:
83        - policy-db-migrator
84       hostname: policy-api
85       ports:
86        - ${API_PORT}:6969
87       volumes:
88        - ./config/api/apiParameters.yaml:/opt/app/policy/api/etc/apiParameters.yaml:ro
89        - ./config/api/logback.xml:/opt/app/policy/api/etc/logback.xml:ro
90        - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
91       entrypoint: ./wait_for_port.sh
92       command: [
93         '-c', './policy-api.sh',
94         'mariadb', '3306',
95         'policy-db-migrator', '6824'
96         ]
97    pap:
98       image: ${CONTAINER_LOCATION}onap/policy-pap:${POLICY_PAP_VERSION}
99       container_name: policy-pap
100       depends_on:
101        - mariadb
102        - simulator
103        - api
104       hostname: policy-pap
105       ports:
106        - ${PAP_PORT}:6969
107       volumes:
108        - ./config/pap/papParameters.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
109        - ./config/${PROJECT}/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
110        - ./config/pap/logback.xml:/opt/app/policy/pap/etc/logback.xml:ro
111        - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
112       entrypoint: ./wait_for_port.sh
113       command: [
114         '-c', './policy-pap.sh',
115         'mariadb', '3306',
116         'message-router', '3904',
117         'api', '6969'
118         ]
119    xacml-pdp:
120       image: ${CONTAINER_LOCATION}onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION}
121       container_name: policy-xacml-pdp
122       depends_on:
123        - mariadb
124        - simulator
125        - pap
126       hostname: policy-xacml-pdp
127       ports:
128        - ${XACML_PORT}:6969
129        - "30999:3904"
130       volumes:
131        - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
132        - ./config/xacml-pdp/logback.xml:/opt/app/policy/pdpx/etc/logback.xml:ro
133        - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro
134       entrypoint: ./wait_for_port.sh
135       command: [
136         '-c', './policy-pdpx.sh',
137         'mariadb', '3306',
138         'message-router', '3904',
139         'pap', '6969'
140         ]
141    drools-pdp:
142       image: ${CONTAINER_LOCATION}onap/policy-drools:${POLICY_DROOLS_PDP_VERSION}
143       container_name: drools
144       depends_on:
145        - mariadb
146        - simulator
147        - pap
148       hostname: drools
149       ports:
150        - ${DROOLS_PORT}:6969
151        - ${DROOLS_TELEMETRY_PORT}:9696
152       volumes:
153        - ./config/drools-pdp/custom:/tmp/policy-install/config:ro
154        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
155       env_file:
156         - ./config/drools-pdp/env/base.conf
157       entrypoint: /opt/app/policy/bin/wait_for_port.sh
158       command: [
159         '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot',
160         'mariadb', '3306',
161         'message-router', '3904'
162         ]
163    drools-applications:
164       image: ${CONTAINER_LOCATION}onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION}
165       container_name: drools-apps
166       depends_on:
167        - mariadb
168        - simulator
169        - pap
170        - xacml-pdp
171       hostname: drools-apps
172       ports:
173        - ${DROOLS_APPS_PORT}:6969
174        - ${DROOLS_APPS_TELEMETRY_PORT}:9696
175       volumes:
176        - ./config/drools-applications/custom:/tmp/policy-install/config:ro
177        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
178       env_file:
179         - ./config/drools-applications/env/base.conf
180         - ./config/drools-applications/env/feature-healthcheck.conf
181         - ./config/drools-applications/env/feature-pooling-dmaap.conf
182       entrypoint: /opt/app/policy/bin/wait_for_port.sh
183       command: [
184         '-c', '/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot',
185         'mariadb', '3306',
186         'message-router', '3904',
187         'pap', '6969',
188         'aai-sim', '6666',
189         'sdnc-sim', '6668',
190         'so-sim', '6669',
191         'vfc-sim', '6670'
192         ]
193    apex-pdp:
194       image: ${CONTAINER_LOCATION}onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION}
195       container_name: policy-apex-pdp
196       depends_on:
197        - mariadb
198        - simulator
199        - pap
200       hostname: policy-apex-pdp
201       ports:
202        - ${APEX_PORT}:6969
203        - ${APEX_EVENTS_PORT}:23324
204       volumes:
205        - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
206        - ./config/apex-pdp/logback.xml:/opt/app/policy/apex-pdp/etc/logback.xml:ro
207        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
208       entrypoint: /opt/app/policy/bin/wait_for_port.sh
209       command: [
210         '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json',
211         'mariadb', '3306',
212         'message-router', '3904',
213         'pap', '6969'
214         ]
215    distribution:
216       image: ${CONTAINER_LOCATION}onap/policy-distribution:${POLICY_DISTRIBUTION_VERSION}
217       container_name: policy-distribution
218       depends_on:
219        - mariadb
220        - api
221        - pap
222        - apex-pdp
223       hostname: policy-distribution
224       ports:
225        - ${DIST_PORT}:6969
226       volumes:
227        - ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro
228        - /tmp/distribution/:/opt/app/policy/distribution/etc/temp/:ro
229        - ./config/distribution/logback.xml:/opt/app/policy/distribution/etc/logback.xml:ro
230        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
231       entrypoint: /opt/app/policy/bin/wait_for_port.sh
232       command: [
233         '-c', './policy-dist.sh',
234         'mariadb', '3306',
235         'message-router', '3904',
236         'pap', '6969',
237         'apex-pdp', '6969'
238         ]
239    policy-clamp-runtime-acm:
240       image: ${CONTAINER_LOCATION}onap/policy-clamp-runtime-acm:${POLICY_CLAMP_VERSION}
241       container_name: policy-clamp-runtime-acm
242       depends_on:
243        - mariadb
244        - kafka
245        - policy-clamp-ac-http-ppnt
246        - policy-clamp-ac-k8s-ppnt
247        - policy-clamp-ac-pf-ppnt
248        - policy-clamp-ac-sim-ppnt
249        - apex-pdp
250       hostname: policy-clamp-runtime-acm
251       ports:
252        - ${ACM_PORT}:6969
253       volumes:
254        - ./config/clamp/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml
255        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
256        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
257       entrypoint: /opt/app/policy/bin/wait_for_port.sh
258       command: [
259         '-c', './acm-runtime.sh',
260         'mariadb', '3306',
261         'kafka', '9092',
262         'policy-clamp-ac-http-ppnt', '6969',
263         'policy-clamp-ac-k8s-ppnt', '6969',
264         'policy-clamp-ac-pf-ppnt', '6969',
265         'apex-pdp', '6969'
266         ]
267
268    policy-clamp-ac-http-ppnt:
269       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-http-ppnt:${POLICY_CLAMP_VERSION}
270       container_name: policy-clamp-ac-http-ppnt
271       depends_on:
272        - kafka
273       hostname: policy-clamp-ac-http-ppnt
274       ports:
275        - "30290:6969"
276       volumes:
277        - ./config/clamp/HttpParticipantParameters.yaml:/opt/app/policy/clamp/etc/HttpParticipantParameters.yaml
278        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
279        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
280       entrypoint: /opt/app/policy/bin/wait_for_port.sh
281       command: [
282         '-c', './http-participant.sh',
283         'kafka', '9092'
284         ]
285    policy-clamp-ac-k8s-ppnt:
286       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-k8s-ppnt:${POLICY_CLAMP_VERSION}
287       container_name: policy-clamp-ac-k8s-ppnt
288       depends_on:
289        - kafka
290       hostname: policy-clamp-ac-k8s-ppnt
291       ports:
292        - "30295:6969"
293       volumes:
294        - ./config/clamp/KubernetesParticipantParameters.yaml:/opt/app/policy/clamp/etc/KubernetesParticipantParameters.yaml
295        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
296        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
297       entrypoint: /opt/app/policy/bin/wait_for_port.sh
298       command: [
299         '-c', './kubernetes-participant.sh',
300         'kafka', '9092'
301         ]
302    policy-clamp-ac-pf-ppnt:
303       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-pf-ppnt:${POLICY_CLAMP_VERSION}
304       container_name: policy-clamp-ac-pf-ppnt
305       depends_on:
306        - kafka
307        - api
308       hostname: policy-clamp-ac-pf-ppnt
309       ports:
310        - ${POLICY_PARTICIPANT_PORT}:6969
311       volumes:
312        - ./config/clamp/PolicyParticipantParameters.yaml:/opt/app/policy/clamp/etc/PolicyParticipantParameters.yaml:ro
313        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
314        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
315       entrypoint: /opt/app/policy/bin/wait_for_port.sh
316       command: [
317         '-c', './policy-participant.sh',
318         'kafka', '9092',
319         'api', '6969'
320         ]
321    policy-clamp-ac-a1pms-ppnt:
322       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-a1pms-ppnt:${POLICY_CLAMP_VERSION}
323       container_name: policy-clamp-ac-a1pms-ppnt
324       depends_on:
325        - kafka
326       hostname: policy-clamp-ac-a1pms-ppnt
327       ports:
328        - "30296:6969"
329       volumes:
330        - ./config/clamp/A1pmsParticipantParameters.yaml:/opt/app/policy/clamp/etc/A1pmsParticipantParameters.yaml:ro
331        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
332        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
333       entrypoint: /opt/app/policy/bin/wait_for_port.sh
334       command: [
335         '-c', './a1pms-participant.sh',
336         'kafka', '9092'
337         ]
338    policy-clamp-ac-kserve-ppnt:
339       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-kserve-ppnt:${POLICY_CLAMP_VERSION}
340       container_name: policy-clamp-ac-kserve-ppnt
341       depends_on:
342        - kafka
343       hostname: policy-clamp-ac-kserve-ppnt
344       ports:
345        - "30297:6969"
346       volumes:
347        - ./config/clamp/KserveParticipantParameters.yaml:/opt/app/policy/clamp/etc/KserveParticipantParameters.yaml:ro
348        - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
349        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
350       entrypoint: /opt/app/policy/bin/wait_for_port.sh
351       command: [
352         '-c', './kserve-participant.sh',
353         'kafka', '9092'
354         ]
355    policy-clamp-ac-sim-ppnt:
356       image: ${CONTAINER_LOCATION}onap/policy-clamp-ac-sim-ppnt:${POLICY_CLAMP_VERSION}
357       container_name: policy-clamp-ac-sim-ppnt
358       depends_on:
359         - kafka
360       hostname: policy-clamp-ac-sim-ppnt
361       ports:
362         - ${SIM_PARTICIPANT_PORT}:6969
363       volumes:
364         - ./config/clamp/SimulatorParticipantParameters.yaml:/opt/app/policy/clamp/etc/SimulatorParticipantParameters.yaml:ro
365         - ./config/clamp/logback.xml:/opt/app/policy/clamp/etc/logback.xml:ro
366         - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
367       entrypoint: /opt/app/policy/bin/wait_for_port.sh
368       command: [
369         '-c', './sim-participant.sh',
370         'kafka', '9092'
371       ]
372    prometheus:
373       image: nexus3.onap.org:10001/prom/prometheus:latest
374       container_name: prometheus
375       hostname: prometheus
376       ports:
377        - ${PROMETHEUS_PORT}:9090
378       volumes:
379        - ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml
380    grafana:
381       image: nexus3.onap.org:10001/grafana/grafana:latest
382       container_name: grafana
383       depends_on:
384        - prometheus
385       hostname: grafana
386       ports:
387        - ${GRAFANA_PORT}:3000
388       volumes:
389        - ./metrics/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
390        - ./metrics/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
391        - ./metrics/dashboards:/var/lib/grafana/dashboards
392
393    zookeeper:
394      image: confluentinc/cp-zookeeper:latest
395      environment:
396        ZOOKEEPER_CLIENT_PORT: 2181
397        ZOOKEEPER_TICK_TIME: 2000
398      ports:
399        - 2181:2181
400
401    kafka:
402      image: confluentinc/cp-kafka:latest
403      container_name: kafka
404      depends_on:
405        - zookeeper
406      ports:
407        - 29092:29092
408        - 9092:9092
409      environment:
410        KAFKA_BROKER_ID: 1
411        KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
412        KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://kafka:9092,PLAINTEXT_HOST://localhost:29092
413        KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
414        KAFKA_INTER_BROKER_LISTENER_NAME: PLAINTEXT
415        KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1