Api socket #5

Merged
mi merged 3 commits from api-socket into main 2026-09-10 22:09:58 +02:00
Owner
No description provided.
mi added 3 commits 2026-09-10 22:09:54 +02:00
A real PostgreSQLContainer run proxied to podman's socket, twice: the
whole traffic is 18 endpoints, all under /v1.32/. The trace settles
four questions that shaped milestone 3's risk: exec is a plain framed
response and needs no connection hijacking, logs use docker's 8-byte
frame header, containers are created with an empty HostPort meaning
'pick a free one', and cleanup filters containers by label.

tools/apirecord is the proxy that recorded it, kept for comparing
werkdock's own answers with podman's.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
werkdock system service serves the Docker Engine API subset that a real
Testcontainers session sends. Package api is a frontend over package
instance and package store, as the CLI verbs are; everything outside
the measured subset answers 501 with the reason.

Ports are the deliberate deviation: werkdock shares the host's network
and cannot map a port, so it picks a free one and tells the service to
bind it through the image's own environment variable (PGPORT and kin).
The same small table carries the user an image needs when its
entrypoint expects to drop privileges itself. Both are documented.

Instances gained labels and a label filter, execs became records with
an id and an exit code, and pull moved into package registry so the
API and the CLI share it.

Validated with PostgreSQLContainer 1.19.3 locally and on the
Hostsharing managed webspace: start, log wait strategy, JDBC query,
execInContainer, kill, remove, session cleanup. Version 0.6.0.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
The API is now exercised by werkdock's own tests end to end, over HTTP
against a real bwrap sandbox: create, start, framed logs on both
streams, exec into the instance's volume with its exit code, the label
filter, kill, wait, delete. Until now only the external werkprobe
repository covered this, which CI cannot run.

Log parameters that would change the answer are refused with the reason
instead of ignored — tail, timestamps, and a non-zero since or until —
the same contract the run flags have kept since RFC 0002. The container
list honours limit.

The service verb's own logic gained tests: where the socket goes, the
kernel's path limit, and that a stale socket is replaced while a live
one is never taken over.

Coverage of package api rises from 54% to 67%.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
mi merged commit f9c1ae835d into main 2026-09-10 22:09:58 +02:00
mi deleted branch api-socket 2026-09-10 22:09:58 +02:00
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: mi/werkdock#5