Skip to content

Commit

Permalink
init cockroach cluster settings in indexer docker-compose (#175)
Browse files Browse the repository at this point in the history
  • Loading branch information
sameh-farouk authored May 22, 2024
1 parent 567b0ae commit 82969c7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 3 deletions.
22 changes: 19 additions & 3 deletions indexer/docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
version: "3.4"
version: "3.8"

services:
db:
Expand All @@ -11,9 +11,21 @@ services:
volumes:
- /cockroach/cockroach-data

ingest:
db-init:
depends_on:
- db
image: cockroachdb/cockroach:v22.2.2

volumes:
- ./setup_db.sh:/setup_db.sh
entrypoint: "/bin/bash"
command: /setup_db.sh
restart: on-failure

ingest:
depends_on:
db-init:
condition: service_completed_successfully
restart: on-failure
image: subsquid/substrate-ingest:1
volumes:
Expand All @@ -34,7 +46,8 @@ services:

gateway:
depends_on:
- db
db-init:
condition: service_completed_successfully
image: subsquid/substrate-gateway:2.5.0
environment:
DATABASE_MAX_CONNECTIONS: 5
Expand All @@ -44,6 +57,9 @@ services:
- "8888:8000"

explorer:
depends_on:
db-init:
condition: service_completed_successfully
image: subsquid/substrate-explorer:firesquid
environment:
DB_TYPE: cockroach
Expand Down
9 changes: 9 additions & 0 deletions indexer/setup_db.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/bash
sleep 2
echo "Set sql.conn.max_read_buffer_message_size to 32 MiB"

HOSTPARAMS="--host db --insecure"
SQL="/cockroach/cockroach.sh sql $HOSTPARAMS"

# https://github.com/threefoldtech/tfchain_graphql/issues/130#issuecomment-1689987550
$SQL -e "SET CLUSTER SETTING sql.conn.max_read_buffer_message_size = '32MiB';"

0 comments on commit 82969c7

Please sign in to comment.