dayhoff-tools 1.6.14__tar.gz → 1.7.0__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.14 → dayhoff_tools-1.7.0}/PKG-INFO +1 -1
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/engine_commands.py +6 -63
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/pyproject.toml +1 -1
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/README.md +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.6.14 → dayhoff_tools-1.7.0}/dayhoff_tools/warehouse.py +0 -0
@@ -1764,22 +1764,16 @@ def attach_studio(
|
|
1764
1764
|
last_error = None
|
1765
1765
|
|
1766
1766
|
for attempt in range(max_attempts):
|
1767
|
-
#
|
1768
|
-
# didn't notice because the operation table wasn't updated yet),
|
1769
|
-
# bail out early.
|
1767
|
+
# Check if the attach already completed
|
1770
1768
|
if _is_studio_attached(studio["studio_id"], engine["instance_id"]):
|
1771
|
-
console.print("[dim]DEBUG: Studio already attached (detected by _is_studio_attached)[/dim]")
|
1772
1769
|
success = True
|
1773
1770
|
break
|
1774
1771
|
|
1775
|
-
console.print(f"[dim]DEBUG: Attempt {attempt + 1}/{max_attempts}[/dim]")
|
1776
1772
|
success, error_msg = _attempt_studio_attach(
|
1777
1773
|
studio, engine, target_user, public_key
|
1778
1774
|
)
|
1779
|
-
console.print(f"[dim]DEBUG: Attempt result: success={success}, error_msg={error_msg}[/dim]")
|
1780
1775
|
|
1781
1776
|
if success:
|
1782
|
-
console.print("[dim]DEBUG: Success! Breaking out of retry loop[/dim]")
|
1783
1777
|
break # success!
|
1784
1778
|
|
1785
1779
|
if error_msg:
|
@@ -1851,33 +1845,19 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
|
|
1851
1845
|
},
|
1852
1846
|
)
|
1853
1847
|
|
1854
|
-
# DEBUG: Log what we're getting back
|
1855
|
-
console.print(f"[dim]DEBUG: Attach response: {response.status_code}[/dim]")
|
1856
|
-
if response.status_code not in (200, 202):
|
1857
|
-
try:
|
1858
|
-
console.print(f"[dim]DEBUG: Error: {response.json().get('error', 'No error field')}[/dim]")
|
1859
|
-
except:
|
1860
|
-
console.print(f"[dim]DEBUG: Could not parse error response[/dim]")
|
1861
|
-
|
1862
1848
|
# Fast-path success
|
1863
1849
|
if response.status_code == 200:
|
1864
|
-
console.print("[dim]DEBUG: Got 200 - immediate success[/dim]")
|
1865
1850
|
return True, None
|
1866
1851
|
|
1867
1852
|
# Asynchronous path – API returned 202 Accepted and operation tracking ID
|
1868
1853
|
if response.status_code == 202:
|
1869
|
-
|
1870
|
-
|
1871
|
-
|
1872
|
-
# Instead of polling the operation status (which seems broken),
|
1873
|
-
# just wait a bit and check if the studio is actually attached
|
1874
|
-
# This is what dh studio status does and it works reliably
|
1854
|
+
# The operation status polling is broken in the Lambda, so we just
|
1855
|
+
# wait and check if the studio is actually attached
|
1875
1856
|
time.sleep(5) # Give the async operation a moment to start
|
1876
1857
|
|
1877
|
-
#
|
1858
|
+
# Check periodically if the studio is attached
|
1878
1859
|
for check in range(20): # Check for up to 60 seconds
|
1879
1860
|
if _is_studio_attached(studio["studio_id"], engine["instance_id"]):
|
1880
|
-
console.print("[dim]DEBUG: Studio attachment detected via status check[/dim]")
|
1881
1861
|
return True, None
|
1882
1862
|
time.sleep(3)
|
1883
1863
|
|
@@ -1924,45 +1904,8 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
|
|
1924
1904
|
return False, None
|
1925
1905
|
|
1926
1906
|
|
1927
|
-
|
1928
|
-
|
1929
|
-
|
1930
|
-
Returns (True, "") on success or (False, error_message) on failure or
|
1931
|
-
timeout.
|
1932
|
-
|
1933
|
-
IMPORTANT: This helper deliberately *avoids* creating its own Rich Live/
|
1934
|
-
spinner so that it can be called from inside another Progress/Live context
|
1935
|
-
(the outer "Attaching studio…" progress bar). Nested Live renderables lead
|
1936
|
-
to constant hide/show repaint cycles, which is what caused the flickering
|
1937
|
-
the user observed.
|
1938
|
-
"""
|
1939
|
-
start_ts = time.time()
|
1940
|
-
while True:
|
1941
|
-
# ---- timeout guard -------------------------------------------------
|
1942
|
-
if time.time() - start_ts > timeout:
|
1943
|
-
return False, "Timed out waiting for attach operation to complete"
|
1944
|
-
|
1945
|
-
# ---- fetch status ---------------------------------------------------
|
1946
|
-
op_resp = make_api_request("GET", f"/operations/{operation_id}")
|
1947
|
-
if op_resp.status_code != 200:
|
1948
|
-
console.print(f"[dim]DEBUG: Operation poll failed: HTTP {op_resp.status_code}[/dim]")
|
1949
|
-
return False, (
|
1950
|
-
f"Failed to fetch operation status (HTTP {op_resp.status_code})"
|
1951
|
-
)
|
1952
|
-
data = op_resp.json()
|
1953
|
-
op_status = data.get("status")
|
1954
|
-
console.print(f"[dim]DEBUG: Operation status: {op_status}[/dim]")
|
1955
|
-
|
1956
|
-
# ---- interpret state -----------------------------------------------
|
1957
|
-
if op_status == "COMPLETED":
|
1958
|
-
console.print("[dim]DEBUG: Operation completed successfully[/dim]")
|
1959
|
-
return True, ""
|
1960
|
-
if op_status == "FAILED":
|
1961
|
-
console.print(f"[dim]DEBUG: Operation failed: {data.get('error', 'Operation failed')}[/dim]")
|
1962
|
-
return False, data.get("error", "Operation failed")
|
1963
|
-
|
1964
|
-
# Not finished yet – wait a little and poll again (no live spinner)
|
1965
|
-
time.sleep(3)
|
1907
|
+
# Note: _poll_operation was removed because the Lambda's operation tracking is broken.
|
1908
|
+
# We now use _is_studio_attached() to check if the studio is actually attached instead.
|
1966
1909
|
|
1967
1910
|
|
1968
1911
|
@studio_app.command("detach")
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.
|
8
|
+
version = "1.7.0"
|
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
|