File tree Expand file tree Collapse file tree 1 file changed +2
-11
lines changed
src/dstack/_internal/server/services/runs Expand file tree Collapse file tree 1 file changed +2
-11
lines changed Original file line number Diff line number Diff line change 55 ServiceConfiguration ,
66)
77from dstack ._internal .core .models .repos .virtual import DEFAULT_VIRTUAL_REPO_ID , VirtualRunRepoData
8- from dstack ._internal .core .models .resources import ResourcesSpec
98from dstack ._internal .core .models .runs import LEGACY_REPO_DIR , AnyRunConfiguration , RunSpec
109from dstack ._internal .core .models .volumes import InstanceMountPoint
1110from dstack ._internal .core .services import validate_dstack_resource_name
@@ -113,18 +112,10 @@ def validate_run_spec_and_set_defaults(
113112 raise ServerClientError (
114113 f"Probe timeout cannot be longer than { settings .MAX_PROBE_TIMEOUT } s"
115114 )
116- if isinstance (run_spec .configuration .replicas , list ):
117- default_resources = ResourcesSpec ()
118- if (
119- run_spec .configuration .resources
120- and run_spec .configuration .resources .dict () != default_resources .dict ()
121- ):
122- raise ServerClientError (
123- "Top-level `resources` is not allowed when `replicas` is a list. "
124- "Specify `resources` in each replica group instead."
125- )
126115 if run_spec .configuration .priority is None :
127116 run_spec .configuration .priority = RUN_PRIORITY_DEFAULT
117+ # We do not reject top-level `resources` when `replicas` is a list. Adding strict checks
118+ # would be fragile because the spec may be changed later (for example by plugins).
128119 set_resources_defaults (run_spec .configuration .resources )
129120 set_gpu_vendor_default (
130121 run_spec .configuration .resources ,
You can’t perform that action at this time.
0 commit comments