fix(compose): wait for healthchecks before starting osprey-ui-api#294
Draft
haileyok wants to merge 1 commit into
Draft
fix(compose): wait for healthchecks before starting osprey-ui-api#294haileyok wants to merge 1 commit into
haileyok wants to merge 1 commit into
Conversation
Convert osprey-ui-api.depends_on from the bare list form (which waits for containers to be started but not ready) to the long form with condition keys. Postgres has a pg_isready healthcheck, so wait on service_healthy there; the other three deps (osprey-worker, druid-broker, snowflake-id-worker) have no healthcheck defined, so fall back to service_started. Fixes the first-boot crash where osprey-ui-api raced postgres and errored with "could not translate host name 'postgres' to address". Refs #96. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Contributor
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
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.
Description
Converts
osprey-ui-api.depends_onindocker-compose.yamlfrom the bare list form to the long form withcondition:keys, so the container waits for postgres to beservice_healthybefore starting.On a clean boot the
osprey-ui-apicontainer was crashing with:The bare list form of
depends_ononly waits for the dependency container to be started, not ready. Postgres already defines apg_isreadyhealthcheck (line 260), so we can wait on it properly.For the three other dependencies (
osprey-worker,druid-broker,snowflake-id-worker), nohealthcheck:is defined, so they stay onservice_started. Adding healthchecks for those is plausible follow-up work but out of scope here.Closes #96 (sub-item 2 of the friction log).
Changes
osprey-ui-api.depends_on: bare list -> long form with explicitcondition:per deppostgres: service_healthy(has pg_isready healthcheck)osprey-worker,druid-broker,snowflake-id-worker:service_started(no healthcheck defined)Testing
Live boot verification deferred to the operator (a live osprey stack is running on this machine and shouldn't be disturbed).
Static verification:
docker compose -f docker-compose.yaml config --quiet-> exit 0python3 -c "import yaml; yaml.safe_load(open('docker-compose.yaml'))"-> OKconditionandrequired: true.Checklist
docker compose configvalidatesosprey-ui-api.depends_onblock changed)docker compose upboot verified by operator