diff --git a/README.md b/README.md index fe51a01..513c4b6 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,84 @@ # Hero Code Home +## Architecture Overview + +The Hero Code system follows a hierarchical job execution architecture with three main components: + +### [Coordinator](https://git.ourworld.tf/herocode/herocoordinator) +- Manages DAGs (Direct Acyclic Graphs) that define flows of jobs +- Orchestrates job execution by dispatching individual steps from DAGs to supervisors +- Handles flow logic and determines the next steps based on job completion results + +### [Supervisor](https://git.ourworld.tf/herocode/supervisor) +- Receive job assignments from the coordinator +- Dispatch jobs to appropriate runners based on job requirements +- Act as intermediaries between coordinators and runners +- Return job results back to the coordinator + +### [Runner](https://git.ourworld.tf/herocode/herorunner) +- Execute the actual jobs assigned by supervisors +- Run job-specific code and return responses to supervisors +- Specialized for different types of workloads and environments +- Use Hero DB as their data layer for persistent storage and data operations + +Runners run scripts in rhai or heroscript and are written in multiple languages. Each runner uses Hero DB as its data layer for persistent storage and data operations. +- [System Runner](https://git.ourworld.tf/herocode/runner_system) +- [OSIS Runner](https://git.ourworld.tf/herocode/runner_osis) +- [V Runner](https://git.ourworld.tf/herocode/runner_v) +- [Python Runner](https://git.ourworld.tf/herocode/runner_python) + + +```mermaid +graph TD + C[Coordinator
DAG Management & Flow Logic] + + subgraph N1["Node 1 (Linux User)"] + S1[Supervisor 1] + R1[Runner 1
System Runner] + R2[Runner 2
Python Runner] + DB1[(Hero DB 1)] + end + + subgraph N2["Node 2 (Linux User)"] + S2[Supervisor 2] + R3[Runner 3
V Runner] + R4[Runner 4
OSIS Runner] + DB2[(Hero DB 2)] + end + + C <-->|Job & Result| S1 + C <-->|Job & Result| S2 + + S1 <-->|Job & Result| R1 + S1 <-->|Job & Result| R2 + S2 <-->|Job & Result| R3 + S2 <-->|Job & Result| R4 + + R1 <-->|Data| DB1 + R2 <-->|Data| DB1 + R3 <-->|Data| DB2 + R4 <-->|Data| DB2 + + style C fill:#e1f5fe + style S1 fill:#f3e5f5 + style S2 fill:#f3e5f5 + style R1 fill:#e8f5e8 + style R2 fill:#e8f5e8 + style R3 fill:#e8f5e8 + style R4 fill:#e8f5e8 + style DB1 fill:#fff3e0 + style DB2 fill:#fff3e0 +``` + + + ## Local Embedded Application Front End ([leaf](https://git.ourworld.tf/herocode/leaf)) Leaf is a local embedded application front end. It is a web application that can be embedded in any web application. It is a set of widgets that can be used to build web applications. -## Hero Backend ([baobab](https://git.ourworld.tf/herocode/baobab)) +## [Hero DB](https://git.ourworld.tf/herocode/herodb) -Baobab is the hero backend. It is a Base Object and Actor Backend. It offers OpenRPC interfaces over WebSockets and Unix, and has a supervisor to manage actors, their lifecycles, and jobs dispatched. - -## Actors ([actor](https://git.ourworld.tf/herocode/baobab/core/actor)) - -Actors are self contained job runner binaries that connect to the baobab backend and run jobs dispatched by the baobab supervisor. Actors run scripts in rhai or heroscript and are written in multiple languages. -- [System Actor](https://git.ourworld.tf/herocode/actor_system) -- [OSIS Actor](https://git.ourworld.tf/herocode/actor_osis) -- [V Actor](https://git.ourworld.tf/herocode/actor_v) -- [Python Actor](https://git.ourworld.tf/herocode/actor_python) +Hero DB is the data layer used by runners in each node. It provides persistent storage and data operations for runners, enabling them to store and retrieve data as needed during job execution. ## Herolibs diff --git a/scripts/install.sh b/scripts/install.sh new file mode 100755 index 0000000..875597e --- /dev/null +++ b/scripts/install.sh @@ -0,0 +1,99 @@ +#!/bin/bash + +# Hero Code Workspace Installer +# This script installs all repositories in the Hero Code ecosystem + +set -e + +# Colors for output +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[1;33m' +BLUE='\033[0;34m' +CYAN='\033[0;36m' +NC='\033[0m' # No Color + +# Repository list - each repo should have scripts/install.sh +REPOS=( + # "https://git.ourworld.tf/herocode/baobab" + # "https://git.ourworld.tf/herocode/leaf" + "https://git.ourworld.tf/herocode/herolib_rust" + # "https://git.ourworld.tf/herocode/herolib_v" + # "https://git.ourworld.tf/herocode/herolib_py" + # "https://git.ourworld.tf/herocode/actor_system" + # "https://git.ourworld.tf/herocode/actor_osis" + # "https://git.ourworld.tf/herocode/actor_v" + # "https://git.ourworld.tf/herocode/actor_python" +) + +# Parse command line arguments +while [[ $# -gt 0 ]]; do + case $1 in + -h|--help) + echo "Usage: $0 [OPTIONS]" + echo "" + echo "This script curls and executes install scripts from all Hero Code repositories." + echo "" + echo "Options:" + echo " -h, --help Show this help message" + echo "" + echo "Environment variables:" + echo " CODEROOT Override code directory (default: ~/code)" + exit 0 + ;; + *) + echo "Unknown option: $1" + exit 1 + ;; + esac +done + +echo -e "${BLUE}===============================================${NC}" +echo -e "${BLUE} Hero Code Workspace Installer${NC}" +echo -e "${BLUE}===============================================${NC}" +echo "" + +# Check system requirements +echo -e "${YELLOW}🔍 Checking system requirements...${NC}" + +if ! command -v curl >/dev/null 2>&1; then + echo -e "${RED}❌ Error: curl is required but not installed${NC}" + exit 1 +fi +echo -e "${GREEN}✅ curl found${NC}" + +echo "" + +# Install repositories by curling their install scripts +echo -e "${YELLOW}🔧 Installing Hero Code repositories...${NC}" +echo "" + +failed_repos=() +for repo_url in "${REPOS[@]}"; do + repo_name=$(basename "$repo_url") + install_script_url="$repo_url/raw/branch/development/scripts/install.sh" + + echo -e "${CYAN}📦 Installing $repo_name${NC}" + echo -e "${BLUE} Script: $install_script_url${NC}" + + # Curl and execute the install script + if curl -sSL "$install_script_url" | bash; then + echo -e "${GREEN} ✅ $repo_name installed successfully${NC}" + else + echo -e "${RED} ❌ $repo_name installation failed${NC}" + failed_repos+=("$repo_name") + fi + echo "" +done + +if [ ${#failed_repos[@]} -gt 0 ]; then + echo -e "${RED}❌ Failed to install: ${failed_repos[*]}${NC}" + exit 1 +fi + +echo -e "${GREEN}===============================================${NC}" +echo -e "${GREEN} Installation Complete!${NC}" +echo -e "${GREEN}===============================================${NC}" +echo "" +echo -e "${GREEN}🎉 All Hero Code repositories have been installed!${NC}" +echo "" \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh new file mode 100644 index 0000000..e69de29