Esempio n. 1
0
def open_tensorboard(args: Namespace) -> None:
    tensorboard_id = command.expand_uuid_prefixes(args)
    resp = api.get(
        args.master,
        "api/v1/tensorboards/{}".format(tensorboard_id)).json()["tensorboard"]
    check_eq(resp["state"], "STATE_RUNNING",
             "TensorBoard must be in a running state")
    api.browser_open(args.master, resp["serviceAddress"])
Esempio n. 2
0
def open_notebook(args: Namespace) -> None:
    notebook_id = command.expand_uuid_prefixes(args)
    resp = api.get(
        args.master,
        "api/v1/notebooks/{}".format(notebook_id)).json()["notebook"]
    check_eq(resp["state"], "STATE_RUNNING",
             "Notebook must be in a running state")
    api.browser_open(args.master, resp["serviceAddress"])
Esempio n. 3
0
def show_ssh_command(args: Namespace) -> None:
    shell_id = command.expand_uuid_prefixes(args)
    shell = api.get(args.master, f"api/v1/shells/{shell_id}").json()["shell"]
    check_eq(shell["state"], "STATE_RUNNING",
             "Shell must be in a running state")
    _open_shell(args.master,
                shell,
                args.ssh_opts,
                retain_keys_and_print=True,
                print_only=True)
Esempio n. 4
0
def logs(args: Namespace) -> None:
    task_id = cast(str, command.expand_uuid_prefixes(args, args.task_id))
    api.pprint_task_logs(
        args.master,
        task_id,
        head=args.head,
        tail=args.tail,
        follow=args.follow,
        agent_ids=args.agent_ids,
        container_ids=args.container_ids,
        rank_ids=args.rank_ids,
        sources=args.sources,
        stdtypes=args.stdtypes,
        level_above=args.level,
        timestamp_before=args.timestamp_before,
        timestamp_after=args.timestamp_after,
    )