Skip to content
Merged
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
12 changes: 11 additions & 1 deletion src/dstack/_internal/core/models/configurations.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
Field,
GetCoreSchemaHandler,
RootModel,
Tag,
ValidationError,
ValidationInfo,
conint,
Expand Down Expand Up @@ -1046,7 +1047,16 @@ class ServiceConfigurationParams(CoreModel):
] = None # None = omitted (may get default when model is set); [] = explicit empty

replicas: Annotated[
Optional[Union[List[ReplicaGroup], Range[int]]],
Optional[
# `Tag` only names the arm in validation errors. Without it the `loc` of a bad
# `replicas` spells out the whole wrapped schema —
# `service.replicas.list[function-after[validate_scaling(), ReplicaGroup]].0` — which
# is what `dstack apply` shows the user.
Union[
Annotated[list[ReplicaGroup], Tag("ReplicaGroup")],
Annotated[Range[int], Tag("Range[int]")],
]
],
Field(
description=(
"The number of replicas or a list of replica groups. "
Expand Down
Loading