dayhoff-tools 1.3.20__tar.gz → 1.3.22__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/PKG-INFO +1 -1
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/engine_commands.py +18 -7
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/pyproject.toml +1 -1
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/README.md +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.3.20 → dayhoff_tools-1.3.22}/dayhoff_tools/warehouse.py +0 -0
@@ -365,8 +365,8 @@ def get_ssh_public_key() -> str:
|
|
365
365
|
)
|
366
366
|
|
367
367
|
|
368
|
-
def update_ssh_config_entry(engine_name: str, instance_id: str,
|
369
|
-
"""Add or update a single SSH config entry."""
|
368
|
+
def update_ssh_config_entry(engine_name: str, instance_id: str, ssh_user: str):
|
369
|
+
"""Add or update a single SSH config entry for the given SSH user."""
|
370
370
|
config_path = Path.home() / ".ssh" / "config"
|
371
371
|
config_path.parent.mkdir(mode=0o700, exist_ok=True)
|
372
372
|
|
@@ -381,7 +381,7 @@ def update_ssh_config_entry(engine_name: str, instance_id: str, username: str):
|
|
381
381
|
new_entry = f"""
|
382
382
|
Host {engine_name} {SSH_MANAGED_COMMENT}
|
383
383
|
HostName {instance_id}
|
384
|
-
User
|
384
|
+
User {ssh_user}
|
385
385
|
ProxyCommand sh -c "aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'"
|
386
386
|
"""
|
387
387
|
|
@@ -808,8 +808,13 @@ def terminate_engine(
|
|
808
808
|
@engine_app.command("ssh")
|
809
809
|
def ssh_engine(
|
810
810
|
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
811
|
+
admin: bool = typer.Option(False, "--admin", help="Connect as ec2-user instead of the engine owner user"),
|
811
812
|
):
|
812
|
-
"""Connect to an engine via SSH.
|
813
|
+
"""Connect to an engine via SSH.
|
814
|
+
|
815
|
+
By default the CLI connects using the engine's owner username (the same one stored in the `User` tag).
|
816
|
+
Pass `--admin` to connect with the underlying [`ec2-user`] account for break-glass or debugging.
|
817
|
+
"""
|
813
818
|
username = check_aws_sso()
|
814
819
|
|
815
820
|
# Get all engines to resolve name
|
@@ -825,9 +830,12 @@ def ssh_engine(
|
|
825
830
|
console.print(f"[red]❌ Engine is not running (state: {engine['state']})[/red]")
|
826
831
|
raise typer.Exit(1)
|
827
832
|
|
833
|
+
# Choose SSH user
|
834
|
+
ssh_user = "ec2-user" if admin else engine["user"]
|
835
|
+
|
828
836
|
# Update SSH config
|
829
|
-
console.print(f"Updating SSH config for [cyan]{engine['name']}[/cyan]...")
|
830
|
-
update_ssh_config_entry(engine["name"], engine["instance_id"],
|
837
|
+
console.print(f"Updating SSH config for [cyan]{engine['name']}[/cyan] (user: {ssh_user})...")
|
838
|
+
update_ssh_config_entry(engine["name"], engine["instance_id"], ssh_user)
|
831
839
|
|
832
840
|
# Connect
|
833
841
|
console.print(f"[green]✓ Connecting to {engine['name']}...[/green]")
|
@@ -840,6 +848,7 @@ def config_ssh(
|
|
840
848
|
all_engines: bool = typer.Option(
|
841
849
|
False, "--all", "-a", help="Include all engines from all users"
|
842
850
|
),
|
851
|
+
admin: bool = typer.Option(False, "--admin", help="Generate entries that use ec2-user instead of per-engine owner user"),
|
843
852
|
):
|
844
853
|
"""Update SSH config with available engines."""
|
845
854
|
username = check_aws_sso()
|
@@ -898,12 +907,14 @@ def config_ssh(
|
|
898
907
|
# Add new entries if not cleaning
|
899
908
|
if not clean:
|
900
909
|
for engine in running_engines:
|
910
|
+
# Determine ssh user based on --admin flag
|
911
|
+
ssh_user = 'ec2-user' if admin else engine['user']
|
901
912
|
new_lines.extend(
|
902
913
|
[
|
903
914
|
"",
|
904
915
|
f"Host {engine['name']} {SSH_MANAGED_COMMENT}",
|
905
916
|
f" HostName {engine['instance_id']}",
|
906
|
-
f" User
|
917
|
+
f" User {ssh_user}",
|
907
918
|
f" ProxyCommand sh -c \"aws ssm start-session --target %h --document-name AWS-StartSSHSession --parameters 'portNumber=%p'\"",
|
908
919
|
]
|
909
920
|
)
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.3.
|
8
|
+
version = "1.3.22"
|
9
9
|
description = "Common tools for all the repos at Dayhoff Labs"
|
10
10
|
authors = [
|
11
11
|
{name = "Daniel Martin-Alarcon", email = "dma@dayhofflabs.com"}
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|