From f2d9b3fb8cd1b8bf3a011d5c76a0988e26b34054 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Thu, 23 May 2024 11:44:38 +0200 Subject: [PATCH 1/3] Update to reflect ngi-preproc --- taca/server_status/server_status.py | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/taca/server_status/server_status.py b/taca/server_status/server_status.py index 3431da31..a63c2c6e 100644 --- a/taca/server_status/server_status.py +++ b/taca/server_status/server_status.py @@ -12,14 +12,15 @@ def get_nases_disk_space(): config = CONFIG["server_status"] servers = config.get("servers", dict()) - for server_url, path in servers.items(): + for server_url, path_vars in servers.items(): # Get command - command = "{command} {path}".format(command=config["command"], path=path) - - # If localhost, don't connect to ssh + command = config["command"] if server_url == "localhost": - command = command.split() + path = path_vars["path"] + server_url = path_vars["name"] + command = f"{command} {path}".split() else: + command = f"{command} {path_vars}" if "promethion" in server_url: user = "prom" else: From ab8aec23a9292354cd926a35e291eba97bf709cf Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Thu, 23 May 2024 12:09:04 +0200 Subject: [PATCH 2/3] Update VERSIONLOG.md --- VERSIONLOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/VERSIONLOG.md b/VERSIONLOG.md index 91a1f350..6ad3cbb3 100644 --- a/VERSIONLOG.md +++ b/VERSIONLOG.md @@ -1,5 +1,9 @@ # TACA Version Log +## 20240523.1 + +Update server status to run on ngi-preproc + ## 20240520.1 Fix erroneous name of pod5 output dir for ONT runs. From 63c5d63accba3918ef7d73ad17ac2a35dee2ca17 Mon Sep 17 00:00:00 2001 From: Anandashankar Anil Date: Thu, 23 May 2024 12:40:19 +0200 Subject: [PATCH 3/3] Reflect restructured yaml file --- taca/server_status/server_status.py | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/taca/server_status/server_status.py b/taca/server_status/server_status.py index a63c2c6e..20541811 100644 --- a/taca/server_status/server_status.py +++ b/taca/server_status/server_status.py @@ -12,23 +12,22 @@ def get_nases_disk_space(): config = CONFIG["server_status"] servers = config.get("servers", dict()) - for server_url, path_vars in servers.items(): + for server_name, path_vars in servers.items(): # Get command command = config["command"] - if server_url == "localhost": - path = path_vars["path"] - server_url = path_vars["name"] + path = path_vars["path"] + if path_vars["url"] == "localhost": command = f"{command} {path}".split() else: - command = f"{command} {path_vars}" - if "promethion" in server_url: + command = f"{command} {path}" + if "promethion" in server_name: user = "prom" else: user = config["user"] # Connect via ssh to server and execute the command - command = ["ssh", "-t", f"{user}@{server_url}", command] + command = ["ssh", "-t", f"{user}@{path_vars['url']}", command] - result[server_url] = _run_cmd(command) + result[server_name] = _run_cmd(command) # Storage systems are mouted locally, e.g. ngi-nas for storage_system, path in config.get("storage_systems", {}).items():