-
Notifications
You must be signed in to change notification settings - Fork 14
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
Make make services
wait for healthchecks to pass using --wait
#5556
Conversation
This enables starting lms services and the dev server by running `make services && make dev`, without encountering errors due to the DB not being ready. nb. The `--wait` flag is missing from the docs but see docker/compose#8777.
Switch to Docker Compose v2 and change `make services` to use the `--wait` flag to wait for healthchecks to pass before exiting. Also add a healthcheck for Elasticsearch. The Makefile changes follow the pattern in the lms app. Together these changes mean that h and its services can be started with `make services && make dev`, without encountering errors due to Postgres / Elasticsearch not being ready to connect. The `start_period` setting is set to a generous value (1 min) as normal startup times for ES are quite long (15-20s on my 2020 Intel MacBook Pro). See also hypothesis/lms#5556.
Oh nice, I wasn't aware of FYI you can just run |
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.
Oh, apologies, for some reason I thought this was in h (which doesn't use the cookiecutter yet): In LMS a Makefile
change like this would have to be made in the cookiecutter (specifically here: https://github.com/hypothesis/cookiecutters/blob/1a447d9aa982a7dee029777f343811746d76aa8d/_shared/project/Makefile#L10) and then it'll get applied to all cookiecutter-using projects
OK, I moved this change to the cookiecutter here: hypothesis/cookiecutters#141. |
Switch to Docker Compose v2 and change `make services` to use the `--wait` flag to wait for healthchecks to pass before exiting. Also add a healthcheck for Elasticsearch. The Makefile changes follow the pattern in the lms app. Together these changes mean that h and its services can be started with `make services && make dev`, without encountering errors due to Postgres / Elasticsearch not being ready to connect. The `start_period` setting is set to a generous value (1 min) as normal startup times for ES are quite long (15-20s on my 2020 Intel MacBook Pro). See also hypothesis/lms#5556.
Switch to Docker Compose v2 and change `make services` to use the `--wait` flag to wait for healthchecks to pass before exiting. Also add a healthcheck for Elasticsearch. The Makefile changes follow the pattern in the lms app. Together these changes mean that h and its services can be started with `make services && make dev`, without encountering errors due to Postgres / Elasticsearch not being ready to connect. The `start_period` setting is set to a generous value (1 min) as normal startup times for ES are quite long (15-20s on my 2020 Intel MacBook Pro). See also hypothesis/lms#5556.
This enables starting lms services and the dev server by running
make services && make dev
, without encountering errors due to the DB not being ready.nb. The
--wait
flag is missing from the docs but see docker/compose#8777.