Skip to content

Commit 1c9eabe

Browse files
committed
Forbid scheduled services with autoscaling
1 parent ef90ddf commit 1c9eabe

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

  • src/dstack/_internal/server/services

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

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -979,6 +979,12 @@ def _validate_run_spec_and_set_defaults(run_spec: RunSpec):
979979
raise ServerClientError(
980980
f"Maximum utilization_policy.time_window is {settings.SERVER_METRICS_RUNNING_TTL_SECONDS}s"
981981
)
982+
if (
983+
run_spec.merged_profile.schedule
984+
and run_spec.configuration.type == "service"
985+
and run_spec.configuration.replicas.min == 0
986+
):
987+
raise ServerClientError("Scheduled services with autoscaling to zero are not supported")
982988
if run_spec.configuration.priority is None:
983989
run_spec.configuration.priority = RUN_PRIORITY_DEFAULT
984990
set_resources_defaults(run_spec.configuration.resources)

0 commit comments

Comments
 (0)