Lease a temporary Postgres 16 database, inspect host resources, and review anonymous volume cleanup.
iddio env run
Run a command with a temporary, tmpfs-backed Postgres 16 database, or grant one to external process holders.
iddio env run {pg16|pg16-pool} [--host NAME] [--owner OWNER] [--timeout D] [--bind IP] [--env-name VAR] [--tls] [--tmpfs SIZE] (-- CMD [ARG...] | --pid PID [--pid PID...])
|
Flag
|
Default
|
Meaning
|
--owner OWNER
|
IDDIO_OWNER, then unknown | Record the lease owner. |
--timeout D
|
1h | Bound queue time and lease lifetime with a positive Go duration, at most 8h. |
--host NAME
|
envDefaultHost (pg16 needs --host if unset) | Select the pg16 host. pg16-pool accepts only local. |
--bind IP
|
Host bind address (127.0.0.1 on local) | Publish Postgres on this IP literal. For pg16-pool the address must match envPoolBind. |
--env-name VAR
|
unset | Also inject the database URL into this variable for an attached command. |
--tls
|
off | Enable TLS with a per-lease certificate (pg16 only). |
--tmpfs SIZE
|
320m | Set the pg16 data tmpfs size (320m to 4g). |
--pid PID
|
unset | Hold a detached lease while any listed live PID survives. Repeat for multiple holders. |
--json
|
false | Print machine-readable output. Streams use SSE frames. |
The postgres:16 image must be available on the selected engine. The dedicated pg16 container uses one CPU and defaults to a 768 MiB memory cap and a 320 MiB data tmpfs. With --tmpfs, the memory cap is the larger of 768 MiB and twice the tmpfs size.
Attached commands receive DATABASE_URL, PGHOST, PGPORT, PGDATABASE, PGUSER, PGPASSWORD, PGSSLMODE=disable, and IDDIO_LEASE, with --tls setting PGSSLMODE=require and adding PGSSLROOTCERT. Local pg16 loopback binds use postgres / iddio. Non-loopback local binds and remote hosts use postgres with a random per-lease password.
pg16-pool creates a database and non-superuser login for each lease. The shared container uses one CPU, 2 GiB of memory, and a 1 GiB tmpfs for lease data. PostgreSQL keeps its write-ahead log on the disposable container layer. It starts on first use and stops after 15 idle minutes.
If the pool dies before a child starts, the attached command exits 1 once the supervisor confirms that outcome. Pool cleanup continues independently.
A pool lease has kind pool_db and reserves one db slot and 64 MiB. Admission keeps over 30% of the measured tmpfs free after reservations.
A detached lease requires at least one live --pid holder and returns its connection details on grant. It releases after all holders have been gone for 60 seconds, on cancellation, or at the deadline.
The command prints lease=ID on stderr. An interrupt detaches the caller. The supervised command continues. Use env result ID to reattach, or env cancel ID to stop it.
Exit codes
. Attached run returns the child exit status, including 128 plus a signal number. A detached grant exits 0. 1 start or release failure (including pool_died), 3 timeout, 4 cancellation, 5 invalid request or a lease that can never fit, 7 indeterminate or lost supervision, 130 detached.
iddio env run pg16 --host local -- go test ./...
iddio env run pg16 --host local --pid 12345
iddio env run pg16-pool --env-name TEST_DATABASE_URL -- make test-db
iddio env list
List leases, configured hosts, or sampled Podman containers, volumes, and images.
iddio env list [leases|hosts|containers|volumes|images] [flags] (alias: ls)
|
Flag
|
Default
|
Meaning
|
--owner OWNER
|
no filter | Match the recorded owner exactly. |
--state STATE
|
no filter | Match a lifecycle state. |
--history, --all
|
false | Include retained terminal resources. The flags are aliases. |
--since TIME
|
no filter | Include resources created at or after an RFC3339 timestamp. |
--sort KEY
|
-createdAt | Sort by createdAt (oldest first) or -createdAt (newest first). |
--limit N
|
all | Return at most N results after filtering and sorting. N must be positive. |
--json
|
false | Print machine-readable output. Streams use SSE frames. |
The default kind is leases, including both env and lock leases. Lease states are queued, granted, releasing, released, expired, cancelled, release_failed, and indeterminate.
All kinds accept --limit. Containers, volumes, and images also accept --sort and --since. Containers also accept --owner, --state, and --history. Leases accept every listed filter.
Container states are configured, created, initialized, running, paused, stopping, removing, unknown, stopped, and exited. Selecting stopped or exited requires history.
The shared container carries its poolId in inventory. Container, volume, and image inventories are read-only samples. A failed inventory refresh makes these lists return an error.
Exit codes
. 0 for a successful list, 5 for invalid filters, unavailable inventory, or service/read errors.
iddio env list leases --state queued
iddio env list containers --history --json
iddio env show
Read one lease or a named host snapshot.
iddio env show LEASE_ID | host NAME [--json] (alias: inspect)
|
Flag
|
Default
|
Meaning
|
--json
|
false | Print machine-readable output. Streams use SSE frames. |
Host snapshots include resource pressure, reservations, and stale-sample diagnostics. Lease snapshots can contain the database URL and test credentials.
Exit codes
. 0 for a successful read, 5 for an unknown ID, invalid host, or service/read error.
iddio env show $LEASE_ID --json
iddio env show host local
iddio env wait
Wait for a lease to be granted or for a pre-grant launcher outcome.
iddio env wait LEASE_ID [--json]
|
Flag
|
Default
|
Meaning
|
--json
|
false | Print machine-readable output. Streams use SSE frames. |
This is useful for a detached --pid lease. The lease handle is printed to stderr. Interrupting the wait leaves the lease in place.
Exit codes
. 0 granted, 1 start failure, 3 timeout, 4 cancellation, 5 invalid or unknown ID, 7 indeterminate or lost supervision, 130 detached.
iddio env wait $LEASE_ID --json
iddio env logs
Read retained Postgres container output and lease lifecycle records.
iddio env logs LEASE_ID [--follow] [--json]
|
Flag
|
Default
|
Meaning
|
--follow
|
false | Read new output through settlement and drain final records. |
--json
|
false | Print machine-readable output. Streams use SSE frames. |
Output is retained up to a 1 MiB prefix. Finite JSON output contains base64 data. With --follow --json, output uses env.log SSE frames.
Exit codes
. 0 for a successful read, 5 for an invalid/unknown ID or read error, 130 when a follower detaches.
iddio env logs $LEASE_ID
iddio env logs $LEASE_ID --follow --json
iddio env result
Wait for or read a retained lease or volume-cleanup outcome.
iddio env result LEASE_ID|GC_ID [--json]
|
Flag
|
Default
|
Meaning
|
--json
|
false | Print machine-readable output. Streams use SSE frames. |
Lease JSON includes releaseAt when the daemon records the release decision for lease objects. settledAt records completion.
Loss of the shared pool gives affected leases state release_failed and outcome pool_died (exit 1). A GC result includes each selected volume and its removal outcome. A lease result waits through release unless it becomes indeterminate or release_failed.
Exit codes
. For leases, 0 released, 1 start/release failure, 3 timeout, 4 cancellation, 5 invalid/unknown ID or error, 7 indeterminate, 130 detached. For GC, 0 all removed or empty, 1 any skipped/kept, 7 any indeterminate, 5 invalid/expired ID or error, 130 detached.
iddio env result $LEASE_ID --json
iddio env result $GC_ID --json
iddio env cancel
Request cancellation of a lease and prompt cleanup.
iddio env cancel LEASE_ID [--json]
|
Flag
|
Default
|
Meaning
|
--json
|
false | Print machine-readable output. Streams use SSE frames. |
Use env result LEASE_ID to confirm cleanup after the acknowledgement. Repeating a cancellation acknowledges the existing request or settled state.
Exit codes
. 0 for an acknowledged request, 5 for an invalid/unknown ID or service/read error.
iddio env cancel $LEASE_ID
iddio env gc
Preview eligible anonymous volumes, then apply a saved and reviewed cleanup plan.
iddio env gc [--host NAME] [--dry-run] [--json] | iddio env gc --apply GC_ID [--json]
|
Flag
|
Default
|
Meaning
|
--dry-run
|
Preview by default | Save and print a preview without removing anything. |
--apply GC_ID
|
false | Recheck and remove eligible volumes from this saved preview. |
--json
|
false | Print machine-readable output. Streams use SSE frames. |
The preview is saved for 24 hours and prints gc=ID to stderr. Review its items before applying. Only anonymous, dangling volumes older than six hours are candidates.
Apply requires the preview ID. It rechecks each volume and its references before removal and keeps or skips changed, referenced, or uncertain items.
Repeating --apply for the same ID returns the retained outcome. Use env result GC_ID to read or await it.
Exit codes
. Preview exits 0 on success. Apply returns 0 all removed or empty, 1 any skipped/kept, 7 any indeterminate, 5 invalid/expired plan or service/read error, 130 detached.
iddio env gc --json
iddio env gc --apply $GC_ID --json
iddio env events
Subscribe to environment lease, inventory, host, and cleanup changes.
iddio env events [--json]
|
Flag
|
Default
|
Meaning
|
--json
|
false | Print machine-readable output. Streams use SSE frames. |
JSON mode emits env.changed SSE frames. Events identify resources to read again by kind and ID.
Exit codes
. 130 when the stream is detached, 5 for a service or stream error.
iddio env events --json