From e2ecf903517fca7e2ca70fa548406410a198aa8a Mon Sep 17 00:00:00 2001 From: sanderegg <35365065+sanderegg@users.noreply.github.com> Date: Tue, 5 Nov 2024 15:09:29 +0100 Subject: [PATCH] use sshkey.pem --- .../autoscaled_monitor/cli.py | 13 +++++-------- .../autoscaled_monitor/constants.py | 1 + 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/cli.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/cli.py index 189dde5c0df0..20e1d380d12d 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/cli.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/cli.py @@ -13,6 +13,7 @@ DEFAULT_COMPUTATIONAL_EC2_FORMAT_WORKERS, DEFAULT_DYNAMIC_EC2_FORMAT, DEPLOY_SSH_KEY_PARSER, + UNIFIED_SSH_KEY_PARSE, wallet_id_spec, ) from .ec2 import autoscaling_ec2_client, cluster_keeper_ec2_client @@ -78,16 +79,12 @@ def main( # locate ssh key path for file_path in deploy_config.glob("**/*.pem"): - if any(_ in file_path.name for _ in ["license", "pkcs8"]): - continue - # very bad HACK where the license file contain openssh in the name - if ( - any(_ in f"{file_path}" for _ in ("sim4life.io", "osparc-master")) - and "openssh" not in f"{file_path}" - ): + if any(_ in file_path.name for _ in ["license", "pkcs8", "dask"]): continue - if DEPLOY_SSH_KEY_PARSER.parse(f"{file_path.name}") is not None: + if DEPLOY_SSH_KEY_PARSER.parse( + f"{file_path.name}" + ) is not None or UNIFIED_SSH_KEY_PARSE.parse(f"{file_path.name}"): rich.print( f"will be using following ssh_key_path: {file_path}. " "TIP: if wrong adapt the code or manually remove some of them." diff --git a/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py b/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py index 661039bed398..6b8b1038205e 100644 --- a/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py +++ b/scripts/maintenance/computational-clusters/autoscaled_monitor/constants.py @@ -22,6 +22,7 @@ def wallet_id_spec(text) -> None | int: DEPLOY_SSH_KEY_PARSER: Final[parse.Parser] = parse.compile( r"{prefix}-{random_name}.pem" ) +UNIFIED_SSH_KEY_PARSE: Final[parse.Parser] = parse.compile("sshkey.pem") MINUTE: Final[int] = 60 HOUR: Final[int] = 60 * MINUTE