Skip to content

Commit 0f9417b

Browse files
committed
Fixes after review
1 parent 1290743 commit 0f9417b

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

contributing/BACKENDS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ Refer to examples:
118118

119119
Under the backend directory you've created, create the `compute.py` file and define the
120120
backend compute class that extends the `dstack._internal.core.backends.base.compute.Compute` class.
121-
It can also extend and implement `ComputeWith*` classes to support additional features such as fleets, volumes, gateways, placement groups, etc.
121+
It can also extend and implement `ComputeWith*` classes to support additional features such as fleets, volumes, gateways, placement groups, etc. For example, it should extend `ComputeWithCreateInstanceSupport` to support fleets.
122122

123123
Refer to examples:
124124
[datacrunch](https://github.com/dstackai/dstack/blob/master/src/dstack/_internal/core/backends/datacrunch/compute.py),

src/dstack/_internal/server/services/backends/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -369,7 +369,7 @@ async def get_instance_offers(
369369
return sorted(offers, key=lambda i: not i[1].availability.is_available())
370370

371371

372-
def check_backed_type_available(backend_type: BackendType):
372+
def check_backend_type_available(backend_type: BackendType):
373373
if backend_type not in list_available_backend_types():
374374
raise BackendNotAvailable(
375375
f"Backend {backend_type.value} not available."

src/dstack/_internal/server/services/gateways/__init__.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
from dstack._internal.server.db import get_db
4040
from dstack._internal.server.models import GatewayComputeModel, GatewayModel, ProjectModel
4141
from dstack._internal.server.services.backends import (
42-
check_backed_type_available,
42+
check_backend_type_available,
4343
get_project_backend_by_type_or_error,
4444
get_project_backend_with_model_by_type_or_error,
4545
)
@@ -538,7 +538,7 @@ def gateway_model_to_gateway(gateway_model: GatewayModel) -> Gateway:
538538

539539

540540
def _validate_gateway_configuration(configuration: GatewayConfiguration):
541-
check_backed_type_available(configuration.backend)
541+
check_backend_type_available(configuration.backend)
542542
if configuration.backend not in BACKENDS_WITH_GATEWAY_SUPPORT:
543543
raise ServerClientError(
544544
f"Gateways are not supported for {configuration.backend.value} backend."

src/dstack/_internal/server/services/volumes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -376,7 +376,7 @@ async def generate_volume_name(session: AsyncSession, project: ProjectModel) ->
376376
def _validate_volume_configuration(configuration: VolumeConfiguration):
377377
if configuration.volume_id is None and configuration.size is None:
378378
raise ServerClientError("Volume must specify either volume_id or size")
379-
backends_services.check_backed_type_available(configuration.backend)
379+
backends_services.check_backend_type_available(configuration.backend)
380380
if configuration.backend not in BACKENDS_WITH_VOLUMES_SUPPORT:
381381
raise ServerClientError(
382382
f"Volumes are not supported for {configuration.backend.value} backend."

0 commit comments

Comments
 (0)