Refactoring of the entire dev deployment
[oam.git] / solution / dev / docker-compose.yml
1 ################################################################################
2 # Copyright 2021 highstreet technologies GmbH
3 #
4 # Licensed under the Apache License, Version 2.0 (the "License");
5 # you may not use this file except in compliance with the License.
6 # You may obtain a copy of the License at
7 #
8 #     http://www.apache.org/licenses/LICENSE-2.0
9 #
10 # Unless required by applicable law or agreed to in writing, software
11 # distributed under the License is distributed on an "AS IS" BASIS,
12 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 # See the License for the specific language governing permissions and
14 # limitations under the License.
15 #
16 version: '3.8'
17 services:
18   persistence:
19     image: ${PERSISTENCE_IMAGE}
20     container_name: persistence
21     environment:
22       - discovery.type=single-node
23     networks:
24       oam:
25         ipv4_address: ${PERSISTENCE_IP}
26
27   sdnr:
28     image: ${SDNC_IMAGE}
29     container_name: sdnr
30     ports:
31       - ${SDNC_REST_PORT}:8181
32       - 8101:8101
33     environment:
34       - SDNC_CONFIG_DIR=/opt/onap/ccsdk/data/properties
35       - ODL_CERT_DIR=${SDNC_CERT_DIR}
36       - ENABLE_ODL_CLUSTER=false
37       - SDNC_REPLICAS=0
38       - CCSDK_REPLICAS=0
39       - DOMAIN=""
40       - SDNRWT=true
41       - SDNRINIT=true
42       - SDNRONLY=true
43       - SDNRDBURL=http://persistence:9200
44       - A1_ADAPTER_NORTHBOUND=false
45       - ODL_ADMIN_PASSWORD=${ADMIN_PASSWORD}
46       - JAVA_OPTS=-Xms256m -Xmx4g
47     volumes:
48       - ./sdnr/mountpoint-registrar.properties:/opt/opendaylight/etc/mountpoint-registrar.properties
49       - ./sdnr/certs/certs.properties:${SDNC_CERT_DIR}/certs.properties
50       - ./sdnr/certs/keys0.zip:${SDNC_CERT_DIR}/keys0.zip
51     networks:
52       oam:
53         ipv4_address: ${SDNC_IP}
54     depends_on:
55       - persistence
56     
57   zookeeper:
58     image: ${ZOOKEEPER_IMAGE}
59     container_name: zookeeper
60     ports:
61       - 2181:2181
62     environment:
63       ZOOKEEPER_REPLICAS: 1
64       ZOOKEEPER_TICK_TIME: 2000
65       ZOOKEEPER_SYNC_LIMIT: 5
66       ZOOKEEPER_INIT_LIMIT: 10
67       ZOOKEEPER_MAX_CLIENT_CNXNS: 200
68       ZOOKEEPER_AUTOPURGE_SNAP_RETAIN_COUNT: 3
69       ZOOKEEPER_AUTOPURGE_PURGE_INTERVAL: 24
70       ZOOKEEPER_CLIENT_PORT: 2181
71       KAFKA_OPTS: -Djava.security.auth.login.config=/etc/zookeeper/secrets/jaas/zk_server_jaas.conf -Dzookeeper.kerberos.removeHostFromPrincipal=true -Dzookeeper.kerberos.removeRealmFromPrincipal=true -Dzookeeper.authProvider.1=org.apache.zookeeper.server.auth.SASLAuthenticationProvider -Dzookeeper.requireClientAuthScheme=sasl
72       ZOOKEEPER_SERVER_ID:
73     volumes:
74       -  ./zookeeper/zk_server_jaas.conf:/etc/zookeeper/secrets/jaas/zk_server_jaas.conf
75     networks:
76       oam:
77         aliases:
78         - zookeeper
79         ipv4_address: ${ZOOKEEPER_IP}
80
81   kafka:
82     image: ${KAFKA_IMAGE}
83     container_name: kafka
84     ports:
85      - 9092:9092
86     environment:
87       enableCadi: 'false'
88       KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
89       KAFKA_ZOOKEEPER_CONNECTION_TIMEOUT_MS: 40000
90       KAFKA_ZOOKEEPER_SESSION_TIMEOUT_MS: 40000
91       KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL_PLAINTEXT:PLAINTEXT,EXTERNAL_PLAINTEXT:PLAINTEXT
92       KAFKA_ADVERTISED_LISTENERS: INTERNAL_PLAINTEXT://kafka:9092
93       KAFKA_LISTENERS: INTERNAL_PLAINTEXT://0.0.0.0:9092
94       KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL_PLAINTEXT
95       KAFKA_CONFLUENT_SUPPORT_METRICS_ENABLE: 'false'
96       KAFKA_OPTS: -Djava.security.auth.login.config=/etc/kafka/secrets/jaas/zk_client_jaas.conf
97       KAFKA_ZOOKEEPER_SET_ACL: 'true'
98       KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
99       # Reduced the number of partitions only to avoid the timeout error for the first subscribe call in slow environment
100       KAFKA_OFFSETS_TOPIC_NUM_PARTITIONS: 1
101     volumes:
102       -  ./kafka/zk_client_jaas.conf:/etc/kafka/secrets/jaas/zk_client_jaas.conf
103     networks:
104       oam:
105         aliases:
106         - kafka
107         ipv4_address: ${KAFKA_IP}
108     depends_on:
109      - zookeeper
110
111   dmaap:
112     container_name: onap-dmaap
113     image: ${DMAAP_IMAGE}
114     ports:
115       - 3904:3904
116       - 3905:3905
117     environment:
118       enableCadi: 'false'
119     volumes:
120       - ./dmaap/MsgRtrApi.properties:/appl/dmaapMR1/bundleconfig/etc/appprops/MsgRtrApi.properties
121       - ./dmaap/logback.xml:/appl/dmaapMR1/bundleconfig/etc/logback.xml
122       - ./dmaap/cadi.properties:/appl/dmaapMR1/etc/cadi.properties
123     networks:
124       oam:
125         aliases:
126         - dmaap
127         ipv4_address: ${DMAAP_IP}
128     depends_on:
129       - zookeeper
130       - kafka
131
132   ves-collector:
133     image: ${VES_COLLECTOR_IMAGE}
134     container_name: ves-collector
135     environment:
136       DMAAPHOST: onap-dmaap
137     ports:
138       - 8080:8080
139       - 8443:8443
140     volumes:
141       - ./ves-collector/collector.properties:/opt/app/VESCollector/etc/collector.properties
142     networks:
143       oam:
144         ipv4_address: ${VES_COLLECTOR_IP}
145
146   ntsim-ng-o-du-1122:
147     image: "${DOCKER_REPO}nts-ng-o-ran-du:${NTS_BUILD_VERSION}"
148     container_name: ntsim-ng-o-du-1122
149     hostname: "highstreet-O-DU-1122"
150     cap_add:
151       - SYS_ADMIN
152     stop_grace_period: 5m
153     environment:
154       NTS_NF_STANDALONE_START_FEATURES: "datastore-populate ves-heartbeat ves-file-ready ves-pnf-registration web-cut-through"
155       NTS_NF_MOUNT_POINT_ADDRESSING_METHOD: ${NTS_NF_MOUNT_POINT_ADDRESSING_METHOD}
156       NTS_HOST_IP: ${NTS_HOST_IP}
157       NTS_HOST_BASE_PORT: ${NTS_HOST_BASE_PORT}
158       NTS_HOST_NETCONF_SSH_BASE_PORT: ${NTS_HOST_NETCONF_SSH_BASE_PORT}
159       NTS_HOST_NETCONF_TLS_BASE_PORT: ${NTS_HOST_NETCONF_TLS_BASE_PORT}
160       NTS_HOST_TRANSFER_FTP_BASE_PORT: ${NTS_HOST_TRANSFER_FTP_BASE_PORT}
161       NTS_HOST_TRANSFER_SFTP_BASE_PORT: ${NTS_HOST_TRANSFER_SFTP_BASE_PORT}
162       NTS_BUILD_DATE: ${NTS_BUILD_DATE}
163   
164       SDN_CONTROLLER_PROTOCOL: ${SDN_CONTROLLER_PROTOCOL}
165       SDN_CONTROLLER_IP: ${SDNC_IP}
166       SDN_CONTROLLER_PORT: ${SDNC_REST_PORT}
167       SDN_CONTROLLER_USERNAME: ${ADMIN_USERNAME}
168       SDN_CONTROLLER_PASSWORD: ${ADMIN_PASSWORD}
169   
170       VES_COMMON_HEADER_VERSION: ${VES_COMMON_HEADER_VERSION}
171       VES_ENDPOINT_PROTOCOL: ${VES_ENDPOINT_PROTOCOL}
172       VES_ENDPOINT_IP: ${VES_COLLECTOR_IP}
173       VES_ENDPOINT_PORT: ${VES_ENDPOINT_PORT}
174       VES_ENDPOINT_AUTH_METHOD: ${VES_ENDPOINT_AUTH_METHOD}
175       VES_ENDPOINT_USERNAME: ${VES_ENDPOINT_USERNAME}
176       VES_ENDPOINT_PASSWORD: ${VES_ENDPOINT_PASSWORD}
177     volumes:
178       - ./ntsim-ng-o-du/config.json:/opt/dev/ntsim-ng/config/config.json
179       - ./ntsim-ng-o-du/o-ran-sc-du-hello-world-operational.xml:/opt/dev/deploy/data/o-ran-sc-du-hello-world-operational.xml
180       - ./ntsim-ng-o-du/o-ran-sc-du-hello-world-running.xml:/opt/dev/deploy/data/o-ran-sc-du-hello-world-running.xml
181     depends_on:
182       - sdnr
183       - ves-collector
184     networks:
185       oam:
186   
187 networks:
188   oam:
189     driver: bridge
190     ipam:
191       driver: default
192       config:
193       - subnet: ${NETWORK_SUBNET_IP}
194         gateway: ${NETWORK_GATEWAY_IP}