Ejemplo n.º 1
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = store.get_runs(args.experiment, args.worker)
        runinfo_dicts = [x.to_json() for x in runinfos]
        print(json.dumps(runinfo_dicts))
Ejemplo n.º 2
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = store.get_runs(args.experiment, args.worker)

        table = _get_runinfo_table(runinfos, args.max_column_width)

        if args.sort is not None:
            table.sort(args.sort, args.desc)

        if args.columns is not None:
            columns = args.columns.split(",")
            table = table[columns]

        table.print()
Ejemplo n.º 3
0
    def test_get_runs(self):
        with tempfile.TemporaryDirectory() as tempdir:
            rootdir = Path(tempdir)

            store = LogStore(rootdir)

            experiment_id = store.create_experiment(self.experiment)
            run_id = store.create_run(experiment_id, self.worker_name)

            run_info = RunInfo(
                version=VERSION,
                uuid=run_id,
                name="test run",
                module="test_module",
                execution_path=Path("test/path"),
                experiment_id=experiment_id,
                experiment_name=self.experiment_name,
                worker_name=self.worker_name,
                status=Status.FINISHED,
                params=Params({"test": "params"}),
                report=Report({"test": "report"}),
                storage=store.get_storage(experiment_id, run_id),
                platform=get_platform_info(),
                git=get_git_info(),
                note="test note",
                stdout="test stdout",
                stderr="test stderr",
                start_time=datetime.datetime.now(),
                end_time=datetime.datetime.now(),
            )

            store.save_run(run_info)

            runinfos = store.get_runs(experiment_id=experiment_id,
                                      worker_name=self.worker_name)

            assert runinfos[0].uuid == run_id
Ejemplo n.º 4
0
    def run(self, args: argparse.Namespace) -> None:
        settings = Settings()
        if args.config_file is not None:
            settings.load(args.config_file)

        store_path = args.store or settings.logstore_storepath

        store = LogStore(store_path)
        runinfos = [
            x for x in store.get_runs(args.experiment, args.worker)
            if x.status == Status.FAILED or x.status == Status.INTERRUPTED
        ]

        if args.force:
            choise = "y"
        else:
            print("Following runs will be removed:")
            for runinfo in runinfos:
                print(f"  {runinfo.uuid}")
            choise = input("Are you sure you want to continue? [y/N] ")

        if choise.strip().lower() == "y":
            for runinfo in runinfos:
                store.delete_run(runinfo.uuid)