Exemple #1
0
def delete_experiment(args: Namespace) -> None:
    if args.yes or render.yes_or_no(
            "Deleting an experiment will result in the unrecoverable \n"
            "deletion of all associated logs, checkpoints, and other \n"
            "metadata associated with the experiment. For a recoverable \n"
            "alternative, see the 'det archive' command. Do you still \n"
            "wish to proceed?"):
        api.delete(args.master, "experiments/{}".format(args.experiment_id))
        print("Successfully deleted experiment {}".format(args.experiment_id))
    else:
        print("Aborting experiment deletion.")
Exemple #2
0
def kill_command(args: Namespace) -> None:
    for i, cid in enumerate(args.command_id):
        try:
            api.delete(args.master, "commands/{}".format(cid))
            print(colored("Killed command {}".format(cid), "green"))
        except api.errors.APIException as e:
            if not args.force:
                for ignored in args.command_id[i + 1 :]:
                    print("Cowardly not killing {}".format(ignored))
                raise e
            print(colored("Skipping: {} ({})".format(e, type(e).__name__), "red"))
Exemple #3
0
    def remove_metadata(self, keys: List[str]) -> None:
        """
        Removes user-defined metadata from the checkpoint. Any top-level keys that
        appear in the ``keys`` list are removed from the checkpoint.

        Arguments:
            keys (List[string]): Top-level keys to remove from the checkpoint metadata.
        """
        if self._master:
            r = api.delete(self._master,
                           "checkpoints/{}/metadata".format(self.uuid),
                           params={"keys": keys})
            self.metadata = r.json()
Exemple #4
0
def remove_templates(args: Namespace) -> None:
    api.delete(args.master, path="templates/" + args.template_name)
    print(colored("Removed template {}".format(args.template_name), "green"))