feat: Add install script, uninstall script, and CI test workflow #64

Merged
mahmoud merged 11 commits from development_install_ci into development 2026-04-07 09:20:22 +00:00
Owner

Summary

  • Install script (scripts/install.sh): Single-command installer that downloads pre-built binaries (cloud-hypervisor, mycelium, hero_proc, my_hypervisor, hero_compute), installs system dependencies, and starts all services. Safe to re-run — checks each component and only downloads what's missing or outdated. Supports --env flag for environment selection.
  • Uninstall script (scripts/uninstall.sh): Clean removal of all installed components.
  • CI workflow (.forgejo/workflows/test-install.yaml): Forgejo Actions workflow that tests the install script in a container environment — verifies binary downloads, dependency installation, and service startup.

Changes

File Description
scripts/install.sh Single-command installer with progress output, version checks, graceful package handling
scripts/uninstall.sh Uninstall script for clean removal
.forgejo/workflows/test-install.yaml CI workflow to test the install script

Install usage

# Default (development environment)
curl -sfL https://forge.ourworld.tf/lhumina_code/hero_compute/raw/branch/development/scripts/install.sh | bash

# Specific environment
curl -sfL https://forge.ourworld.tf/lhumina_code/hero_compute/raw/branch/development/scripts/install.sh | bash -s -- --env production

Test plan

  • CI workflow passes in container environment
  • Install script downloads all binaries correctly
  • Install script handles missing system packages gracefully
  • Uninstall script removes all components
  • Re-running install script is idempotent
## Summary - **Install script** (`scripts/install.sh`): Single-command installer that downloads pre-built binaries (cloud-hypervisor, mycelium, hero_proc, my_hypervisor, hero_compute), installs system dependencies, and starts all services. Safe to re-run — checks each component and only downloads what's missing or outdated. Supports `--env` flag for environment selection. - **Uninstall script** (`scripts/uninstall.sh`): Clean removal of all installed components. - **CI workflow** (`.forgejo/workflows/test-install.yaml`): Forgejo Actions workflow that tests the install script in a container environment — verifies binary downloads, dependency installation, and service startup. ## Changes | File | Description | |------|-------------| | `scripts/install.sh` | Single-command installer with progress output, version checks, graceful package handling | | `scripts/uninstall.sh` | Uninstall script for clean removal | | `.forgejo/workflows/test-install.yaml` | CI workflow to test the install script | ## Install usage ```bash # Default (development environment) curl -sfL https://forge.ourworld.tf/lhumina_code/hero_compute/raw/branch/development/scripts/install.sh | bash # Specific environment curl -sfL https://forge.ourworld.tf/lhumina_code/hero_compute/raw/branch/development/scripts/install.sh | bash -s -- --env production ``` ## Test plan - [x] CI workflow passes in container environment - [x] Install script downloads all binaries correctly - [x] Install script handles missing system packages gracefully - [x] Uninstall script removes all components - [x] Re-running install script is idempotent ### Related issues - https://forge.ourworld.tf/lhumina_code/hero_compute/issues/63
ci: add install script test workflow
Some checks failed
Test Install Script / test-install-ubuntu (push) Failing after 14s
Test / test (push) Successful in 1m26s
Test Install Script / test-install-alpine (push) Has been cancelled
63dbc52556
Adds a Forgejo Actions workflow that tests scripts/install.sh via
curl | bash on both Ubuntu 22.04 and Alpine 3.19 containers.

Tests: binary installation, service startup, clean shutdown, and
idempotent re-run. Scoped to development_install_ci branch for
validation before merging.

#63
fix: handle unavailable system packages gracefully in install script
Some checks failed
Test Install Script / test-install-ubuntu (push) Failing after 26s
Test / test (push) Successful in 1m30s
Test Install Script / test-install-alpine (push) Has been cancelled
1418726745
Install packages one-by-one so that unavailable packages (e.g.
virtiofsd on Ubuntu 22.04) don't abort the entire installation.
Missing packages are logged as warnings instead of fatal errors.

