aztk/utils/helpers.py
def wait_for_all_nodes_state(pool, node_state, batch_client):
    """
    Waits for all nodes in pool to reach any specified state in set
    :param batch_client: The batch client to use.
    :type batch_client: `batchserviceclient.BatchServiceClient`
    :param pool: The pool containing the node.
    :type pool: `batchserviceclient.models.CloudPool`
    :param set node_state: node states to wait for
    :rtype: list
    :return: list of `batchserviceclient.models.ComputeNode`
    """
    while True:
        # refresh pool to ensure that there is no resize error
        pool = batch_client.pool.get(pool.id)
        if pool.resize_errors is not None:
            raise RuntimeError("resize error encountered for pool {}: {!r}".format(pool.id, pool.resize_errors))
        nodes = list(batch_client.compute_node.list(pool.id))

        totalNodes = pool.target_dedicated_nodes + pool.target_low_priority_nodes
        if len(nodes) >= totalNodes and all(node.state in node_state for node in nodes):
            return nodes
        time.sleep(1)

    Waits for all nodes in pool to reach any specified state in set
    :param batch_client: The batch client to use.
    :type batch_client: `batchserviceclient.BatchServiceClient`
    :param pool: The pool containing the node.
    :type pool: `batchserviceclient.models.CloudPool`
    :param set node_state: node states to wait for
    :rtype: list
    :return: list of `batchserviceclient.models.ComputeNode`
    
Waits for all nodes in pool to reach any specified state in set
Waits for all nodes in pool to reach any specified state in set
def wait_for_all_nodes_state(pool, node_state, batch_client):
    while True:
        pool = batch_client.pool.get(pool.id)
        if pool.resize_errors is not None:
            raise RuntimeError("resize error encountered for pool {}: {!r}".format(pool.id, pool.resize_errors))
        nodes = list(batch_client.compute_node.list(pool.id))
        totalNodes = pool.target_dedicated_nodes + pool.target_low_priority_nodes
        if len(nodes) >= totalNodes and all(node.state in node_state for node in nodes):
            return nodes
        time.sleep(1)
def wait_for_all_nodes_state ( pool , node_state , batch_client ) : while True : pool = batch_client . pool . get ( pool . id ) if pool . resize_errors is not None : raise RuntimeError ( "resize error encountered for pool {}: {!r}" . format ( pool . id , pool . resize_errors ) ) nodes = list ( batch_client . compute_node . list ( pool . id ) ) totalNodes = pool . target_dedicated_nodes + pool . target_low_priority_nodes if len ( nodes ) >= totalNodes and all ( node . state in node_state for node in nodes ) : return nodes time . sleep ( 1 )
Waits for all nodes in pool to reach any specified state in set
Waits for all nodes in pool to reach any specified state in set
"""
    Waits for all nodes in pool to reach any specified state in set
    :param batch_client: The batch client to use.
    :type batch_client: `batchserviceclient.BatchServiceClient`
    :param pool: The pool containing the node.
    :type pool: `batchserviceclient.models.CloudPool`
    :param set node_state: node states to wait for
    :rtype: list
    :return: list of `batchserviceclient.models.ComputeNode`
    """ # refresh pool to ensure that there is no resize error
list of `batchserviceclient.models.ComputeNode`
list of ` batchserviceclient . models . ComputeNode `
list
pool
The pool containing the node.
The pool containing the node .
node_state
node states to wait for
node states to wait for
batch_client
The batch client to use.
The batch client to use .