dayhoff-tools 1.3.5__tar.gz → 1.3.7__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.
Files changed (32) hide show
  1. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/PKG-INFO +1 -1
  2. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/engine_commands.py +57 -18
  3. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/pyproject.toml +1 -1
  4. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/README.md +0 -0
  5. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/__init__.py +0 -0
  6. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/chemistry/standardizer.py +0 -0
  7. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/chemistry/utils.py +0 -0
  8. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/__init__.py +0 -0
  9. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/cloud_commands.py +0 -0
  10. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/main.py +0 -0
  11. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/swarm_commands.py +0 -0
  12. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/cli/utility_commands.py +0 -0
  13. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/base.py +0 -0
  14. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/deploy_aws.py +0 -0
  15. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
  16. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/deploy_utils.py +0 -0
  17. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/job_runner.py +0 -0
  18. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/processors.py +0 -0
  19. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/deployment/swarm.py +0 -0
  20. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/embedders.py +0 -0
  21. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/fasta.py +0 -0
  22. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/file_ops.py +0 -0
  23. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/h5.py +0 -0
  24. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/gcp.py +0 -0
  25. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/gtdb.py +0 -0
  26. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/kegg.py +0 -0
  27. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/mmseqs.py +0 -0
  28. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/structure.py +0 -0
  29. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/intake/uniprot.py +0 -0
  30. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/logs.py +0 -0
  31. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/sqlite.py +0 -0
  32. {dayhoff_tools-1.3.5 → dayhoff_tools-1.3.7}/dayhoff_tools/warehouse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.3.5
3
+ Version: 1.3.7
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
@@ -163,7 +163,7 @@ def format_status(state: str, ready: Optional[bool]) -> str:
163
163
  if ready is True:
164
164
  return "[green]Running ✓[/green]"
165
165
  elif ready is False:
166
- return "[yellow]Running ⚠ (Initializing...)[/yellow]"
166
+ return "[yellow]Running ⚠ (Bootstrapping...)[/yellow]"
167
167
  else:
168
168
  return "[green]Running[/green]"
169
169
  elif state.lower() == "stopped":
