4. Up, status, down
$ PR=123 pstack upstack: pr-123→ up: database→ compose up (backend, frontend) ✓ up database ✓ assert_live database ✓ compose (compose)The → lines are progress, printed as work happens. The ✓ block is the step report, printed
once at the end. In a long deploy the arrows are what you watch; the report is what you read.
Add -v to see the actual commands and their output:
$ PR=8 pstack up -vstack: pr-8→ compose up (backend) $ docker compose -p 'pr-8' -f 'compose.generated.yml' -f 'docker-compose.preview.tls.yml' --profile 'backend' up -d --remove-orphansThat is the whole Compose contract, visible: -p <stack> for namespacing, one -f per file
(compose.file then each compose.overlays entry, in order), the selected profiles, and
--remove-orphans so relabelling from backend+frontend to backend actually stops the frontend
instead of orphaning it.
The first -f is compose.generated.yml, which pstack writes beside compose.file and never
over it. It does this whenever a service needs routing labels or has no logging: key. Such a
service gets a json-file log cap (10m × 3), or the loki driver on a host that runs Loki. Add
compose.generated.yml to your repository’s .gitignore.
Reading the step report
Section titled “Reading the step report” ✓ assert_gone database │ │ └─ axis name, or `(compose)` for the compose step │ └─ phase: up · assert_live · down · assert_gone · compose · capacity └─ mark| Mark | Meaning | Where it comes from |
|---|---|---|
✓ |
step passed | any phase |
? |
unverifiable — the axis defines no assert_gone, so nothing was checked. Not a pass. |
assert_gone phase only |
✗ |
step failed. On assert_gone this is a leak. |
any phase |
A trailing summary line counts what matters: 1 leaked resource(s), 1 unverifiable axis/axes.
A down step can pass and carry a message — teardown is best-effort by design, so a failed
down hook is recorded as non-fatal rather than failing the run. Here the whole Compose teardown
failed (this host has no docker at all) and the run still continued, exactly as intended:
✓ compose (compose) — non-fatal: bash: docker: command not foundA ✓ with a non-fatal: message means this step errored and we carried on deliberately. Read
those messages — they are how you notice a down hook that has been silently failing for weeks. The
thing that would actually fail the run is the assert_gone that follows.
And here is ? in the wild — the three-axis spec from section 3, whose dns-record axis has no
assert_gone:
$ PR=123 pstack verify -f warn.ymlstack: pr-123→ verify (asserting resources are gone) ? assert_gone dns-record — unverifiable: no assert_gone defined ✓ assert_gone queue-namespace ✓ assert_gone images 1 unverifiable axis/axes$ echo $?0Exit 0 with a ? means: everything I could check was clean. It does not mean the host is
clean. Every ? is a resource class you are trusting on faith.
Status
Section titled “Status”$ PR=123 pstack statusstack: pr-123(nothing running)status passes docker compose ps through unmodified — when containers exist you get Compose’s own
table verbatim. Two synthetic replies stand in for an empty result: (nothing running) when ps
produces no output, and (no compose section in spec) when the spec has no compose: block at all.
Verify (before teardown, as a sanity check)
Section titled “Verify (before teardown, as a sanity check)”Run it against a live stack and it should fail. If it passes while the stack is up, your
assert_gone is lying — go back to section 3.
$ PR=123 pstack verifystack: pr-123→ verify (asserting resources are gone) ✗ assert_gone database — LEAKED: resource still present after teardown 1 leaked resource(s)$ echo $?2$ PR=123 pstack downstack: pr-123→ compose down (all profiles)→ down: database→ verify (asserting resources are gone) ✓ compose (compose) ✓ down database ✓ assert_gone database$ echo $?0Order: Compose down first (every profile), then axes in reverse declaration order, then
verify — which runs by default, because a teardown that half-worked is precisely what you need to
hear about. Confirm with -v:
$ PR=456 pstack down -vstack: pr-456→ compose down (all profiles) $ docker compose -p 'pr-456' -f 'docker-compose.preview.yml' --profile 'backend' --profile 'frontend' down -v --remove-orphansAll profiles from the spec appear, whatever you brought up. Compose treats a service whose profile
isn’t enabled as absent, so tearing down with fewer profiles than you deployed leaves that
profile’s resources behind — most visibly one dead <stack>_default network per PR, forever.
Enumerating every profile costs nothing (a profile with no matching service is a no-op).
down -v also removes volumes, but never images. That is an axis, not Compose’s job.