Add build.sh and run.sh scripts for osiris runner
- Added build.sh that builds runner_osiris binary in release mode - Added run.sh that builds first, then starts the runner - Fixed binary name from osiris_runner to runner_osiris - Scripts use RUSTFLAGS to suppress warnings - Runner configured via environment variables (RUNNER_ID, REDIS_URL, BASE_DB_ID)
This commit is contained in:
29
Cargo.lock
generated
29
Cargo.lock
generated
@@ -1290,14 +1290,27 @@ dependencies = [
|
||||
"chrono",
|
||||
"hex",
|
||||
"log",
|
||||
"redis 0.25.4",
|
||||
"secp256k1",
|
||||
"serde",
|
||||
"serde-wasm-bindgen",
|
||||
"serde_json",
|
||||
"sha2",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
"uuid",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "hero-job-client"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"chrono",
|
||||
"hero-job",
|
||||
"log",
|
||||
"redis 0.25.4",
|
||||
"serde_json",
|
||||
"thiserror 1.0.69",
|
||||
"tokio",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
@@ -3262,6 +3275,7 @@ dependencies = [
|
||||
"clap",
|
||||
"env_logger",
|
||||
"hero-job",
|
||||
"hero-job-client",
|
||||
"hero_logger",
|
||||
"heromodels",
|
||||
"heromodels-derive",
|
||||
@@ -3767,6 +3781,17 @@ dependencies = [
|
||||
"serde",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde-wasm-bindgen"
|
||||
version = "0.6.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "8302e169f0eddcc139c70f139d19d6467353af16f9fce27e8c30158036a1e16b"
|
||||
dependencies = [
|
||||
"js-sys",
|
||||
"serde",
|
||||
"wasm-bindgen",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "serde_core"
|
||||
version = "1.0.228"
|
||||
|
||||
@@ -53,6 +53,7 @@ rand = "0.8"
|
||||
# Core hero dependencies
|
||||
hero_logger = { git = "https://git.ourworld.tf/herocode/baobab.git", branch = "logger" }
|
||||
hero-job = { path = "../job/rust" }
|
||||
hero-job-client = { path = "../job/rust/client" }
|
||||
# hero-job = { git = "https://git.ourworld.tf/herocode/job.git", subdirectory = "rust" }
|
||||
|
||||
# Osiris dependencies (used by runner_osiris binary)
|
||||
|
||||
11
scripts/build.sh
Executable file
11
scripts/build.sh
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
echo "Building Osiris Runner..."
|
||||
cd "$PROJECT_DIR"
|
||||
RUSTFLAGS="-A warnings" cargo build --release --bin runner_osiris
|
||||
|
||||
echo "✅ Osiris Runner built successfully"
|
||||
23
scripts/run.sh
Executable file
23
scripts/run.sh
Executable file
@@ -0,0 +1,23 @@
|
||||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR=$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)
|
||||
PROJECT_DIR=$(cd "$SCRIPT_DIR/.." && pwd)
|
||||
|
||||
# Build first
|
||||
"$SCRIPT_DIR/build.sh"
|
||||
|
||||
# Configuration
|
||||
RUNNER_ID="${RUNNER_ID:-osiris}"
|
||||
REDIS_URL="${REDIS_URL:-redis://localhost:6379}"
|
||||
BASE_DB_ID="${BASE_DB_ID:-1}"
|
||||
LOG_LEVEL="${LOG_LEVEL:-info}"
|
||||
|
||||
echo "Starting Osiris Runner..."
|
||||
cd "$PROJECT_DIR"
|
||||
|
||||
RUST_LOG="$LOG_LEVEL" RUST_LOG_STYLE=never \
|
||||
exec target/release/runner_osiris \
|
||||
--redis-url "$REDIS_URL" \
|
||||
--base-db-id "$BASE_DB_ID" \
|
||||
"$RUNNER_ID"
|
||||
@@ -10,7 +10,8 @@ pub use async_runner::{AsyncRunner, spawn_async_runner};
|
||||
pub use sync_runner::{SyncRunner, SyncRunnerConfig, spawn_sync_runner};
|
||||
|
||||
// Re-export job types from hero-job crate
|
||||
pub use hero_job::{Job, JobStatus, JobError, JobBuilder, JobSignature, Client, ClientBuilder};
|
||||
pub use hero_job::{Job, JobStatus, JobError, JobBuilder, JobSignature};
|
||||
pub use hero_job_client::{Client, ClientBuilder};
|
||||
pub use redis::AsyncCommands;
|
||||
use log::{error, info};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user