#63
ci: retrigger install test workflow
All checks were successful
Test / test (push) Successful in 1m48s
Test / test (pull_request) Successful in 1m25s
50a9238ca6
ci: add workflow description comment to trigger CI
Some checks failed
Test Install Script / test-install-ubuntu (push) Failing after 45s
Test / test (push) Successful in 1m26s
Test / test (pull_request) Successful in 1m52s
Test Install Script / test-install-alpine (push) Has been cancelled
66eaa6125a
fix: correct CI binary list and skip hardware checks in CI
Some checks failed
Test Install Script / test-install-ubuntu (push) Failing after 43s
Test / test (push) Has been cancelled
Test / test (pull_request) Has been cancelled
Test Install Script / test-install-alpine (push) Has been cancelled
fc3533d70b
- Fix binary list: use actual binaries from config
  (hero_proc, hero_proc_server, hero_proc_ui)
- Skip kernel extraction and hypervisor doctor checks when CI=true
  (no KVM, no kernel, no virtiofsd in containers)
- Set CI=true env var in workflow steps

#63
fix: rework CI service checks for container environments
Some checks failed
Test Install Script / test-install-ubuntu (push) Successful in 58s
Test / test (pull_request) Successful in 2m23s
Test / test (push) Successful in 2m24s
Test Install Script / test-install-alpine (push) Has been cancelled
714f694636
Instead of expecting daemons to run (needs KVM, TUN, sockets):
- Verify binaries respond to --version/--help (proves downloads valid)
- Start hero_proc_server, confirm PID alive, then stop and confirm clean shutdown
- Skip mycelium daemon test (needs TUN), verify --help instead

#63
docs: document --env flag for curl | bash usage
Some checks failed
Test Install Script / test-install-ubuntu (push) Successful in 1m6s
Test / test (pull_request) Successful in 2m21s
Test / test (push) Successful in 2m22s
Test Install Script / test-install-alpine (push) Has been cancelled
c2e30b8485
Add bash -s -- --env examples to install script header and setup guide.

#63
feat: add progress dots and install log for long-running steps
Some checks failed
Test / test (push) Has been cancelled
Test / test (pull_request) Has been cancelled
Test Install Script / test-install-ubuntu (push) Successful in 1m20s
Test Install Script / test-install-alpine (push) Has been cancelled
d5d2b9659a
- Package installs show progress dots while running in background
- Binary downloads show progress dots with filename
- Full output logged to ~/hero/log/install.log
- Log path shown at start and in final summary

#63
feat: Update hero_compute_sdk for HTTP RPC over UDS
Some checks failed
Test / test (pull_request) Failing after 41s
Test / test (push) Failing after 55s
fc77d93045
- Add functions for generating socket paths
- Introduce http_rpc_unix for HTTP RPC over UDS
- Remove raw_rpc_unix and related constants
feat: polish install script output and add uninstall script
Some checks failed
Test / test (pull_request) Failing after 38s
Test / test (push) Failing after 55s
Test Install Script / test-install-ubuntu (push) Successful in 1m13s
Test Install Script / test-install-alpine (push) Has been cancelled
c0be39f116
Install script improvements:
- Color output (green/yellow/red) with unicode symbols
- Box-drawn header and summary
- Progress dots with done/failed status for every operation
- Download labels show component name instead of temp filenames
- All output logged to ~/hero/log/install.log
- Services show running/stopped status in summary
- Consistent indentation and alignment throughout

New uninstall script (scripts/uninstall.sh):
- Stops all services, removes binaries, data, config, PATH entries
- Removes system packages (virtiofsd, busybox-static)
- Removes my_hypervisor network interface
- Verification step confirms clean state
- Supports curl | bash for remote execution

#63
refactor: Update to use hero_compute_sdk for RPC
Some checks failed
Test / test (push) Failing after 41s
Test / test (pull_request) Failing after 1m3s
8948b18cd2
- Use hero_compute_sdk for socket path resolution
- Update RPC calls to use HTTP/1.1 over Unix sockets/TCP
- Remove direct UnixStream and TcpStream usage for RPC
- Update imports and dependencies
- Add hero_compute_sdk to Cargo.toml
fix: suppress interactive apt prompts during install
Some checks failed
Test / test (pull_request) Failing after 40s
Test / test (push) Failing after 1m2s
Test Install Script / test-install-ubuntu (push) Successful in 1m34s
Test Install Script / test-install-alpine (push) Has been cancelled
ca2e1253ac
Set DEBIAN_FRONTEND=noninteractive and force-confdef/force-confold
dpkg options to prevent needrestart and config file prompts from
blocking the installer (especially virtiofsd on Ubuntu 24.04).

