def _run(run, state): log.info("Starting %s", run.id) try: gapi.run(restart=run.id, extra_env={"NO_RESTARTING_MSG": "1"}) except gapi.RunError as e: log.error("%s failed with exit code %i", run.id, e.returncode) state.show_waiting_msg = True
def run(self, quiet=False, **kw): trial_run = self.trial_run(required=True) cwd = os.environ["CMD_DIR"] opspec = trial_run.opref.to_opspec(cwd) label = trial_run.get("label") extra_env = {"NO_RESTARTING_MSG": "1"} if not quiet: log.info( "Running trial %s: %s (%s)", self._run_desc(trial_run), opspec, self._flags_desc(), ) try: gapi.run(restart=trial_run.path, cwd=cwd, label=label, extra_env=extra_env, quiet=quiet, **kw) except gapi.RunError as e: op_util.ensure_exit_status(trial_run, e.returncode) log.error("Run %s failed - see logs for details", trial_run.id) except KeyboardInterrupt as e: sys.exit(exit_code.SIGTERM)
def _run(run, run_kwargs): log.info("Run %s started", run.id) try: gapi.run(**run_kwargs) except gapi.RunError as e: log.error("Run %s exited with code %i", run.id, e.returncode) else: log.info("Run %s completed", run.id)
def _run(run, state): env = { "NO_RESTARTING_MSG": "1", "PYTHONPATH": run.guild_path("job-packages"), } gapi.run(restart=run.id, extra_env=env, gpus=state.gpus)
def _run(run, state): env = _run_env(run) gapi.run(restart=run.id, extra_env=env, gpus=state.gpus)
def _start_run(run, state): log.info("Starting staged run %s", run.id) try: gapi.run(restart=run.id, extra_env=_run_env(run), gpus=state.gpus) except gapi.RunError as e: raise RuntimeError("%s failed with exit code %i" % (run.id, e.returncode))