forked from cf-cartesi/Escape-From-Tikal
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdocker-compose.yml
More file actions
243 lines (228 loc) · 8.17 KB
/
docker-compose.yml
File metadata and controls
243 lines (228 loc) · 8.17 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
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
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
networks:
coprocessor-network:
name: coprocessor-network
driver: bridge
services:
anvil:
build:
context: .
dockerfile: ./coprocessor-env/Dockerfile-anvil-latest
container_name: anvil
ports:
- 127.0.0.1:8545:8545
volumes:
- ./coprocessor-env/avs-and-eigenlayer-deployed-anvil-state.json:/root/.anvil/state.json
- ./coprocessor-env:/cartesi-lambada-coprocessor
command: /cartesi-lambada-coprocessor/run-anvil-devnet.sh
healthcheck:
test: bash -c "[ -f /cartesi-lambada-coprocessor/env/devnet-operators-ready.flag ]"
interval: 3s
retries: 300
start_period: 15s
networks:
- coprocessor-network
operator:
image: ghcr.io/zippiehq/cartesi-coprocessor-operator:latest
container_name: cartesi-coprocessor-operator
ports:
- 127.0.0.1:3033:3033
- 127.0.0.1:5001:5001
depends_on:
anvil:
condition: service_healthy
postgres:
condition: service_healthy
# llama-server:
# condition: service_healthy
setup-operator:
condition: service_completed_successfully
volumes:
- ./coprocessor-env/operator-data:/operator-snapshots
environment:
UPLOAD_DIR: /tmp
ALWAYS_CONSOLE_PUTCHAR: true
SNAPSHOT_DIR: /operator-snapshots
LLAMA_SERVER: http://llama-server:8080
BLS_PRIVATE_KEY: ${OPERATOR_BLS_KEY:-13219903133444082589215719304558031505888625714969126489655808257015621956774}
IPFS_DAEMON_OFFLINE: ${IPFS_DAEMON_ONLINE-true}
networks:
- coprocessor-network
setup-operator:
image: ghcr.io/zippiehq/cartesi-coprocessor-operator:latest
container_name: cartesi-coprocessor-setup-operator
depends_on:
anvil:
condition: service_healthy
volumes:
- ./coprocessor-env/coprocessor_deployment_output_devnet.json:/operator/contracts/script/output/coprocessor_deployment_output_devnet.json
- ./coprocessor-env/deployment_parameters_devnet.json:/operator/contracts/script/input/deployment_parameters_devnet.json
environment:
# RUST_BACKTRACE: 1
OPERATOR_BLS_KEY: ${OPERATOR_BLS_KEY:-13219903133444082589215719304558031505888625714969126489655808257015621956774}
command: bash -c "/operator/setup-operator --operator-private-key 0xc276a0e2815b89e9a3d8b64cb5d745d5b4f6b84531306c97aad82156000a7dd7 --http-endpoint http://anvil:8545 --chain-writer-reader-addresses contracts/script/input/deployment_parameters_devnet.json --avs-registry-writer-addresses contracts/script/output/coprocessor_deployment_output_devnet.json --socket http://operator:3033"
networks:
- coprocessor-network
postgres:
image: postgres:latest
container_name: cartesi-coprocessor-postgres
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres || exit 1"]
interval: 10s
timeout: 5s
environment:
POSTGRES_PASSWORD: password
POSTGRES_USER: user
POSTGRES_DB: db
networks:
- coprocessor-network
localstack:
image: localstack/localstack
container_name: localstack
ports:
- "127.0.0.1:4566:4566" # LocalStack Gateway
- "127.0.0.1:4510-4559:4510-4559" # external services port range
volumes:
- "./coprocessor-env/localstack-volume:/var/lib/localstack"
- "/var/run/docker.sock:/var/run/docker.sock"
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:4566"]
interval: 10s
retries: 200
start_period: 10s
networks:
- coprocessor-network
setup-localstack:
image: localstack/localstack
container_name: cartesi-coprocessor-setup-localstack
depends_on:
localstack:
condition: service_healthy
volumes:
- ./coprocessor-env/create-s3-env.sh:/create-s3-env.sh
entrypoint: bash
command: -c "/create-s3-env.sh"
networks:
- coprocessor-network
solver:
image: ghcr.io/zippiehq/cartesi-coprocessor-solver:latest
container_name: cartesi-coprocessor-solver
ports:
- 3034:3034
depends_on:
anvil:
condition: service_healthy
localstack:
condition: service_healthy
setup-operator:
condition: service_completed_successfully
setup-localstack:
condition: service_completed_successfully
volumes:
- ./config-devnet.toml:/cartesi-coprocessor-solver/config.toml
environment:
RUST_LOG: full
UPLOAD_DIR: /uploads
BUCKET_NAME: solver-bucket
AWS_ENDPOINT_URL_S3: http://localstack:4566
AWS_ACCESS_KEY_ID: 123
AWS_SECRET_ACCESS_KEY: xyz
networks:
- coprocessor-network
solver-bucket.localstack:
build:
dockerfile_inline: |
# syntax=docker.io/docker/dockerfile:1.4
FROM nginx
RUN <<EOF
echo '
server {
listen 4566;
server_name solver-bucket.localstack;
location / {
proxy_set_header X-Real-IP $$remote_addr;
# proxy_set_header X-Forwarded-For $$remote_addr;
proxy_set_header Host $$http_host;
proxy_pass http://localstack:4566/solver-bucket/;
}
}
' > /etc/nginx/conf.d/redirect.conf
EOF
networks:
- coprocessor-network
llama-server:
hostname: llama-server
container_name: llama-server
image: ghcr.io/ggerganov/llama.cpp:server
profiles:
- llm
volumes:
- ./llama/models:/llama/models
command: -m /llama/models/Phi-3-mini-4k-instruct-q4.gguf -c 2048
healthcheck:
test: ["CMD", "curl", "-f", "http://127.0.0.1:8080/health"]
interval: 10s
retries: 200
start_period: 10s
ports:
- 11434:8080
networks:
- coprocessor-network
# otterscan:
# image: otterscan/otterscan:v2.6.1
# ports:
# - 127.0.0.1:5100:80
# profiles:
# - explorer
# environment:
# ERIGON_URL: http://127.0.0.1:8545
# OTTERSCAN_CONFIG: |
# {
# "erigonURL": "http://127.0.0.1:8545",
# "sourcifySources": {
# "ipfs": "http://127.0.0.1:5555/repository",
# "central_server": "http://127.0.0.1:5555/repository"
# }
# }
# depends_on:
# anvil:
# condition: service_healthy
# setup-operator:
# condition: service_completed_successfully
# networks:
# - coprocessor-network
# sourcify:
# image: ghcr.io/ethereum/sourcify/server:latest
# ports:
# - 127.0.0.1:5555:5555
# volumes:
# - ./sourcify-chains.json:/home/app/services/server/dist/sourcify-chains.json
# - ./local.js:/home/app/services/server/dist/config/local.js
# environment:
# NODE_ENV: production
# profiles:
# - explorer
# depends_on:
# anvil:
# condition: service_healthy
# setup-operator:
# condition: service_completed_successfully
# networks:
# - coprocessor-network
# foundry:
# image: ghcr.io/foundry-rs/foundry
# platform: linux/amd64
# profiles:
# - explorer
# depends_on:
# anvil:
# condition: service_healthy
# setup-operator:
# condition: service_completed_successfully
# volumes:
# - ./coprocessor-env/contracts:/contracts
# entrypoint: sh
# command: >
# -c "cd contracts && forge verify-contract 0x4c5859f0F772848b2D91F1D83E2Fe57935348029 src/Coprocessor.sol:Coprocessor --constructor-args $(cast abi-encode \"constructor(address)\" \"0xf5059a5D33d5853360D16C683c16e67980206f36\") --verifier sourcify --verifier-url http://sourcify:5555 --rpc-url http://anvil:8545 --chain-id 31337 --num-of-optimizations 200 --compiler-version 0.8.20 --evm-version london
# && forge verify-contract 0x95401dc811bb5740090279Ba06cfA8fcF6113778 lib/eigenlayer-middleware/lib/openzeppelin-contracts/contracts/proxy/transparent/TransparentUpgradeableProxy.sol:TransparentUpgradeableProxy --verifier sourcify --verifier-url http://sourcify:5555 --rpc-url http://anvil:8545 --chain-id 31337 --constructor-args $(cast abi-encode \"constructor(address,address,bytes)\" \"0x9E545E3C0baAB3E08CdfD552C960A1050f373042\" \"0xc3e53F4d16Ae77Db1c982e75a937B9f60FE63690\" \"0x\") --num-of-optimizations 200 --compiler-version 0.8.20 --evm-version london"
# networks:
# - coprocessor-network