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
Add a healthcheck to the Docker container image #10413
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
electrum
approved these changes
Dec 29, 2021
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.
See comments, otherwise looks good. Thanks for adding this feature
nineinchnick
force-pushed
the
healthcheck
branch
from
December 29, 2021 11:48
7c277bb
to
53b447f
Compare
nineinchnick
force-pushed
the
healthcheck
branch
from
January 18, 2022 14:05
53b447f
to
bee811b
Compare
nineinchnick
force-pushed
the
healthcheck
branch
from
February 14, 2022 11:10
bee811b
to
64a67be
Compare
findepi
reviewed
Feb 14, 2022
nineinchnick
force-pushed
the
healthcheck
branch
2 times, most recently
from
February 15, 2022 09:43
1c79d2f
to
6e6ee42
Compare
nineinchnick
force-pushed
the
healthcheck
branch
2 times, most recently
from
February 23, 2022 12:13
2cdd937
to
eeb52dc
Compare
findepi
reviewed
Feb 24, 2022
nineinchnick
force-pushed
the
healthcheck
branch
from
February 24, 2022 09:35
eeb52dc
to
ac15579
Compare
nineinchnick
force-pushed
the
healthcheck
branch
from
February 24, 2022 13:32
ac15579
to
3cb7ec9
Compare
findepi
approved these changes
Feb 24, 2022
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
By defining a healthcheck command in the container image, users can quickly see if the container is ready to accept requests in the output of
docker ps
:Without this, the
STATUS
column only shows the uptime.It also frees uses from having to figure out the exact condition and they can use a generic loop that would wait for the container to be ready, like so:
If the healthcheck fails 3 times, it'll start showing as unhealthy. To see more details about the failure, one would have to run
docker inspect $CONTAINER_ID --format "{{json .State.Health}}"
, or run it one more time asdocker exec -it $CONTAINER_ID /usr/lib/trino/bin/health-check
.This healthcheck is enabled by default and can be disabled by adding
--no-healthcheck
todocker run
.The same healthcheck script could be used in readiness and liveness probes in https://github.com/trinodb/charts