Merge "Adopt new docs/tox API"
[oam.git] / solution / smo / oam / docker-compose.yml
index 1f8b1fd..d6e9438 100755 (executable)
@@ -1,3 +1,19 @@
+################################################################################
+# Copyright 2023 highstreet technologies GmbH
+#
+# 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.
+#
+
 # no more versions needed! Compose spec supports all features w/o a version
 services:
 
@@ -6,100 +22,130 @@ services:
     container_name: odlux
     hostname: odlux
     environment:
-      - ENABLE_OAUTH=true
-      - WEBPROTOCOL=HTTP
-      - WEBPORT=${SDNC_WEB_PORT}
-      - SDNRPROTOCOL=http
-      - SDNRHOST=sdnr
-      - SDNRPORT=${SDNC_REST_PORT}
+      ENABLE_OAUTH: true
+      WEBPROTOCOL: HTTP
+      WEBPORT: ${SDNC_WEB_PORT}
+      SDNRPROTOCOL: http
+      SDNRHOST: controller
+      SDNRPORT: ${SDNC_REST_PORT}
     labels:
       traefik.enable: true
       traefik.http.routers.sdnc-web.entrypoints: websecure
       traefik.http.routers.sdnc-web.rule: Host(`odlux.oam.${SOLUTION_DOMAIN}`)
       traefik.http.routers.sdnc-web.tls: true
       traefik.http.services.sdnc-web.loadbalancer.server.port: ${SDNC_WEB_PORT}
+    depends_on:
+      controller:
+        condition: service_healthy
     networks:
+      dmz:
       smo:
 
-  sdnr:
+  controller:
     image: ${SDNC_IMAGE}
-    container_name: sdnr
-    hostname: sdnr
-    ports:
-      - 6666:6666
-      - 4335:4335
+    container_name: controller
+    hostname: controller
+    extra_hosts:
+      - "controller.dcn.smo.o-ran-sc.org:${HOST_IP}"
+    healthcheck:
+      test: wget --no-verbose --tries=1 --spider http://localhost:${SDNC_REST_PORT}/ready || exit 1
+      start_period: 60s
+      interval: 10s
+      timeout: 5s
+      retries: 5
     environment:
-      - ENABLE_ODL_CLUSTER=false
-      - ENABLE_OAUTH=true
-      - ODL_ADMIN_PASSWORD=${ADMIN_PASSWORD}
-      - SDNC_CONFIG_DIR=/opt/onap/ccsdk/data/properties
-      - SDNC_REPLICAS=0
-      - CCSDK_REPLICAS=0
-      - DOMAIN=""
-      - SDNRWT=true
-      - SDNRONLY=true
-      - SDNRINIT=true
-      - SDNRDM=true
-      - SDNRDBURL=http://persistence:9200
-      - SDNR_NETCONF_CALLHOME_ENABLED=true
-      - A1_ADAPTER_NORTHBOUND=false
-      - JAVA_OPTS=-Xms256m -Xmx4g
-      - IDENTITY_PROVIDER_URL=${IDENTITY_PROVIDER_URL}
-      - SDNC_WEB_URL=https://odlux.oam.${SOLUTION_DOMAIN}
-      - SDNR_VES_COLLECTOR_ENABLED=true
-      - SDNR_VES_COLLECTOR_TLS_ENABLED=false
-      - SDNR_VES_COLLECTOR_TRUST_ALL_CERTS=true
-      - SDNR_VES_COLLECTOR_IP=ves-collector
-      - SDNR_VES_COLLECTOR_PORT=$VES_ENDPOINT_PORT
-      - SDNR_VES_COLLECTOR_VERSION=v7
-      - SDNR_VES_COLLECTOR_REPORTING_ENTITY_NAME=ONAP SDN-R
-      - SDNR_VES_COLLECTOR_EVENTLOG_MSG_DETAIL=LONG
-      - SDNR_VES_COLLECTOR_USERNAME=${VES_ENDPOINT_USERNAME}
-      - SDNR_VES_COLLECTOR_PASSWORD=${VES_ENDPOINT_PASSWORD}
+      ENABLE_ODL_CLUSTER: false
+      ENABLE_OAUTH: true
+      ODL_CERT_DIR: ${SDNC_CERT_DIR}
+      ODL_ADMIN_PASSWORD: ${ADMIN_PASSWORD}
+      SDNC_CONFIG_DIR: /opt/onap/ccsdk/data/properties
+      SDNC_REPLICAS: 0
+      CCSDK_REPLICAS: 0
+      DOMAIN: ""
+      SDNRWT: true
+      SDNRONLY: true
+      SDNRINIT: true
+      SDNRDM: true
+      SDNRDBURL: http://persistence:9200
+      SDNR_NETCONF_CALLHOME_ENABLED: true
+      A1_ADAPTER_NORTHBOUND: false
+      JAVA_OPTS: -Xms256m -Xmx4g
+      IDENTITY_PROVIDER_URL: ${IDENTITY_PROVIDER_URL}
+      SDNC_WEB_URL: https://odlux.oam.${SOLUTION_DOMAIN}
+      SDNR_VES_COLLECTOR_ENABLED: true
+      SDNR_VES_COLLECTOR_TLS_ENABLED: false
+      SDNR_VES_COLLECTOR_TRUST_ALL_CERTS: true
+      SDNR_VES_COLLECTOR_IP: ves-collector
+      SDNR_VES_COLLECTOR_PORT: $VES_ENDPOINT_PORT
+      SDNR_VES_COLLECTOR_VERSION: v7
+      SDNR_VES_COLLECTOR_REPORTING_ENTITY_NAME: ONAP SDN-R
+      SDNR_VES_COLLECTOR_EVENTLOG_MSG_DETAIL: LONG
+      SDNR_VES_COLLECTOR_USERNAME: ${VES_ENDPOINT_USERNAME}
+      SDNR_VES_COLLECTOR_PASSWORD: ${VES_ENDPOINT_PASSWORD}
     volumes:
       - ./controller/oauth-aaa-app-config.xml:/opt/onap/sdnc/data/oauth-aaa-app-config.xml
       - ./controller/oauth-provider.config.json:/opt/opendaylight/etc/oauth-provider.config.json
       - ./controller/devicemanager.properties:/opt/opendaylight/etc/devicemanager.properties
       - ./controller/mountpoint-registrar.properties:/opt/opendaylight/etc/mountpoint-registrar.properties
