enhance(docker): add healthcheck to execution + conditional depends_on for node#936
Open
enhance(docker): add healthcheck to execution + conditional depends_on for node#936
Conversation
…_healthy condition in node depends_on
Collaborator
🟡 Heimdall Review Status
|
|
Great addition! The healthcheck approach using the metrics endpoint (port 6060) is solid. |
This file contains hidden or 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
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.
What this PR does / Why we need it:
Currently,
depends_on: [execution]only waits for the container to start, not for the execution client (Geth/Reth) to be fully ready (e.g., RPC responding). This often causes op-node to crash or loop on startup with "execution RPC not ready" errors.This PR fixes it with Docker Compose best practices:
executionservice (curl on internal metrics endpoint 6060).depends_oninnodetocondition: service_healthy.Changes:
execution:docker compose config → Valid YAML.
docker compose up -d --build → Services start; execution becomes "healthy" after init.
docker compose ps: execution shows health status; node waits properly.
No crashes from premature op-node startup.
References:
Docker Compose docs: https://docs.docker.com/compose/compose-file/05-services/#healthcheck
https://docs.docker.com/compose/compose-file/05-services/#dependson (condition: service_healthy)
Open to tweaks (e.g., different test endpoint like 8545 RPC, adjust timings). Thanks for reviewing!