dayhoff-tools 1.6.7__tar.gz → 1.6.9__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.7 → dayhoff_tools-1.6.9}/PKG-INFO +1 -1
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/engine_commands.py +31 -7
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/pyproject.toml +1 -1
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/README.md +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.6.7 → dayhoff_tools-1.6.9}/dayhoff_tools/warehouse.py +0 -0
@@ -1718,14 +1718,27 @@ def attach_studio(
|
|
1718
1718
|
asynchronous attach operation actually finishes, even in the unlikely
|
1719
1719
|
event that the operation-tracking DynamoDB record is not yet updated.
|
1720
1720
|
"""
|
1721
|
+
# First try the per-studio endpoint – fastest.
|
1721
1722
|
resp = make_api_request("GET", f"/studios/{target_studio_id}")
|
1722
|
-
if resp.status_code
|
1723
|
-
|
1724
|
-
|
1725
|
-
|
1726
|
-
|
1727
|
-
|
1728
|
-
|
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
|
1729
1742
|
|
1730
1743
|
# Determine retry strategy based on whether we just started the engine
|
1731
1744
|
if engine_started_now:
|
@@ -1850,6 +1863,17 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
|
|
1850
1863
|
# --- determine if we should retry ---
|
1851
1864
|
recoverable = False
|
1852
1865
|
if response.status_code in (409, 503):
|
1866
|
+
# Special-case: 409 because studio is already in-use. If it's attached to
|
1867
|
+
# *this* engine we can safely treat it as success.
|
1868
|
+
if response.status_code == 409:
|
1869
|
+
try:
|
1870
|
+
err_text = response.json().get("error", "").lower()
|
1871
|
+
except Exception:
|
1872
|
+
err_text = ""
|
1873
|
+
# Fast path – avoid another API call when we know why we got 409.
|
1874
|
+
if "in-use" in err_text or "already attached" in err_text:
|
1875
|
+
if _is_studio_attached(studio["studio_id"], engine["instance_id"]):
|
1876
|
+
return True, None
|
1853
1877
|
recoverable = True
|
1854
1878
|
else:
|
1855
1879
|
err_msg = response.json().get("error", "").lower()
|
@@ -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.9"
|
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
|