dayhoff-tools 1.8.6__py3-none-any.whl → 1.8.7__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.
@@ -892,6 +892,48 @@ def engine_status(
892
892
  disk_usage = get_disk_usage_via_ssm(engine["instance_id"]) or "-"
893
893
  status_lines.append(f"Disk: {disk_usage}")
894
894
 
895
+ # Idle timeout (show even when not idle)
896
+ idle_threshold_secs: Optional[int] = None
897
+ # Prefer value from idle detector overlay if present
898
+ try:
899
+ if isinstance(idle_detector.get("idle_threshold"), (int, float)):
900
+ idle_threshold_secs = int(idle_detector["idle_threshold"])
901
+ except Exception:
902
+ idle_threshold_secs = None
903
+
904
+ if idle_threshold_secs is None and engine["state"].lower() == "running":
905
+ # Fallback: read /etc/engine.env via SSM
906
+ try:
907
+ ssm = boto3.client("ssm", region_name="us-east-1")
908
+ resp = ssm.send_command(
909
+ InstanceIds=[engine["instance_id"]],
910
+ DocumentName="AWS-RunShellScript",
911
+ Parameters={
912
+ "commands": [
913
+ "grep -E '^IDLE_TIMEOUT_SECONDS=' /etc/engine.env | cut -d'=' -f2 || echo 1800",
914
+ ],
915
+ "executionTimeout": ["5"],
916
+ },
917
+ )
918
+ cid = resp["Command"]["CommandId"]
919
+ time.sleep(1)
920
+ inv = ssm.get_command_invocation(
921
+ CommandId=cid, InstanceId=engine["instance_id"]
922
+ )
923
+ if inv.get("Status") == "Success":
924
+ out = (inv.get("StandardOutputContent") or "").strip()
925
+ if out:
926
+ idle_threshold_secs = int(out.splitlines()[0].strip())
927
+ except Exception:
928
+ idle_threshold_secs = None
929
+
930
+ if idle_threshold_secs is None:
931
+ idle_threshold_secs = 1800
932
+
933
+ status_lines.append(
934
+ f"Idle timeout: {idle_threshold_secs//60}m ({idle_threshold_secs}s)"
935
+ )
936
+
895
937
  # Health report (only if bootstrap finished)
896
938
  if stage_val == "finished":
897
939
  try:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.8.6
3
+ Version: 1.8.7
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
@@ -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=UKX2B6DKAh82jiyocNMhtmWMhCbNyeOXONMmZ5yD1VE,107809
6
+ dayhoff_tools/cli/engine_commands.py,sha256=DVpVomjFn1YSgtCWEacbfJF_gb-pMHEiL1lewgNPIvU,109444
7
7
  dayhoff_tools/cli/main.py,sha256=LoFs3SI4fdCjP4pdxEAhri-_q0dmNYupmBCRE4KbBac,5933
8
8
  dayhoff_tools/cli/swarm_commands.py,sha256=5EyKj8yietvT5lfoz8Zx0iQvVaNgc3SJX1z2zQR6o6M,5614
9
9
  dayhoff_tools/cli/utility_commands.py,sha256=WQTHOh1MttuxaJjl2c6zMa4x7_JuaKMQgcyotYrU3GA,25883
@@ -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=UETBtZD3r7WgvURqfGbyHlT7cxoiVq8isjzMuerKw8I,24475
30
- dayhoff_tools-1.8.6.dist-info/METADATA,sha256=4FFmSPx7EIfi8eLzspHfAdOZtt_Gj0aLWMQnJ2R2mP4,2914
31
- dayhoff_tools-1.8.6.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
- dayhoff_tools-1.8.6.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
- dayhoff_tools-1.8.6.dist-info/RECORD,,
30
+ dayhoff_tools-1.8.7.dist-info/METADATA,sha256=SK0usJ9RYlGAacdhxWRnf0nvBWCPJZvG8orVV1_61so,2914
31
+ dayhoff_tools-1.8.7.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
32
+ dayhoff_tools-1.8.7.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
33
+ dayhoff_tools-1.8.7.dist-info/RECORD,,