andrussal f451fd504d refactor(testing-framework): rename runners to deployers
- Update paths and orchestration for deployers (compose/k8s/local/docker)

- Consolidate scripts helpers and refresh book/README docs
2025-12-16 21:20:27 +01:00

32 lines
1.0 KiB
Rust

use std::env;
use tracing::debug;
/// Select the compose image and optional platform, honoring
/// NOMOS_TESTNET_IMAGE.
pub fn resolve_image() -> (String, Option<String>) {
let image = env::var("NOMOS_TESTNET_IMAGE")
.unwrap_or_else(|_| String::from("logos-blockchain-testing:local"));
let platform = (image == "ghcr.io/logos-co/nomos:testnet").then(|| "linux/amd64".to_owned());
debug!(image, platform = ?platform, "resolved compose image");
(image, platform)
}
/// Optional extra hosts entry for host networking.
pub fn host_gateway_entry() -> Option<String> {
if let Ok(value) = env::var("COMPOSE_RUNNER_HOST_GATEWAY") {
if value.eq_ignore_ascii_case("disable") || value.is_empty() {
return None;
}
return Some(value);
}
if let Ok(gateway) = env::var("DOCKER_HOST_GATEWAY") {
if !gateway.is_empty() {
return Some(format!("host.docker.internal:{gateway}"));
}
}
Some("host.docker.internal:host-gateway".into())
}