-
Notifications
You must be signed in to change notification settings - Fork 20
/
Copy pathdocker-compose.yml
202 lines (191 loc) · 5.74 KB
/
docker-compose.yml
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
include:
- ./docker-compose.observability.yml
services:
control_node:
container_name: control_node
build:
context: .
dockerfile: dockerfiles/control_node.dockerfile
depends_on:
dbmate:
condition: service_completed_successfully
redis:
condition: service_started
entrypoint: ["opentelemetry-instrument", "--logs_exporter", "otlp", "--traces_exporter", "none", "--metrics_exporter", "otlp", "--service_name", "control_node", "python", "-u", "/app/validator/control_node/src/main.py"]
volumes:
- ${HOME}/.bittensor/wallets:/root/.bittensor/wallets
env_file:
- .vali.env
environment:
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
OTEL_PYTHON_LOG_CORRELATION: "true"
deploy:
restart_policy:
condition: on-failure
weight_setter:
container_name: weight_setter
build:
context: .
dockerfile: dockerfiles/control_node.dockerfile
depends_on:
dbmate:
condition: service_completed_successfully
redis:
condition: service_started
entrypoint: [ "python", "-u", "/app/validator/control_node/src/set_weights/calculate_and_schedule_weights.py" ]
volumes:
- ${HOME}/.bittensor/wallets:/root/.bittensor/wallets
env_file:
- .vali.env
deploy:
restart_policy:
condition: on-failure
query_node:
container_name: query_node
build:
context: .
dockerfile: dockerfiles/query_node.dockerfile
deploy:
replicas: 1
resources:
limits:
cpus: '1.0'
memory: 1G
restart_policy:
condition: on-failure
depends_on:
- redis
- postgresql
volumes:
- ${HOME}/.bittensor/wallets:/root/.bittensor/wallets
entrypoint: ["opentelemetry-instrument", "--logs_exporter", "otlp", "--traces_exporter", "none", "--metrics_exporter", "otlp", "--service_name", "query_node", "python", "-u", "/app/validator/query_node/src/main.py"]
environment:
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
OTEL_PYTHON_LOG_CORRELATION: "true"
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_HOST: ${POSTGRES_HOST}
ENV: ${ENV}
NETUID: ${NETUID}
env_file:
- .vali.env
entry_node:
container_name: entry_node
build:
context: .
dockerfile: dockerfiles/entry_node.dockerfile
deploy:
replicas: 1
resources:
limits:
cpus: '0.50'
memory: 512M
restart_policy:
condition: on-failure
depends_on:
- redis
- postgresql
ports:
- "${ORGANIC_SERVER_PORT:-8091}:${ORGANIC_SERVER_PORT:-8091}"
entrypoint: ["opentelemetry-instrument", "--logs_exporter", "otlp", "--traces_exporter", "none", "--metrics_exporter", "otlp", "--service_name", "entry_node", "python", "-u", "/app/validator/entry_node/src/server.py"]
environment:
OTEL_EXPORTER_OTLP_PROTOCOL: "http/protobuf"
OTEL_EXPORTER_OTLP_ENDPOINT: "http://otel-collector:4317"
OTEL_PYTHON_LOGGING_AUTO_INSTRUMENTATION_ENABLED: "true"
OTEL_PYTHON_LOG_CORRELATION: "true"
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_HOST: ${POSTGRES_HOST}
ENV: ${ENV}
env_file:
- .vali.env
profiles:
- entry_node_profile
postgresql:
container_name: 0_postgresql
image: postgres:latest
volumes:
- ./postgres_data:/var/lib/postgresql/data
healthcheck:
test: [ "CMD-SHELL", "pg_isready -U ${POSTGRES_USER} -d ${POSTGRES_DB}" ]
interval: 5s
timeout: 5s
retries: 5
environment:
POSTGRES_USER: ${POSTGRES_USER}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: ${POSTGRES_DB}
POSTGRES_PORT: ${POSTGRES_PORT}
POSTGRES_HOST: ${POSTGRES_HOST}
dbmate:
container_name: 0_dbmate_nineteen
image: amacneil/dbmate
volumes:
- ./validator/db:/db
command: --wait up
environment:
DATABASE_URL: postgres://${POSTGRES_USER}:${POSTGRES_PASSWORD}@postgresql:5432/${POSTGRES_DB}?sslmode=disable
depends_on:
postgresql:
condition: service_healthy
redis:
container_name: 0_redis
image: redis/redis-stack:latest
deploy:
restart_policy:
condition: on-failure
# if you want this, scale it to `1`
adminer:
scale: 0
container_name: 0_adminer
image: adminer
restart: always
environment:
ADMINER_DEFAULT_SERVER: postgresql
ADMINER_DESIGN: nette
ADMINER_PLUGINS: tables-filter tinymce
ports:
- 5051:8080
depends_on:
postgresql:
condition: service_healthy
# if you want this, scale it to `1`
redis-commander:
scale: 0
container_name: 0_redis_commander
image: ghcr.io/joeferner/redis-commander:latest
restart: always
environment:
- REDIS_HOSTS=local:redis:6379
ports:
- '8081:8081'
depends_on:
- redis
# if you want this, scale it to `1`
redis-proxy:
scale: 0
container_name: 0_redis_proxy
image: hpello/tcp-proxy
command: redis 6379
ports:
- 127.0.0.1:6379:6379
depends_on:
- redis
# if you want this, scale it to `1`
postgres-proxy:
scale: 0
container_name: 0_postgres_proxy
image: hpello/tcp-proxy
command: postgresql 5432
ports:
- 127.0.0.1:5432:5432
depends_on:
- postgresql