Repository navigation
Features: engine metrics, a prune that keeps N, container checkpoints, and sealed secrets - #920
Open
sturdymushroom wants to merge 1 commit into
Open
sturdymushroom wants to merge 1 commit into
sturdymushroom wants to merge 1 commit into
Conversation
sturdymushroom
force-pushed
the
features-wave
branch
2 times, most recently
from
November 24, 2026 21:07
f5dbf68 to
1207604
Compare
…ecrets - GET /metrics: Prometheus 0.0.4 text over engine-held state, no guest round-trips: containers by state, total, images, image bytes, volumes, networks. - POST /images/prune?keep=N: two-phase select then delete, keeping the N newest unused images across the whole list before anything goes; the sweep stays caller-initiated (a sweeper Kiri runs on its own still isn't a thing, libracoder#895). Unparsable keep is a 400; an image whose created never parsed sorts last. - POST /kiri/containers/<id>/checkpoint: the container's writable files as an image, named by the body's reference or by a default checkpoint:<shortid>-<unix time> that stacks. Restoring is running the image: a checkpoint is files, not the process table. - Kiri secrets: values sealed with ChaCha20-Poly1305 under a 0600 key beside the engine's state, listed and read by name, never handed back; a container start names one in its env with secret:<name> and only there does the value reach the guest, the record keeping the reference.
sturdymushroom
force-pushed
the
features-wave
branch
from
November 28, 2026 01:40
1207604 to
7438f68
Compare
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.
Four features toward making Kiri the better Docker.
GET /metrics— Prometheus 0.0.4 text, hand-rolled (no new dependencies), read only from the engine's own state so a scrape never stalls on the guest:kiri_containers{state="..."}(Docker's words,pausedincluded),kiri_containers_total,kiri_images,kiri_image_bytes,kiri_volumes,kiri_networks.POST /images/prune?keep=N— the sweep stays exactly what it is today, caller-initiated (a sweeper Kiri runs on its own still isn't a thing, #895). This adds two-phase select-then-delete: the N newest unused images across the whole list are kept before anything goes. Unparsablekeepis a 400; an image whosecreatednever parsed sorts last (first dropped beyond the kept few).POST /kiri/containers/<id>/checkpoint— the container's writable files become an image, named by the body's reference (repoorrepo:tag) or by a defaultcheckpoint:<shortid>-<unix time>whose seconds change with every call: the checkpoints of a container stack up, none overwrites an earlier one. Restoring one is running it — a checkpoint is files, not the process table. On a stopped engine the checkpoint of a created container says so plainly ("Kiri is stopped") instead of pretending.Kiri secrets — values sealed at rest with ChaCha20-Poly1305 under the engine's own key (
secrets.key, 0600, from the system RNG;ringwas already in the tree for rustls), insecrets.jsonbeside the engine's other state, saved atomically like the rest. Listed and read by name only — no endpoint returns a value. A container's start names one in its env withsecret:<name>(alone, or as any entry's value) and only there does the plaintext reach the guest; the record keeps the reference, so a copiedcontainers.jsoncarries names, not secrets. An unknown name errors at the start (no secret named ...), as Docker's create answersno such secret.Testing
cargo test -p kiri: 986 passed, 0 failed (+linux_unit1/0). New tests: prune's keep (newest kept, 400 onsoon/1.5), the checkpoint name rules (incl.localhost:5000/repo— its colon is not a tag's), checkpoint of an unknown container and of one the stopped engine cannot reach, secrets round-trip and persistence (a second engine reads what the first sealed), the API listing without any value, and the/metricssnapshot against computed engine counts.cargo clippy -p kiri: clean on the touched regions.cargo test --workspace --exclude kiri-init --lockedgreen — 1260 passed, 0 failed across the 16 crates.The metrics/prune/secrets paths stay off the request hot path (a
/metricsarm, a prune the client asked for, and an env scan only when an entry actually names a secret), so nothing inSpeed's measured calls changes.