dayhoff-tools 1.3.5__py3-none-any.whl → 1.3.7__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.
- dayhoff_tools/cli/engine_commands.py +57 -18
- {dayhoff_tools-1.3.5.dist-info → dayhoff_tools-1.3.7.dist-info}/METADATA +1 -1
- {dayhoff_tools-1.3.5.dist-info → dayhoff_tools-1.3.7.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.3.5.dist-info → dayhoff_tools-1.3.7.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.3.5.dist-info → dayhoff_tools-1.3.7.dist-info}/entry_points.txt +0 -0
@@ -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 ⚠ (
|
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
|
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
|
-
|
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
|
-
|
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
|
-
|
940
|
-
|
941
|
-
|
942
|
-
|
943
|
-
|
944
|
-
|
945
|
-
|
946
|
-
|
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 = "[
|
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 = "[
|
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:
|
@@ -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=
|
6
|
+
dayhoff_tools/cli/engine_commands.py,sha256=FBRNwuJ3Q7leRZrUCHn_4FHTA06QU-bqE3GrG87QLt8,50442
|
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.
|
31
|
-
dayhoff_tools-1.3.
|
32
|
-
dayhoff_tools-1.3.
|
33
|
-
dayhoff_tools-1.3.
|
30
|
+
dayhoff_tools-1.3.7.dist-info/METADATA,sha256=UzFsOWGLYUgKx_soBtZVUgEhc_4sNoK8DmD6ZWh0_78,2842
|
31
|
+
dayhoff_tools-1.3.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
32
|
+
dayhoff_tools-1.3.7.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
33
|
+
dayhoff_tools-1.3.7.dist-info/RECORD,,
|
File without changes
|
File without changes
|