From 7fa06711a6a0ae1e49c6362d1a90bdf43a2e5849 Mon Sep 17 00:00:00 2001 From: Minh Vu Date: Sat, 6 Jun 2026 19:17:20 +0200 Subject: [PATCH] Accept remote telemetry container aliases --- src/srtctl/core/validation.py | 7 +++++++ tests/test_validation.py | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/src/srtctl/core/validation.py b/src/srtctl/core/validation.py index 63deff81c..34ce0883e 100644 --- a/src/srtctl/core/validation.py +++ b/src/srtctl/core/validation.py @@ -92,6 +92,10 @@ def _check_path(path_str: str, *, expect: str) -> tuple[bool, str]: return True, f"exists: {path}" +def _is_container_uri(value: Any) -> bool: + return isinstance(value, str) and not value.startswith(("/", "./")) and ":" in value + + def _preflight_model( raw_config: dict[str, Any], resolved_config: dict[str, Any], @@ -300,6 +304,9 @@ def _preflight_telemetry( if not resolved_value: continue # schema-level validator handles required-when-enabled + if _is_container_uri(resolved_value): + continue + ok, _ = _check_path(_expand_path(resolved_value), expect="file") if ok: continue diff --git a/tests/test_validation.py b/tests/test_validation.py index df0c6201c..86448b785 100644 --- a/tests/test_validation.py +++ b/tests/test_validation.py @@ -506,6 +506,41 @@ def test_telemetry_aliases_resolve_and_pass_when_files_exist(self, tmp_path): assert results[0].ok is True assert results[0].errors == [] + def test_telemetry_accepts_alias_resolving_to_remote_image(self, tmp_path): + model_dir = tmp_path / "model" + model_dir.mkdir() + container_file = tmp_path / "container.sqsh" + container_file.write_text("sqsh") + scraper_file = tmp_path / "scraper.sqsh" + scraper_file.write_text("sqsh") + node_file = tmp_path / "node.sqsh" + node_file.write_text("sqsh") + + results = preflight_config_variants( + { + "name": "telemetry-remote-image", + "model": {"path": str(model_dir), "container": str(container_file), "precision": "bf16"}, + "resources": { + "gpu_type": "gb200", + "gpus_per_node": 4, + "prefill_nodes": 1, + "decode_nodes": 1, + "prefill_workers": 1, + "decode_workers": 1, + }, + "telemetry": { + "enabled": True, + "container_image": str(scraper_file), + "dcgm_exporter": {"container_image": "dcgm-exporter", "port": 9401}, + "node_exporter": {"container_image": str(node_file), "port": 9101}, + }, + }, + cluster_config={"containers": {"dcgm-exporter": "nvcr.io/nvidia/k8s/dcgm-exporter:latest"}}, + ) + + assert results[0].ok is True + assert results[0].errors == [] + def test_telemetry_missing_sqsh_fails_preflight(self, tmp_path): model_dir = tmp_path / "model" model_dir.mkdir()