Skip to content

Commit

Permalink
use sshkey.pem
Browse files Browse the repository at this point in the history
  • Loading branch information
sanderegg committed Nov 5, 2024
1 parent cd20a2c commit e2ecf90
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e2ecf90

Please sign in to comment.