示例#1
0
    def delete_runs(self, **opts):
        if not self._deleted_runs_dir and not opts.get("permanent"):
            raise remotelib.OperationNotSupported(
                "remote '%s' does not support non permanent deletes\n"
                "Use the '--permanent' with this command and try again." % self.name
            )
        args = click_util.Args(archive=self._runs_dir, remote=None, **opts)
        self._sync_runs_meta()
        if args.permanent:
            preview = cmd_impl_support.format_warn(
                "WARNING: You are about to permanently delete "
                "the following runs on %s:" % self.name
            )
            confirm = "Permanently delete these runs?"
        else:
            preview = "You are about to delete the following runs on %s:" % self.name
            confirm = "Delete these runs?"
        no_runs_help = "Nothing to delete."

        def delete_f(selected):
            self._delete_runs(selected, args.permanent)
            self._sync_runs_meta(force=True)

        try:
            runs_impl.runs_op(
                args,
                None,
                preview,
                confirm,
                no_runs_help,
                delete_f,
                confirm_default=not args.permanent,
            )
        except SystemExit as e:
            raise self._fix_system_exit_msg_for_remote(e, ["runs rm", "runs delete"])
示例#2
0
    def purge_runs(self, **opts):
        if not self._deleted_runs_dir:
            raise remotelib.OperationNotSupported()
        self._sync_runs_meta()
        args = click_util.Args(archive=self._deleted_runs_dir, remote=None, **opts)
        preview = (
            "WARNING: You are about to permanently delete "
            "the following runs on %s:" % self.name
        )
        confirm = "Permanently delete these runs?"
        no_runs_help = "Nothing to purge."

        def purge_f(selected):
            self._purge_runs(selected)
            self._sync_runs_meta(force=True)

        try:
            runs_impl.runs_op(
                args,
                None,
                preview,
                confirm,
                no_runs_help,
                purge_f,
                confirm_default=False,
            )
        except SystemExit as e:
            self._fix_system_exit_msg_for_remote(e, ["runs purge"])
示例#3
0
    def restore_runs(self, **opts):
        if not self._deleted_runs_dir:
            raise remotelib.OperationNotSupported()
        self._sync_runs_meta()
        args = click_util.Args(archive=self._deleted_runs_dir, remote=None, **opts)
        preview = "You are about to restore the following runs on %s:" % self.name
        confirm = "Restore these runs?"
        no_runs_help = "Nothing to restore."

        def restore_f(selected):
            self._restore_runs(selected)
            self._sync_runs_meta(force=True)

        try:
            runs_impl.runs_op(
                args,
                None,
                preview,
                confirm,
                no_runs_help,
                restore_f,
                confirm_default=True,
            )
        except SystemExit as e:
            self._fix_system_exit_msg_for_remote(e, ["runs restore"])
示例#4
0
 def list_runs(self, **opts):
     deleted = opts.pop("deleted", False)
     if deleted and not self._deleted_runs_dir:
         raise remotelib.OperationNotSupported(
             "remote '%s' does not support '--delete' option" % self.name
         )
     self._sync_runs_meta()
     runs_dir = self._deleted_runs_dir if deleted else self._runs_dir
     if not os.path.exists(runs_dir):
         return
     assert not opts.get("archive"), opts
     assert not opts.get("remote"), opts
     args = click_util.Args(
         deleted=False, archive=runs_dir, remote=None, json=False, **opts
     )
     try:
         runs_impl.list_runs(args)
     except SystemExit as e:
         raise self._fix_system_exit_msg_for_remote(e, ["runs list", "runs"])
示例#5
0
 def stop(self):
     raise remotelib.OperationNotSupported(
         "stop is not supported for ssh remotes")
示例#6
0
 def reinit(self):
     if not self.init:
         raise remotelib.OperationNotSupported(
             "init is not defined for this remote")
     self._ssh_cmd(self.init)
示例#7
0
文件: s3.py 项目: wingkitlee0/guildai
 def stop_runs(self, **opts):
     raise remotelib.OperationNotSupported()
示例#8
0
文件: s3.py 项目: wingkitlee0/guildai
 def check(self, **opts):
     raise remotelib.OperationNotSupported()
示例#9
0
文件: s3.py 项目: wingkitlee0/guildai
 def watch_run(self, **opts):
     raise remotelib.OperationNotSupported()
示例#10
0
文件: s3.py 项目: wingkitlee0/guildai
 def run_op(self, opspec, flags, restart, no_wait, **opts):
     raise remotelib.OperationNotSupported()
示例#11
0
 def reinit(self):
     raise remotelib.OperationNotSupported(
         "reinit is not supported for ssh remotes")