Merge "Fix minor issues with CSITs"
[policy/docker.git] / csit / compose-grafana.yml
1 #
2 # ===========LICENSE_START====================================================
3 #  Copyright (C) 2022 Nordix Foundation.
4 # ============================================================================
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
8 #
9 #      http://www.apache.org/licenses/LICENSE-2.0
10 #
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
16 # ============LICENSE_END=====================================================
17 #
18 version: '2'
19 services:
20    mariadb:
21       image: nexus3.onap.org:10001/mariadb:${POLICY_MARIADB_VER}
22       container_name: mariadb
23       hostname: mariadb
24       command: ['--lower-case-table-names=1', '--wait_timeout=28800']
25       env_file: config/db/db.conf
26       volumes:
27          - ./config/db:/docker-entrypoint-initdb.d:ro
28          - ./config/clamp/policy-clamp-create-tables.sql:/tmp/policy-clamp-create-tables.sql
29       expose:
30        - 3306
31    policy-db-migrator:
32       image: nexus3.onap.org:10001/onap/policy-db-migrator:${POLICY_DOCKER_VERSION}
33       container_name: policy-db-migrator
34       hostname: policy-db-migrator
35       depends_on:
36         - mariadb
37       expose:
38        - 6824
39       env_file: config/db/db.conf
40       environment:
41         SQL_DB: policyadmin
42         SQL_HOST: mariadb
43       volumes:
44          - ./db_migrator_policy_init.sh:/opt/app/policy/bin/db_migrator_policy_init.sh:ro
45          - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
46       entrypoint: /opt/app/policy/bin/wait_for_port.sh
47       command: [
48               '-c',
49                 '/opt/app/policy/bin/db_migrator_policy_init.sh',
50                 'mariadb', '3306'
51                ]
52    simulator:
53       image: nexus3.onap.org:10001/onap/policy-models-simulator:${POLICY_MODELS_VERSION}
54       container_name: simulator
55       hostname: simulator
56       networks:
57           default:
58               aliases:
59                   - message-router
60                   - aai-sim
61                   - grpc-sim
62                   - sdnc-sim
63                   - so-sim
64                   - vfc-sim
65       volumes:
66        - ./config/sim-all:/opt/app/policy/simulators/etc/mounted:ro
67       expose:
68        - 6666
69        - 6668
70        - 6669
71        - 6670
72        - 3904
73        - 6680
74    api:
75       image: nexus3.onap.org:10001/onap/policy-api:${POLICY_API_VERSION}
76       container_name: policy-api
77       depends_on:
78        - policy-db-migrator
79       hostname: policy-api
80       expose:
81        - 6969
82       volumes:
83        - ./config/api/apiParameters.yaml:/opt/app/policy/api/etc/apiParameters.yaml:ro
84        - ./wait_for_port.sh:/opt/app/policy/api/bin/wait_for_port.sh:ro
85       entrypoint: ./wait_for_port.sh
86       command: [
87         '-c', './policy-api.sh',
88         'mariadb', '3306',
89         'policy-db-migrator', '6824'
90         ]
91    pap:
92       image: nexus3.onap.org:10001/onap/policy-pap:${POLICY_PAP_VERSION}
93       container_name: policy-pap
94       depends_on:
95        - mariadb
96        - simulator
97        - api
98       hostname: policy-pap
99       expose:
100        - 6969
101       volumes:
102        - ./config/pap/papParameters.yaml:/opt/app/policy/pap/etc/papParameters.yaml:ro
103        - ./config/pap/groups.json:/opt/app/policy/pap/etc/mounted/groups.json:ro
104        - ./wait_for_port.sh:/opt/app/policy/pap/bin/wait_for_port.sh:ro
105       entrypoint: ./wait_for_port.sh
106       command: [
107         '-c', './policy-pap.sh',
108         'mariadb', '3306',
109         'message-router', '3904',
110         'api', '6969'
111         ]
112    xacml-pdp:
113       image: nexus3.onap.org:10001/onap/policy-xacml-pdp:${POLICY_XACML_PDP_VERSION}
114       container_name: policy-xacml-pdp
115       depends_on:
116        - mariadb
117        - simulator
118        - pap
119       hostname: policy-xacml-pdp
120       expose:
121        - 6969
122       volumes:
123        - ./config/xacml-pdp/defaultConfig.json:/opt/app/policy/pdpx/etc/defaultConfig.json:ro
124        - ./wait_for_port.sh:/opt/app/policy/pdpx/bin/wait_for_port.sh:ro
125       entrypoint: ./wait_for_port.sh
126       command: [
127         '-c', './policy-pdpx.sh',
128         'mariadb', '3306',
129         'message-router', '3904',
130         'pap', '6969'
131         ]
132    drools:
133       image: nexus3.onap.org:10001/onap/policy-drools:${POLICY_DROOLS_PDP_VERSION}
134       container_name: drools
135       depends_on:
136        - mariadb
137        - simulator
138        - pap
139       hostname: drools
140       expose:
141        - 6969
142        - 9696
143       volumes:
144        - ./config/drools/custom:/tmp/policy-install/config:ro
145        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
146       env_file:
147         - config/drools/env/base.conf
148       entrypoint: /opt/app/policy/bin/wait_for_port.sh
149       command: [
150         '-c', '/opt/app/policy/bin/pdpd-entrypoint.sh boot',
151         'mariadb', '3306',
152         'message-router', '3904'
153         ]
154    drools-apps:
155       image: nexus3.onap.org:10001/onap/policy-pdpd-cl:${POLICY_DROOLS_APPS_VERSION}
156       container_name: drools-apps
157       depends_on:
158        - mariadb
159        - simulator
160        - pap
161        - xacml-pdp
162       hostname: drools-apps
163       expose:
164        - 6969
165        - 9696
166       volumes:
167        - ./config/drools-apps/custom:/tmp/policy-install/config:ro
168        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
169       env_file:
170         - config/drools-apps/env/base.conf
171         - config/drools-apps/env/feature-healthcheck.conf
172         - config/drools-apps/env/feature-pooling-dmaap.conf
173       entrypoint: /opt/app/policy/bin/wait_for_port.sh
174       command: [
175         '-c', '/opt/app/policy/bin/pdpd-cl-entrypoint.sh boot',
176         'mariadb', '3306',
177         'message-router', '3904',
178         'pap', '6969',
179         'aai-sim', '6666',
180         'sdnc-sim', '6668',
181         'so-sim', '6669',
182         'vfc-sim', '6670'
183         ]
184    apex-pdp:
185       image: nexus3.onap.org:10001/onap/policy-apex-pdp:${POLICY_APEX_PDP_VERSION}
186       container_name: policy-apex-pdp
187       depends_on:
188        - mariadb
189        - simulator
190        - pap
191       hostname: policy-apex-pdp
192       expose:
193        - 6969
194        - 23324
195       volumes:
196        - ./config/apex-pdp/OnapPfConfig.json:/opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json:ro
197        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
198       entrypoint: /opt/app/policy/bin/wait_for_port.sh
199       command: [
200         '-c', '/opt/app/policy/apex-pdp/bin/apexOnapPf.sh -c /opt/app/policy/apex-pdp/etc/onappf/config/OnapPfConfig.json',
201         'mariadb', '3306',
202         'message-router', '3904',
203         'pap', '6969'
204         ]
205    distribution:
206       image: nexus3.onap.org:10001/onap/policy-distribution:${POLICY_DISTRIBUTION_VERSION}
207       container_name: policy-distribution
208       depends_on:
209        - mariadb
210        - api
211        - pap
212        - apex-pdp
213       hostname: policy-distribution
214       volumes:
215        - ./config/distribution/defaultConfig.json:/opt/app/policy/distribution/etc/defaultConfig.json:ro
216        - ./distribution/config/temp/:/opt/app/policy/distribution/etc/temp/:ro
217        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
218       entrypoint: /opt/app/policy/bin/wait_for_port.sh
219       command: [
220         '-c', './policy-dist.sh',
221         'mariadb', '3306',
222         'message-router', '3904',
223         'pap', '6969',
224         'apex-pdp', '6969'
225         ]
226    policy-clamp-runtime-acm:
227       image: nexus3.onap.org:10001/onap/policy-clamp-runtime-acm:${POLICY_CLAMP_VERSION}
228       container_name: policy-clamp-runtime-acm
229       depends_on:
230        - mariadb
231        - simulator
232       hostname: policy-clamp-runtime-acm
233       expose:
234        - 6969
235       volumes:
236        - ./wait_for_port.sh:/opt/app/policy/bin/wait_for_port.sh:ro
237        - ./config/clamp/AcRuntimeParameters.yaml:/opt/app/policy/clamp/etc/AcRuntimeParameters.yaml:ro
238       entrypoint: /opt/app/policy/bin/wait_for_port.sh
239       command: [
240         '-c', './acm-runtime.sh',
241         'message-router', '3904'
242         ]
243    prometheus:
244       image: prom/prometheus:v2.32.1
245       container_name: prometheus
246       hostname: prometheus
247       expose:
248        - 9090
249       volumes:
250        - ./metrics/prometheus.yml:/etc/prometheus/prometheus.yml
251    grafana:
252       image: grafana/grafana-oss:8.3.4
253       container_name: grafana
254       depends_on:
255        - prometheus
256       hostname: grafana
257       expose:
258        - 3000
259       volumes:
260        - ./metrics/dashboard.yaml:/etc/grafana/provisioning/dashboards/dashboard.yaml
261        - ./metrics/datasource.yaml:/etc/grafana/provisioning/datasources/datasource.yaml
262        - ./metrics/dashboards:/var/lib/grafana/dashboards
263    node-exporter:
264       image: prom/node-exporter:latest
265       container_name: node-exporter
266       restart: unless-stopped
267       volumes:
268          - /proc:/host/proc:ro
269          - /sys:/host/sys:ro
270          - /:/rootfs:ro
271       command:
272          - '--path.procfs=/host/proc'
273          - '--path.rootfs=/rootfs'
274          - '--path.sysfs=/host/sys'
275          - '--collector.filesystem.mount-points-exclude=^/(sys|proc|dev|host|etc)($$|/)'
276       expose:
277          - 9100