Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions src/srtctl/core/validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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],
Expand Down Expand Up @@ -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
Expand Down
35 changes: 35 additions & 0 deletions tests/test_validation.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down