Skip to content

Commit

Permalink
Fix volume attachment with dstack backend (#2175)
Browse files Browse the repository at this point in the history
Fixes: #2172
See: #2172
See: #1682
  • Loading branch information
un-def authored Jan 6, 2025
1 parent edec92d commit 163298e
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -546,7 +546,7 @@ async def _attach_volumes(
volume = volume_model_to_volume(volume_model)
try:
if (
job_provisioning_data.backend != volume.configuration.backend
job_provisioning_data.get_base_backend() != volume.configuration.backend
or job_provisioning_data.region != volume.configuration.region
):
continue
Expand Down
2 changes: 2 additions & 0 deletions src/dstack/_internal/server/services/jobs/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ def job_model_to_job_submission(job_model: JobModel) -> JobSubmission:
job_provisioning_data.instance_type.resources.description = (
job_provisioning_data.instance_type.resources.pretty_format()
)
# TODO do we really still need this magic? See https://github.com/dstackai/dstack/pull/1682
# i.e., replacing `jpd.backend` with `jpd.get_base_backend()` should give the same result
if (
job_provisioning_data.backend == BackendType.DSTACK
and job_provisioning_data.backend_data is not None
Expand Down
2 changes: 1 addition & 1 deletion src/dstack/_internal/server/services/runs.py
Original file line number Diff line number Diff line change
Expand Up @@ -844,7 +844,7 @@ def get_job_mount_point_volume(
"""
for volume in volumes:
if (
volume.configuration.backend != job_provisioning_data.backend
volume.configuration.backend != job_provisioning_data.get_base_backend()
or volume.configuration.region != job_provisioning_data.region
):
continue
Expand Down

0 comments on commit 163298e

Please sign in to comment.