Skip to content

Commit 281be18

Browse files
committed
Use BACKENDS_WITH_GROUP_PROVISIONING_SUPPORT
1 parent 3323c05 commit 281be18

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/dstack/_internal/core/backends/features.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from dstack._internal.core.backends.base.compute import (
22
ComputeWithCreateInstanceSupport,
33
ComputeWithGatewaySupport,
4+
ComputeWithGroupProvisioningSupport,
45
ComputeWithMultinodeSupport,
56
ComputeWithPlacementGroupSupport,
67
ComputeWithPrivateGatewaySupport,
@@ -39,6 +40,10 @@ def _get_backends_with_compute_feature(
3940
configurator_classes=_configurator_classes,
4041
compute_feature_class=ComputeWithCreateInstanceSupport,
4142
)
43+
BACKENDS_WITH_GROUP_PROVISIONING_SUPPORT = _get_backends_with_compute_feature(
44+
configurator_classes=_configurator_classes,
45+
compute_feature_class=ComputeWithGroupProvisioningSupport,
46+
)
4247
BACKENDS_WITH_PRIVILEGED_SUPPORT = _get_backends_with_compute_feature(
4348
configurator_classes=_configurator_classes,
4449
compute_feature_class=ComputeWithPrivilegedSupport,

src/dstack/_internal/server/background/tasks/process_submitted_jobs.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
ComputeWithVolumeSupport,
1616
)
1717
from dstack._internal.core.backends.base.models import JobConfiguration
18+
from dstack._internal.core.backends.features import BACKENDS_WITH_GROUP_PROVISIONING_SUPPORT
1819
from dstack._internal.core.errors import BackendError, ServerClientError
1920
from dstack._internal.core.models.common import NetworkMode
2021
from dstack._internal.core.models.compute_groups import ComputeGroupProvisioningData
@@ -852,7 +853,8 @@ async def _run_jobs_on_new_instances(
852853
job_configurations = [JobConfiguration(job=j, volumes=offer_volumes) for j in jobs]
853854
compute = backend.compute()
854855
try:
855-
if len(jobs) > 1 and isinstance(compute, ComputeWithGroupProvisioningSupport):
856+
if len(jobs) > 1 and offer.backend in BACKENDS_WITH_GROUP_PROVISIONING_SUPPORT:
857+
assert isinstance(compute, ComputeWithGroupProvisioningSupport)
856858
cgpd = await common_utils.run_async(
857859
compute.run_jobs,
858860
run,

0 commit comments

Comments
 (0)