#63
fix: mycelium peer args and early PATH setup
Some checks failed
Test / test (push) Failing after 42s
Test / test (pull_request) Failing after 44s
Test Install Script / test-install-ubuntu (push) Successful in 1m21s
Test Install Script / test-install-alpine (push) Has been cancelled
cac6ca7ae9
- mycelium --peers expects space-separated args, not comma-separated
  single string (was causing 'invalid socket address syntax' error)
- Add ~/hero/bin to PATH early in install so my_hypervisor doctor
  can find cloud-hypervisor during installation

#63
feat(sockets): align with Hero Socket Convention -- HTTP over UDS + standardized layout
Some checks failed
Test / test (pull_request) Failing after 1m19s
Test / test (push) Failing after 1m44s
9805acfc8b
Migrate hero_compute from raw newline-delimited JSON-RPC via UnixRpcServer
to HTTP-over-UDS via AxumRpcServer with standardized socket directory layout
under $HERO_SOCKET_DIR/hero_compute/.

Socket layout:
  - rpc.sock (server)
  - ui.sock (dashboard)
  - explorer_rpc.sock (explorer)

#65
fix(sdk): add connect_server_socket for correct AxumRpcServer RPC path
Some checks failed
Test / test (push) Failing after 2m12s
Test / test (pull_request) Failing after 2m13s
29399f568c
The generated connect_socket() sends HTTP POST to /rpc, but AxumRpcServer
serves at /api/root/cloud/rpc. Add connect_server_socket() that uses
unix_socket_with_path() with the correct path.

Also add protocol: "openrpc" to heroservice.json for hero_router discovery.

#65
docs: update all documentation for HTTP-over-UDS socket convention
Some checks failed
Test / test (pull_request) Failing after 2m21s
Test / test (push) Failing after 2m22s
c51b8a77e1
- Replace all references to old socket names (hero_compute_server.sock, etc.)
  with new layout (hero_compute/rpc.sock, ui.sock, explorer_rpc.sock)
- Update protocol descriptions from "raw JSON-RPC newline-delimited" to
  "HTTP/1.1 JSON-RPC 2.0 over UDS"
- Replace socat examples with curl --unix-socket examples
- Standardize explorer socket env var to HERO_COMPUTE_EXPLORER_SOCKET
- Update mermaid diagrams in architecture.md

#65
style: apply rustfmt formatting
All checks were successful
Test / test (pull_request) Successful in 3m6s
Test / test (push) Successful in 3m8s
53a54f2b93
#65
mahmoud force-pushed development_install_ci from 53a54f2b93
All checks were successful
Test / test (pull_request) Successful in 3m6s
Test / test (push) Successful in 3m8s
to ec27ebebc4
All checks were successful
Test / test (push) Successful in 2m22s
Test / test (pull_request) Successful in 2m25s
2026-04-06 18:34:49 +00:00
Compare
mahmoud changed title from CI workflow to test single line installer to feat: Add install script, uninstall script, and CI test workflow 2026-04-06 18:42:11 +00:00
chore: finalize CI workflow targets and docs before merge
Some checks failed
Test Install Script / test-install-ubuntu (pull_request) Failing after 59s
Test / test (pull_request) Successful in 2m20s
Test / test (push) Successful in 2m23s
Test Install Script / test-install-alpine (pull_request) Has been cancelled
7b350f5f87
- Update test-install.yaml to target development/main branches
- Add --env flag documentation to setup.md
fix: set FORGE_TOKEN and WEBROOT defaults when starting hero_proc_server
Some checks failed
Test Install Script / test-install-ubuntu (pull_request) Failing after 47s
Test / test (push) Successful in 1m30s
Test / test (pull_request) Successful in 1m51s
Test Install Script / test-install-alpine (pull_request) Has been cancelled
e365fa84a3
hero_proc_server v0.4.4 requires FORGE_TOKEN and WEBROOT env vars
on startup. Set sensible defaults so the installer can start the
service. Users can configure the real token later.
fix: address all review findings for install/uninstall/CI
Some checks failed
Test / test (push) Successful in 2m55s
Test / test (pull_request) Successful in 2m56s
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m24s
Test Install Script / test-install-alpine (pull_request) Has been cancelled
40ac805515
Install script (scripts/install.sh):
- Replace set -e with set -u to prevent silent exits from background
  process failures; all errors now handled explicitly with return codes
