python/ray/autoscaler/_private/kuberay/node_provider.py
def create_node(
        self, node_config: Dict[str, Any], tags: Dict[str, str], count: int
    ) -> Dict[str, Dict[str, str]]:
        """Creates a number of nodes within the namespace."""
        with self._lock:
            url = "rayclusters/{}".format(self.cluster_name)
            raycluster = self._get(url)
            group_name = tags["ray-user-node-type"]
            group_index = _worker_group_index(raycluster, group_name)
            tag_filters = {TAG_RAY_USER_NODE_TYPE: group_name}
            current_replica_count = len(self.non_terminated_nodes(tag_filters))
            path = f"/spec/workerGroupSpecs/{group_index}/replicas"
            payload = [
                {
                    "op": "replace",
                    "path": path,
                    "value": current_replica_count + count,
                },
            ]
            self._patch(url, payload)
        return {}
Creates a number of nodes within the namespace.
Creates a number of nodes within the namespace.
Creates a number of nodes within the namespace .
def create_node(
        self, node_config: Dict[str, Any], tags: Dict[str, str], count: int
    ) -> Dict[str, Dict[str, str]]:
        with self._lock:
            url = "rayclusters/{}".format(self.cluster_name)
            raycluster = self._get(url)
            group_name = tags["ray-user-node-type"]
            group_index = _worker_group_index(raycluster, group_name)
            tag_filters = {TAG_RAY_USER_NODE_TYPE: group_name}
            current_replica_count = len(self.non_terminated_nodes(tag_filters))
            path = f"/spec/workerGroupSpecs/{group_index}/replicas"
            payload = [
                {
                    "op": "replace",
                    "path": path,
                    "value": current_replica_count + count,
                },
            ]
            self._patch(url, payload)
        return {}
def create_node ( self , node_config : Dict [ str , Any ] , tags : Dict [ str , str ] , count : int ) -> Dict [ str , Dict [ str , str ] ] : with self . _lock : url = "rayclusters/{}" . format ( self . cluster_name ) raycluster = self . _get ( url ) group_name = tags [ "ray-user-node-type" ] group_index = _worker_group_index ( raycluster , group_name ) tag_filters = { TAG_RAY_USER_NODE_TYPE : group_name } current_replica_count = len ( self . non_terminated_nodes ( tag_filters ) ) path = f"/spec/workerGroupSpecs/{group_index}/replicas" payload = [ { "op" : "replace" , "path" : path , "value" : current_replica_count + count , } , ] self . _patch ( url , payload ) return { }
Creates a number of nodes within the namespace.
Creates a number of nodes within the namespace .
"""Creates a number of nodes within the namespace."""
self
node_config
Dict[str, Any]
tags
Dict[str, str]
count
int