D6 — setup-binaries.sh refactor: per-user manifest-driven install loop #8

Open
opened 2026-05-20 21:42:11 +00:00 by mik-tf · 0 comments
Owner

D6 — setup-binaries.sh refactor: per-user manifest-driven install loop

Sub-issue of #? (v0.1 scope). Lives in lhumina_code/hero_demo (the bootstrap script's home), but listed here because deployer's D4 work depends on it.

What this does

Refactor hero_demo/deploy/single-vm/scripts/setup-binaries.sh (s132) so its lab build loop is driven by the per-user component manifest (~/hero/cfg/cockpit/services.toml, format in hero_cockpit#1 §6) instead of the hardcoded d07_set.txt.

Today's behaviour

# Loops over every entry in /root/d07_set.txt — fixed all-34 set
while read repo; do
    lab build "$repo" --download --install
done < /root/d07_set.txt

Target behaviour

# Reads /root/cockpit-services.toml (uploaded by deployer)
# Picks entries where [enabled].$name = true
# Maps each enabled component to its source-repo (most are 1:1)
# Loops over only the enabled set

Required pieces

  1. TOML parser — sh can't natively. Either use toml cli tool (small Python or Go) or have the deployer pre-process the TOML into a flat newline-list before scp'ing it. The pre-process path keeps setup-binaries.sh dependency-free.
  2. Component → repo map — for components that don't 1:1 match a repo, encode the mapping in setup-binaries.sh:
    declare -A COMPONENT_REPO=(
        [hero_proxy]=hero_proxy
        [hero_router]=hero_router
        [hero_proc]=hero_proc
        [hero_embedder]=hero_embedder
        [hero_db]=hero_db
        [hero_books]=hero_books
        [hero_cockpit]=hero_cockpit
        [hero_slides]=hero_slides
        [hero_whiteboard]=hero_whiteboard
        [hero_collab]=hero_collab
        [hero_agent]=hero_agent
        [hero_voice]=hero_voice
    )
    
  3. Always-on bootstrap-core — proxy + router + proc + cockpit always installed regardless of manifest. Embedder + db + books default-on per demo profile.
  4. Embedder small-model flag — when [embedder].model = "small", set EMBEDDER_MODEL_SIZE=small env var before starting hero_embedder so it loads the smaller variant. Coordinated with hero_embedder#? (small model).
  5. Backwards-compatible — if no manifest is present at the standard path, fall back to today's d07_set.txt behaviour (so non-deployer-driven manual runs still work).

Acceptance criteria

  • setup-binaries.sh reads /root/cockpit-services.toml (or the equivalent flat list pre-processed by deployer)
  • Installs only enabled components
  • Always installs the bootstrap-core (proxy + router + proc + cockpit)
  • Starts the cockpit + the user's enabled services via lab service <name> --start
  • Falls back to d07_set.txt if no manifest present
  • Embedder uses small model when embedder.model = "small" in manifest

References

## D6 — setup-binaries.sh refactor: per-user manifest-driven install loop Sub-issue of [`#?` (v0.1 scope)](https://forge.ourworld.tf/lhumina_code/hero_os_tfgrid_deployer/issues/2). Lives in `lhumina_code/hero_demo` (the bootstrap script's home), but listed here because deployer's D4 work depends on it. ## What this does Refactor [`hero_demo/deploy/single-vm/scripts/setup-binaries.sh`](https://forge.ourworld.tf/lhumina_code/hero_demo/src/branch/development/deploy/single-vm/scripts/setup-binaries.sh) (s132) so its `lab build` loop is driven by the per-user component manifest (`~/hero/cfg/cockpit/services.toml`, format in [`hero_cockpit#1` §6](https://forge.ourworld.tf/lhumina_code/hero_cockpit/issues/1)) instead of the hardcoded `d07_set.txt`. ## Today's behaviour ```bash # Loops over every entry in /root/d07_set.txt — fixed all-34 set while read repo; do lab build "$repo" --download --install done < /root/d07_set.txt ``` ## Target behaviour ```bash # Reads /root/cockpit-services.toml (uploaded by deployer) # Picks entries where [enabled].$name = true # Maps each enabled component to its source-repo (most are 1:1) # Loops over only the enabled set ``` ## Required pieces 1. **TOML parser** — sh can't natively. Either use `toml` cli tool (small Python or Go) or have the deployer pre-process the TOML into a flat newline-list before scp'ing it. The pre-process path keeps setup-binaries.sh dependency-free. 2. **Component → repo map** — for components that don't 1:1 match a repo, encode the mapping in setup-binaries.sh: ```bash declare -A COMPONENT_REPO=( [hero_proxy]=hero_proxy [hero_router]=hero_router [hero_proc]=hero_proc [hero_embedder]=hero_embedder [hero_db]=hero_db [hero_books]=hero_books [hero_cockpit]=hero_cockpit [hero_slides]=hero_slides [hero_whiteboard]=hero_whiteboard [hero_collab]=hero_collab [hero_agent]=hero_agent [hero_voice]=hero_voice ) ``` 3. **Always-on bootstrap-core** — proxy + router + proc + cockpit always installed regardless of manifest. Embedder + db + books default-on per `demo` profile. 4. **Embedder small-model flag** — when `[embedder].model = "small"`, set `EMBEDDER_MODEL_SIZE=small` env var before starting hero_embedder so it loads the smaller variant. Coordinated with [hero_embedder#? (small model)](https://forge.ourworld.tf/lhumina_code/hero_embedder). 5. **Backwards-compatible** — if no manifest is present at the standard path, fall back to today's d07_set.txt behaviour (so non-deployer-driven manual runs still work). ## Acceptance criteria - `setup-binaries.sh` reads `/root/cockpit-services.toml` (or the equivalent flat list pre-processed by deployer) - Installs only enabled components - Always installs the bootstrap-core (proxy + router + proc + cockpit) - Starts the cockpit + the user's enabled services via `lab service <name> --start` - Falls back to `d07_set.txt` if no manifest present - Embedder uses small model when `embedder.model = "small"` in manifest ## References - s132 script: [`hero_demo/deploy/single-vm/scripts/setup-binaries.sh`](https://forge.ourworld.tf/lhumina_code/hero_demo/src/branch/development/deploy/single-vm/scripts/setup-binaries.sh) - Manifest format: [`hero_cockpit#1` §6](https://forge.ourworld.tf/lhumina_code/hero_cockpit/issues/1) - Deployer D4 (consumer): [`#? (D4 post-deploy)`](https://forge.ourworld.tf/lhumina_code/hero_os_tfgrid_deployer/issues/2) - Umbrella: [`#? (v0.1 scope)`](https://forge.ourworld.tf/lhumina_code/hero_os_tfgrid_deployer/issues/2)
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
1 participant
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_os_tfgrid_deployer#8
No description provided.