(feature): docker health checks - #12124
Conversation
✅ Deploy Preview for inventree-web-pui-preview ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
| healthcheck: | ||
| test: | ||
| [ | ||
| 'CMD-SHELL', |
There was a problem hiding this comment.
I think we should expose an invoke command to determine the health of the background worker process - which could encapsulate the code her potentially
|
@getpwnam thanks for submitting this, overall it looks pretty reasonable. What are your thoughts about exposing an internal function (e.g. invoke task) for background worker health check? This makes it a bit more general purpose I think. Also, do you have any tracing or metrics over the 10 day period you have been running this? In particular what load does a 20s interval impose on the setup? |
Requested Improvements
|
|
Refer to this PR - #12193 - for a much more efficient health check for the worker task |
|
You can now update this to use the following commands:
Which should be much simpler |
|
Thank you for these @SchrodingersGat - I'll get those running on my instance for a while and PR. |
|
@getpwnam great, LMK how you go |
|
Hi @getpwnam @SchrodingersGat — I had opened #12419 for #12123 but closed it in favor of this PR. To help finish the remaining review items here, I have opened a docs/CHANGELOG follow-up: #12420 — Document Docker Compose container health checks Changes:
Happy to adjust wording, fold these commits into your branch, or update the docs once the final invoke-based health check commands land here. |
|
@getpwnam will you have any time to look into the requested changes? |
|
@getpwnam please fix conflicts and use updated commands |
|
Hi @getpwnam @SchrodingersGat — following the review feedback to switch to br413/InvenTree Changes vs this PR:
Docs/CHANGELOG follow-up is still in #12420 (approved by @SchrodingersGat) — happy to fold that in once this lands, or adjust the docs branch to match whatever you merge here. @getpwnam — if you'd like, I can open a PR against your |

Add health checks for each container in
docker-compose.ymland updated dependencies to require healthy state in each case.pg_isreadysucceedsredis-cli pingsucceeds/api/system/health/returns HTTP 200is_worker_running()returns True/api/system/health/withHost: ${INVENTREE_SITE_URL}returns HTTP 200Tested on my v1.3.3 instance for around 10 days with no problems to report.
Would appreciate some extra testing/validation from a Docker expert.
Refs: #12122
Refs: #12123