[autoscaler] Also account for head node resources in multi node type autoscaling (#10230)

This commit is contained in:
Eric Liang
2020-08-24 10:26:22 -07:00
committed by GitHub
parent f051c2852e
commit 4761eacc3e
2 changed files with 51 additions and 9 deletions
+4 -4
View File
@@ -198,12 +198,12 @@ class StandardAutoscaler:
# First let the resource demand scheduler launch nodes, if enabled.
if self.resource_demand_scheduler and self.resource_demand_vector:
# TODO(ekl) include head node in the node list
instances = (self.resource_demand_scheduler.get_nodes_to_launch(
nodes, self.pending_launches.breakdown(),
to_launch = (self.resource_demand_scheduler.get_nodes_to_launch(
self.provider.non_terminated_nodes(tag_filters={}),
self.pending_launches.breakdown(),
self.resource_demand_vector))
# TODO(ekl) also enforce max launch concurrency here?
for node_type, count in instances:
for node_type, count in to_launch:
self.launch_new_node(count, node_type=node_type)
# Launch additional nodes of the default type, if still needed.