Skip to content

Commit 48c0e96

Browse files
authored
Fix Internal Server Error in services w/o gateways (#2225)
1 parent f148a3e commit 48c0e96

File tree

1 file changed

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

1 file changed

+5
-0
lines changed

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

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
from sqlalchemy.ext.asyncio import AsyncSession
66
from sqlalchemy.orm import joinedload
77

8+
import dstack._internal.server.services.jobs as jobs_services
89
from dstack._internal.core.consts import DSTACK_RUNNER_SSH_PORT
910
from dstack._internal.core.models.common import is_core_model_instance
1011
from dstack._internal.core.models.configurations import ServiceConfiguration
@@ -73,6 +74,10 @@ async def get_service(self, project_name: str, run_name: str) -> Optional[Servic
7374
else:
7475
ssh_destination = "root@localhost" # TODO(#1535): support non-root images properly
7576
ssh_port = DSTACK_RUNNER_SSH_PORT
77+
job_submission = jobs_services.job_model_to_job_submission(job)
78+
jrd = job_submission.job_runtime_data
79+
if jrd is not None and jrd.ports is not None:
80+
ssh_port = jrd.ports.get(ssh_port, ssh_port)
7681
ssh_proxy = SSHConnectionParams(
7782
hostname=jpd.hostname,
7883
username=jpd.username,

0 commit comments

Comments
 (0)