dayhoff-tools 1.3.2__py3-none-any.whl → 1.3.3__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 +38 -43
- {dayhoff_tools-1.3.2.dist-info → dayhoff_tools-1.3.3.dist-info}/METADATA +1 -1
- {dayhoff_tools-1.3.2.dist-info → dayhoff_tools-1.3.3.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.3.2.dist-info → dayhoff_tools-1.3.3.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.3.2.dist-info → dayhoff_tools-1.3.3.dist-info}/entry_points.txt +0 -0
@@ -330,9 +330,7 @@ def list_engines(
|
|
330
330
|
current_user = check_aws_sso()
|
331
331
|
|
332
332
|
params = {}
|
333
|
-
if
|
334
|
-
params["user"] = current_user
|
335
|
-
elif user:
|
333
|
+
if user:
|
336
334
|
params["user"] = user
|
337
335
|
|
338
336
|
response = make_api_request("GET", "/engines", params=params)
|
@@ -947,7 +945,7 @@ def get_user_studio(username: str) -> Optional[Dict]:
|
|
947
945
|
return None
|
948
946
|
|
949
947
|
studios = response.json().get("studios", [])
|
950
|
-
user_studios = [s for s in studios if s["
|
948
|
+
user_studios = [s for s in studios if s["user"] == username]
|
951
949
|
|
952
950
|
return user_studios[0] if user_studios else None
|
953
951
|
|
@@ -962,7 +960,7 @@ def create_studio(
|
|
962
960
|
# Check if user already has a studio
|
963
961
|
existing = get_user_studio(username)
|
964
962
|
if existing:
|
965
|
-
console.print(f"[yellow]You already have a studio: {existing['
|
963
|
+
console.print(f"[yellow]You already have a studio: {existing['studio_id']}[/yellow]")
|
966
964
|
return
|
967
965
|
|
968
966
|
console.print(f"Creating {size_gb}GB studio for user [cyan]{username}[/cyan]...")
|
@@ -1004,22 +1002,22 @@ def studio_status():
|
|
1004
1002
|
|
1005
1003
|
# Create status panel
|
1006
1004
|
status_lines = [
|
1007
|
-
f"[bold]Studio ID:[/bold] {studio['
|
1008
|
-
f"[bold]User:[/bold] {studio['
|
1009
|
-
f"[bold]Status:[/bold] {studio['
|
1010
|
-
f"[bold]Size:[/bold] {studio['
|
1011
|
-
f"[bold]Created:[/bold] {studio['
|
1005
|
+
f"[bold]Studio ID:[/bold] {studio['studio_id']}",
|
1006
|
+
f"[bold]User:[/bold] {studio['user']}",
|
1007
|
+
f"[bold]Status:[/bold] {studio['status']}",
|
1008
|
+
f"[bold]Size:[/bold] {studio['size_gb']}GB",
|
1009
|
+
f"[bold]Created:[/bold] {studio['creation_date']}",
|
1012
1010
|
]
|
1013
1011
|
|
1014
|
-
if studio.get("
|
1015
|
-
status_lines.append(f"[bold]Attached to:[/bold] {studio['
|
1012
|
+
if studio.get("attached_vm_id"):
|
1013
|
+
status_lines.append(f"[bold]Attached to:[/bold] {studio['attached_vm_id']}")
|
1016
1014
|
|
1017
1015
|
# Try to get engine details
|
1018
1016
|
response = make_api_request("GET", "/engines")
|
1019
1017
|
if response.status_code == 200:
|
1020
1018
|
engines = response.json().get("engines", [])
|
1021
1019
|
attached_engine = next(
|
1022
|
-
(e for e in engines if e["instance_id"] == studio["
|
1020
|
+
(e for e in engines if e["instance_id"] == studio["attached_vm_id"]),
|
1023
1021
|
None
|
1024
1022
|
)
|
1025
1023
|
if attached_engine:
|
@@ -1055,19 +1053,19 @@ def attach_studio(
|
|
1055
1053
|
console.print("[red]❌ Failed to create studio[/red]")
|
1056
1054
|
raise typer.Exit(1)
|
1057
1055
|
studio = response.json()
|
1058
|
-
studio["
|
1056
|
+
studio["studio_id"] = studio["studio_id"] # Normalize key
|
1059
1057
|
else:
|
1060
1058
|
raise typer.Exit(0)
|
1061
1059
|
|
1062
1060
|
# Check if already attached
|
1063
|
-
if studio.get("
|
1061
|
+
if studio.get("status") == "in-use":
|
1064
1062
|
console.print(
|
1065
|
-
f"[yellow]Studio is already attached to {studio.get('
|
1063
|
+
f"[yellow]Studio is already attached to {studio.get('attached_vm_id')}[/yellow]"
|
1066
1064
|
)
|
1067
1065
|
if not Confirm.ask("Detach and reattach to new engine?"):
|
1068
1066
|
return
|
1069
1067
|
# Detach first
|
1070
|
-
response = make_api_request("POST", f"/studios/{studio['
|
1068
|
+
response = make_api_request("POST", f"/studios/{studio['studio_id']}/detach")
|
1071
1069
|
if response.status_code != 200:
|
1072
1070
|
console.print("[red]❌ Failed to detach studio[/red]")
|
1073
1071
|
raise typer.Exit(1)
|
@@ -1113,7 +1111,7 @@ def attach_studio(
|
|
1113
1111
|
|
1114
1112
|
response = make_api_request(
|
1115
1113
|
"POST",
|
1116
|
-
f"/studios/{studio['
|
1114
|
+
f"/studios/{studio['studio_id']}/attach",
|
1117
1115
|
json_data={
|
1118
1116
|
"vm_id": engine["instance_id"],
|
1119
1117
|
"user": username,
|
@@ -1146,13 +1144,13 @@ def detach_studio():
|
|
1146
1144
|
console.print("[yellow]You don't have a studio.[/yellow]")
|
1147
1145
|
return
|
1148
1146
|
|
1149
|
-
if studio.get("
|
1147
|
+
if studio.get("status") != "in-use":
|
1150
1148
|
console.print("[yellow]Your studio is not attached to any engine.[/yellow]")
|
1151
1149
|
return
|
1152
1150
|
|
1153
|
-
console.print(f"Detaching studio from {studio.get('
|
1151
|
+
console.print(f"Detaching studio from {studio.get('attached_vm_id')}...")
|
1154
1152
|
|
1155
|
-
response = make_api_request("POST", f"/studios/{studio['
|
1153
|
+
response = make_api_request("POST", f"/studios/{studio['studio_id']}/detach")
|
1156
1154
|
|
1157
1155
|
if response.status_code == 200:
|
1158
1156
|
console.print(f"[green]✓ Studio detached successfully![/green]")
|
@@ -1172,8 +1170,8 @@ def delete_studio():
|
|
1172
1170
|
return
|
1173
1171
|
|
1174
1172
|
console.print("[red]⚠️ WARNING: This will permanently delete your studio and all data![/red]")
|
1175
|
-
console.print(f"Studio ID: {studio['
|
1176
|
-
console.print(f"Size: {studio['
|
1173
|
+
console.print(f"Studio ID: {studio['studio_id']}")
|
1174
|
+
console.print(f"Size: {studio['size_gb']}GB")
|
1177
1175
|
|
1178
1176
|
# Multiple confirmations
|
1179
1177
|
if not Confirm.ask("\nAre you sure you want to delete your studio?"):
|
@@ -1191,7 +1189,7 @@ def delete_studio():
|
|
1191
1189
|
console.print("Deletion cancelled.")
|
1192
1190
|
return
|
1193
1191
|
|
1194
|
-
response = make_api_request("DELETE", f"/studios/{studio['
|
1192
|
+
response = make_api_request("DELETE", f"/studios/{studio['studio_id']}")
|
1195
1193
|
|
1196
1194
|
if response.status_code == 200:
|
1197
1195
|
console.print(f"[green]✓ Studio deleted successfully![/green]")
|
@@ -1212,9 +1210,6 @@ def list_studios(
|
|
1212
1210
|
if response.status_code == 200:
|
1213
1211
|
studios = response.json().get("studios", [])
|
1214
1212
|
|
1215
|
-
if not all_users:
|
1216
|
-
studios = [s for s in studios if s["UserID"] == username]
|
1217
|
-
|
1218
1213
|
if not studios:
|
1219
1214
|
console.print("No studios found.")
|
1220
1215
|
return
|
@@ -1229,14 +1224,14 @@ def list_studios(
|
|
1229
1224
|
table.add_column("Created")
|
1230
1225
|
|
1231
1226
|
for studio in studios:
|
1232
|
-
status_color = "green" if studio["
|
1227
|
+
status_color = "green" if studio["status"] == "available" else "yellow"
|
1233
1228
|
table.add_row(
|
1234
|
-
studio["
|
1235
|
-
studio["
|
1236
|
-
f"[{status_color}]{studio['
|
1237
|
-
f"{studio['
|
1238
|
-
studio.get("
|
1239
|
-
studio["
|
1229
|
+
studio["studio_id"],
|
1230
|
+
studio["user"],
|
1231
|
+
f"[{status_color}]{studio['status']}[/{status_color}]",
|
1232
|
+
f"{studio['size_gb']}GB",
|
1233
|
+
studio.get("attached_vm_id", "-"),
|
1234
|
+
studio["creation_date"],
|
1240
1235
|
)
|
1241
1236
|
|
1242
1237
|
console.print(table)
|
@@ -1256,9 +1251,9 @@ def reset_studio():
|
|
1256
1251
|
return
|
1257
1252
|
|
1258
1253
|
console.print(f"[yellow]⚠️ This will force-reset your studio state[/yellow]")
|
1259
|
-
console.print(f"Current status: {studio['
|
1260
|
-
if studio.get("
|
1261
|
-
console.print(f"Listed as attached to: {studio['
|
1254
|
+
console.print(f"Current status: {studio['status']}")
|
1255
|
+
if studio.get("attached_vm_id"):
|
1256
|
+
console.print(f"Listed as attached to: {studio['attached_vm_id']}")
|
1262
1257
|
|
1263
1258
|
if not Confirm.ask("\nReset studio state?"):
|
1264
1259
|
console.print("Reset cancelled.")
|
@@ -1273,7 +1268,7 @@ def reset_studio():
|
|
1273
1268
|
try:
|
1274
1269
|
# Check if volume is actually attached
|
1275
1270
|
ec2 = boto3.client("ec2", region_name="us-east-1")
|
1276
|
-
volumes = ec2.describe_volumes(VolumeIds=[studio["
|
1271
|
+
volumes = ec2.describe_volumes(VolumeIds=[studio["studio_id"]])
|
1277
1272
|
|
1278
1273
|
if volumes["Volumes"]:
|
1279
1274
|
volume = volumes["Volumes"][0]
|
@@ -1284,19 +1279,19 @@ def reset_studio():
|
|
1284
1279
|
)
|
1285
1280
|
if Confirm.ask("Force-detach the volume?"):
|
1286
1281
|
ec2.detach_volume(
|
1287
|
-
VolumeId=studio["
|
1282
|
+
VolumeId=studio["studio_id"],
|
1288
1283
|
InstanceId=attachments[0]["InstanceId"],
|
1289
1284
|
Force=True,
|
1290
1285
|
)
|
1291
1286
|
console.print("Waiting for volume to detach...")
|
1292
1287
|
waiter = ec2.get_waiter("volume_available")
|
1293
|
-
waiter.wait(VolumeIds=[studio["
|
1288
|
+
waiter.wait(VolumeIds=[studio["studio_id"]])
|
1294
1289
|
|
1295
1290
|
# Reset in DynamoDB
|
1296
1291
|
table.update_item(
|
1297
|
-
Key={"
|
1298
|
-
UpdateExpression="SET #status = :status,
|
1299
|
-
ExpressionAttributeNames={"#status": "
|
1292
|
+
Key={"studio_id": studio["studio_id"]},
|
1293
|
+
UpdateExpression="SET #status = :status, attached_vm_id = :vm_id, attached_device = :device",
|
1294
|
+
ExpressionAttributeNames={"#status": "status"},
|
1300
1295
|
ExpressionAttributeValues={
|
1301
1296
|
":status": "available",
|
1302
1297
|
":vm_id": None,
|
@@ -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=uqS46dGMaF5UGNbIJ3G1oY3QxD38jUNHiBAfYMBpmf4,46268
|
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.3.dist-info/METADATA,sha256=mWVT1xFladhd-RuJOeESPAoFxe1FDKsJP-G9tTlO1yk,2842
|
31
|
+
dayhoff_tools-1.3.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
32
|
+
dayhoff_tools-1.3.3.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
33
|
+
dayhoff_tools-1.3.3.dist-info/RECORD,,
|
File without changes
|
File without changes
|