Skip to content

Commit 0312426

Browse files
committed
feat(agents): add the sandbox reaper reconcile engine and health server
Add the per-namespace reconcile pass: classify each managed Sandbox from its annotations and bound Pod, gather checkpoint evidence, and apply the planned tombstone or delete with resourceVersion/UID preconditions, re-reading on CAS conflicts and recording Kubernetes Events and metrics. A Pod watch keeps termination-log receipts after Pods are deleted. Receipts live in memory only. When the bound Pod is gone and no receipt was observed (a reaper restart or a watch gap), the receipt is treated as unknown: the newest object listed in the session's own prefix is recorded, an S3 failure defers the session, and only an empty listing records a missing checkpoint. Add the /metrics, /healthz, and /readyz router. Each pass has a 60-second deadline; liveness records pass starts and readiness records successes, so a slow S3 or apiserver fails readiness without restarting the reaper. Scenario and property tests for the pass follow in the next layer. Signed-off-by: Tee8z <[email protected]>
1 parent 32be8a9 commit 0312426

6 files changed

Lines changed: 1136 additions & 0 deletions

File tree

‎Cargo.lock‎

Lines changed: 128 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎crates/buzz-sandbox-reaper/Cargo.toml‎

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,24 @@ path = "src/main.rs"
1414
# never in buzz-backend-kubernetes, whose binary ships inside the desktop app.
1515
[dependencies]
1616
buzz-backend-kubernetes = { path = "../buzz-backend-kubernetes" }
17+
kube = { workspace = true, features = ["runtime"] }
18+
k8s-openapi = { workspace = true }
1719
tokio = { workspace = true }
20+
tokio-util = { workspace = true }
21+
futures-util = { workspace = true }
1822
serde = { workspace = true }
1923
serde_json = { workspace = true }
2024
chrono = { workspace = true }
25+
axum = { workspace = true }
26+
http = "1"
27+
http-body-util = "0.1"
2128
metrics = { workspace = true }
29+
metrics-exporter-prometheus = { workspace = true }
2230
tracing = { workspace = true }
2331
aws-config = { version = "1", default-features = false, features = ["rt-tokio", "default-https-client"] }
2432
aws-sdk-s3 = { version = "1", default-features = false, features = ["rt-tokio", "default-https-client"] }
2533

2634
[dev-dependencies]
35+
tower = { workspace = true }
36+
tokio = { workspace = true, features = ["test-util"] }
2737
proptest = { workspace = true }

‎crates/buzz-sandbox-reaper/src/main.rs‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,7 @@
88
mod config;
99
mod evidence;
1010
mod plan;
11+
mod reconcile;
12+
mod server;
1113

1214
fn main() {}

0 commit comments

Comments
 (0)