dayhoff-tools 1.4.9__py3-none-any.whl → 1.4.11__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.
@@ -1606,6 +1606,9 @@ def attach_studio(
1606
1606
  engines = response.json().get("engines", [])
1607
1607
  engine = resolve_engine(engine_name_or_id, engines)
1608
1608
 
1609
+ # Flag to track if we started the engine in this command (affects retry length)
1610
+ engine_started_now: bool = False
1611
+
1609
1612
  if engine["state"].lower() != "running":
1610
1613
  console.print(f"[yellow]⚠️ Engine is {engine['state']}[/yellow]")
1611
1614
  if engine["state"].lower() == "stopped" and Confirm.ask(
@@ -1618,6 +1621,8 @@ def attach_studio(
1618
1621
  console.print("[red]❌ Failed to start engine[/red]")
1619
1622
  raise typer.Exit(1)
1620
1623
  console.print("[green]✓ Engine started[/green]")
1624
+ # Mark that we booted the engine so attach loop gets extended retries
1625
+ engine_started_now = True
1621
1626
  # No further waiting here – attachment attempts below handle retry logic while the
1622
1627
  # engine finishes booting.
1623
1628
  else:
@@ -1639,7 +1644,7 @@ def attach_studio(
1639
1644
  transient=True,
1640
1645
  ) as prog:
1641
1646
  task = prog.add_task("Attaching studio (engine is still booting)…", total=None)
1642
- ATTEMPT_LIMIT = 40 # ~6-7 min max (40 × 10 s)
1647
+ ATTEMPT_LIMIT = 40 if engine_started_now else 6 # shorter retries for already-running engines
1643
1648
  RETRY_DELAY = 10
1644
1649
  for attempt in range(ATTEMPT_LIMIT):
1645
1650
  success, error_msg = _attempt_studio_attach(studio, engine, target_user, public_key)
@@ -1648,7 +1653,8 @@ def attach_studio(
1648
1653
  break # success!
1649
1654
 
1650
1655
  # Update spinner description with attempt number
1651
- prog.update(task, description=f"Attaching studio (engine is still booting)… {attempt+1}/{ATTEMPT_LIMIT}")
1656
+ if attempt % 3 == 0: # update every 3rd attempt to avoid spam
1657
+ prog.update(task, description=f"Attaching studio (engine is still booting)… {attempt+1}/{ATTEMPT_LIMIT}")
1652
1658
 
1653
1659
  if error_msg:
1654
1660
  console.print(f"[red]❌ Failed to attach studio: {error_msg}[/red]")
@@ -1699,7 +1705,14 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
1699
1705
  "not available",
1700
1706
  "pending", # VM state pending
1701
1707
  ]
1702
- if any(p in err_msg for p in RECOVERABLE_PATTERNS):
1708
+ FATAL_PATTERNS = [
1709
+ "in-use",
1710
+ "already attached",
1711
+ "permission",
1712
+ ]
1713
+ if any(p in err_msg for p in FATAL_PATTERNS):
1714
+ recoverable = False
1715
+ elif any(p in err_msg for p in RECOVERABLE_PATTERNS):
1703
1716
  recoverable = True
1704
1717
 
1705
1718
  if not recoverable:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.4.9
3
+ Version: 1.4.11
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=jZvSCjyuwYD7VkLgNZtPdql1DIRfV1cBqxfCeX7He-Y,83666
6
+ dayhoff_tools/cli/engine_commands.py,sha256=gUUkeq9dk3cvPXUUBb0jghXyv2sunMHBpZc7QG13WxM,84239
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.4.9.dist-info/METADATA,sha256=W66afkFiTx--DfzPdtSb3FqaZtskSvpboofWw9KvACQ,2824
31
- dayhoff_tools-1.4.9.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.4.9.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.4.9.dist-info/RECORD,,
30
+ dayhoff_tools-1.4.11.dist-info/METADATA,sha256=YL207sfB-ZU1tyuWixWdJegI-oZvWZ7uM7eOWLDokTQ,2825
31
+ dayhoff_tools-1.4.11.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.4.11.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.4.11.dist-info/RECORD,,