docs: STATUS.md through Step 7

This commit is contained in:
archipelago
2026-04-23 02:21:01 -04:00
parent 069bc4a561
commit 6e46932f72

View File

@@ -1,6 +1,6 @@
# RESUME HERE — Rust orchestrator migration
Updated: 2026-04-23 (Step 6 committed, moving to Step 7)
Updated: 2026-04-23 (Step 7 committed, moving to Step 8)
**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/`.**
@@ -14,16 +14,16 @@ Working through the 11-step plan in [`rust-orchestrator-migration.md`](./rust-or
- [x] **Step 4**`e8a59c93` ContainerOrchestrator trait, RpcHandler uses it in prod (+ `13858842` chore gitignore ._*)
- [x] **Step 5**`fc39b04b` BootReconciler with Arc<Notify> 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
- [x] **Step 7**`069bc4a5` bitcoin-ui pre-start hook renders nginx.conf from embedded template. New `container::bitcoin_ui` module (render fn, atomic tmp+rename, idempotent byte-compare, 8 unit tests). `ProdContainerOrchestrator::run_pre_start_hooks` fires in `install_fresh` before `create_container` and in `ensure_running` (Running+Rewritten → restart; Stopped → re-render+start). bitcoin-ui Dockerfile no longer COPYs nginx conf; arrives via runtime bind-mount (safe-failure → 404 if missing, never stale auth). `apps/{bitcoin,electrs,lnd}-ui/manifest.yml` land. Integration test asserts `install("bitcoin-ui")` writes substituted config to disk. 39/39 container:: tests pass (same 1 pre-existing failure).
- [ ] **Step 8** — Delete bash scripts + systemd units + ISO builder lines, **plus** add ISO builder lines to copy `apps/*/manifest.yml``/opt/archipelago/apps/` on install — next up
- [ ] **Step 9** — Hot-swap + verify on .228
- [ ] **Step 10** — Hot-swap + verify on .116
- [ ] **Step 11** — Chaos matrix on both nodes
## Acceptance evidence (Steps 16)
## Acceptance evidence (Steps 17)
`cargo test -p archipelago-container --lib` → 25/25 pass.
`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 test -p archipelago container::`38/39 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).
@@ -40,6 +40,7 @@ Clean — only leftover is `tests/` (bats harness from prior session, not in sco
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
7. Step 7 bitcoin-ui template → embed via `include_str!`, render on install + every reconcile, atomic tmp+rename to `/var/lib/archipelago/bitcoin-ui/nginx.conf`, bind-mount into container. RPC user hardcoded `archipelago`, password from `/var/lib/archipelago/secrets/bitcoin-rpc-password`.
## Context: which host is what
@@ -52,11 +53,25 @@ Both are development alpha nodes — **full destructive latitude**, no need to a
## Next action
**Step 7UI manifests + Dockerfile refactor.** Design doc §396-437.
**Step 8Delete bash scripts + systemd units, and teach the ISO builder to install manifests.**
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/<ui>` 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).
Files to delete (the scripts the Rust orchestrator has now replaced):
1. `scripts/first-boot-containers.sh` (1392 lines — the sed/envsubst path, now covered by bitcoin-ui pre-start hook + `install_fresh`)
2. `scripts/reconcile-containers.sh` (now covered by `BootReconciler` in-process loop)
3. `scripts/container-specs.sh` (manifests live in `apps/*/manifest.yml` instead)
4. `image-recipe/configs/archipelago-first-boot-containers.service` (systemd unit)
5. `image-recipe/configs/archipelago-reconcile.service` (systemd unit)
Enablement lines to remove in `image-recipe/build-auto-installer-iso.sh`:
- line ~2773 (first-boot unit enable)
- line ~2896 (reconcile unit enable)
- line ~2961 (any remaining enablement hooks — verify)
**New requirement** (discovered this session, not in original spec):
- Add ISO builder lines to copy `apps/*/manifest.yml``/opt/archipelago/apps/` on install. Without this, `load_manifests()` finds no manifests on fresh nodes and the orchestrator has nothing to reconcile. Reference: `image-recipe/build-auto-installer-iso.sh:2350-2351` (existing `cp -r /docker/* /mnt/target/opt/archipelago/docker/` pattern — mirror it for `/apps/`).
No Rust code changes in this step. Atomic commit: deletions + ISO builder edits together.
---