Skip to content

Commit 2c76d3a

Browse files
committed
DPL MCP: local file support for sidecar and alikes
1 parent 630c8fb commit 2c76d3a

1 file changed

Lines changed: 8 additions & 0 deletions

File tree

Framework/Core/scripts/hyperloop-perf-server/hl_common.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,14 @@ async def fetch_bytes(url: str, proxy_token: str = "", token: str = "") -> bytes
3232
then HYPERLOOP_TOKEN, then ``token``.
3333
token: Hyperloop auth token fallback.
3434
"""
35+
# Local file (a path or a file:// URL) — read directly, no HTTP. Lets a
36+
# locally-generated side-car (igprof-demangle-symbols output) be attached
37+
# via load_igprof(sidecar_url=/path/to/...syms.gz) without a web server.
38+
if url.startswith("file://") or os.path.isfile(url):
39+
path = url[len("file://"):] if url.startswith("file://") else url
40+
with open(path, "rb") as f:
41+
return f.read()
42+
3543
proxy_token = (
3644
proxy_token
3745
or os.environ.get("PROXY_TOKEN", "")

0 commit comments

Comments
 (0)