| 66 | |
| 67 | |
| 68 | def 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 | |
| 87 | def emit_deprecation_warning(message: str, stacklevel: int = 2) -> None: |