3.4 KiB
3.4 KiB
Getting Started with Horus
Quick start guide to running your first Horus job.
Prerequisites
- Redis server running
- Rust toolchain installed
- Horus repository cloned
Installation
Build from Source
# Clone repository
git clone https://git.ourworld.tf/herocode/horus
cd horus
# Build all components
cargo build --release
# Binaries will be in target/release/
Quick Start
1. Start Redis
# Using Docker
docker run -d -p 6379:6379 redis:latest
# Or install locally
redis-server
2. Start a Runner
# Start Hero runner
./target/release/herorunner my-runner
# Or SAL runner
./target/release/runner_sal my-sal-runner
# Or Osiris runner
./target/release/runner_osiris my-osiris-runner
3. Start the Supervisor
./target/release/supervisor --port 8080
4. Submit a Job
Using the Supervisor client:
use hero_supervisor_client::SupervisorClient;
use hero_job::Job;
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
let client = SupervisorClient::new("http://localhost:8080")?;
let job = Job::new(
"my-runner",
"print('Hello from Horus!')".to_string(),
);
let result = client.create_job(job).await?;
println!("Job ID: {}", result.id);
Ok(())
}
Example Workflows
Simple Heroscript Execution
# Job payload
print("Hello World")
!!git.list
SAL System Operation
// List files in directory
let files = os.list_dir("/tmp");
for file in files {
print(file);
}
Osiris Data Storage
// Store user data
let users = osiris.model("users");
let user = users.create(#{
name: "Alice",
email: "alice@example.com"
});
print(`Created user: ${user.id}`);
Architecture Overview
┌──────────────┐
│ Coordinator │ (Optional: For workflows)
└──────┬───────┘
│
┌──────▼───────┐
│ Supervisor │ (Job dispatcher)
└──────┬───────┘
│
│ Redis
│
┌──────▼───────┐
│ Runners │ (Job executors)
│ - Hero │
│ - SAL │
│ - Osiris │
└──────────────┘
Next Steps
Common Issues
Runner Not Receiving Jobs
- Check Redis connection
- Verify runner ID matches job target
- Check supervisor logs
Job Signature Verification Failed
- Ensure job is properly signed
- Verify public key is registered
- Check signature format
Timeout Errors
- Increase job timeout value
- Check runner resource availability
- Optimize job payload
Development
Running Tests
# All tests
cargo test
# Specific component
cargo test -p hero-supervisor
cargo test -p runner-hero
Debug Mode
# Enable debug logging
RUST_LOG=debug ./target/release/supervisor --port 8080
Support
- Documentation: docs.ourworld.tf/horus
- Repository: git.ourworld.tf/herocode/horus
- Issues: Report on the repository