2025-12-10 10:40:33 +01:00
|
|
|
use std::{env, time::Duration};
|
2025-12-09 17:45:10 +01:00
|
|
|
|
|
|
|
|
/// Default cfgsync port used across runners.
|
|
|
|
|
pub const DEFAULT_CFGSYNC_PORT: u16 = 4400;
|
|
|
|
|
|
|
|
|
|
/// Default container path for KZG parameters (compose/k8s mount point).
|
|
|
|
|
pub const DEFAULT_KZG_CONTAINER_PATH: &str = "/kzgrs_test_params/kzgrs_test_params";
|
|
|
|
|
|
|
|
|
|
/// Default host-relative directory for KZG assets.
|
|
|
|
|
pub const DEFAULT_KZG_HOST_DIR: &str = "testing-framework/assets/stack/kzgrs_test_params";
|
|
|
|
|
|
2025-12-10 10:40:33 +01:00
|
|
|
/// Default HTTP probe interval used across readiness checks.
|
|
|
|
|
pub const DEFAULT_HTTP_POLL_INTERVAL: Duration = Duration::from_secs(1);
|
|
|
|
|
|
|
|
|
|
/// Default node HTTP timeout when probing endpoints.
|
|
|
|
|
pub const DEFAULT_NODE_HTTP_TIMEOUT: Duration = Duration::from_secs(240);
|
|
|
|
|
|
|
|
|
|
/// Default node HTTP timeout when probing NodePort endpoints.
|
|
|
|
|
pub const DEFAULT_NODE_HTTP_PROBE_TIMEOUT: Duration = Duration::from_secs(30);
|
|
|
|
|
|
|
|
|
|
/// Default Kubernetes deployment readiness timeout.
|
|
|
|
|
pub const DEFAULT_K8S_DEPLOYMENT_TIMEOUT: Duration = Duration::from_secs(180);
|
|
|
|
|
|
|
|
|
|
/// Default Prometheus HTTP port.
|
|
|
|
|
pub const DEFAULT_PROMETHEUS_HTTP_PORT: u16 = 9090;
|
|
|
|
|
|
|
|
|
|
/// Default Prometheus HTTP timeout.
|
|
|
|
|
pub const DEFAULT_PROMETHEUS_HTTP_TIMEOUT: Duration = Duration::from_secs(240);
|
|
|
|
|
|
|
|
|
|
/// Default Prometheus HTTP probe timeout for NodePort checks.
|
|
|
|
|
pub const DEFAULT_PROMETHEUS_HTTP_PROBE_TIMEOUT: Duration = Duration::from_secs(30);
|
|
|
|
|
|
|
|
|
|
/// Default Prometheus service name.
|
|
|
|
|
pub const DEFAULT_PROMETHEUS_SERVICE_NAME: &str = "prometheus";
|
|
|
|
|
|
2025-12-09 17:45:10 +01:00
|
|
|
/// Resolve cfgsync port from `NOMOS_CFGSYNC_PORT`, falling back to the default.
|
|
|
|
|
pub fn cfgsync_port() -> u16 {
|
|
|
|
|
env::var("NOMOS_CFGSYNC_PORT")
|
|
|
|
|
.ok()
|
|
|
|
|
.and_then(|v| v.parse::<u16>().ok())
|
|
|
|
|
.unwrap_or(DEFAULT_CFGSYNC_PORT)
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/// Resolve container KZG path from `NOMOS_KZG_CONTAINER_PATH`, falling back to
|
|
|
|
|
/// the default.
|
|
|
|
|
pub fn kzg_container_path() -> String {
|
|
|
|
|
env::var("NOMOS_KZG_CONTAINER_PATH").unwrap_or_else(|_| DEFAULT_KZG_CONTAINER_PATH.to_string())
|
|
|
|
|
}
|