mirror of
https://codeberg.org/Toasterson/solstice-ci.git
synced 2026-04-10 13:20:41 +00:00
Validate runner paths at startup and improve diagnostics; bump version to 0.1.10
- Add validation for `RUNNER_LINUX_PATH` and `RUNNER_ILLUMOS_PATH` with detailed warnings and diagnostics for misconfigurations. - Log fallback to default paths and warn if binaries are missing. - Increment orchestrator version to 0.1.10. Signed-off-by: Till Wegmueller <toasterson@gmail.com>
This commit is contained in:
parent
931e5ac81a
commit
b36e5c70a8
2 changed files with 52 additions and 1 deletions
|
|
@ -1,6 +1,6 @@
|
||||||
[package]
|
[package]
|
||||||
name = "orchestrator"
|
name = "orchestrator"
|
||||||
version = "0.1.9"
|
version = "0.1.10"
|
||||||
edition = "2024"
|
edition = "2024"
|
||||||
build = "build.rs"
|
build = "build.rs"
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,6 +119,57 @@ async fn main() -> Result<()> {
|
||||||
let opts = Opts::parse();
|
let opts = Opts::parse();
|
||||||
info!(db = %opts.database_url, amqp = %opts.amqp_url, "orchestrator starting");
|
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
|
// Load orchestrator config (image map) and ensure images are present locally
|
||||||
let cfg = OrchestratorConfig::load(opts.config.as_deref()).await?;
|
let cfg = OrchestratorConfig::load(opts.config.as_deref()).await?;
|
||||||
config::ensure_images(&cfg).await?;
|
config::ensure_images(&cfg).await?;
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue