Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Orion v2 docker setup #4730

Merged
merged 3 commits into from
May 16, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .env
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,23 @@ PROCESSOR_INDEXER_GATEWAY=http://hydra-indexer-gateway:4000/graphql
# State update endpoint used by prcessor (to send state updates)
STATE_UPDATE_ENDPOINT=http://graphql-server:8082/update-processor-state

# Subsquid
SQUID_ARCHIVE_GATEWAY_PORT=8000
SQUID_ARCHIVE_DB_NAME=squid_archive

# Orion
ORION_API_PORT=4350
ORION_DB_NAME=orion
PROCESSOR_PROMETHEUS_PORT=3337
SUPPORT_NO_CATEGORY_VIDEOS=true
SUPPORT_NEW_CATEGORIES=true
KILL_SWITCH_ON=false
VIDEO_VIEW_PER_IP_TIME_LIMIT=30
OPERATOR_SECRET=this-is-not-so-secret-change-it
MAX_CACHED_ENTITIES=1000
APP_PRIVATE_KEY=this-is-not-so-secret-change-it
TRUSTED_REVERSE_PROXIES=1

# Colossus services identities
# Assuming hired lead has worker id 0
COLOSSUS_1_WORKER_ID=1
Expand Down
86 changes: 67 additions & 19 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -281,28 +281,76 @@ services:
ports:
- "3002:3002"

orion:
container_name: orion
image: joystream/orion
squid-archive:
image: subsquid/substrate-ingest:firesquid
depends_on:
- db
restart: unless-stopped
env_file:
- .env
environment:
- ORION_PORT=6116
- ORION_MONGO_HOSTNAME=mongo
- ORION_FEATURED_CONTENT_SECRET=password123
- ORION_ADMIN_SECRET=password123
- ORION_QUERY_NODE_URL=http://graphql-server:${GRAPHQL_SERVER_PORT}/graphql
- APP_PRIVATE_KEY=secret123
ports:
- "6116:6116"
- DB_NAME=${SUBSQUID_ARCHIVE_DB_NAME}
- DB_HOST=db
command: [
'-e',
'${JOYSTREAM_NODE_WS}',
'-c',
'20',
'--out',
'postgres://postgres:postgres@db:${DB_PORT}/${SUBSQUID_ARCHIVE_DB_NAME}',
]

squid-archive-gateway:
image: subsquid/substrate-gateway:firesquid
depends_on:
- db
restart: unless-stopped
env_file:
- .env
environment:
- DB_NAME=${SUBSQUID_ARCHIVE_DB_NAME}
- DB_HOST=db
- DATABASE_MAX_CONNECTIONS=5
- RUST_LOG=actix_web=info,actix_server=info
command: [
'--database-url',
'postgres://postgres:postgres@db:${DB_PORT}/${SUBSQUID_ARCHIVE_DB_NAME}',
]
ports:
- '127.0.0.1:${SQUID_ARCHIVE_GATEWAY_PORT}:8000'

orion-processor:
image: orion:latest
restart: unless-stopped
env_file:
- .env
depends_on:
- mongo
restart: always
- db
environment:
- DB_NAME=${ORION_DB_NAME}
- DB_HOST=db
- GQL_PORT=${ORION_API_PORT}
- ARCHIVE_GATEWAY_URL=http://squid-archive-gateway:${SQUID_ARCHIVE_GATEWAY_PORT}/graphql
command: >
sh -c "npx squid-typeorm-migration apply && \
node lib/processor.js"
ports:
- '127.0.0.1:${PROCESSOR_PROMETHEUS_PORT}:${PROCESSOR_PROMETHEUS_PORT}'

mongo:
restart: always
container_name: mongo
image: library/mongo:4.4
volumes:
- orion-mongo-data:/data/db
orion-api:
image: orion:latest
restart: unless-stopped
env_file:
- .env
depends_on:
- db
environment:
- DB_NAME=${ORION_DB_NAME}
- DB_HOST=db
- GQL_PORT=${ORION_API_PORT}
command: ["npm", "run", "query-node-start"]
ports:
- '${ORION_API_PORT}:${ORION_API_PORT}'

volumes:
chain-data:
Expand Down
6 changes: 5 additions & 1 deletion start.sh
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ fi
./query-node/start.sh

## Orion
docker-compose up -d orion
docker-compose exec db psql -U postgres -c "CREATE DATABASE orion;"
docker-compose up -d squid-archive
docker-compose up -d squid-archive-gateway
docker-compose up -d orion-processor
docker-compose up -d orion-api

## Init the chain with some state
if [[ $SKIP_CHAIN_SETUP != 'true' ]]; then
Expand Down