Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "[autoscaler] Better validation for min_workers and max_workers " #13807

Merged
merged 1 commit into from
Jan 29, 2021
Merged
Show file tree
Hide file tree
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
Revert "[autoscaler] Better validation for min_workers and max_workers (
#13779)"

This reverts commit 4d6817c.
  • Loading branch information
simon-mo authored Jan 29, 2021
commit 384fc1fdf6a148bf04a60eb0fa940d7bee0c4e83
8 changes: 0 additions & 8 deletions python/ray/autoscaler/_private/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,14 +86,6 @@ def validate_config(config: Dict[str, Any]) -> None:
raise ValueError(
"`head_node_type` must be one of `available_node_types`.")

sum_min_workers = sum(
config["available_node_types"][node_type].get("min_workers", 0)
for node_type in config["available_node_types"])
if sum_min_workers > config["max_workers"]:
raise ValueError(
"The specified global `max_workers` is smaller than the "
"sum of `min_workers` of all the available node types.")


def prepare_config(config):
with_defaults = fillout_defaults(config)
Expand Down
25 changes: 0 additions & 25 deletions python/ray/tests/test_autoscaler_yaml.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,31 +45,6 @@ def testValidateDefaultConfig(self):
except Exception:
self.fail("Config did not pass validation test!")

def testValidateDefaultConfigMinMaxWorkers(self):
aws_config_path = os.path.join(
RAY_PATH, "autoscaler/aws/example-multi-node-type.yaml")
with open(aws_config_path) as f:
config = yaml.safe_load(f)
config = prepare_config(config)
for node_type in config["available_node_types"]:
config["available_node_types"][node_type]["resources"] = config[
"available_node_types"][node_type].get("resources", {})
try:
validate_config(config)
except Exception:
self.fail("Config did not pass validation test!")

config["max_workers"] = 0 # the sum of min_workers is 1.
with pytest.raises(ValueError):
validate_config(config)

# make sure edge case of exactly 1 passes too.
config["max_workers"] = 1
try:
validate_config(config)
except Exception:
self.fail("Config did not pass validation test!")

@pytest.mark.skipif(
sys.platform.startswith("win"),
reason="TODO(ameer): fails on Windows.")
Expand Down