dayhoff-tools 1.3.21__py3-none-any.whl → 1.3.22__py3-none-any.whl

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.
@@ -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,8 +830,8 @@ 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
 
828
- # Determine which SSH user to use (your username for your engines, ec2-user otherwise)
829
- ssh_user = username if engine["user"] == username else "ec2-user"
833
+ # Choose SSH user
834
+ ssh_user = "ec2-user" if admin else engine["user"]
830
835
 
831
836
  # Update SSH config
832
837
  console.print(f"Updating SSH config for [cyan]{engine['name']}[/cyan] (user: {ssh_user})...")
@@ -843,6 +848,7 @@ def config_ssh(
843
848
  all_engines: bool = typer.Option(
844
849
  False, "--all", "-a", help="Include all engines from all users"
845
850
  ),
851
+ admin: bool = typer.Option(False, "--admin", help="Generate entries that use ec2-user instead of per-engine owner user"),
846
852
  ):
847
853
  """Update SSH config with available engines."""
848
854
  username = check_aws_sso()
@@ -901,8 +907,8 @@ def config_ssh(
901
907
  # Add new entries if not cleaning
902
908
  if not clean:
903
909
  for engine in running_engines:
904
- # Use engine owner's username when it's your own engine; otherwise default to ec2-user
905
- ssh_user = engine['user'] if engine['user'] == username else 'ec2-user'
910
+ # Determine ssh user based on --admin flag
911
+ ssh_user = 'ec2-user' if admin else engine['user']
906
912
  new_lines.extend(
907
913
  [
908
914
  "",
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.3.21
3
+ Version: 1.3.22
4
4
  Summary: Common tools for all the repos at Dayhoff Labs
5
5
  Author: Daniel Martin-Alarcon
6
6
  Author-email: dma@dayhofflabs.com
@@ -3,7 +3,7 @@ dayhoff_tools/chemistry/standardizer.py,sha256=uMn7VwHnx02nc404eO6fRuS4rsl4dvSPf
3
3
  dayhoff_tools/chemistry/utils.py,sha256=jt-7JgF-GeeVC421acX-bobKbLU_X94KNOW24p_P-_M,2257
4
4
  dayhoff_tools/cli/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
5
  dayhoff_tools/cli/cloud_commands.py,sha256=33qcWLmq-FwEXMdL3F0OHm-5Stlh2r65CldyEZgQ1no,40904
6
- dayhoff_tools/cli/engine_commands.py,sha256=LzHTmcUQUOcJJCGHghBMRr8TdQsfb3Fj4s8T575MutM,79766
6
+ dayhoff_tools/cli/engine_commands.py,sha256=hA6F2U5gc5wGBFrZuF4m1GQJ7vojnvuz6Z6yrzicSmc,80068
7
7
  dayhoff_tools/cli/main.py,sha256=rgeEHD9lJ8SBCR34BTLb7gVInHUUdmEBNXAJnq5yEU4,4795
8
8
  dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
9
9
  dayhoff_tools/cli/utility_commands.py,sha256=qs8vH9TBFHsOPC3X8cU3qZigM3dDn-2Ytq4o_F2WubU,27874
@@ -27,7 +27,7 @@ dayhoff_tools/intake/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJq
27
27
  dayhoff_tools/logs.py,sha256=DKdeP0k0kliRcilwvX0mUB2eipO5BdWUeHwh-VnsICs,838
28
28
  dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
29
29
  dayhoff_tools/warehouse.py,sha256=8YbnQ--usrEgDQGfvpV4MrMji55A0rq2hZaOgFGh6ag,15896
30
- dayhoff_tools-1.3.21.dist-info/METADATA,sha256=Xz7PBOgBq2Wn2Sh1zSAaogaOqyXz6AaYG0YbSD6ONIs,2825
31
- dayhoff_tools-1.3.21.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.3.21.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.3.21.dist-info/RECORD,,
30
+ dayhoff_tools-1.3.22.dist-info/METADATA,sha256=bwJfZE8ZcPZo3rV8YDzgvMndM_qRk_zRzVFeqxCrXn4,2825
31
+ dayhoff_tools-1.3.22.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.3.22.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.3.22.dist-info/RECORD,,