Skip to content

Commit 60e2cec

Browse files
authored
Docker validator has 4 shards. (linera-io#2672)
* Docker validator has 4 shards * Docker workflow should run when docker-compose.yml changes.
1 parent 4f128f6 commit 60e2cec

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/docker.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ on:
88
- "**"
99
paths:
1010
- 'docker/Dockerfile'
11+
- 'docker/docker-compose.yml'
1112
- 'docker/compose.sh'
1213
- 'Cargo.toml'
1314
- '.github/workflows/docker.yml'
@@ -59,4 +60,4 @@ jobs:
5960
# Docker compose can take some time to start
6061
max_attempts: 5
6162
timeout_minutes: 2
62-
command: sleep 60 && linera --wallet docker/wallet.json --storage rocksdb:docker/linera.db sync-balance
63+
command: sleep 60 && linera --wallet docker/wallet.json --storage rocksdb:docker/linera.db sync-balance

configuration/compose/validator.toml

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,25 @@ Grpc = "ClearText"
1616
Grpc = "ClearText"
1717

1818
[[shards]]
19-
host = "shard"
19+
host = "docker-shard-1"
2020
port = 19100
21-
metrics_host = "shard"
21+
metrics_host = "docker-shard-1"
22+
metrics_port = 21100
23+
24+
[[shards]]
25+
host = "docker-shard-2"
26+
port = 19100
27+
metrics_host = "docker-shard-2"
28+
metrics_port = 21100
29+
30+
[[shards]]
31+
host = "docker-shard-3"
32+
port = 19100
33+
metrics_host = "docker-shard-3"
34+
metrics_port = 21100
35+
36+
[[shards]]
37+
host = "docker-shard-4"
38+
port = 19100
39+
metrics_host = "docker-shard-4"
2240
metrics_port = 21100

docker/docker-compose.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ services:
1919
- linera-shared:/shared
2020
shard:
2121
image: linera
22-
container_name: shard
22+
deploy:
23+
replicas: 4
2324
command: [ "./compose-server-entrypoint.sh" ]
2425
volumes:
2526
- .:/config

0 commit comments

Comments
 (0)