docker-compose-monitoring.yml 3.79 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
##
# BuildGrid's Docker Compose manifest.
#
#   ¡FOR LOCAL DEVELOPMENT ONLY!
#
# Spins-up a 'local' grid instance:
#   - Controller at http://localhost:50051
#   - CAS + AC at: http://localhost:50052
#
# Basic usage:
#  - docker-compose build
#  - docker-compose up --scale bots=10
#  - docker-compose down
#  - docker volume inspect buildgrid_data
#  - docker volume rm buildgrid_data
#  - docker image rm buildgrid:local
#
version: "3.2"

services:
  database:
    image: postgres:latest
    environment:
      POSTGRES_USER: bgd
      POSTGRES_PASSWORD: insecure
      POSTGRES_DB: bgd
    volumes:
      - type: volume
        source: db
        target: /var/lib/postgresql/data
    networks:
      - backend
    ports:
      - "5432:5432"

  statsd:
37
    image: graphiteapp/graphite-statsd
38
39
40
41
42
43
44
45
46
47
48
    ports:
      - "80:80"
      - "2003-2004:2003-2004"
      - "2023-2024:2023-2024"
      - "8125:8125/udp"
      - "8126:8126"
    networks:
      - backend

  grafana:
    image: grafana/grafana
49
50
51
52
    environment:
      GF_AUTH_BASIC_ENABLED: "false"
      GF_AUTH_PROXY_ENABLED: "false"
      GF_AUTH_ANONYMOUS_ENABLED: "true"
53
54
55
56
57
58
59
60
61
62
63
64
    ports:
      - "3000:3000"
    volumes:
      - type: bind
        source: ./data/config/grafana
        target: /etc/grafana/provisioning
    depends_on:
      - statsd
    networks:
      - backend
      - host

65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
  minio:
    image: minio/minio:latest
    entrypoint: /bin/sh -c
    command: [
      "mkdir -p /data/buildgrid && \
       minio server /data"
    ]
    volumes:
      - type: volume
        source: s3
        target: /data
    ports:
      - "9000:9000"
    networks:
      - backend

81
82
83
84
85
86
  storage:
    build:
      context: .
    image: buildgrid:local
    command: [
      "server", "start", "-vv",
87
      "/app/config/s3-indexed-cas.yml"]
88
89
    volumes:
      - type: bind
90
91
        source: ./data/config/s3-indexed-cas.yml
        target: /app/config/s3-indexed-cas.yml
92
93
94
95
96
97
98
99
100
101
102
103
    ports:
      - "50052:50052"
    networks:
      - backend
      - host

  cache:
    build:
      context: .
    image: buildgrid:local
    command: [
      "server", "start", "-vvv",
104
      "/app/config/cache.yml"]
105
106
    volumes:
      - type: bind
107
108
        source: ./data/config/cache.yml
        target: /app/config/cache.yml
109
110
111
112
113
114
115
116
117
118
    ports:
      - "50053:50053"
    networks:
      - backend
      - host

  controller:
    image: buildgrid:local
    command: [
      "server", "start", "-vvv",
119
      "/app/config/controller.yml"]
120
121
    volumes:
      - type: bind
122
123
        source: ./data/config/monitoring-controller.yml
        target: /app/config/controller.yml
124
125
126
127
128
129
130
131
132
133
134
135
    ports:
      - "50051:50051"
    depends_on:
      - database
      - statsd
    networks:
      - backend
      - host

  bots:  # To be scaled horizontaly
    image: buildgrid:local
    command: [
136
      "bot", "--instance-name=",
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
      "--remote=http://controller:50051",
      "--remote-cas=http://storage:50052",
      "host-tools"]
    privileged: true
    volumes:
      - type: volume
        source: cache
        target: /var/lib/buildgrid/cache
      - type: bind
        source: ./data/bin
        target: /app/tools
    depends_on:
      - controller
    networks:
      - backend

153
154
155
156
157
158
159
160
  cleanup:
    image: buildgrid:local
    # The high and low watermarks can be reduced for easier testing of
    # cleanup in particular, but having them too low will make it difficult
    # to run real work.
    command: [
      "cleanup", "start", "-vv", "--high-watermark", "2G",
      "--low-watermark", "1G", "--batch-size", "100M", "--sleep-interval",
161
      "10", "/app/config/s3-indexed-cas.yml"
162
163
164
    ]
    volumes:
      - type: bind
165
166
        source: ./data/config/s3-indexed-cas.yml
        target: /app/config/s3-indexed-cas.yml
167
168
169
170
171
172
173
174
    depends_on:
      - minio
      - database
      - storage
      - statsd
    networks:
      - backend

175
176
177
178
179
180
181
networks:
  backend:
  host:

volumes:
  cache:
  db:
182
  s3: