diff --git a/docs/STATUS.md b/docs/STATUS.md index a8a6bac5..6044ac07 100644 --- a/docs/STATUS.md +++ b/docs/STATUS.md @@ -1,6 +1,6 @@ # RESUME HERE — Rust orchestrator migration -Updated: 2026-04-22 (Step 3 committed, moving to Step 4) +Updated: 2026-04-23 (Step 6 committed, moving to Step 7) **To resume this work, SSH into the ThinkPad and run `opencode` from `~/Projects/archy/`. Or work from the laptop via the SSHFS mount at `~/mnt/archy-thinkpad/`.** @@ -12,19 +12,19 @@ Working through the 11-step plan in [`rust-orchestrator-migration.md`](./rust-or - [x] **Step 2** — `34af4d9d` ContainerRuntime trait gained `image_exists` + `build_image`, 4 argv tests, 25/25 pass - [x] **Step 3** — `b6a04d31` ProdContainerOrchestrator (999 LOC), 16 tests all pass, not yet wired to main.rs - [x] **Step 4** — `e8a59c93` ContainerOrchestrator trait, RpcHandler uses it in prod (+ `13858842` chore gitignore ._*) -- [ ] **Step 5** — BootReconciler task in new file boot_reconciler.rs (next up) -- [ ] **Step 6** — main.rs wire-up: load manifests, adopt, spawn reconciler (replaces the commented-out `run_boot_reconciliation` block at main.rs:107-111) -- [ ] **Step 7** — Three UI manifests + Dockerfile refactor (runtime bind-mount of nginx.conf) +- [x] **Step 5** — `fc39b04b` BootReconciler with Arc shutdown, 4 paused-time tests pass +- [x] **Step 6** — main.rs wire-up: construct orchestrator once, load_manifests + adopt_existing + spawn BootReconciler, thread through Server::new / ApiHandler::new / RpcHandler::new, wire shutdown Notify to SIGTERM/SIGINT. Clean `cargo check -p archipelago` (6 pre-existing warnings), container tests 43/44 pass (the one failing `test_parse_image_versions` is pre-existing and unrelated — asserts `!contains_key("NOT_AN_IMAGE")` but the retain on line 106 keeps anything ending in `_IMAGE`). +- [ ] **Step 7** — Three UI manifests (bitcoin-ui, electrs-ui, lnd-ui) + Dockerfile refactor (runtime bind-mount of nginx.conf) — next up - [ ] **Step 8** — Delete bash scripts + systemd units + ISO builder lines - [ ] **Step 9** — Hot-swap + verify on .228 - [ ] **Step 10** — Hot-swap + verify on .116 - [ ] **Step 11** — Chaos matrix on both nodes -## Acceptance evidence (Steps 1–4) +## Acceptance evidence (Steps 1–6) `cargo test -p archipelago-container --lib` → 25/25 pass. -`cargo test -p archipelago container::` → 21/21 pass (16 prod_orchestrator + 5 other container tests). -`cargo build -p archipelago` → clean, 11 "unused" warnings for methods not yet wired from main.rs (expected). +`cargo test -p archipelago container::` → 43/44 pass (all container:: tests; the 1 failure is pre-existing `test_parse_image_versions` — assert bug against `_IMAGE` suffix filter). +`cargo check -p archipelago` → clean, 6 warnings (dead-code on trait methods not yet exercised — expected until Step 9 hot-swap). Unrelated test failures (identity_manager / session / wallet / mesh / credentials): 24 pre-existing on baseline `b6a04d31`, fluctuates to 25 on Step 4 — confirmed unrelated (diff only shifted 3 fs-state tests that are independently flaky). @@ -39,6 +39,7 @@ Clean — only leftover is `tests/` (bats harness from prior session, not in sco 3. Reconciler interval → 30 seconds 4. Concurrency → per-app `Mutex<()>` in a `DashMap` 5. Bash scripts → delete immediately (first-boot-containers.sh, reconcile-containers.sh, container-specs.sh, + their systemd units) +6. Step 4 extension → `ContainerOrchestrator` trait includes `install(app_id)`; the `manifest_path`-based install RPC stays dev-only ## Context: which host is what @@ -51,14 +52,11 @@ Both are development alpha nodes — **full destructive latitude**, no need to a ## Next action -**Step 5 — BootReconciler.** New file `core/archipelago/src/container/boot_reconciler.rs`. Design doc §269-352 has the full shape. Plan: +**Step 7 — UI manifests + Dockerfile refactor.** Design doc §396-437. -1. `pub struct BootReconciler { orchestrator: Arc, interval: Duration, shutdown: CancellationToken }` — interval is 30s per answered Q3. -2. `pub async fn run_forever(self)` that runs an initial `reconcile_all()` then loops on `tokio::select! { sleep | shutdown }`. -3. Unit tests against a `MockRuntime`: verifies (a) initial reconcile fires immediately, (b) second reconcile fires after `interval`, (c) shutdown token terminates the loop cleanly, (d) a per-app failure in one reconcile doesn't stop subsequent reconciles. -4. Wire-up lives in Step 6. - -No changes to existing code; this is an additive file + tests. +1. Create `apps/bitcoin-ui/manifest.yml`, `apps/electrs-ui/manifest.yml`, `apps/lnd-ui/manifest.yml`. Each uses `container.build.context` pointing at `/opt/archipelago/docker/` on the host (so the orchestrator's `build_image` step can find the Dockerfile at install time). +2. Refactor `docker/bitcoin-ui/Dockerfile` + its nginx.conf template so `BITCOIN_RPC_AUTH` is injected at **runtime via a bind-mount of nginx.conf**, not baked via sed at build time. This means the Dockerfile copies only the template, and the manifest's `volumes:` entry mounts the rendered nginx.conf from host state dir into `/etc/nginx/nginx.conf` read-only. +3. No orchestrator code changes in this step — just manifests + Dockerfile edits. Step 9 will hot-swap the binary on .228 which already has the `/opt/archipelago/docker/` trees (since those are part of the image). ---