Skip to content

Commit 85e0b47

Browse files
authored
Restore fleet termination_policy for 0.18 backward compatibility (#2436)
1 parent 4a94ddf commit 85e0b47

File tree

2 files changed

+8
-1
lines changed

2 files changed

+8
-1
lines changed

src/dstack/_internal/core/models/fleets.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
ProfileParams,
1717
ProfileRetry,
1818
SpotPolicy,
19+
TerminationPolicy,
1920
parse_idle_duration,
2021
)
2122
from dstack._internal.core.models.resources import Range, ResourcesSpec
@@ -223,9 +224,15 @@ class InstanceGroupParams(CoreModel):
223224
),
224225
] = None
225226

227+
# Deprecated and unused. Left for compatibility with 0.18 clients.
228+
termination_policy: Annotated[Optional[TerminationPolicy], Field(exclude=True)] = None
229+
termination_idle_time: Annotated[Optional[Union[str, int]], Field(exclude=True)] = None
230+
226231
class Config:
227232
@staticmethod
228233
def schema_extra(schema: Dict[str, Any], model: Type):
234+
del schema["properties"]["termination_policy"]
235+
del schema["properties"]["termination_idle_time"]
229236
add_extra_schema_types(
230237
schema["properties"]["nodes"],
231238
extra_types=[{"type": "integer"}, {"type": "string"}],

src/dstack/_internal/core/models/profiles.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -241,7 +241,7 @@ class ProfileParams(CoreModel):
241241
Field(description="Run termination policy based on utilization"),
242242
] = None
243243

244-
# # Deprecated and unused. Left for compatibility with 0.18 clients.
244+
# Deprecated and unused. Left for compatibility with 0.18 clients.
245245
pool_name: Annotated[Optional[str], Field(exclude=True)] = None
246246
instance_name: Annotated[Optional[str], Field(exclude=True)] = None
247247
retry_policy: Annotated[Optional[ProfileRetryPolicy], Field(exclude=True)] = None

0 commit comments

Comments
 (0)