Skip to main content

Module container_status

Module container_status 

Source
Expand description

This machine’s agent containers as the frontend sees them: a name, whose they are, a state and an image, pushed as container-status when one changes, with the container runtime’s own state as container-runtime, and read as a whole with GET /api/v1/containers (docs/specs/SPEC_CONTAINER_STATUS_IN_THE_FRONTEND_2026_11_14.md).

Names and states only. There is no field for a log, an environment, a mount or a statistic, so none can leak through it. Docker is the source of truth: run follows its event stream, rebuilds from a list now and then, and this module keeps what it was told (Registry) and says what changed (Hub).

Which containers: those named agentmux-<agent id>, as container_name_for_slug names them. One whose id is no agent’s is an orphan (agent_id null), because that is the one a person wants to see. Another container is never listed: a name must carry the label new containers get (AGENT_LABEL), or look like an agent id (a UUID), or be the id of a definition.

A container that stopped, died or was removed ends its agent’s gateway tokens (a model route’s and the API key’s), whoever stopped it: AgentMux’s own stops do it where they happen (container::key_route), and this is the one for a stop it did not make (Docker Desktop, a daemon restart), so the token does not outlive the container and is not given again to one that takes its place at the same address ([end_gateway_tokens]).

AgentMux’s own helper containers (the gateway forwarder, container::gateway_fwd) are listed too, with helper naming what they are and no agent.

Structs§

ContainerRuntimeStatus
The container runtime’s own state, the fields of containerruntimeavailable with the time it was seen.
ContainerStatus
One agent container. agent_id and agent_name are null for an orphan.
ContainersList
The answer of GET /api/v1/containers: what is there now.
DockerEvent
One event about an agent container.
DockerSource
Hub
The registry with the way out: every change it makes is published, once.
Listed
One container of Docker’s list.
Probe
What a look at the container runtime found.
Registry
What Docker (and srv’s own start-up) has said, and what was last published from it.

Enums§

Action
An event action that changes where a container is.
ContainerState
Where a container is.
Published
What Hub says to the outside.

Constants§

AGENT_LABEL
The label a new agent container carries: its agent’s id.
NAME_PREFIX
The name every agent container starts with (container_name_for_slug).

Traits§

Source
Where the containers are read from.

Functions§

hub
The hub, once installed.
install
Start publishing on broker for the rest of the process, and return the hub for run. The first call wins.
note_starting
srv is about to bring container_name up from image (empty when it exists already).
run
Watches for the rest of the process. A machine with no container runtime and no container is looked at once, then left alone until something wakes the hub (a container agent starting, or a reader of the route that finds a runtime).