74 improve server installer#97
Conversation
Track install phase, installer container metadata, exit state, failure reason, timestamps, and recent logs from the daemon. Expose install state through daemon and Protocube APIs so clients can query install progress without talking to the daemon directly. Allow io_weight 0 to omit Docker blkio weight for local Docker/WSL testing environments that do not support io.weight.
Keep install info responses focused on lifecycle metadata only. Route installer log visibility through the existing server logs endpoint, and record the install lock owner so servers waiting on shared base installation can surface the active installer logs.
Add warmup and post-warmup install-script fields with defaults and validation. Run daemon-owned warmup after install using lifecycle phases, online signal matching, timeout/retry policy, graceful shutdown, and post-warmup execution.
Add parser coverage for warmup defaults, explicit warmup fields, and invalid failure policies. Add daemon warmup tests for defaulting, retry attempt semantics, and startup signal matching.
Issue #74 Merge Notes: Daemon-Owned Install/Warmup LifecycleSummaryThis change moves install lifecycle visibility and first-boot warmup ownership into the daemon, with Protocube acting as the client-facing proxy. The daemon now tracks install phases, exposes install metadata and lifecycle logs, runs warmup and post-warmup containers after install, and supports reinstall through the same lifecycle path. What Changed
How It WorksInstall begins in daemon After install succeeds, Clients should call Protocube, not the daemon directly: GET /api/servers/:id/install
GET /api/servers/:id/logs?type=install
POST /api/servers/:id/reinstallDirect daemon API calls require the daemon's internal node token, not an admin Protocube API key. Compliance Checklist
Manual ValidationLocal manual validation was run through Protocube on Run these commands from the repository root. Useful commands: export SLS_KEY='...'
export SERVER_ID='...'Rebuild: docker compose -f protocube/docker-compose.yml up -d --build
docker compose -f daemon/docker-compose.yml up -d --buildTrigger reinstall: curl -i -X POST \
-H "Authorization: Bearer $SLS_KEY" \
"http://localhost:5620/api/servers/$SERVER_ID/reinstall"Poll lifecycle: watch -n 2 "curl -s -H \"Authorization: Bearer $SLS_KEY\" \
'http://localhost:5620/api/servers/$SERVER_ID/install?size=100' | jq '{phase,status,exit_code,started_at,finished_at,lines:(.content // [] | length)}'"Expected final state: {
"phase": "ready",
"status": "exited",
"exit_code": 0,
"lines": 1
}Check install logs through install endpoint: curl -s \
-H "Authorization: Bearer $SLS_KEY" \
"http://localhost:5620/api/servers/$SERVER_ID/install?size=100" | jq -r '.content[]?'Check install logs through logs endpoint: curl -s \
-H "Authorization: Bearer $SLS_KEY" \
"http://localhost:5620/api/servers/$SERVER_ID/logs?type=install&size=100" | jq -r '.data[]'Check runtime logs separately: curl -s \
-H "Authorization: Bearer $SLS_KEY" \
"http://localhost:5620/api/servers/$SERVER_ID/logs?size=100" | jq -r '.data[]'Validate persisted lifecycle logs: sudo find /var/log/sls/daemon/install -maxdepth 1 -type f -name "$SERVER_ID*" -printf '%p %s bytes\n'Expected files: Automated Test EvidenceFocused tests for changed daemon packages: docker run --rm -v "$PWD:/src" -w /src/daemon golang:1.25.8 go test ./server ./api/routerResult: pass. Focused tests for changed Protocube packages: docker run --rm -v "$PWD:/src" -w /src/protocube golang:1.25.8 go test ./client ./server ./api/routerResult: pass. Broader Protocube suite: docker run --rm -v "$PWD:/src" -w /src/protocube golang:1.25.8 go test ./...Result: pass. Broader daemon suite: docker run --rm -v "$PWD:/src" -w /src/daemon golang:1.25.8 go test ./...Result: existing unrelated failure in Known Local Environment CaveatFull Minecraft runtime boot is blocked in the current WSL + Docker Desktop environment by overlay mount propagation. Observed behavior:
Root cause from local testing:
Review implication:
|
This MR implements daemon-owned install lifecycle tracking and warmup for Issue #74. The daemon now owns install phases, warmup, post-warmup cleanup, reinstall, and install lifecycle logs. Protocube proxies the lifecycle endpoint and install log requests so clients do not call daemon directly. Paper and Spigot definitions no longer embed first-boot warmup logic in the install script; they install/configure files and delegate first boot to daemon warmup.
Known limitation: local WSL + Docker Desktop cannot fully validate runtime Paper boot because daemon-created overlay mounts do not propagate to sibling containers. Install and warmup lifecycle validation passes; full runtime boot should be verified on native Linux Docker Engine.