- Add --connect-timeout 10 --max-time 120 --retry 2 to all curl calls
- Show download URL to user on failure (not just in log file)
- Every download() caller now checks return code and handles failure
  gracefully (skip component, not crash entire install)
- Tighten version grep with word-boundary anchoring to prevent
  0.1.3 matching 0.1.30
- Fix printf format strings: use %b for ANSI escapes consistently,
  never embed escape codes in format string position
- Extract _hero_proc_socket_exists helper to avoid path duplication
- Extract _wait_with_dots helper to reduce code duplication
- Rename mycelium peers variable to peers_list for clarity
- Add FORGE_TOKEN to --help output

Uninstall script (scripts/uninstall.sh):
- Replace pgrep -f with pgrep -x for exact process name matching,
  falling back to full-path match only for ~/hero/bin/ binaries
- Check reverse dependencies before removing system packages
  (apt-cache rdepends) to avoid breaking shared packages
- Fix printf format strings for consistent ANSI handling
- Use set -u instead of set -e

CI workflow (.forgejo/workflows/test-install.yaml):
- Set FORGE_TOKEN and WEBROOT as job-level env vars
- Consolidate binary existence + response checks into single step
  (reduces duplication between Ubuntu and Alpine jobs)
- Add FORGE_TOKEN/WEBROOT to service start/stop test step
- Branch triggers already set to development/main
fix: update stale versions in configure.sh
Some checks failed
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m4s
Test / test (push) Failing after 1m9s
Test / test (pull_request) Successful in 1m54s
Test Install Script / test-install-alpine (pull_request) Has been cancelled
9b86da41dd
- cloud-hypervisor: v43.0 → v50.0
- my_hypervisor: v0.1.2 → v0.1.4

These defaults were out of sync with the central config.
fix: show PATH export command in post-install summary
Some checks failed
Test / test (push) Has been cancelled
Test Install Script / test-install-ubuntu (pull_request) Has been cancelled
Test Install Script / test-install-alpine (pull_request) Has been cancelled
Test / test (pull_request) Has been cancelled
036bfbd41f
After curl | bash, ~/hero/bin is added to .bashrc but not the
current shell. Print the export command so the user can copy-paste
it immediately.
merge: bring in latest development changes
Some checks failed
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m25s
Test / test (pull_request) Successful in 2m18s
Test / test (push) Successful in 2m21s
Test Install Script / test-install-alpine (pull_request) Has been cancelled
ed2c3f058e
ci: remove Alpine job from install test workflow
All checks were successful
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m5s
Test / test (pull_request) Successful in 1m29s
Test / test (push) Successful in 1m48s
03b50499ab
chore: fix comment — Ubuntu only
All checks were successful
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m25s
Test / test (pull_request) Successful in 2m5s
Test / test (push) Successful in 2m19s
ec8652cfa5
merge: resolve conflict in configure.sh — keep development version (central config)
All checks were successful
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m26s
Test / test (push) Successful in 2m14s
Test / test (pull_request) Successful in 2m19s
171eed46a3
fix: prompt for user confirmation even via curl | bash
All checks were successful
Test Install Script / test-install-ubuntu (pull_request) Successful in 1m7s
Test / test (pull_request) Successful in 1m27s
Test / test (push) Successful in 1m54s
674790c0e6
Read from /dev/tty instead of stdin so the y/N prompt works when
the script is piped (curl | bash). Skip in CI where no TTY exists.
mahmoud merged commit 5f788f2658 into development 2026-04-07 09:20:22 +00:00
mahmoud deleted branch development_install_ci 2026-04-07 09:20:28 +00:00
Sign in to join this conversation.
No reviewers
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_compute!64
No description provided.