-
Notifications
You must be signed in to change notification settings - Fork 537
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
Use monitors instead of custom healthcheck.py script to verify service dependencies' health #22951
Conversation
d755a98
to
d075bad
Compare
6bb1a40
to
0c00dff
Compare
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.
Still playing with it locally, some comments
0c00dff
to
268516a
Compare
f0fe4ec
to
825fa3c
Compare
f'Expected {settings.DB_CHARSET}, ' | ||
f'recieved {result[1]}', | ||
id='setup.E005', | ||
try: |
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 you "stop" the mysql service and run
./manage.py monitors --service olympia_database
The command raises here as it is a check. we want to return the error object which means that check should not raise.
In general, this django check should also not raise but return the error object.
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.
r+ once CI pass
825fa3c
to
48645c7
Compare
- Updated `docker-compose.yml` to improve health checks for worker and web services, ensuring they are monitored effectively. - Introduced a new management command `monitors.py` to check the health of various services, including database and web. - Updated `Makefile-docker` to replace healthcheck with monitors - Updated `initialize.py` to ensure the database is running before proceeding with initialization. - Removed the obsolete `healthcheck.py` script in favor of the new monitoring approach. - Added tests for the new monitoring functionality to ensure reliability. TMP: better tests
48645c7
to
ceb393d
Compare
Fixes: mozilla/addons#15249
Relates to: mozilla/addons#15248
Description
the custom healthcheck.py script was returning false positives. Instead of fixing this scripts, it makes more sense to use the existing infrastructure we have from monitors to ensure services are running correctly.
Context
We can use a management command running a set of monitors on a timeout to verify service dependencies are up. This is useful in the initializion command itself that depdends on the database being up, and after the initialization command where we want to ensure several critical dependencies are up before letting make up return successfully.
Testing
With a running environment you can run
Any combination of these should result in a failure. You can adjust the attempts parameter or the services parameter to check different services.
Checklist
#ISSUENUM
at the top of your PR to an existing open issue in the mozilla/addons repository.