concrete.ml.deployment.utils.md

module concrete.ml.deployment.utils

Utils.

  • Check if connection possible

  • Wait for connection to be available (with timeout)


function filter_logs

filter_logs(previous_logs: str, current_logs: str)str

Filter logs based on previous logs.

Arguments:

  • previous_logs (str): previous logs

  • current_logs (str): current logs

Returns:

  • str: filtered logs


function wait_for_connection_to_be_available

wait_for_connection_to_be_available(
    hostname: str,
    ip_address: str,
    path_to_private_key: Path,
    timeout: int = 1,
    wait_time: int = 1,
    max_retries: int = 20,
    wait_bar: bool = False
)

Wait for connection to be available.

Arguments:

  • hostname (str): host name

  • ip_address (str): ip address

  • path_to_private_key (Path): path to private key

  • timeout (int): ssh timeout option

  • wait_time (int): time to wait between retries

  • max_retries (int): number of retries, if < 0 unlimited retries

  • wait_bar (bool): tqdm progress bar of retries

Raises:

  • TimeoutError: if it wasn't able connect to ssh with the given constraints


function is_connection_available

is_connection_available(
    hostname: str,
    ip_address: str,
    path_to_private_key: Path,
    timeout: int = 1
)

Check if ssh connection is available.

Arguments:

  • hostname (str): host name

  • ip_address (str): ip address

  • path_to_private_key (Path): path to private key

  • timeout: ssh timeout option

Returns:

  • bool: True if connection succeeded

Last updated