def test_runcommand(self): module = "hello" execution_path = "./example" experiment_name = "my_experiment" worker_name = "my_worker" with tempfile.TemporaryDirectory() as tempdir: rootdir = Path(tempdir) executor = Executor( rootdir=rootdir, module=module, execution_path=execution_path, ) experiment_id = executor.init(experiment_name) runinfo = executor.run(experiment_id, worker_name) args = self.parser.parse_args([ "rename", "-r", runinfo.uuid, "-n", "new name", "-s", tempdir, ]) args.func(args) runinfo_ = executor._store.load_run(runinfo.uuid) assert runinfo_.name == "new name"
def run(self, args: argparse.Namespace) -> None: settings = Settings() if args.config_file is not None: settings.load(args.config_file) module = args.module or settings.logexp_module store_path = args.store or settings.logstore_storepath exec_path = args.exec_path or settings.logexp_execpath if not module: raise RuntimeError("module is required") executor = Executor( rootdir=store_path, module=module, execution_path=exec_path, ) run_info = executor.run( experiment_id=args.experiment, worker_name=args.worker, params_path=args.params, name=args.name, note=args.note, ) if run_info.report is not None: _print_report(run_info.report) _print_summary(run_info)
def test_runcommand(self): module = "hello" execution_path = "./example" experiment_name = "my_experiment" worker_name = "my_worker" with tempfile.TemporaryDirectory() as tempdir: rootdir = Path(tempdir) executor = Executor( rootdir=rootdir, module=module, execution_path=execution_path, ) experiment_id = executor.init(experiment_name) runinfo = executor.run(experiment_id, worker_name) run_path = rootdir / str( experiment_id) / worker_name / runinfo.uuid assert run_path.exists() args = self.parser.parse_args([ "delete", "-r", runinfo.uuid, "-s", tempdir, "-f", ]) args.func(args) assert not run_path.exists()
def test_run(): with tempfile.TemporaryDirectory() as tempdir: rootdir = Path(tempdir) executor = Executor( rootdir=rootdir, module="hello", execution_path="./examples", ) experiment_id = executor.init("my_experiment") runinfo = executor.run(experiment_id, "my_worker")
def test_runcommand(self): module = "hello" execution_path = "./example" experiment_name = "my_experiment" worker_name = "my_worker" with tempfile.TemporaryDirectory() as tempdir: rootdir = Path(tempdir) executor = Executor( rootdir=rootdir, module=module, execution_path=execution_path, ) experiment_id = executor.init(experiment_name) runinfo = executor.run(experiment_id, worker_name) args = self.parser.parse_args([ "logs", "-s", tempdir, "-e", experiment_id, "-w", worker_name ]) args.func(args)