Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions runner/docs/shim.openapi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ openapi: 3.1.2

info:
title: dstack-shim API
version: v2/0.20.30
version: v2/0.21.0
x-logo:
url: https://avatars.githubusercontent.com/u/54146142?s=260
description: >
Expand Down Expand Up @@ -90,7 +90,7 @@ paths:
get:
summary: Get instance info
description: >
(since [0.20.30](https://github.com/dstackai/dstack/releases/tag/0.20.30))
(since [0.21.0](https://github.com/dstackai/dstack/releases/tag/0.21.0))
Returns facts about the host observed by shim, e.g., the GPU driver version.
Unlike `/components`, the reported entities are not managed by shim.
tags: [Instance]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -835,8 +835,8 @@ def _is_legacy_aws_acm_gateway_with_pending_migration(gateway_model: GatewayMode
and gateway_model.hostname is None
):
logger.warning(
"Found AWS ACM gateway %s without a hostname, which should indicate a pre-0.20.30"
" gateway not yet migrated to the 0.20.30 format. Waiting for the gateway pipeline to"
"Found AWS ACM gateway %s without a hostname, which should indicate a pre-0.21.0"
" gateway not yet migrated to the 0.21.0 format. Waiting for the gateway pipeline to"
" perform the migration",
gateway_model.id,
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ async def fetch(self, limit: int) -> list[GatewayPipelineItem]:
GatewayModel.replica_scale_attempt > 0,
),
),
# fetch pre-0.20.30 AWS ACM gateways to migrate their hostname
# fetch pre-0.21.0 AWS ACM gateways to migrate their hostname
# and backend_data onto GatewayModel
and_(
GatewayModel.hostname.is_(None),
Expand Down Expand Up @@ -737,7 +737,7 @@ def _reconcile_gateway_replica_count(
gateway_replicas: list[GatewayComputeModel],
) -> _ReplicaScalingResult:
desired_replica_count = gateway_model.desired_replica_count
if desired_replica_count is None: # pre-0.20.30 gateway
if desired_replica_count is None: # pre-0.21.0 gateway
if gateway_model.status != GatewayStatus.SUBMITTED:
return _ReplicaScalingResult()
desired_replica_count = gateways_services.get_gateway_configuration(gateway_model).replicas
Expand Down Expand Up @@ -891,7 +891,7 @@ def _migrate_hostname_and_backend_data_from_legacy_replica(
gateway_computes: list[GatewayComputeModel],
) -> _GatewayUpdateMap:
"""
Move `hostname` and `backend_data` from pre-0.20.30 GatewayComputeModel onto GatewayModel.
Move `hostname` and `backend_data` from pre-0.21.0 GatewayComputeModel onto GatewayModel.

Alembic migration ecc9e8a0bfac does the same thing. This function is a fallback in case any
gateways are created by an older server replica after the migration passes.
Expand All @@ -902,7 +902,7 @@ def _migrate_hostname_and_backend_data_from_legacy_replica(
if gateway_compute.hostname_deprecated_readonly is not None:
update_map: _GatewayUpdateMap = {
"hostname": gateway_compute.hostname_deprecated_readonly,
# Pre-0.20.30 AWS ACM gateways used GatewayComputeModel.backend_data exclusively
# Pre-0.21.0 AWS ACM gateways used GatewayComputeModel.backend_data exclusively
# for load-balancer related fields, and not for gateway replica instance fields.
# So GatewayComputeModel.backend_data is copied entirely.
"backend_data": gateway_compute.backend_data,
Expand Down
4 changes: 2 additions & 2 deletions src/dstack/_internal/server/models.py
Original file line number Diff line number Diff line change
Expand Up @@ -613,7 +613,7 @@ class GatewayModel(PipelineModelMixin, BaseModel):
status: Mapped[GatewayStatus] = mapped_column(EnumAsString(GatewayStatus, 100))
status_message: Mapped[Optional[str]] = mapped_column(Text)
desired_replica_count: Mapped[Optional[int]] = mapped_column(Integer)
"""Only `None` for pre-0.20.30 gateways that were never scaled"""
"""Only `None` for pre-0.21.0 gateways that were never scaled"""
replica_scale_attempt: Mapped[int] = mapped_column(Integer, server_default="0")
last_replica_scale_attempt_at: Mapped[Optional[datetime]] = mapped_column(NaiveDateTime)
last_update_at: Mapped[Optional[datetime]] = mapped_column(NaiveDateTime)
Expand Down Expand Up @@ -690,7 +690,7 @@ class GatewayComputeModel(PipelineModelMixin, BaseModel):
**TODO**: rename.
"""
hostname_deprecated_readonly: Mapped[Optional[str]] = mapped_column("hostname", String(100))
"""Replaced by GatewayModel.hostname since 0.20.30"""
"""Replaced by GatewayModel.hostname since 0.21.0"""
configuration: Mapped[Optional[str]] = mapped_column(Text)
"""`configuration` is optional for compatibility with pre-0.18.2 gateways.
Use `get_gateway_compute_configuration` to construct `configuration` for old gateways.
Expand Down
2 changes: 1 addition & 1 deletion src/tests/_internal/server/services/runner/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -638,7 +638,7 @@ def test_gpu_driver(self):


class TestShimClientGetInstanceInfo(BaseShimClientTest):
@pytest.mark.shim_version("0.20.30")
@pytest.mark.shim_version("0.21.0")
def test_returns_instance_info(self, adapter: requests_mock.Adapter, client: ShimClient):
adapter.register_uri(
"GET",
Expand Down
Loading