-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat(docker): Update docker-compose to use lily worker pattern #1044
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,16 +5,20 @@ LILY_REPO=/var/lib/lily | |
#LILY_CONFIG=/var/lib/lily/config.toml | ||
|
||
# Postgres URL may be overridden | ||
#LILY_STORAGE_POSTGRESQL_DB_URL=postgres://user:pass@host:port/database?options | ||
placer14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
LILY_STORAGE_POSTGRESQL_DB_URL=postgres://postgres@timescaledb:5432/postgres?sslmode=disable | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. need the password field: |
||
|
||
# Enable IMPORT_SNAPSHOT below to use snapshot on lily startup | ||
#_LILY_DOCKER_INIT_IMPORT_MAINNET_SNAPSHOT=true | ||
#LILY_DOCKER_INIT_IMPORT_MAINNET_SNAPSHOT=true | ||
#LILY_DOCKER_INIT_IMPORT_SNAPSHOT_PATH= | ||
|
||
# Debugging options | ||
#LILY_TRACING=true | ||
LILY_PROMETHEUS_PORT="prometheus:9090" | ||
LILY_PROMETHEUS_PORT=0.0.0.0:9090 | ||
|
||
# Logging options | ||
GOLOG_LOG_FMT=json | ||
GOLOG_LOG_LEVEL=info | ||
LILY_LOG_LEVEL_NAMED="vm:error,badgerbs:error" | ||
LILY_LOG_LEVEL_NAMED=vm:error,badgerbs:error | ||
|
||
# Queue configuration | ||
LILY_REDIS_ADDR=redis-queue:6379 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
[API] | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. needs a storage config |
||
ListenAddress = "/ip4/0.0.0.0/tcp/1234/http" | ||
[Libp2p] | ||
ListenAddresses = ["/ip4/0.0.0.0/tcp/1347"] | ||
ConnMgrLow = 400 | ||
ConnMgrHigh = 500 | ||
ConnMgrGrace = "5m0s" | ||
[Queue] | ||
[Queue.Notifiers] | ||
[Queue.Notifiers.Notifier1] | ||
Network = "tcp" | ||
Addr = "redis-queue:6379" | ||
DB = 0 | ||
PoolSize = 0 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
# FOR DEV ONLY: disabled authentication | ||
ALLOW_EMPTY_PASSWORD=yes |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Path for lily state should be on a persisted volume | ||
placer14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
LILY_REPO=/var/lib/lily | ||
|
||
# Config path default is below but may be customized | ||
#LILY_CONFIG=/var/lib/lily/config.toml | ||
|
||
# Postgres URL may be overridden | ||
LILY_STORAGE_POSTGRESQL_DB_URL=postgres://postgres@timescaledb:5432/postgres?sslmode=disable | ||
|
||
# Enable IMPORT_SNAPSHOT below to use snapshot on lily startup | ||
#LILY_DOCKER_INIT_IMPORT_MAINNET_SNAPSHOT=true | ||
#LILY_DOCKER_INIT_IMPORT_SNAPSHOT_PATH= | ||
|
||
# Debugging options | ||
#LILY_TRACING=true | ||
LILY_PROMETHEUS_PORT=0.0.0.0:9091 | ||
|
||
# Logging options | ||
GOLOG_LOG_FMT=json | ||
GOLOG_LOG_LEVEL=info | ||
LILY_LOG_LEVEL_NAMED=vm:error,badgerbs:error | ||
|
||
# Queue configuration | ||
LILY_REDIS_ADDR=redis-queue:6379 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
[API] | ||
ListenAddress = "/ip4/0.0.0.0/tcp/1234/http" | ||
[Libp2p] | ||
ListenAddresses = ["/ip4/0.0.0.0/tcp/1347"] | ||
ConnMgrLow = 400 | ||
ConnMgrHigh = 500 | ||
ConnMgrGrace = "5m0s" | ||
[Queue] | ||
[Queue.Workers] | ||
[Queue.Workers.Worker1] | ||
[Queue.Workers.Worker1.RedisConfig] | ||
Network = "tcp" | ||
Addr = "redis-queue:6379" | ||
DB = 0 | ||
PoolSize = 0 | ||
[Queue.Workers.Worker1.WorkerConfig] | ||
Concurrency = 1 | ||
LoggerLevel = "debug" | ||
WatchQueuePriority = 5 | ||
FillQueuePriority = 3 | ||
IndexQueuePriority = 1 | ||
WalkQueuePriority = 1 | ||
StrictPriority = false | ||
ShutdownTimeout = 30000000000 | ||
[Storage] | ||
[Storage.Postgresql] | ||
[Storage.Postgresql.postgres] | ||
SchemaName = "lily" | ||
URLEnv = "LILY_STORAGE_POSTGRESQL_DB_URL" | ||
ApplicationName = "lily" | ||
PoolSize = 20 | ||
AllowUpsert = false |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,7 +37,7 @@ services: | |
- '--web.console.templates=/usr/share/prometheus/consoles' | ||
ports: | ||
- 9090:9090 | ||
network_mode: "host" | ||
#network_mode: "host" | ||
restart: always | ||
|
||
grafana: | ||
placer14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
@@ -47,38 +47,77 @@ services: | |
- prometheus | ||
ports: | ||
- 3000:3000 | ||
network_mode: "host" | ||
#network_mode: "host" | ||
volumes: | ||
- grafana_data:/var/lib/grafana | ||
- ./build/grafana/provisioning/:/etc/grafana/provisioning/ | ||
env_file: | ||
- ./build/grafana/config.monitoring | ||
restart: always | ||
|
||
#lily: | ||
#container_name: lily | ||
## Select (only one) image | ||
#image: filecoin/lily:v0.8.0 | ||
#image: filecoin/lily:v0.8.0-calibnet | ||
#image: filecoin/lily:v0.8.0-calibnet-dev | ||
#env_file: | ||
## Check envvars for configurable options | ||
#- ./build/lily/docker.env | ||
#depends_on: | ||
#- prometheus | ||
#- timescaledb | ||
#- jaeger | ||
#ports: | ||
#- 1234:1234 | ||
#volumes: | ||
#- lily_data:/var/lib/lily | ||
#- ./build/lily/docker_init.sh:/usr/bin/docker_init.sh | ||
#entrypoint: /usr/bin/docker_init.sh | ||
#command: | ||
#- daemon | ||
redis-queue: | ||
image: bitnami/redis:7.0 | ||
env_file: | ||
# Check envvars for configurable options | ||
- ./build/lily/redis-queue.env | ||
ports: | ||
- 6379:6379 | ||
restart: always | ||
|
||
notifier: | ||
image: filecoin/lily:v0.11.0 | ||
env_file: | ||
# Check envvars for configurable options | ||
- ./build/lily/notifier.env | ||
depends_on: | ||
- prometheus | ||
- timescaledb | ||
- jaeger | ||
- redis-queue | ||
ports: | ||
- 1234:1234 | ||
volumes: | ||
# holds lily datastore repo | ||
- lily_notifier_data:/var/lib/lily | ||
# persist params through restarts | ||
- lily_notifier_tmp:/var/tmp/filecoin-proof-parameters | ||
# notifier-specific config | ||
- ./build/lily/notifier_config.toml:/var/lib/lily/config.toml | ||
- ./build/lily/docker_init.sh:/usr/bin/docker_init.sh | ||
entrypoint: /usr/bin/docker_init.sh | ||
command: | ||
- "daemon --bootstrap=false" | ||
placer14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
worker: | ||
image: filecoin/lily:v0.11.0 | ||
env_file: | ||
# Check envvars for configurable options | ||
- ./build/lily/worker.env | ||
depends_on: | ||
- prometheus | ||
- timescaledb | ||
- jaeger | ||
- redis-queue | ||
- notifier | ||
ports: | ||
- 1234 | ||
volumes: | ||
# holds lily datastore repo | ||
- lily_worker_data:/var/lib/lily | ||
# persist params through restarts | ||
- lily_worker_tmp:/var/tmp/filecoin-proof-parameters | ||
# notifier-specific config | ||
- ./build/lily/worker_config.toml:/var/lib/lily/config.toml | ||
- ./build/lily/docker_init.sh:/usr/bin/docker_init.sh | ||
entrypoint: /usr/bin/docker_init.sh | ||
command: | ||
- "daemon --bootstrap=false" | ||
placer14 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
volumes: | ||
timescaledb: {} | ||
prometheus_data: {} | ||
grafana_data: {} | ||
lily_data: {} | ||
lily_notifier_data: {} | ||
lily_worker_data: {} | ||
lily_notifier_tmp: {} | ||
lily_worker_tmp: {} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. If it's not already, could the daemon's repo also be persisted? (so we don't redownload the snapshots) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Both |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can't comment on the line, but above on line 11, could we add an
elif
with something like:then we could optionally specify locally mounted snapshots in the compose file: https://github.com/filecoin-project/lily/pull/1044/files#diff-e45e45baeda1c1e73482975a664062aa56f20c03dd9d64a827aba57775bed0d3R86
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I made the envvar get a default assignment if found to be empty.