@@ -332,17 +332,15 @@ def launch_engine(
332
332
  else:
333
333
  error = response.json().get("error", "Unknown error")
334
334
  console.print(f"[red]❌ Failed to launch engine: {error}[/red]")
335
- raise typer.Exit(1)
336
335
 
337
336
 
338
337
  @engine_app.command("list")
339
338
  def list_engines(
340
339
  user: Optional[str] = typer.Option(None, "--user", "-u", help="Filter by user"),
341
- all_users: bool = typer.Option(False, "--all", "-a", help="Show all users' engines"),
342
340
  running_only: bool = typer.Option(False, "--running", help="Show only running engines"),
343
341
  stopped_only: bool = typer.Option(False, "--stopped", help="Show only stopped engines"),
344
342
  ):
345
- """List all engines."""
343
+ """List engines (shows all engines by default)."""
346
344
  current_user = check_aws_sso()
347
345
 
348
346
  params = {}
@@ -618,14 +616,18 @@ def ssh_engine(
618
616
  @engine_app.command("config-ssh")
619
617
  def config_ssh(
620
618
  clean: bool = typer.Option(False, "--clean", help="Remove all managed entries"),
619
+ all_engines: bool = typer.Option(False, "--all", "-a", help="Include all engines from all users"),
621
620
  ):
622
- """Update SSH config with all available engines."""
621
+ """Update SSH config with available engines."""
623
622
  username = check_aws_sso()
624
623
 
625
624
  if clean:
626
625
  console.print("Removing all managed SSH entries...")
627
626
  else:
628
- console.print("Updating SSH config with all running engines...")
627
+ if all_engines:
628
+ console.print("Updating SSH config with all running engines...")
629
+ else:
630
+ console.print(f"Updating SSH config with running engines for [cyan]{username}[/cyan] and [cyan]shared[/cyan]...")
629
631
 
630
632
  # Get all engines
631
633
  response = make_api_request("GET", "/engines")
@@ -635,6 +637,14 @@ def config_ssh(
635
637
 
636
638
  engines = response.json().get("engines", [])
637
639
  running_engines = [e for e in engines if e["state"].lower() == "running"]
640
+
641
+ # Filter engines based on options
642
+ if not all_engines:
643
+ # Show only current user's engines and shared engines
644
+ running_engines = [
645
+ e for e in running_engines
646
+ if e["user"] == username or e["user"] == "shared"
647
+ ]
638
648
 
639
649
  # Read existing config
640
650
  config_path = Path.home() / ".ssh" / "config"
@@ -685,7 +695,8 @@ def config_ssh(
685
695
  f"[green]✓ Updated SSH config with {len(running_engines)} engines[/green]"
686
696
  )
687
697
  for engine in running_engines:
688
- console.print(f"{engine['name']} {engine['instance_id']}")
698
+ user_display = f"[dim]({engine['user']})[/dim]" if engine['user'] != username else ""
699
+ console.print(f" • {engine['name']} → {engine['instance_id']} {user_display}")
689
700
 
690
701
 
691
702
  @engine_app.command("keep-awake")
@@ -936,15 +947,43 @@ def create_ami(
936
947
 
937
948
  response = ec2.create_image(**create_params)
938
949
 
939
- ami_id = response["ImageId"]
940
- console.print(f"[green]✓ AMI creation initiated![/green]")
941
- console.print(f"AMI ID: [cyan]{ami_id}[/cyan]")
942
- console.print("\n[dim]The AMI creation process will continue in the background.[/dim]")
943
- console.print("[dim]You can monitor progress in the EC2 Console under 'AMIs'.[/dim]")
944
- console.print(
945
- f"\nOnce complete, run [cyan]terraform apply[/cyan] in "
946
- f"terraform/environments/dev to use the new AMI."
947
- )
950
+ ami_id = response["ImageId"]
951
+ console.print(f"[green]✓ AMI creation initiated![/green]")
952
+ console.print(f"AMI ID: [cyan]{ami_id}[/cyan]")
953
+
954
+ # Restore the source engine to a normal state
955
+ console.print("Restoring source engine state...")
956
+ restore_response = ssm.send_command(
957
+ InstanceIds=[engine["instance_id"]],
958
+ DocumentName="AWS-RunShellScript",
959
+ Parameters={
960
+ "commands": [
961
+ "sudo touch /opt/dayhoff/first_boot_complete.sentinel",
962
+ "sudo systemctl restart engine-idle-detector.timer",
963
+ ],
964
+ "executionTimeout": ["60"],
965
+ },
966
+ )
967
+
968
+ # Quick wait to see if it failed immediately
969
+ time.sleep(1)
970
+ restore_command_id = restore_response["Command"]["CommandId"]
971
+ result = ssm.get_command_invocation(
972
+ CommandId=restore_command_id,
973
+ InstanceId=engine["instance_id"],
974
+ )
975
+ if result["Status"] not in ["Pending", "InProgress", "Success"]:
976
+ console.print("[yellow]⚠️ Warning: Failed to restore source engine state.[/yellow]")
977
+ else:
978
+ console.print("[green]✓ Source engine restored to normal operation.[/green]")
979
+
980
+
981
+ console.print("\n[dim]The AMI creation process will continue in the background.[/dim]")
982
+ console.print("[dim]You can monitor progress in the EC2 Console under 'AMIs'.[/dim]")
983
+ console.print(
984
+ f"\nOnce complete, run [cyan]terraform apply[/cyan] in "
985
+ f"terraform/environments/dev to use the new AMI."
986
+ )
948
987
 
949
988
  except ClientError as e:
950
989
  console.print(f"[red]❌ Failed to create AMI: {e}[/red]")
@@ -1020,7 +1059,7 @@ def studio_status():
1020
1059
  # Format status with colors
1021
1060
  status = studio['status']
1022
1061
  if status == "in-use":
1023
- status_display = "[magenta]attached[/magenta]"
1062
+ status_display = "[bright_blue]attached[/bright_blue]"
1024
1063
  elif status in ["attaching", "detaching"]:
1025
1064
  status_display = f"[yellow]{status}[/yellow]"
1026
1065
  else:
@@ -1258,7 +1297,7 @@ def list_studios(
1258
1297
  for studio in studios:
1259
1298
  # Change status display
1260
1299
  if studio["status"] == "in-use":
1261
- status_display = "[magenta]attached[/magenta]"
1300
+ status_display = "[bright_blue]attached[/bright_blue]"
1262
1301
  elif studio["status"] in ["attaching", "detaching"]:
1263
1302
  status_display = "[yellow]" + studio["status"] + "[/yellow]"
1264
1303
  else:
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
5
5
 
6
6
  [project]
7
7
  name = "dayhoff-tools"
8
- version = "1.3.5"
8
+ version = "1.3.7"
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