Add ring deployment exec for interactive container access - #218
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds
ring deployment exec: run a command, or open a shell, inside a running instance.Opt-in via
[server.exec] enabled = true; a server with it off answers 501. Docker only for now, other runtimes report that they do not support it. The command's exit code becomes the CLI's, so it composes with the shell.Two things worth knowing when reading the diff:
Exec re-checks container ownership. Every other path in the Docker runtime reaches containers through
list_instances*, which only ever yields containers carrying thering_deploymentlabel. Exec takes an id straight from its caller, so it has to re-establish that invariant itself, otherwise any id reaching the handler addresses every container on the daemon. Stream ticket scopes are separated for the same reason: a ticket minted for logs cannot be replayed to open a shell.Sessions are bounded rather than killable. A container runtime gives no way to kill an exec once started, and dropping the connection leaves the process running. Ring cannot close that gap, so it bounds its own participation instead: a concurrency quota plus duration and idle timeouts, after which it stops relaying and frees the slot. The idle timeout is the one that matters in practice, since a client that vanished without closing stops producing traffic long before anything else notices.
The e2e caught a bug the Rust tests could not: with stdin already at EOF (
$(ring deployment exec …)), the client closed the WebSocket, which tore the session down before the container had written anything. Every captured command came back empty with exit code 0.t44_exec.shcovers that case explicitly.Two commits here are unrelated to exec but were needed to get CI green:
h2carries a DoS advisory published on 2026-08-17 (RUSTSEC-2026-0258, fixed in 0.4.16), andanyhow,event-listenerandspinhad unsoundness or yank warnings. All four are lockfile-only bumps within the existing semver ranges. They fail onmaintoo; nothing in this branch pulls them in.