Skip to content

Commit a510369

Browse files
authored
Support the local backend with the in-server proxy (#2858)
Fix this error when requesting a service running on the local backend and served by the in-server proxy: ```python File "/dstack/src/dstack/_internal/proxy/lib/services/service_connection.py", line 82, in open await self._tunnel.aopen() File "/dstack/src/dstack/_internal/core/services/ssh/tunnel.py", line 204, in aopen raise get_ssh_error(stderr) dstack._internal.core.errors.SSHError: Connection closed by UNKNOWN port 65535 ``` If the replica runs on the local backend, connect directly to the container, without proxy jumping through the shim host. Similar to workarounds in `SSHAttach` and `runner_ssh_tunnel`.
1 parent c876047 commit a510369

File tree

1 file changed

+3
-0
lines changed
  • src/dstack/_internal/server/services/proxy

1 file changed

+3
-0
lines changed

src/dstack/_internal/server/services/proxy/repo.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
import dstack._internal.server.services.jobs as jobs_services
99
from dstack._internal.core.consts import DSTACK_RUNNER_SSH_PORT
10+
from dstack._internal.core.models.backends.base import BackendType
1011
from dstack._internal.core.models.configurations import ServiceConfiguration
1112
from dstack._internal.core.models.instances import RemoteConnectionInfo, SSHConnectionParams
1213
from dstack._internal.core.models.runs import (
@@ -86,6 +87,8 @@ async def get_service(self, project_name: str, run_name: str) -> Optional[Servic
8687
username=jpd.username,
8788
port=jpd.ssh_port,
8889
)
90+
if jpd.backend == BackendType.LOCAL:
91+
ssh_proxy = None
8992
ssh_head_proxy: Optional[SSHConnectionParams] = None
9093
ssh_head_proxy_private_key: Optional[str] = None
9194
instance = get_or_error(job.instance)

0 commit comments

Comments
 (0)