Create install script for Hero Compute and required binaries #63
Labels
No labels
prio_critical
prio_low
type_bug
type_contact
type_issue
type_lead
type_question
type_story
type_task
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
lhumina_code/hero_compute#63
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
A script to install all required binaries from release pages and move them to the appropriate path. Think of it like:
The script should:
Install the latest stable version of
hero_procfrom:https://forge.ourworld.tf/lhumina_code/hero_proc/releases
Install the latest stable version of
myceliumfrom:https://github.com/threefoldtech/mycelium/releases
Install the latest stable version of
my_hypervisorfrom:https://forge.ourworld.tf/geomind_code/my_hypervisor/releases
Install the latest stable version of
cloud-hypervisorfrom:https://github.com/cloud-hypervisor/cloud-hypervisor/releases/
Download all required binaries for
hero_computefrom:https://forge.ourworld.tf/lhumina_code/hero_compute/releases
Post-installation steps:
System dependencies:
After installing all binaries:
Service setup:
After confirming that all binaries and dependencies are installed:
Start required services (e.g.,
hero_proc,mycelium) in the background using the central config peersPrint the next steps for the user, for example:
User confirmation:
Before starting the installation, the script should:
Example:
Final output:
After installation completes, the script should:
Technical requirements:
The script should work on Ubuntu, Alpine, and other Linux distributions
Keep the script clean and modular (avoid excessive length)
Use functions for all major tasks:
P.S. After successful implementation, we should:
Implementation Spec for Issue #63 — Install Script
Objective
Create a standalone shell install script (
scripts/install.sh) that downloads pre-built binaries for the entire Hero Compute stack from their respective release pages, installs them to~/hero/bin, starts required services (hero_proc, mycelium), and works across Ubuntu, Alpine, and other Linux distributions.Requirements
hero_proc(3 binaries) from forge.ourworld.tf/lhumina_code/hero_procmyceliumfrom github.com/threefoldtech/myceliummy_hypervisor(2 binaries) from forge.ourworld.tf/geomind_code/my_hypervisorcloud-hypervisorfrom github.com/cloud-hypervisor/cloud-hypervisorhero_compute(4 binaries) from forge.ourworld.tf/lhumina_code/hero_compute~/hero/binscripts/configure.shconventionsFiles to Create
scripts/install.shImplementation Plan
Step 1: Script skeleton with header, output helpers, and version defaults
Files:
scripts/install.sh(new)set -e, header comment block matching configure.sh stylebuildenv.shfor version defaults with fallbacks for standalone useStep 2: User confirmation prompt
Files:
scripts/install.shconfirm_install()function with banner, system info, version list, install dir, y/N promptStep 3: System dependency detection and installation
Files:
scripts/install.shinstall_system_deps()— detects package manager (apt/apk/dnf/yum), installs runtime depsStep 4: Binary download functions
Files:
scripts/install.shinstall_hero_proc()— 3 binaries from Forgejo releasesinstall_mycelium()— tar.gz from GitHub, extract + moveinstall_my_hypervisor()— 2 binaries (init goes to ~/.my_hypervisor/bin/)install_cloud_hypervisor()— static binary from GitHubinstall_hero_compute()— 4 binaries from Forgejo releasesStep 5: PATH setup
Files:
scripts/install.shsetup_path()— add ~/hero/bin to PATH in .bashrc/.profile if not presentStep 6: Service startup functions
Files:
scripts/install.shstart_hero_proc()— start hero_proc_server, verify socketstart_mycelium()— start with hardcoded peers, warn if not rootStep 7: Summary, next steps, and main() wiring
Files:
scripts/install.shprint_summary()— versions, stop commands, next stepsmain()— calls all functions in order--helpflag supportAcceptance Criteria
scripts/install.shexists and is executable~/hero/bin(3 hero_proc + 1 mycelium + 2 my_hypervisor + 1 cloud-hypervisor + 4 hero_compute + my_hypervisor-init to ~/.my_hypervisor/bin/)ncancels cleanlycurl | bashNotes
buildenv.shwhen in repo, falls back to hardcoded defaults. All overridable via env vars.~/.my_hypervisor/bin/(not ~/hero/bin).tcp://188.40.132.242:9651,tcp://136.243.47.186:9651,tcp://185.69.166.7:9651.Implementation Summary
Changes Made
1. hero_compute_config (central config repo) — 5 files changed:
[releases]section to all 4 environment configs (development.toml,production.toml,canary.toml,testing.toml)config.schema.jsonwith the releases schemarepo,version,binaries,asset_suffix(for Forgejo releases) orurltemplate with{version}placeholder (for GitHub releases)hero_compute(v0.1.3),hero_proc(v0.4.1),my_hypervisor(v0.1.4),cloud_hypervisor(v43.0),mycelium(v0.7.3)2. hero_cloud — 1 new file:
scripts/install.sh(571 lines) — standalone binary installerKey Design Decisions
--env production|development|testing|canaryselects which config to fetch.curl | bash, prompts interactively otherwise.Script Flow
arch_check— verify x86_64fetch_config— download environment TOML from central config repoconfirm_install— show plan, prompt y/Ninstall_system_deps— runtime packages via detected package managerinstall_cloud_hypervisor— from GitHub release (URL template in config)install_mycelium— from GitHub release tar.gz (URL template in config)install_hero_proc— 3 binaries from Forgejo release (repo + suffix in config)install_my_hypervisor— 2 binaries + kernel check + doctor (repo + suffix in config)install_hero_compute— 4 binaries from Forgejo release (repo + suffix in config)setup_path— add ~/hero/bin to PATHstart_services— hero_proc_server + mycelium with config peersprint_summary— versions, stop commands, next stepsTesting
Still needed
Implementation committed:
hero_cloud:
3585f98—scripts/install.shhero_compute_config:
77f26c3—[releases]section in all environment configsRelated Issues:
#77