mirror of
https://github.com/wassname/ray.git
synced 2026-08-08 11:25:28 +08:00
[autoscaler] Refactor multi node type autoscaler config (#10190)
This commit is contained in:
@@ -70,6 +70,22 @@ def validate_config(config: Dict[str, Any]) -> None:
|
||||
"machine and make sure the versions match.".format(
|
||||
ray_version=ray.__version__))
|
||||
|
||||
if "available_node_types" in config:
|
||||
if "head_node_type" not in config:
|
||||
raise ValueError(
|
||||
"You must specify `head_node_type` if `available_node_types "
|
||||
"is set.")
|
||||
if config["head_node_type"] not in config["available_node_types"]:
|
||||
raise ValueError(
|
||||
"`head_node_type` must be one of `available_node_types`.")
|
||||
if "worker_default_node_type" not in config:
|
||||
raise ValueError("You must specify `worker_default_node_type` if "
|
||||
"`available_node_types is set.")
|
||||
if (config["worker_default_node_type"] not in config[
|
||||
"available_node_types"]):
|
||||
raise ValueError("`worker_default_node_type` must be one of "
|
||||
"`available_node_types`.")
|
||||
|
||||
|
||||
def prepare_config(config):
|
||||
with_defaults = fillout_defaults(config)
|
||||
|
||||
Reference in New Issue
Block a user