dayhoff-tools 1.5.9__py3-none-any.whl → 1.6.1__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.

Potentially problematic release.


This version of dayhoff-tools might be problematic. Click here for more details.

@@ -1477,27 +1477,49 @@ def create_ami(
1477
1477
  for s in attached_studios:
1478
1478
  console.print(f" • {s['user']} ({s['studio_id']})")
1479
1479
 
1480
+ detach_failed = []
1480
1481
  for s in attached_studios:
1481
1482
  resp = make_api_request("POST", f"/studios/{s['studio_id']}/detach")
1482
1483
  if resp.status_code != 200:
1484
+ # Check if actually detached despite error
1485
+ time.sleep(2)
1486
+ check_resp = make_api_request("GET", f"/studios/{s['studio_id']}")
1487
+ if check_resp.status_code == 200:
1488
+ studio_data = check_resp.json()
1489
+ if studio_data.get("status") == "available":
1490
+ console.print(
1491
+ f" [yellow]⚠ {s['studio_id']} reported error but is detached[/yellow]"
1492
+ )
1493
+ continue # It's actually detached, continue
1494
+
1483
1495
  console.print(
1484
- f"[red]❌ Failed to detach {s['studio_id']} – aborting.[/red]"
1496
+ f" [red]❌ Failed to detach {s['studio_id']}[/red]"
1485
1497
  )
1486
- return
1498
+ detach_failed.append(s['studio_id'])
1499
+
1500
+ if detach_failed:
1501
+ console.print(
1502
+ f"[red]Failed to detach {len(detach_failed)} studio(s). Aborting AMI creation.[/red]"
1503
+ )
1504
+ return
1487
1505
 
1488
1506
  # Wait briefly for volumes to become available (max 2 min)
1489
1507
  # (time is already imported at module level)
1490
1508
  ec2_wait = boto3.client("ec2", region_name="us-east-1")
1491
1509
  vol_ids = [s["studio_id"] for s in attached_studios]
1492
1510
  console.print("Waiting for volumes to detach…")
1493
- waiter = ec2_wait.get_waiter("volume_available")
1494
- try:
1495
- waiter.wait(
1496
- VolumeIds=vol_ids, WaiterConfig={"Delay": 5, "MaxAttempts": 24}
1497
- )
1498
- except Exception:
1511
+
1512
+ # Check volume states directly instead of using waiter
1513
+ for attempt in range(24): # Max 2 minutes
1514
+ time.sleep(5)
1515
+ volumes = ec2_wait.describe_volumes(VolumeIds=vol_ids)["Volumes"]
1516
+ all_available = all(v["State"] == "available" for v in volumes)
1517
+ if all_available:
1518
+ console.print("[green]✓ All studios detached[/green]")
1519
+ break
1520
+ else:
1499
1521
  console.print(
1500
- "[yellow]Proceeding even though some volumes may still be detaching.[/yellow]"
1522
+ "[yellow] Some volumes may still be detaching, but proceeding...[/yellow]"
1501
1523
  )
1502
1524
 
1503
1525
  # Create the AMI
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.5.9
3
+ Version: 1.6.1
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=RSbZK2hN3bTBQrZxAgooqMsqSiw0hnhmzTVkL44xdD4,97147
6
+ dayhoff_tools/cli/engine_commands.py,sha256=iZdl1eyJqwGVVm0vukY8sbnMv_k7CaesdnGBjE3cF0c,98283
7
7
  dayhoff_tools/cli/main.py,sha256=tRN7WCBHg6uyNp6rA54pKTCoVmBntta2i0Yas3bUpZ4,4853
8
8
  dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
9
9
  dayhoff_tools/cli/utility_commands.py,sha256=FRZTPrjsG_qmIIqoNxd1Q1vVkS_5w8aY33IrVYVNCLg,18131
@@ -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=heaYc64qplgN3_1WVPFmqj53goStioWwY5NqlWc4c0s,24453
30
- dayhoff_tools-1.5.9.dist-info/METADATA,sha256=mGdK_rLBA7HwjkUI7e2sQ5oGExLsBU8A-GIBD9-xyaM,2914
31
- dayhoff_tools-1.5.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.5.9.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.5.9.dist-info/RECORD,,
30
+ dayhoff_tools-1.6.1.dist-info/METADATA,sha256=HL_pHrcjy_JbaTdP8O0mAP0xUzrEDp7VWpcFfuWwzbM,2914
31
+ dayhoff_tools-1.6.1.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.6.1.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.6.1.dist-info/RECORD,,