dayhoff-tools 1.6.6__tar.gz → 1.6.8__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.6.6 → dayhoff_tools-1.6.8}/PKG-INFO +1 -1
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/engine_commands.py +36 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/pyproject.toml +1 -1
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/README.md +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.6.6 → dayhoff_tools-1.6.8}/dayhoff_tools/warehouse.py +0 -0
@@ -1710,6 +1710,36 @@ def attach_studio(
|
|
1710
1710
|
|
1711
1711
|
console.print(f"Attaching studio to engine [cyan]{engine['name']}[/cyan]...")
|
1712
1712
|
|
1713
|
+
# Helper --------------------------------------------------------------
|
1714
|
+
def _is_studio_attached(target_studio_id: str, target_vm_id: str) -> bool:
|
1715
|
+
"""Return True when the given studio already shows as attached to the VM.
|
1716
|
+
|
1717
|
+
Using this extra check lets us stop the outer retry loop as soon as the
|
1718
|
+
asynchronous attach operation actually finishes, even in the unlikely
|
1719
|
+
event that the operation-tracking DynamoDB record is not yet updated.
|
1720
|
+
"""
|
1721
|
+
# First try the per-studio endpoint – fastest.
|
1722
|
+
resp = make_api_request("GET", f"/studios/{target_studio_id}")
|
1723
|
+
if resp.status_code == 200:
|
1724
|
+
data = resp.json()
|
1725
|
+
if (
|
1726
|
+
data.get("status") == "in-use"
|
1727
|
+
and data.get("attached_vm_id") == target_vm_id
|
1728
|
+
):
|
1729
|
+
return True
|
1730
|
+
# Fallback: list + filter (covers edge-cases where the direct endpoint
|
1731
|
+
# is slower to update IAM/APIGW mapping than the list endpoint).
|
1732
|
+
list_resp = make_api_request("GET", "/studios")
|
1733
|
+
if list_resp.status_code == 200:
|
1734
|
+
for stu in list_resp.json().get("studios", []):
|
1735
|
+
if (
|
1736
|
+
stu.get("studio_id") == target_studio_id
|
1737
|
+
and stu.get("status") == "in-use"
|
1738
|
+
and stu.get("attached_vm_id") == target_vm_id
|
1739
|
+
):
|
1740
|
+
return True
|
1741
|
+
return False
|
1742
|
+
|
1713
1743
|
# Determine retry strategy based on whether we just started the engine
|
1714
1744
|
if engine_started_now:
|
1715
1745
|
max_attempts = 40 # About 7 minutes total with exponential backoff
|
@@ -1734,6 +1764,12 @@ def attach_studio(
|
|
1734
1764
|
last_error = None
|
1735
1765
|
|
1736
1766
|
for attempt in range(max_attempts):
|
1767
|
+
# If the attach already completed in the previous iteration (but we
|
1768
|
+
# didn't notice because the operation table wasn’t updated yet),
|
1769
|
+
# bail out early.
|
1770
|
+
if _is_studio_attached(studio["studio_id"], engine["instance_id"]):
|
1771
|
+
success = True
|
1772
|
+
break
|
1737
1773
|
success, error_msg = _attempt_studio_attach(
|
1738
1774
|
studio, engine, target_user, public_key
|
1739
1775
|
)
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.6.
|
8
|
+
version = "1.6.8"
|
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
|