Ejemplo n.º 1
0
 def run_op(self, opspec, flags, restart, no_wait, stage, **opts):
     with util.TempDir(prefix="guild-remote-stage-") as tmp:
         if not restart:
             op_src = _op_src(opspec)
             if op_src:
                 _build_package(op_src, tmp.path)
         remote_run_dir = self._init_remote_run(tmp.path, opspec, restart)
     run_id = os.path.basename(remote_run_dir)
     self._start_op(remote_run_dir, opspec, restart, flags, run_id, stage,
                    **opts)
     if stage:
         log.info("%s staged as on %s as %s", opspec, self.name, run_id)
         log.info(
             "To start the operation, use 'guild run -r %s --start %s'",
             self.name,
             run_id,
         )
     if no_wait or stage:
         return run_id
     try:
         self._watch_started_op(remote_run_dir)
     except KeyboardInterrupt:
         raise remotelib.RemoteProcessDetached(run_id)
     else:
         return run_id
Ejemplo n.º 2
0
Archivo: ssh.py Proyecto: ErSKS/guildai
 def run_op(self, opspec, flags, restart, no_wait, **opts):
     with util.TempDir(prefix="guild-remote-pkg-") as dist_dir:
         _build_package(dist_dir)
         remote_run_dir = self._init_remote_run(dist_dir, opspec, restart)
     self._start_op(remote_run_dir, opspec, flags, **opts)
     run_id = os.path.basename(remote_run_dir)
     if no_wait:
         return run_id
     try:
         self._watch_started_op(remote_run_dir)
     except KeyboardInterrupt:
         raise remotelib.RemoteProcessDetached(run_id)
     else:
         return run_id