diff --git a/crates/orchestrator/Cargo.toml b/crates/orchestrator/Cargo.toml index c9dea9a..ebcd0c3 100644 --- a/crates/orchestrator/Cargo.toml +++ b/crates/orchestrator/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "orchestrator" -version = "0.1.9" +version = "0.1.10" edition = "2024" build = "build.rs" diff --git a/crates/orchestrator/src/main.rs b/crates/orchestrator/src/main.rs index 2ef686c..0c6c42c 100644 --- a/crates/orchestrator/src/main.rs +++ b/crates/orchestrator/src/main.rs @@ -119,6 +119,57 @@ async fn main() -> Result<()> { let opts = Opts::parse(); info!(db = %opts.database_url, amqp = %opts.amqp_url, "orchestrator starting"); + // Validate runner binary paths early and explain source of values + { + const DEFAULT_LINUX: &str = "./target/release/solstice-runner-linux"; + const DEFAULT_ILLUMOS: &str = "./target/release/solstice-runner-illumos"; + let env_linux = std::env::var("RUNNER_LINUX_PATH").ok(); + let env_illumos = std::env::var("RUNNER_ILLUMOS_PATH").ok(); + + // Linux runner diagnostics + if opts.runner_linux_path == DEFAULT_LINUX { + match env_linux { + Some(ref v) if v == DEFAULT_LINUX => { + // Env explicitly set to default; still log info + debug!(runner_linux_env = %v, "RUNNER_LINUX_PATH provided but equals default"); + } + Some(ref v) => { + // Clap should have picked env; if not, operator likely used wrong syntax in EnvironmentFile + warn!(expected_env = %v, actual = %opts.runner_linux_path, "environment contained RUNNER_LINUX_PATH but CLI value did not reflect it; ensure EnvironmentFile uses KEY=VALUE syntax and restart the service"); + } + None => { + warn!(using_default = %opts.runner_linux_path, "RUNNER_LINUX_PATH not set; using default Linux runner path"); + } + } + } else { + info!(runner_linux_path = %opts.runner_linux_path, "using Linux runner path from CLI/env"); + } + // Existence check + if std::fs::metadata(&opts.runner_linux_path).is_err() { + warn!(path = %opts.runner_linux_path, "Linux runner binary not found at path; job execution will fail until this is corrected"); + } + + // Illumos runner diagnostics + if opts.runner_illumos_path == DEFAULT_ILLUMOS { + match env_illumos { + Some(ref v) if v == DEFAULT_ILLUMOS => { + debug!(runner_illumos_env = %v, "RUNNER_ILLUMOS_PATH provided but equals default"); + } + Some(ref v) => { + warn!(expected_env = %v, actual = %opts.runner_illumos_path, "environment contained RUNNER_ILLUMOS_PATH but CLI value did not reflect it; ensure EnvironmentFile uses KEY=VALUE syntax and restart the service"); + } + None => { + debug!(using_default = %opts.runner_illumos_path, "RUNNER_ILLUMOS_PATH not set; using default illumos runner path"); + } + } + } else { + info!(runner_illumos_path = %opts.runner_illumos_path, "using illumos runner path from CLI/env"); + } + if std::fs::metadata(&opts.runner_illumos_path).is_err() { + debug!(path = %opts.runner_illumos_path, "Illumos runner binary not found (only relevant for illumos labels)"); + } + } + // Load orchestrator config (image map) and ensure images are present locally let cfg = OrchestratorConfig::load(opts.config.as_deref()).await?; config::ensure_images(&cfg).await?;