dayhoff-tools 1.4.10__tar.gz → 1.4.12__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.
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/PKG-INFO +1 -1
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/engine_commands.py +44 -20
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/pyproject.toml +1 -1
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/README.md +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.4.10 → dayhoff_tools-1.4.12}/dayhoff_tools/warehouse.py +0 -0
@@ -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,14 +1621,13 @@ 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:
|
1624
1629
|
raise typer.Exit(1)
|
1625
1630
|
|
1626
|
-
# Track whether this command just started the engine (affects retry length)
|
1627
|
-
engine_started_now = False
|
1628
|
-
|
1629
1631
|
# Retrieve SSH public key (required for authorised_keys provisioning)
|
1630
1632
|
try:
|
1631
1633
|
public_key = get_ssh_public_key()
|
@@ -1635,33 +1637,55 @@ def attach_studio(
|
|
1635
1637
|
|
1636
1638
|
console.print(f"Attaching studio to engine [cyan]{engine['name']}[/cyan]...")
|
1637
1639
|
|
1638
|
-
|
1639
|
-
|
1640
|
-
|
1641
|
-
|
1642
|
-
|
1643
|
-
|
1644
|
-
|
1645
|
-
|
1646
|
-
|
1647
|
-
|
1640
|
+
# Determine retry strategy
|
1641
|
+
max_attempts = 40 if engine_started_now else 3
|
1642
|
+
retry_delay = 10 if engine_started_now else 3
|
1643
|
+
|
1644
|
+
if engine_started_now:
|
1645
|
+
# Long spinner-based loop while the freshly started engine finishes booting
|
1646
|
+
with Progress(
|
1647
|
+
SpinnerColumn(),
|
1648
|
+
TimeElapsedColumn(),
|
1649
|
+
TextColumn("[progress.description]{task.description}"),
|
1650
|
+
transient=True,
|
1651
|
+
) as prog:
|
1652
|
+
task = prog.add_task("Attaching studio (engine is still booting)…", total=None)
|
1653
|
+
|
1654
|
+
for attempt in range(max_attempts):
|
1655
|
+
success, error_msg = _attempt_studio_attach(studio, engine, target_user, public_key)
|
1656
|
+
|
1657
|
+
if success:
|
1658
|
+
break # success!
|
1659
|
+
|
1660
|
+
# Update spinner every 3rd try to avoid log spam
|
1661
|
+
if attempt % 3 == 0:
|
1662
|
+
prog.update(task, description=f"Attaching studio (engine is still booting)… {attempt+1}/{max_attempts}")
|
1663
|
+
|
1664
|
+
if error_msg:
|
1665
|
+
console.print(f"[red]❌ Failed to attach studio: {error_msg}[/red]")
|
1666
|
+
return
|
1667
|
+
|
1668
|
+
time.sleep(retry_delay)
|
1669
|
+
|
1670
|
+
else:
|
1671
|
+
console.print("[yellow]Engine is still starting up – please retry in a minute.[/yellow]")
|
1672
|
+
return
|
1673
|
+
else:
|
1674
|
+
# Quick path: engine is already running – try a couple of times then fail fast
|
1675
|
+
for attempt in range(max_attempts):
|
1648
1676
|
success, error_msg = _attempt_studio_attach(studio, engine, target_user, public_key)
|
1649
1677
|
|
1650
1678
|
if success:
|
1651
|
-
break #
|
1652
|
-
|
1653
|
-
# Update spinner description with attempt number
|
1654
|
-
if attempt % 3 == 0: # update every 3rd attempt to avoid spam
|
1655
|
-
prog.update(task, description=f"Attaching studio (engine is still booting)… {attempt+1}/{ATTEMPT_LIMIT}")
|
1679
|
+
break # good to go
|
1656
1680
|
|
1657
1681
|
if error_msg:
|
1658
1682
|
console.print(f"[red]❌ Failed to attach studio: {error_msg}[/red]")
|
1659
1683
|
return
|
1660
1684
|
|
1661
|
-
time.sleep(
|
1685
|
+
time.sleep(retry_delay)
|
1662
1686
|
|
1663
1687
|
else:
|
1664
|
-
console.print("[yellow]
|
1688
|
+
console.print("[yellow]Could not attach studio – please retry in a moment.[/yellow]")
|
1665
1689
|
return
|
1666
1690
|
|
1667
1691
|
# Successful attach path
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.4.
|
8
|
+
version = "1.4.12"
|
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
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|