Skip to content

Commit

Permalink
Fix Internal Server Error in services w/o gateways (#2225)
Browse files Browse the repository at this point in the history
  • Loading branch information
jvstme authored Jan 24, 2025
1 parent f148a3e commit 48c0e96
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/dstack/_internal/server/services/proxy/repo.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
from sqlalchemy.ext.asyncio import AsyncSession
from sqlalchemy.orm import joinedload

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

0 comments on commit 48c0e96

Please sign in to comment.