Grafana to OSM stack, system metrics and new exporters
[osm/devops.git] / installers / docker / docker-compose.yaml
index d8866e5..7070edd 100644 (file)
@@ -1,3 +1,21 @@
+##
+# Copyright 2019 ETSI
+#
+# 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.
+##
+
+########################################################################
+
 version: '3'
 volumes:
   ro:
@@ -26,6 +44,11 @@ services:
       interval: 10s
       timeout: 10s
       retries: 3
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   kafka:
     image: wurstmeister/kafka:${KAFKA_TAG:-latest}
     ports:
@@ -39,6 +62,16 @@ services:
       KAFKA_LOG_RETENTION_HOURS: 24
     volumes:
       - /var/run/docker.sock:/var/run/docker.sock
+    healthcheck:
+      test: zookeeper-shell.sh zookeeper:2181 ls /brokers/ids 2>&1 | grep "Node does not exist" && exit 1 || exit 0
+      interval: 20s
+      timeout: 10s
+      retries: 5
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - zookeeper
   mongo:
@@ -59,8 +92,25 @@ services:
       - prom_db:/prometheus
     networks:
       - netOSM
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
+  prometheus-cadvisor:
+    image: google/cadvisor:${PROMETHEUS_CADVISOR_TAG:-latest}
+    ports:
+      - "${OSM_PROM_CADVISOR_PORTS:-8080:8080}"
+    volumes:
+      - /:/rootfs:ro
+      - /var/run:/var/run:ro
+      - /sys:/sys:ro
+      - /var/lib/docker/:/var/lib/docker:ro
+      - /dev/disk/:/dev/disk:ro
+    networks:
+      - netOSM    
   keystone:
-    image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/keystone:${TAG:-6}
     networks:
       - netOSM
     environment:
@@ -69,8 +119,13 @@ services:
       - ./keystone.env
     ports:
       - "${OSM_KEYSTONE_PORTS:-5000:5000}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   nbi:
-    image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/nbi:${TAG:-6}
     networks:
       - netOSM
     volumes:
@@ -82,11 +137,16 @@ services:
       - ./nbi.env
     ports:
       - "${OSM_NBI_PORTS:-9999:9999}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - kafka
     #  - mongo
   lcm:
-    image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/lcm:${TAG:-6}
     networks:
       - netOSM
     volumes:
@@ -97,6 +157,11 @@ services:
       OSMLCM_MESSAGE_HOST: kafka
     env_file:
       - ./lcm.env
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
     #depends_on:
     #  - kafka
     #  - mongo
@@ -111,10 +176,15 @@ services:
       - ro_db:/var/lib/mysql
     env_file:
       - ./ro-db.env
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
 #    ports:
 #      - "3306:3306"
   ro:
-    image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/ro:${TAG:-6}
     networks:
       - netOSM
     environment:
@@ -127,8 +197,13 @@ services:
       - ro:/var/log/osm
     ports:
       - "${OSM_RO_PORTS:-9090:9090}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
   mon:
-    image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/mon:${TAG:-6}
     networks:
       - netOSM
     volumes:
@@ -148,7 +223,7 @@ services:
             max-file: 5
             max-size: 10m
   pol:
-    image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/pol:${TAG:-6}
     networks:
       - netOSM
     volumes:
@@ -167,7 +242,7 @@ services:
         max-file: 5
         max-size: 10m
   light-ui:
-    image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-5}
+    image: ${DOCKER_USER:-opensourcemano}/light-ui:${TAG:-6}
     networks:
       - netOSM
     environment:
@@ -178,3 +253,20 @@ services:
       - ./lwui.env
     ports:
       - "${OSM_UI_PORTS:-80:80}"
+    logging:
+      driver: "json-file"
+      options:
+        max-size: "100m"
+        max-file: "2"
+  grafana:
+    image: grafana/grafana
+    volumes:
+      - ./files/dashboards-osm.yml:/etc/grafana/provisioning/dashboards/dashboards-osm.yml
+      - ./files/osm-sample-dashboard.json:/etc/grafana/provisioning/dashboards/osm-sample-dashboard.json
+      - ./files/osm-system-dashboard.json:/etc/grafana/provisioning/dashboards/osm-system-dashboard.json
+      - ./files/datasource-prometheus.yml:/etc/grafana/provisioning/datasources/datasource-prometheus.yml
+    hostname: grafana
+    ports:
+      - "${OSM_GRAFANA_PORTS:-3000:3000}"
+    networks:
+      - netOSM
\ No newline at end of file