MCPcopy Create free account
hub / github.com/ScaleML/AgentSPEX / ensure_runtime_dirs

Function ensure_runtime_dirs

src/harness/paths.py:178–191  ·  view source on GitHub ↗

Create the runtime directories and export env vars for subprocesses. Idempotent. Safe to call from any entry point before path-dependent work. Exports ``HOST_WORKSPACE`` and ``WORKSPACE_PERSISTENT`` so Docker containers and shell scripts spawned by the current process see the same absol

()

Source from the content-addressed store, hash-verified

176
177
178def ensure_runtime_dirs() -> None:
179 """Create the runtime directories and export env vars for subprocesses.
180
181 Idempotent. Safe to call from any entry point before path-dependent work.
182 Exports ``HOST_WORKSPACE`` and ``WORKSPACE_PERSISTENT`` so Docker containers
183 and shell scripts spawned by the current process see the same absolute
184 paths Python is using.
185 """
186 ws = host_workspace()
187 wp = workspace_persistent()
188 ws.mkdir(parents=True, exist_ok=True)
189 (wp / "outputs").mkdir(parents=True, exist_ok=True)
190 os.environ.setdefault("HOST_WORKSPACE", str(ws))
191 os.environ.setdefault("WORKSPACE_PERSISTENT", str(wp))

Callers 6

mainFunction · 0.90
runMethod · 0.90
mainFunction · 0.90
run_loopFunction · 0.90
mainFunction · 0.90
init_run_envFunction · 0.85

Calls 2

host_workspaceFunction · 0.85
workspace_persistentFunction · 0.85

Tested by

no test coverage detected