MCPcopy Create free account
hub / github.com/Dstack-TEE/dstack / get_tappd_endpoint

Function get_tappd_endpoint

sdk/python/src/dstack_sdk/dstack_client.py:68–84  ·  view source on GitHub ↗
(endpoint: str | None = None)

Source from the content-addressed store, hash-verified

66
67
68def get_tappd_endpoint(endpoint: str | None = None) -> str:
69 if endpoint:
70 return endpoint
71 if "TAPPD_SIMULATOR_ENDPOINT" in os.environ:
72 logger.info(f"Using tappd endpoint: {os.environ['TAPPD_SIMULATOR_ENDPOINT']}")
73 return os.environ["TAPPD_SIMULATOR_ENDPOINT"]
74 # Try paths in order: legacy paths first, then namespaced paths
75 socket_paths = [
76 "/var/run/tappd.sock",
77 "/run/tappd.sock",
78 "/var/run/dstack/tappd.sock",
79 "/run/dstack/tappd.sock",
80 ]
81 for path in socket_paths:
82 if os.path.exists(path):
83 return path
84 return socket_paths[0]
85
86
87def emit_deprecation_warning(message: str, stacklevel: int = 2) -> None:

Callers 2

__init__Method · 0.70
__init__Method · 0.70

Calls 1

infoMethod · 0.45

Tested by

no test coverage detected