Skip to main content

Module container_update

Module container_update 

Source
Expand description

A container agent whose container runs an older agent image than this AgentMux: telling its pane once, and updating the container when asked (a button in the pane, or Agents update_container). See backend::container::drift for what an update does. Agents update_container with a container_image also changes which of the two shipped images the agent runs.

Structs§

UpdateContainerRequest 🔒
POST /api/v1/agent/container/update: Agents update_container, for the agent named in agent. With container_image (one of the two images AgentMux ships) it also changes the image first.

Constants§

CURRENT 🔒
The version this AgentMux ships the agent image for.

Functions§

already_told 🔒
broker_agents_changed 🔒
change_image 🔒
set_image for the agent named (an id or slug, open or not), asked for by caller. A container agent cannot change an image, its own included: like a container’s limits, that is for a host agent, the steward or the operator.
container_is_gone 🔒
Docker answers 404 when the container to remove does not exist.
current_image_available 🔒
Whether this AgentMux’s own agent image of the kind configured (its stored agent:container_image) can be had: on this machine, or from the registry. When it can’t (a build ahead of its release), a container is on the floating tag because nothing newer exists.
current_image_available_cached 🔒
current_image_available for the check made on every turn: a registry answer is kept for a while, so a slow or unreachable registry does not delay each message.
first_report 🔒
Whether the container named container_name runs another image version than current, and has not been reported yet. Marks it reported.
handle_update_container 🔒
image_blocks_update 🔒
Why an agent configured with configured (its stored agent:container_image, empty for the default) can’t be moved to this AgentMux’s agent image: it runs its own image, or is pinned to another version.
is_older 🔒
Whether version running is older than current, comparing their numeric dotted parts (0.59.41 < 0.60.2). A version that does not parse is not older: it is left alone rather than replaced.
note_outdated 🔒
Writes one pane row, and one log line, when an existing container runs another agent image version than this AgentMux.
set_image 🔒
Changes which agent image the container agent uid runs: the definition (so every later open and the next open pane agree), the open pane’s own record of it, and the container, removed so that the next message creates it from the new image. Only between turns, and only to one of the two images AgentMux ships; an agent’s own image is set by editing its definition in the window.
take_update_gate 🔒
The container’s update gate taken exclusively, or None while a turn (or another update) holds it.
told 🔒
Containers (by name and running version) whose pane has been told, so one srv run says it once per container.
update_for_block 🔒
Removes block_id’s container so its next message starts it from this AgentMux’s agent image. Only between turns. Returns the image version the next start uses.
update_if_idle 🔒
Moves an idle agent’s container to this AgentMux’s agent image: when it runs an older one, the agent follows the default image (no pin, no image of its own), the current image is already on this machine, and no turn is using the container. The container is removed (workspace, memory and the CLI volume stay; tools installed inside it are installed again) and the pane is told; the start that follows creates it from the current image. Returns whether it did. Anything else leaves the “outdated” row and its button as they are.