python/ray/autoscaler/_private/kuberay/autoscaling_config.py
def _node_type_from_group_spec(
    group_spec: Dict[str, Any], is_head: bool
) -> Dict[str, Any]:
    """Converts CR group spec to autoscaler node type."""
    if is_head:
        # The head node type has no workers because the head is not a worker.
        min_workers = max_workers = 0
    else:
        # `minReplicas` and `maxReplicas` are required fields for each workerGroupSpec
        min_workers = group_spec["minReplicas"]
        max_workers = group_spec["maxReplicas"]

    resources = _get_ray_resources_from_group_spec(group_spec, is_head)

    return {
        "min_workers": min_workers,
        "max_workers": max_workers,
        # `node_config` is a legacy field required for compatibility.
        # Pod config data is required by the operator but not by the autoscaler.
        "node_config": {},
        "resources": resources,
    }
Converts CR group spec to autoscaler node type.
Converts CR group spec to autoscaler node type.
Converts CR group spec to autoscaler node type .
def _node_type_from_group_spec(
    group_spec: Dict[str, Any], is_head: bool
) -> Dict[str, Any]:
    if is_head:
        min_workers = max_workers = 0
    else:
        min_workers = group_spec["minReplicas"]
        max_workers = group_spec["maxReplicas"]
    resources = _get_ray_resources_from_group_spec(group_spec, is_head)
    return {
        "min_workers": min_workers,
        "max_workers": max_workers,
        "node_config": {},
        "resources": resources,
    }
def _node_type_from_group_spec ( group_spec : Dict [ str , Any ] , is_head : bool ) -> Dict [ str , Any ] : if is_head : min_workers = max_workers = 0 else : min_workers = group_spec [ "minReplicas" ] max_workers = group_spec [ "maxReplicas" ] resources = _get_ray_resources_from_group_spec ( group_spec , is_head ) return { "min_workers" : min_workers , "max_workers" : max_workers , "node_config" : { } , "resources" : resources , }
Converts CR group spec to autoscaler node type.
Converts CR group spec to autoscaler node type .
"""Converts CR group spec to autoscaler node type.""" # The head node type has no workers because the head is not a worker. # `minReplicas` and `maxReplicas` are required fields for each workerGroupSpec # `node_config` is a legacy field required for compatibility. # Pod config data is required by the operator but not by the autoscaler.
group_spec
Dict[str, Any]
is_head
bool