Пример #1
0
def print_copy_result(node_id, success, err):
    log.print("-" * (len(node_id) + 6))
    log.print("| %s |", node_id)
    log.print("-" * (len(node_id) + 6))
    if success:
        log.print("Copy successful")
    else:
        log.print(err)
Пример #2
0
def execute(args: typing.NamedTuple):
    spark_client = aztk.spark.Client(config.load_aztk_secrets())
    app_log = spark_client.get_job_application_log(args.job_id, args.app_name)
    if args.output:
        with utils.Spinner():
            with open(os.path.abspath(os.path.expanduser(args.output)),
                      "w",
                      encoding="UTF-8") as f:
                f.write(app_log.log)
    else:
        log.print(app_log.log)
Пример #3
0
def execute(args: typing.NamedTuple):
    spark_client = aztk.spark.Client(config.load_aztk_secrets())

    if args.tail:
        utils.stream_logs(client=spark_client, cluster_id=args.cluster_id, application_name=args.app_name)
    else:
        app_log = spark_client.cluster.get_application_log(id=args.cluster_id, application_name=args.app_name)
        if args.output:
            with utils.Spinner():
                with open(os.path.abspath(os.path.expanduser(args.output)), "w", encoding="UTF-8") as f:
                    f.write(app_log.log)
        else:
            log.print(app_log.log)
Пример #4
0
def execute(args: typing.NamedTuple):
    spark_client = aztk.spark.Client(config.load_aztk_secrets())
    spark_client.stop_job(args.job_id)
    log.print("Stopped Job {0}".format(args.job_id))