dayhoff-tools 1.9.14__py3-none-any.whl → 1.9.16__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.
@@ -185,7 +185,40 @@ def idle_timeout_cmd(
185
185
  time.sleep(2) # Give it a moment to process
186
186
  console.print(f"[green]✓ Slack notifications updated to '{slack}'[/green]")
187
187
 
188
- if set is None and not slack:
188
+ # Handle setting new timeout value
189
+ if set is not None:
190
+ m = re.match(r"^(?:(\d+)h)?(?:(\d+)m)?$", set)
191
+ if not m:
192
+ console.print(
193
+ "[red]❌ Invalid duration format. Use e.g. 2h, 45m, 1h30m[/red]"
194
+ )
195
+ raise typer.Exit(1)
196
+ hours = int(m.group(1) or 0)
197
+ minutes = int(m.group(2) or 0)
198
+ seconds = hours * 3600 + minutes * 60
199
+ if seconds == 0:
200
+ console.print("[red]❌ Duration must be greater than zero[/red]")
201
+ raise typer.Exit(1)
202
+
203
+ console.print(f"Setting idle timeout to {set} ({seconds} seconds)…")
204
+
205
+ cmd = (
206
+ "sudo sed -i '/^IDLE_TIMEOUT_SECONDS=/d' /etc/engine.env && "
207
+ f"echo 'IDLE_TIMEOUT_SECONDS={seconds}' | sudo tee -a /etc/engine.env >/dev/null && "
208
+ "sudo systemctl restart engine-idle-detector.service"
209
+ )
210
+
211
+ resp = ssm.send_command(
212
+ InstanceIds=[engine["instance_id"]],
213
+ DocumentName="AWS-RunShellScript",
214
+ Parameters={"commands": [cmd], "executionTimeout": ["60"]},
215
+ )
216
+ cid = resp["Command"]["CommandId"]
217
+ time.sleep(2)
218
+ console.print(f"[green]✓ Idle timeout updated to {set}[/green]")
219
+
220
+ # If no action was specified, show current timeout
221
+ if set is None and slack is None:
189
222
  # Show current timeout setting
190
223
  resp = ssm.send_command(
191
224
  InstanceIds=[engine["instance_id"]],
@@ -210,35 +243,6 @@ def idle_timeout_cmd(
210
243
  console.print("[red]❌ Could not retrieve idle timeout[/red]")
211
244
  return
212
245
 
213
- # ----- set new value for timeout -----
214
- m = re.match(r"^(?:(\d+)h)?(?:(\d+)m)?$", set)
215
- if not m:
216
- console.print("[red]❌ Invalid duration format. Use e.g. 2h, 45m, 1h30m[/red]")
217
- raise typer.Exit(1)
218
- hours = int(m.group(1) or 0)
219
- minutes = int(m.group(2) or 0)
220
- seconds = hours * 3600 + minutes * 60
221
- if seconds == 0:
222
- console.print("[red]❌ Duration must be greater than zero[/red]")
223
- raise typer.Exit(1)
224
-
225
- console.print(f"Setting idle timeout to {set} ({seconds} seconds)…")
226
-
227
- cmd = (
228
- "sudo sed -i '/^IDLE_TIMEOUT_SECONDS=/d' /etc/engine.env && "
229
- f"echo 'IDLE_TIMEOUT_SECONDS={seconds}' | sudo tee -a /etc/engine.env >/dev/null && "
230
- "sudo systemctl restart engine-idle-detector.service"
231
- )
232
-
233
- resp = ssm.send_command(
234
- InstanceIds=[engine["instance_id"]],
235
- DocumentName="AWS-RunShellScript",
236
- Parameters={"commands": [cmd], "executionTimeout": ["60"]},
237
- )
238
- cid = resp["Command"]["CommandId"]
239
- time.sleep(2)
240
- console.print(f"[green]✓ Idle timeout updated to {set}[/green]")
241
-
242
246
 
243
247
  def debug_engine(
244
248
  name_or_id: str = typer.Argument(help="Engine name or instance ID"),
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.3
2
2
  Name: dayhoff-tools
3
- Version: 1.9.14
3
+ Version: 1.9.16
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
@@ -6,7 +6,7 @@ dayhoff_tools/cli/cloud_commands.py,sha256=33qcWLmq-FwEXMdL3F0OHm-5Stlh2r65CldyE
6
6
  dayhoff_tools/cli/engine/__init__.py,sha256=RE45X2IPCNUvQp6_OHI2lbjwoqexkH3roUPccIHkeJo,9540
7
7
  dayhoff_tools/cli/engine/engine_core.py,sha256=ItfqW3ZWoHEWLOgtWPYT-SO1idxk5RBBCIe8w9xxf3w,26959
8
8
  dayhoff_tools/cli/engine/engine_lifecycle.py,sha256=_Dk-EZs_qbm8APdOuGOuxhlbK6RgkkoLk2nrwKoo1-A,4519
9
- dayhoff_tools/cli/engine/engine_maintenance.py,sha256=xZgEgpjwTDI2RpoN7P6E7MEGiIA8RJpb0MkCT9u2R14,15889
9
+ dayhoff_tools/cli/engine/engine_maintenance.py,sha256=GxKjb44h6Rzxbd1ycLOzB39Lzo-YZ2s3XhlWygV5BF4,16093
10
10
  dayhoff_tools/cli/engine/engine_management.py,sha256=s_H3FtMlKsdfzR8pwV-j2W2QX-Fypkqj2kPC0aTqC1A,19072
11
11
  dayhoff_tools/cli/engine/shared.py,sha256=Ecx6I1jtzmxQDn3BezKpgpQ4SJeZf4SZjUCLg-67p80,16844
12
12
  dayhoff_tools/cli/engine/studio_commands.py,sha256=VwTQujz32-uMcYusDRE73SdzRpgvIkv7ZAF4zRv6AzA,30266
@@ -33,7 +33,7 @@ dayhoff_tools/intake/uniprot.py,sha256=BZYJQF63OtPcBBnQ7_P9gulxzJtqyorgyuDiPeOJq
33
33
  dayhoff_tools/logs.py,sha256=DKdeP0k0kliRcilwvX0mUB2eipO5BdWUeHwh-VnsICs,838
34
34
  dayhoff_tools/sqlite.py,sha256=jV55ikF8VpTfeQqqlHSbY8OgfyfHj8zgHNpZjBLos_E,18672
35
35
  dayhoff_tools/warehouse.py,sha256=UETBtZD3r7WgvURqfGbyHlT7cxoiVq8isjzMuerKw8I,24475
36
- dayhoff_tools-1.9.14.dist-info/METADATA,sha256=EewV69EQMTMaa0DUiq2t7J9w6WzsTv7Qd7Pz0Jcjg-w,2915
37
- dayhoff_tools-1.9.14.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
- dayhoff_tools-1.9.14.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
39
- dayhoff_tools-1.9.14.dist-info/RECORD,,
36
+ dayhoff_tools-1.9.16.dist-info/METADATA,sha256=11SUuC_t8w2szZPpSIEg4Tb4Wc4JCrd0UcAhymNfqJM,2915
37
+ dayhoff_tools-1.9.16.dist-info/WHEEL,sha256=b4K_helf-jlQoXBBETfwnf4B04YC67LOev0jo4fX5m8,88
38
+ dayhoff_tools-1.9.16.dist-info/entry_points.txt,sha256=iAf4jteNqW3cJm6CO6czLxjW3vxYKsyGLZ8WGmxamSc,49
39
+ dayhoff_tools-1.9.16.dist-info/RECORD,,