diff --git a/src/anemoi/registry/commands/tasks.py b/src/anemoi/registry/commands/tasks.py index 6de4bc0..720d123 100644 --- a/src/anemoi/registry/commands/tasks.py +++ b/src/anemoi/registry/commands/tasks.py @@ -103,14 +103,16 @@ def run_delete_many(self, args): print(f"Do you really want to delete these {len(cat)} entries? (y/n)", end=" ") if input("").lower() != "y": return + count = 0 while cat: try: entry = cat[0] entry.unregister() + count += 1 LOG.info(f"Task {entry.key} deleted.") except CatalogueEntryNotFound: LOG.warning(f"Task {entry.key} not found.") - LOG.info(f"{len(cat)} tasks deleted.") + LOG.info(f"{count} tasks deleted.") def run_take_one(self, args): cat = TaskCatalogueEntryList(*args.take_one, status="queued", sort=args.sort) diff --git a/src/anemoi/registry/tasks.py b/src/anemoi/registry/tasks.py index 9ce0567..78d5339 100644 --- a/src/anemoi/registry/tasks.py +++ b/src/anemoi/registry/tasks.py @@ -85,18 +85,29 @@ def to_str(self, long): status = v.pop("status") progress = v.pop("progress", "") action = v.pop("action", "") - if not long: - if "worker" in v: - v["worker"] = v["worker"].get("host") - content = " ".join(f"{k}={v}" for k, v in v.items()) - rows.append( - [action, when(created, use_utc=True), when(updated, use_utc=True), status, progress, content, uuid] - ) - return table( - rows, - ["Action", "Created", "Updated", "Status", "%", "Details", "UUID"], - ["<", "<", "<", "<", "<", "<", "<"], - ) + source = v.pop("source", "") + destination = v.pop("destination", "") + dataset = v.pop("dataset", "") + row = [ + when(created, use_utc=True), + when(updated, use_utc=True), + status, + action, + source, + destination, + dataset, + progress, + uuid, + ] + rows.append(row) + if long: + content = " ".join(f"{k}={v}" for k, v in v.items()) + row.append(content) + cols = ["Created", "Updated", "Status", "Action", "Src", "Dest", "Dataset", "%", "UUID"] + if long: + cols.append("More") + + return table(rows, cols, "<" * len(cols)) class TaskCatalogueEntry(CatalogueEntry): diff --git a/src/anemoi/registry/workers.py b/src/anemoi/registry/workers.py index c392f58..020bd67 100644 --- a/src/anemoi/registry/workers.py +++ b/src/anemoi/registry/workers.py @@ -202,7 +202,7 @@ def get_source_path(): source_path = source_path + "/" if not source_path.endswith("/") else source_path if target_path.startswith("s3://"): - # untested + LOG.warning("Uploading to S3 is experimental and has not been tested yet.") download(source_path, target_path, resume=True, threads=self.threads) return else: