feat(services): add service_compute lifecycle module #169

Merged
fatmaebrahim merged 4 commits from development_service_compute_lifecycle into development 2026-04-29 13:31:28 +00:00
Member

Summary

Adds a Nushell lifecycle module for the hero_compute four-binary stack — install / start / stop / status / reset — wired through services/mod.nu. Modeled on service_codescalers.nu, with the privileged-service shape (--root mandatory at start) from service_mycelium.nu.

Closes #154

Changes

  • New: tools/modules/services/service_compute.nu (766 lines). Install pulls system packages, downloads cloud-hypervisor v43.0 + my_hypervisor v0.1.2, delegates the mycelium runtime install to service_mycelium, and runs cargo build --release for the four hero_compute binaries. Start registers the three daemon actions (hero_compute_server, hero_compute_ui, hero_compute_explorer) with hero_proc and prints a summary block with sockets/URLs/test plan. Mode and master_ip are threaded into per-action env (HERO_COMPUTE_MODE, HERO_COMPUTE_MASTER_IP).
  • Modified: tools/modules/services/mod.nu — one-line export use service_compute.nu next to service_codescalers.

Deviations from the spec (called out for review)

  • --release flag inverted to --debug (Nushell does not allow type annotations on switch flags, so --release: bool = true is not expressible). Default is release; --debug opts into a debug build.
  • --instance support omitted entirely. hero_compute owns /dev/kvm and the mycelium TUN — multi-instance is not a real use case.
  • --debug is not threaded through start → install. Run service_compute install --debug first if a debug build is wanted.

Test Results

This is a Nushell module; runtime exercising requires /dev/kvm, --root, and network access — can't be run from CI today. Static checks:

  • nu -c 'use ./tools/modules/services/service_compute.nu' — clean parse.
  • nu -c 'use ./tools/modules/services/mod.nu *' — clean parse.
  • help service_compute install/start/stop/status/reset — all signatures render cleanly.

End-to-end install/start/stop/status verification is manual smoke-testing on a KVM-enabled root host (Step 9 of the spec).

Notes for the reviewer

The CI workflow (.forgejo/workflows/build.yaml) only runs scripts/test.sh, which checks SKILL.md frontmatter — it does not parse-check tools/modules/services/*.nu. A regression in this module would slip past CI. Worth a follow-up to add nu -c 'use ./tools/modules/services/mod.nu *' as a smoke step.

## Summary Adds a Nushell lifecycle module for the `hero_compute` four-binary stack — install / start / stop / status / reset — wired through `services/mod.nu`. Modeled on `service_codescalers.nu`, with the privileged-service shape (`--root` mandatory at start) from `service_mycelium.nu`. ## Related Issue Closes https://forge.ourworld.tf/lhumina_code/hero_skills/issues/154 ## Changes - New: `tools/modules/services/service_compute.nu` (766 lines). Install pulls system packages, downloads cloud-hypervisor v43.0 + my_hypervisor v0.1.2, delegates the mycelium runtime install to `service_mycelium`, and runs `cargo build --release` for the four hero_compute binaries. Start registers the three daemon actions (`hero_compute_server`, `hero_compute_ui`, `hero_compute_explorer`) with hero_proc and prints a summary block with sockets/URLs/test plan. Mode and master_ip are threaded into per-action env (`HERO_COMPUTE_MODE`, `HERO_COMPUTE_MASTER_IP`). - Modified: `tools/modules/services/mod.nu` — one-line `export use service_compute.nu` next to `service_codescalers`. ## Deviations from the spec (called out for review) - `--release` flag inverted to `--debug` (Nushell does not allow type annotations on switch flags, so `--release: bool = true` is not expressible). Default is release; `--debug` opts into a debug build. - `--instance` support omitted entirely. hero_compute owns `/dev/kvm` and the mycelium TUN — multi-instance is not a real use case. - `--debug` is not threaded through `start → install`. Run `service_compute install --debug` first if a debug build is wanted. ## Test Results This is a Nushell module; runtime exercising requires `/dev/kvm`, `--root`, and network access — can't be run from CI today. Static checks: - `nu -c 'use ./tools/modules/services/service_compute.nu'` — clean parse. - `nu -c 'use ./tools/modules/services/mod.nu *'` — clean parse. - `help service_compute install/start/stop/status/reset` — all signatures render cleanly. End-to-end install/start/stop/status verification is manual smoke-testing on a KVM-enabled root host (Step 9 of the spec). ## Notes for the reviewer The CI workflow (`.forgejo/workflows/build.yaml`) only runs `scripts/test.sh`, which checks SKILL.md frontmatter — it does not parse-check `tools/modules/services/*.nu`. A regression in this module would slip past CI. Worth a follow-up to add `nu -c 'use ./tools/modules/services/mod.nu *'` as a smoke step.
feat(services): add service_compute lifecycle module
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
7201f06379
Adds tools/modules/services/service_compute.nu — install/start/stop/status/reset
for the hero_compute four-binary stack (manager + server + ui + explorer).
Wired through tools/modules/services/mod.nu.

#154
Merge branch 'development' into development_service_compute_lifecycle
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
17a0ba79da
fix(services): restore service_shrimp.nu after merge from development
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 3s
12324745b7
Merge branch 'development' into development_service_compute_lifecycle
All checks were successful
Build and Publish Skills / build-and-publish (pull_request) Successful in 2s
8ba5ee90da
fatmaebrahim merged commit 4d30743d43 into development 2026-04-29 13:31:28 +00:00
fatmaebrahim deleted branch development_service_compute_lifecycle 2026-04-29 13:31:28 +00:00
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_skills!169
No description provided.