dayhoff-tools 1.6.2__py3-none-any.whl → 1.6.3__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.
Potentially problematic release.
This version of dayhoff-tools might be problematic. Click here for more details.
- dayhoff_tools/cli/engine_commands.py +34 -0
- {dayhoff_tools-1.6.2.dist-info → dayhoff_tools-1.6.3.dist-info}/METADATA +1 -1
- {dayhoff_tools-1.6.2.dist-info → dayhoff_tools-1.6.3.dist-info}/RECORD +5 -5
- {dayhoff_tools-1.6.2.dist-info → dayhoff_tools-1.6.3.dist-info}/WHEEL +0 -0
- {dayhoff_tools-1.6.2.dist-info → dayhoff_tools-1.6.3.dist-info}/entry_points.txt +0 -0
|
@@ -1810,9 +1810,20 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
|
|
|
1810
1810
|
},
|
|
1811
1811
|
)
|
|
1812
1812
|
|
|
1813
|
+
# Fast-path success
|
|
1813
1814
|
if response.status_code == 200:
|
|
1814
1815
|
return True, None
|
|
1815
1816
|
|
|
1817
|
+
# Asynchronous path – API returned 202 Accepted and operation tracking ID
|
|
1818
|
+
if response.status_code == 202:
|
|
1819
|
+
op_id = response.json().get("operation_id")
|
|
1820
|
+
if not op_id:
|
|
1821
|
+
return False, "Async operation started but no operation_id returned"
|
|
1822
|
+
poll_ok, poll_err = _poll_operation(op_id)
|
|
1823
|
+
if poll_ok:
|
|
1824
|
+
return True, None
|
|
1825
|
+
return False, poll_err
|
|
1826
|
+
|
|
1816
1827
|
# --- determine if we should retry ---
|
|
1817
1828
|
recoverable = False
|
|
1818
1829
|
if response.status_code in (409, 503):
|
|
@@ -1848,6 +1859,29 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
|
|
|
1848
1859
|
return False, None
|
|
1849
1860
|
|
|
1850
1861
|
|
|
1862
|
+
def _poll_operation(operation_id: str, timeout: int = 600) -> Tuple[bool, str]:
|
|
1863
|
+
"""Poll the /operations/<id> endpoint until it completes or fails.
|
|
1864
|
+
|
|
1865
|
+
Returns (True, "") on success, or (False, error_message) on failure/timeout.
|
|
1866
|
+
"""
|
|
1867
|
+
start_ts = time.time()
|
|
1868
|
+
with Progress(SpinnerColumn(), TimeElapsedColumn(), TextColumn("[progress.description]{task.description}"), transient=True) as prog:
|
|
1869
|
+
task = prog.add_task("Waiting for studio attach to complete…", total=None)
|
|
1870
|
+
while True:
|
|
1871
|
+
if time.time() - start_ts > timeout:
|
|
1872
|
+
return False, "Timed out waiting for attach operation to complete"
|
|
1873
|
+
op_resp = make_api_request("GET", f"/operations/{operation_id}")
|
|
1874
|
+
if op_resp.status_code != 200:
|
|
1875
|
+
return False, f"Failed to fetch operation status (HTTP {op_resp.status_code})"
|
|
1876
|
+
data = op_resp.json()
|
|
1877
|
+
status = data.get("status")
|
|
1878
|
+
if status == "COMPLETED":
|
|
1879
|
+
return True, ""
|
|
1880
|
+
if status == "FAILED":
|
|
1881
|
+
return False, data.get("error", "Operation failed")
|
|
1882
|
+
time.sleep(3)
|
|
1883
|
+
|
|
1884
|
+
|
|
1851
1885
|
@studio_app.command("detach")
|
|
1852
1886
|
def detach_studio(
|
|
1853
1887
|
user: Optional[str] = typer.Option(
|
|
@@ -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=
|
|
6
|
+
dayhoff_tools/cli/engine_commands.py,sha256=NFva_mgtdnAHaVhtj1eGazISGPrMDGggwIeSkp8JmrU,93629
|
|
7
7
|
dayhoff_tools/cli/main.py,sha256=tRN7WCBHg6uyNp6rA54pKTCoVmBntta2i0Yas3bUpZ4,4853
|
|
8
8
|
dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
|
|
9
9
|
dayhoff_tools/cli/utility_commands.py,sha256=FRZTPrjsG_qmIIqoNxd1Q1vVkS_5w8aY33IrVYVNCLg,18131
|
|
@@ -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=heaYc64qplgN3_1WVPFmqj53goStioWwY5NqlWc4c0s,24453
|
|
30
|
-
dayhoff_tools-1.6.
|
|
31
|
-
dayhoff_tools-1.6.
|
|
32
|
-
dayhoff_tools-1.6.
|
|
33
|
-
dayhoff_tools-1.6.
|
|
30
|
+
dayhoff_tools-1.6.3.dist-info/METADATA,sha256=29t9IXzDzyoA2VuYF4O3Snnh61MeIaldBmORFwY1Arg,2914
|
|
31
|
+
dayhoff_tools-1.6.3.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
|
|
32
|
+
dayhoff_tools-1.6.3.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
|
|
33
|
+
dayhoff_tools-1.6.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|