Example #1
0
 def _run_data(self, run, index):
     formatted = run_util.format_run(run)
     return {
         "id": run.id,
         "shortId": run.short_id,
         "path": run.path,
         "operation": formatted["operation"],
         "opModel": run.opref.model_name,
         "opName": run.opref.op_name,
         "started": formatted["started"],
         "stopped": formatted["stopped"],
         "time": self._run_duration(run),
         "label": formatted["label"],
         "tags": self._format_tags(run.get("tags") or []),
         "comments": run.get("comments") or [],
         "status": run.status,
         "exitStatus": formatted["exit_status"] or None,
         "command": formatted["command"],
         "otherAttrs": self._other_attrs(run),
         "flags": run.get("flags", {}),
         "scalars": self._run_scalars(run, index),
         "env": run.get("env", {}),
         "deps": self._format_deps(run.get("deps", {})),
         "files": self._format_files(run.iter_files(), run.path),
     }
Example #2
0
def run_info(args, ctx):
    runs = runs_for_args(args)
    runspec = args.run or "0"
    selected = selected_runs(runs, [runspec], ctx)
    run = cmd_impl_support.one_run(selected, runspec, ctx)
    formatted = format_run(run)
    out = cli.out
    for name in RUN_DETAIL:
        out("%s: %s" % (name, formatted[name]))
    for name in run.attr_names():
        if name not in CORE_RUN_ATTRS:
            out("%s: %s" % (name, run.get(name, "")))
    if args.env:
        out("environment:", nl=False)
        out(_format_attr_val(run.get("env", "")))
    if args.flags:
        out("flags:", nl=False)
        out(_format_attr_val(run.get("flags", "")))
    if args.files or args.all_files:
        out("files:")
        for path in sorted(run.iter_files(args.all_files)):
            out("  %s" % path)