Exemplo n.º 1
0
Arquivo: install.py Projeto: ar90n/kkt
def wait_for_install_kernel_completion(api: KaggleApi,
                                       meta_data: Dict,
                                       kernel_slug: str,
                                       quiet: bool = False) -> Dict[str, Any]:
    owner_slug = get_username(api)
    while True:
        response = api.process_response(
            api.kernel_output_with_http_info(owner_slug, kernel_slug))

        if response["log"] != "":
            time.sleep(5)  # wait for completion of synchlonizing kernel status
            result = kernel_proc.status(api, kernel_slug)
            if result["status"] != "complete" or result["failureMessage"]:
                logs = json.loads(response["log"])
                err_messages = get_error_messages(logs)
                raise InstallKernelError(err_messages)
            return response
        if not quiet:
            click.echo("Wait for install kernel completion...")
        time.sleep(10)
Exemplo n.º 2
0
def list_outputs(api: KaggleApi, kernel_slug: str):
    user_name = api.config_values[api.CONFIG_NAME_USER]
    return api.process_response(
        api.kernel_output_with_http_info(user_name, kernel_slug)
    )