+      - ./controller/certs/certs.properties:${SDNC_CERT_DIR}/certs.properties
+      - ./controller/certs/keys0.zip:${SDNC_CERT_DIR}/keys0.zip    
     labels:
       traefik.enable: true
-      traefik.http.routers.sdnr.entrypoints: websecure
-      traefik.http.routers.sdnr.rule: Host(`controller.oam.${SOLUTION_DOMAIN}`)
-      traefik.http.routers.sdnr.tls: true
-      traefik.http.services.sdnr.loadbalancer.server.port: 8181
+      traefik.http.routers.controller.entrypoints: websecure
+      traefik.http.routers.controller.rule: Host(`controller.dcn.${SOLUTION_DOMAIN}`)
+      traefik.http.routers.controller.tls: true
+      traefik.http.services.controller.loadbalancer.server.port: ${SDNC_REST_PORT}
+
+      traefik.tcp.routers.controller-ssh.entrypoints: ssh-netconf-callhome
+      traefik.tcp.routers.controller-ssh.rule: HostSNI(`*`)
+      traefik.tcp.routers.controller-ssh.tls: false
+      traefik.tcp.routers.controller-ssh.service: controller-ssh
+      traefik.tcp.services.controller-ssh.loadbalancer.server.port: 4334
+
+      traefik.tcp.routers.controller-tls.entrypoints: tls-netconf-callhome
+      traefik.tcp.routers.controller-tls.rule: HostSNI(`*`)
+      traefik.tcp.routers.controller-tls.tls: false
+      traefik.tcp.routers.controller-tls.service: controller-tls
+      traefik.tcp.services.controller-tls.loadbalancer.server.port: 4335
     networks:
       smo:
-      default:
-        ipv6_address: ${SDNC_OAM_IPv6}
+      dcn:
 
   ves-collector:
-    image: ${VES_COLLECTOR_IMAGE}
+    image: ${VES_COLLECTOR_IMAGE}-configured
+    build:
+      context: ./ves-collector
+      args:
+        - BASEIMAGE=${VES_COLLECTOR_IMAGE}
     container_name: ves-collector
     hostname: ves-collector
+    extra_hosts:
+      - "ves-collector.dcn.${SOLUTION_DOMAIN}:${HOST_IP}"
+    healthcheck:
+      test: curl -k -u ${VES_ENDPOINT_USERNAME}:${VES_ENDPOINT_PASSWORD} ${VES_ENDPOINT_PROTOCOL}://localhost:${VES_ENDPOINT_PORT} || exit 1
+      start_period: 1s
+      interval: 5s
+      timeout: 4s
+      retries: 5
     environment:
       DMAAPHOST: messages
     volumes:
       - ./ves-collector/collector.properties:/opt/app/VESCollector/etc/collector.properties
       - ./ves-collector/ves-dmaap-config.json:/opt/app/VESCollector/etc/ves-dmaap-config.json
-      - ./ves-collector/externalRepo:/opt/app/VESCollector/etc/externalRepo
     labels:
       traefik.enable: true
       traefik.http.routers.ves.entrypoints: websecure
-      traefik.http.routers.ves.rule: Host(`ves-collector.oam.${SOLUTION_DOMAIN}`)
+      traefik.http.routers.ves.rule: Host(`ves-collector.dcn.${SOLUTION_DOMAIN}`)
       traefik.http.routers.ves.tls: true
       traefik.http.services.ves.loadbalancer.server.port: ${VES_ENDPOINT_PORT}
     networks:
       smo:
+      dcn:
 
 networks:
+  dmz:
+    external: true
   smo:
     external: true
-  default:
-    driver: bridge
-    name: oam
-    enable_ipv6: true
-    ipam:
-      driver: default
-      config:
-      - subnet:  "${NETWORK_SUBNET_OAM_IPv6}"
-        gateway: "${NETWORK_GATEWAY_OAM_IPv6}"
\ No newline at end of file
+  dcn:
+    external: true