8000 [Autoscaler] Refactor bin packing routines in autoscaler for code clarity · Issue #12723 · ray-project/ray · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
[Autoscaler] Refactor bin packing routines in autoscaler for code clarity #12723
Open
@ericl

Description

@ericl

Describe your feature request

Currently, the autoscaler code is quite difficult to read since it directly manipulates resources dicts, cluster load dicts, individual node ids directly. This results in a lot of low level code in the main loop of the autoscaler / resource demand scheduler classes. We can extract some of this generic resource manipulation code into a utility class, for instance,

# Calculate nodes to launch
ec = bin_pack.EmulatedCluster(node_type_config, cur_nodes, cur_resource_usage)
ec.apply_min_worker_constraint(min_worker_config)
ec.apply_resource_demands(resource_bundle_demands)
nodes_to_launch = ec.get_nodes_to_launch(cur_pending_nodes)

# Calculate nodes to keep
ec = bin_pack.EmulatedCluster(node_type_config, cur_nodes, cur_resource_usage)
ec.apply_min_worker_constraint(min_worker_config)
ec.apply_resource_demands(request_resource_demands)
allowed_to_terminate = ec.get_unused_nodes()

cc @AmeerHajAli @wuisawesome

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issue, but not time-criticalenhancementRequest for new feature and/or capabilityinfraautoscaler, ray client, kuberay, related issuespending-cleanupThis issue is pending cleanup. It will be removed in 2 weeks after being assigned.

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      0