Reference
Service Behavior
How ota treats supporting services during diagnosis and preparation.
referenceautomation buildersintermediatestable2026-05-30
Recommended next
Why services matter
Treat services as declared readiness dependencies, not hidden setup steps.
Use this page when a repo needs supporting infrastructure such as a database, cache, queue, or local API before tasks can run safely.
- a service is part of the readiness contract, not just an implementation detail
- the service block should say what starts, what stops, what depends on what, and how readiness is checked
ota doctorcan tell you whether the repo is actually readyota upcan bring required services up before setup runs- CI and agents can see startup dependencies instead of guessing
Service lifecycle at a glance
Every service has a lifecycle: start it, check it, and stop it.
ota only trusts a service as ready after the declared healthcheck succeeds.
startis the command ota can use to bring the service uphealthcheckis the command ota uses to prove the service is actually usablestopis the command ota can use to shut the service down laterdepends_oncontrols start order, but it does not replace readiness checks
Service field meanings
Each field exists to remove one guess from the readiness story.
required: whether the service blocks repo readiness when it failsmanageris the preferred control-plane contract for service orchestration.manager.kindishostorcompose.- For Compose managers,
manager.nameandmanager.serviceare required;services.<name>.manager.file/services.<name>.manager.filesandservices.<name>.manager.env_file/services.<name>.manager.env_filesare optional service-owned adapter inputs. - Keep
manager.namealigned with the Compose project name you actually use. Drift betweenmanager.name,attachments.compose, and manualdocker compose -p ...usage will break persistent container attachments and service reachability. - Example: if the repo naturally runs as
qredex-core, usemanager.name: qredex-core, keepattachments.compose: [qredex-core], and use the same Compose project name in manual commands. provideris legacy compatibility for host-bound service control;provider: docker-composewraps onlyhealthcheckwithdocker compose exec, whilestartandstopare taken directly from declaration.start: the command ota uses to start the service; whenmanager.kindiscomposethis is derived automatically from compose context, otherwisestartmust be explicit.stop: the command ota uses to stop the service; whenmanager.kindiscomposethis is derived automatically from compose context, otherwisestopmust be explicit.healthcheck: the command ota uses to prove the service is ready; ifmanageris set, this is adapted to manager-aware execution automaticallydepends_on: the services that must start before this one is attemptedtimeout: how long ota waits for the healthcheck before treating it as slow or failed
How ota uses services
ota servicesinspects the declared service surfaceota doctorchecks healthchecks and reports whether the repo is truly readyota upstarts required services before setup and uses the declared orderota detectcan infer high-confidence service fields from Compose files when the repo does not declare them explicitly- optional services remain visible, but they do not block the repo if they fail
managerdoes not invent services, but it does derive command wiring from its kind so control-plane behavior is consistent.
How to read the behavior
- if a required service fails its healthcheck, the repo is not ready
- if an optional service fails its healthcheck, ota reports it but does not make the repo unusable
ota upstarts required services in dependency order before setupota doctoruses healthchecks to decide whether readiness is real or just assumedota serviceslists the declared service surface without starting anythingdepends_onis an ordering hint, not a readiness guarantee by itself
Real example
This example shows a repo that needs Postgres and Redis before the app can run.
ota.yamlyaml
services: postgres: required: true manager: kind: compose file: compose.yaml service: postgres healthcheck: pg_isready -h localhost -p 5432 timeout: 5000 redis: required: false manager: kind: compose file: compose.yaml service: redis healthcheck: redis-cli ping timeout: 3000 api: required: true manager: kind: compose file: compose.yaml service: api depends_on: - postgres - redis healthcheck: curl -fsS http://localhost:3000/health timeout: 5000What users should expect
- the repo becomes ready only after required services pass their checks
- the service order is driven by declared dependencies, not shell script order
- the healthcheck command decides readiness, not just whether the service process exists
- a slow healthcheck can fail via
timeouteven if the service eventually comes up - manager-based services do not invent services or run guesses; they derive the service command wiring from
kindand the manager fields - the same service declaration should explain behavior to humans and agents
Use cases
- a repo needs a database before tests can run
- a team wants optional local infra visible without making it blocking
- a maintainer wants
upto bring services up beforesetup - CI needs to surface service drift as a clear readiness issue
- an agent needs to know whether it can trust a local app to be live before starting work
- a repo uses
docker-composefor the local stack but still wants ota to own readiness checks
What ota does not do
- does not invent services that are not declared
- does not guess dependency ordering beyond
depends_on - does not replace healthchecks with process existence checks
- does not provide deep service orchestration
- does not replace your OS package manager or container runtime
- does not hide a failed required service behind a successful setup task