-
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
Conversation
@frrist This has the basis for what you asked, but we can't use (docker-compose) replicas for the worker. (We can't assign their ports (API and prom) uniquely and only the first binding succeeds.) The next best thing we can do is make additional boilerplate for Could you also test this out with a repo and see if anything here doesn't make sense? |
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 comment
The reason will be displayed to describe this comment to others. Learn more.
The lily_*_tmp
volumes will persist the params so you don't have to keep downloading them. <3
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.
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 comment
The reason will be displayed to describe this comment to others. Learn more.
Both worker
and notifier
have their repo's persisted.
@@ -22,6 +22,6 @@ else | |||
lily init |
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:
elif [[ ! -z "${LILY_DOCKER_INIT_IMPORT_SNAPSHOT_PATH}" ]]; then
echo "Importing snapshot from ${LILY_DOCKER_INIT_IMPORT_SNAPSHOT_PATH}"
lily init --import-snapshot=${LILY_DOCKER_INIT_IMPORT_SNAPSHOT_PATH}
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.
build/lily/notifier.env
Outdated
|
||
# Enable IMPORT_SNAPSHOT below to use snapshot on lily startup | ||
#_LILY_DOCKER_INIT_IMPORT_MAINNET_SNAPSHOT=true | ||
|
||
# Debugging options | ||
#LILY_TRACING=true | ||
LILY_PROMETHEUS_PORT="prometheus:9090" | ||
LILY_PROMETHEUS_PORT="localhost:9090" |
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.
im not sure this works, I wasn't able to scrap any metrics from the nodes.
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 pushed a change if you want to try this again?
Codecov Report
@@ Coverage Diff @@
## master #1044 +/- ##
======================================
Coverage 34.4% 34.4%
======================================
Files 44 44
Lines 2925 2925
======================================
Hits 1008 1008
Misses 1821 1821
Partials 96 96 |
2ce0084
to
194d34e
Compare
I confirmed getting metrics from worker and notifier into prom and seeing them in grafana. 🤝 |
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.
LOVE IT!! Works great, good to merge after last few comments addressed
build/lily/notifier.env
Outdated
@@ -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 | |||
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 comment
The reason will be displayed to describe this comment to others. Learn more.
need the password field: postgres:password@timescaledb:5432/postgres?sslmode=disable
@@ -0,0 +1,14 @@ | |||
[API] |
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.
needs a storage config
Closes #1034
daemon
and replace wnotifier
andworker
containersnotifier
andworker
each have it's own envvars and confignotifier
andworker
successfully register their queues