-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathhivemind.yaml
More file actions
136 lines (131 loc) · 4.73 KB
/
hivemind.yaml
File metadata and controls
136 lines (131 loc) · 4.73 KB
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
services:
hivemind-install:
image: ${HIVEMIND_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- apps
- hivemind
networks:
haf-network:
command:
- "setup"
- "--database-admin-url=postgresql://haf_admin@haf/haf_block_log"
- "--statement-timeout=${HIVEMIND_STATEMENT_TIMEOUT:-5000}"
- "--swagger-url=${PUBLIC_HOSTNAME}"
depends_on:
haf:
condition: service_healthy
hafah-install:
condition: service_completed_successfully
reputation-tracker-install:
condition: service_completed_successfully
hivemind-block-processing:
image: ${HIVEMIND_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- apps
- hivemind
networks:
haf-network:
command:
- "sync"
- "--database-url=postgresql://hivemind@haf/haf_block_log"
- "--database-admin-url=postgresql://haf_admin@haf/haf_block_log"
- "${HIVEMIND_SYNC_ARGS:-}"
healthcheck:
test: ["CMD-SHELL","/home/hivemind/block-processing-healthcheck.sh || exit 1"]
interval: 10s
timeout: 2s
retries: 10
start_period: 72h
# after requesting a shutdown with SIGTERM, allow the container 30 seconds to exit
# before killing it.
# Normally it will exit cleanly in a second or two, but it can take longer if it's
# in the middle of massive sync. When in massive sync, a forced shutdown can leave
# the hivemind database in an inconsistent state, requiring an uninstall/reinstall
# of hivemind to correct it.
stop_grace_period: 30s
stop_signal: SIGINT
depends_on:
haf:
condition: service_healthy
hivemind-install:
condition: service_completed_successfully
hivemind-server:
image: ${HIVEMIND_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- legacy-hivemind-server
networks:
haf-network:
command:
- "--database-url=postgresql://hivemind@haf/haf_block_log"
- "server"
depends_on:
hivemind-block-processing:
condition: service_healthy
haf:
condition: service_healthy
hivemind-postgrest-server:
image: ${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/haf_api_node/postgrest:${HAF_API_NODE_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- apps
- hivemind
networks:
haf-network:
environment:
PGRST_ADMIN_SERVER_PORT: 3001
PGRST_SERVER_PORT: 8080
PGRST_DB_URI: "postgresql://hivemind_user@pgbouncer:6432/haf_block_log?application_name=hive-mind-postgrest" # warning hivemind improperly matches all connections starting from `hivemind` and crashes if they are made externally (not from python)
PGRST_DB_SCHEMA: hivemind_endpoints
# PGRST_DB_ROOT_SPEC: home
PGRST_DB_ANON_ROLE: hivemind_user
PGRST_DB_POOL: 10
PGRST_DB_POOL_ACQUISITION_TIMEOUT: 10
# PGRST_OPENAPI_MODE: "disabled" # unclear why this is set, I guess because we currently only support json-rpc?
# when debugging, you can enable this
# PGRST_DB_PLAN_ENABLED: true
PGRST_LOG_LEVEL: ${HIVEMIND_SERVER_LOG_LEVEL:-error}
labels:
# for Swagger UI
- "io.hive.swagger.url=/hivemind-api/"
- "io.hive.swagger.name=Hivemind"
- "io.hive.swagger.order=3"
- "io.hive.healthcheck.port=7002"
healthcheck:
test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:3001/ready || exit 1"]
interval: 10s
timeout: 3s
retries: 10
start_period: 1m
depends_on:
hivemind-install:
condition: service_completed_successfully
pgbouncer:
condition: service_healthy
hivemind-postgrest-rewriter:
image: ${HIVEMIND_REWRITER_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind/postgrest-rewriter}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- apps
- hivemind
healthcheck:
test: ["CMD-SHELL", "wget --timeout=2 -nv -t1 --spider 127.0.0.1:81/health || exit 1"]
interval: 10s
timeout: 3s
retries: 10
start_period: 1m
depends_on:
hivemind-postgrest-server:
condition: service_healthy
networks:
- haf-network
hivemind-uninstall:
image: ${HIVEMIND_IMAGE:-${HIVE_API_NODE_REGISTRY:-registry.hive.blog}/hivemind}:${HIVEMIND_VERSION:-${HIVE_API_NODE_VERSION}}
profiles:
- hivemind-uninstall
networks:
haf-network:
entrypoint:
- /home/hivemind/app/uninstall_app.sh
depends_on:
haf:
condition: service_healthy
command:
- "--postgres-url=postgresql://haf_admin@haf/haf_block_log"