dayhoff-tools 1.6.8__tar.gz → 1.6.10__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.
Files changed (32) hide show
  1. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/PKG-INFO +1 -1
  2. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/engine_commands.py +11 -6
  3. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/pyproject.toml +1 -1
  4. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/README.md +0 -0
  5. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/__init__.py +0 -0
  6. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/chemistry/standardizer.py +0 -0
  7. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/chemistry/utils.py +0 -0
  8. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/__init__.py +0 -0
  9. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/cloud_commands.py +0 -0
  10. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/main.py +0 -0
  11. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/swarm_commands.py +0 -0
  12. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/cli/utility_commands.py +0 -0
  13. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/base.py +0 -0
  14. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/deploy_aws.py +0 -0
  15. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
  16. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/deploy_utils.py +0 -0
  17. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/job_runner.py +0 -0
  18. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/processors.py +0 -0
  19. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/deployment/swarm.py +0 -0
  20. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/embedders.py +0 -0
  21. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/fasta.py +0 -0
  22. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/file_ops.py +0 -0
  23. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/h5.py +0 -0
  24. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/gcp.py +0 -0
  25. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/gtdb.py +0 -0
  26. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/kegg.py +0 -0
  27. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/mmseqs.py +0 -0
  28. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/structure.py +0 -0
  29. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/intake/uniprot.py +0 -0
  30. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/logs.py +0 -0
  31. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/sqlite.py +0 -0
  32. {dayhoff_tools-1.6.8 → dayhoff_tools-1.6.10}/dayhoff_tools/warehouse.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.6.8
3
+ Version: 1.6.10
4
4
  Summary: Common tools for all the repos at Dayhoff Labs
5
5
  Author: Daniel Martin-Alarcon
6
6
  Author-email: dma@dayhofflabs.com
@@ -1862,22 +1862,29 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
1862
1862
 
1863
1863
  # --- determine if we should retry ---
1864
1864
  recoverable = False
1865
+ error_text = response.json().get("error", "Unknown error")
1866
+ err_msg = error_text.lower()
1867
+
1868
+ # Check for "Studio is not available (status: in-use)" which means it's already attached
1869
+ if response.status_code == 400 and "not available" in err_msg and "in-use" in err_msg:
1870
+ # Studio is already attached somewhere - check if it's to THIS engine
1871
+ if _is_studio_attached(studio["studio_id"], engine["instance_id"]):
1872
+ return True, None # It's attached to our target engine - success!
1873
+ else:
1874
+ return False, error_text # It's attached elsewhere - fatal error
1875
+
1865
1876
  if response.status_code in (409, 503):
1866
1877
  recoverable = True
1867
1878
  else:
1868
- err_msg = response.json().get("error", "").lower()
1869
1879
  RECOVERABLE_PATTERNS = [
1870
1880
  "not ready",
1871
1881
  "still starting",
1872
1882
  "initializing",
1873
1883
  "failed to mount",
1874
1884
  "device busy",
1875
- "not available",
1876
1885
  "pending", # VM state pending
1877
1886
  ]
1878
1887
  FATAL_PATTERNS = [
1879
- "in-use",
1880
- "already attached",
1881
1888
  "permission",
1882
1889
  ]
1883
1890
  if any(p in err_msg for p in FATAL_PATTERNS):
@@ -1885,8 +1892,6 @@ def _attempt_studio_attach(studio, engine, target_user, public_key):
1885
1892
  elif any(p in err_msg for p in RECOVERABLE_PATTERNS):
1886
1893
  recoverable = True
1887
1894
 
1888
- error_text = response.json().get("error", "Unknown error")
1889
-
1890
1895
  if not recoverable:
1891
1896
  # fatal – abort immediately
1892
1897
  return False, error_text
@@ -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"
8
+ version = "1.6.10"
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