fix(runtime): stage extra-file bind mounts under the temp dir so remote docker daemons can resolve them

This commit is contained in:
Ahmed Allam
2026-08-31 18:19:50 +00:00
committed by Ahmed Allam
parent 1df67c52e2
commit eeca404716
2 changed files with 32 additions and 3 deletions

View File

@@ -2,6 +2,7 @@
from __future__ import annotations
import tempfile
from pathlib import Path
from typing import Any
@@ -18,6 +19,7 @@ from strix.runtime.session_manager import (
build_extra_file_bind_mounts,
build_extra_file_entries,
build_manifest_entries,
extra_file_staging_dir,
)
@@ -319,6 +321,21 @@ def test_extra_file_bind_mounts_avoid_basename_collisions(tmp_path: Path) -> Non
assert mounts[0]["source"] != mounts[1]["source"]
def test_extra_file_staging_lives_under_the_temp_dir_not_the_run_dir() -> None:
staging = extra_file_staging_dir("clients-release-evisort-dev_86b7")
assert staging.is_dir()
assert staging.is_relative_to(Path(tempfile.gettempdir()))
assert "strix_runs" not in staging.parts
def test_extra_file_staging_dir_sanitizes_the_scan_id() -> None:
staging = extra_file_staging_dir("../weird id/../")
assert staging.is_dir()
assert staging.is_relative_to(Path(tempfile.gettempdir()))
def test_only_bind_mount_capable_backends_are_registered_as_such() -> None:
assert backend_supports_bind_mounts("docker")
assert not backend_supports_bind_mounts("e2b")