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
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.