dayhoff-tools 1.9.11__tar.gz → 1.9.12__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.9.11 → dayhoff_tools-1.9.12}/PKG-INFO +1 -1
- dayhoff_tools-1.9.12/dayhoff_tools/cli/engine/__init__.py +291 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/pyproject.toml +1 -1
- dayhoff_tools-1.9.11/dayhoff_tools/cli/engine/__init__.py +0 -49
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/README.md +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/engine_core.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/engine_lifecycle.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/engine_maintenance.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/engine_management.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/shared.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/studio_commands.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/warehouse.py +0 -0
@@ -0,0 +1,291 @@
|
|
1
|
+
"""Engine and Studio management commands for DHT CLI."""
|
2
|
+
|
3
|
+
import typer
|
4
|
+
|
5
|
+
# Initialize Typer apps
|
6
|
+
engine_app = typer.Typer(help="Manage compute engines for development.")
|
7
|
+
studio_app = typer.Typer(help="Manage persistent development studios.")
|
8
|
+
|
9
|
+
# Use lazy loading pattern similar to main.py swarm commands
|
10
|
+
# Import functions only when commands are actually called
|
11
|
+
|
12
|
+
# Engine commands
|
13
|
+
@engine_app.command("launch")
|
14
|
+
def launch_engine_cmd(
|
15
|
+
name: str = typer.Argument(help="Name for the new engine"),
|
16
|
+
engine_type: str = typer.Option(
|
17
|
+
"cpu",
|
18
|
+
"--type",
|
19
|
+
"-t",
|
20
|
+
help="Engine type: cpu, cpumax, t4, a10g, a100, 4_t4, 8_t4, 4_a10g, 8_a10g",
|
21
|
+
),
|
22
|
+
user: str = typer.Option(None, "--user", "-u", help="Override username"),
|
23
|
+
boot_disk_size: int = typer.Option(
|
24
|
+
None,
|
25
|
+
"--size",
|
26
|
+
"-s",
|
27
|
+
help="Boot disk size in GB (default: 50GB, min: 20GB, max: 1000GB)",
|
28
|
+
),
|
29
|
+
availability_zone: str = typer.Option(
|
30
|
+
None,
|
31
|
+
"--az",
|
32
|
+
help="Prefer a specific Availability Zone (e.g., us-east-1b). If omitted the service will try all public subnets.",
|
33
|
+
),
|
34
|
+
):
|
35
|
+
"""Launch a new engine instance."""
|
36
|
+
from .engine_core import launch_engine
|
37
|
+
return launch_engine(name, engine_type, user, boot_disk_size, availability_zone)
|
38
|
+
|
39
|
+
|
40
|
+
@engine_app.command("list")
|
41
|
+
def list_engines_cmd(
|
42
|
+
user: str = typer.Option(None, "--user", "-u", help="Filter by user"),
|
43
|
+
running_only: bool = typer.Option(
|
44
|
+
False, "--running", help="Show only running engines"
|
45
|
+
),
|
46
|
+
stopped_only: bool = typer.Option(
|
47
|
+
False, "--stopped", help="Show only stopped engines"
|
48
|
+
),
|
49
|
+
detailed: bool = typer.Option(
|
50
|
+
False, "--detailed", "-d", help="Show detailed status (slower)"
|
51
|
+
),
|
52
|
+
):
|
53
|
+
"""List engines (shows all engines by default)."""
|
54
|
+
from .engine_core import list_engines
|
55
|
+
return list_engines(user, running_only, stopped_only, detailed)
|
56
|
+
|
57
|
+
|
58
|
+
@engine_app.command("status")
|
59
|
+
def engine_status_cmd(
|
60
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
61
|
+
detailed: bool = typer.Option(False, "--detailed", "-d", help="Show detailed status (slower)"),
|
62
|
+
show_log: bool = typer.Option(False, "--show-log", help="Show bootstrap log (requires --detailed)"),
|
63
|
+
):
|
64
|
+
"""Show engine status and information."""
|
65
|
+
from .engine_core import engine_status
|
66
|
+
return engine_status(name_or_id, detailed, show_log)
|
67
|
+
|
68
|
+
|
69
|
+
@engine_app.command("start")
|
70
|
+
def start_engine_cmd(
|
71
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
72
|
+
):
|
73
|
+
"""Start a stopped engine."""
|
74
|
+
from .engine_lifecycle import start_engine
|
75
|
+
return start_engine(name_or_id)
|
76
|
+
|
77
|
+
|
78
|
+
@engine_app.command("stop")
|
79
|
+
def stop_engine_cmd(
|
80
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
81
|
+
force: bool = typer.Option(
|
82
|
+
False, "--force", "-f", help="Force stop and detach all studios"
|
83
|
+
),
|
84
|
+
):
|
85
|
+
"""Stop an engine."""
|
86
|
+
from .engine_lifecycle import stop_engine
|
87
|
+
return stop_engine(name_or_id, force)
|
88
|
+
|
89
|
+
|
90
|
+
@engine_app.command("terminate")
|
91
|
+
def terminate_engine_cmd(
|
92
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
93
|
+
):
|
94
|
+
"""Permanently terminate an engine."""
|
95
|
+
from .engine_lifecycle import terminate_engine
|
96
|
+
return terminate_engine(name_or_id)
|
97
|
+
|
98
|
+
|
99
|
+
@engine_app.command("ssh")
|
100
|
+
def ssh_engine_cmd(
|
101
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
102
|
+
admin: bool = typer.Option(
|
103
|
+
False, "--admin", help="Connect as ec2-user instead of the engine owner user"
|
104
|
+
),
|
105
|
+
idle_timeout: int = typer.Option(
|
106
|
+
600,
|
107
|
+
"--idle-timeout",
|
108
|
+
help="Idle timeout (seconds) for the SSM port-forward (0 = disable)",
|
109
|
+
),
|
110
|
+
):
|
111
|
+
"""Connect to an engine via SSH."""
|
112
|
+
from .engine_management import ssh_engine
|
113
|
+
return ssh_engine(name_or_id, admin, idle_timeout)
|
114
|
+
|
115
|
+
|
116
|
+
@engine_app.command("config-ssh")
|
117
|
+
def config_ssh_cmd(
|
118
|
+
clean: bool = typer.Option(False, "--clean", help="Remove all managed entries"),
|
119
|
+
all_engines: bool = typer.Option(
|
120
|
+
False, "--all", "-a", help="Include all engines from all users"
|
121
|
+
),
|
122
|
+
admin: bool = typer.Option(
|
123
|
+
False,
|
124
|
+
"--admin",
|
125
|
+
help="Generate entries that use ec2-user instead of per-engine owner user",
|
126
|
+
),
|
127
|
+
):
|
128
|
+
"""Update SSH config with available engines."""
|
129
|
+
from .engine_management import config_ssh
|
130
|
+
return config_ssh(clean, all_engines, admin)
|
131
|
+
|
132
|
+
|
133
|
+
@engine_app.command("resize")
|
134
|
+
def resize_engine_cmd(
|
135
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
136
|
+
size: int = typer.Option(..., "--size", "-s", help="New size in GB"),
|
137
|
+
online: bool = typer.Option(
|
138
|
+
False,
|
139
|
+
"--online",
|
140
|
+
help="Resize while running (requires manual filesystem expansion)",
|
141
|
+
),
|
142
|
+
force: bool = typer.Option(
|
143
|
+
False, "--force", "-f", help="Force resize and detach all studios"
|
144
|
+
),
|
145
|
+
):
|
146
|
+
"""Resize an engine's boot disk."""
|
147
|
+
from .engine_management import resize_engine
|
148
|
+
return resize_engine(name_or_id, size, online, force)
|
149
|
+
|
150
|
+
|
151
|
+
@engine_app.command("gami")
|
152
|
+
def create_ami_cmd(
|
153
|
+
name_or_id: str = typer.Argument(
|
154
|
+
help="Engine name or instance ID to create AMI from"
|
155
|
+
),
|
156
|
+
):
|
157
|
+
"""Create a 'Golden AMI' from a running engine."""
|
158
|
+
from .engine_management import create_ami
|
159
|
+
return create_ami(name_or_id)
|
160
|
+
|
161
|
+
|
162
|
+
@engine_app.command("coffee")
|
163
|
+
def coffee_cmd(
|
164
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
165
|
+
duration: str = typer.Argument("4h", help="Duration (e.g., 2h, 30m, 2h30m)"),
|
166
|
+
cancel: bool = typer.Option(
|
167
|
+
False, "--cancel", help="Cancel existing coffee lock instead of extending"
|
168
|
+
),
|
169
|
+
):
|
170
|
+
"""Pour ☕ for an engine: keeps it awake for the given duration (or cancel)."""
|
171
|
+
from .engine_maintenance import coffee
|
172
|
+
return coffee(name_or_id, duration, cancel)
|
173
|
+
|
174
|
+
|
175
|
+
@engine_app.command("idle")
|
176
|
+
def idle_timeout_cmd_wrapper(
|
177
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
178
|
+
set: str = typer.Option(
|
179
|
+
None, "--set", "-s", help="New timeout (e.g., 2h30m, 45m)"
|
180
|
+
),
|
181
|
+
):
|
182
|
+
"""Show or set the engine idle-detector timeout."""
|
183
|
+
from .engine_maintenance import idle_timeout_cmd
|
184
|
+
return idle_timeout_cmd(name_or_id, set)
|
185
|
+
|
186
|
+
|
187
|
+
@engine_app.command("debug")
|
188
|
+
def debug_engine_cmd(
|
189
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
190
|
+
):
|
191
|
+
"""Debug engine bootstrap status and files."""
|
192
|
+
from .engine_maintenance import debug_engine
|
193
|
+
return debug_engine(name_or_id)
|
194
|
+
|
195
|
+
|
196
|
+
@engine_app.command("repair")
|
197
|
+
def repair_engine_cmd(
|
198
|
+
name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
199
|
+
):
|
200
|
+
"""Repair an engine that's stuck in a bad state (e.g., after GAMI creation)."""
|
201
|
+
from .engine_maintenance import repair_engine
|
202
|
+
return repair_engine(name_or_id)
|
203
|
+
|
204
|
+
|
205
|
+
# Studio commands
|
206
|
+
@studio_app.command("create")
|
207
|
+
def create_studio_cmd(
|
208
|
+
size_gb: int = typer.Option(50, "--size", "-s", help="Studio size in GB"),
|
209
|
+
):
|
210
|
+
"""Create a new studio for the current user."""
|
211
|
+
from .studio_commands import create_studio
|
212
|
+
return create_studio(size_gb)
|
213
|
+
|
214
|
+
|
215
|
+
@studio_app.command("status")
|
216
|
+
def studio_status_cmd(
|
217
|
+
user: str = typer.Option(
|
218
|
+
None, "--user", "-u", help="Check status for a different user (admin only)"
|
219
|
+
),
|
220
|
+
):
|
221
|
+
"""Show status of your studio."""
|
222
|
+
from .studio_commands import studio_status
|
223
|
+
return studio_status(user)
|
224
|
+
|
225
|
+
|
226
|
+
@studio_app.command("attach")
|
227
|
+
def attach_studio_cmd(
|
228
|
+
engine_name_or_id: str = typer.Argument(help="Engine name or instance ID"),
|
229
|
+
user: str = typer.Option(
|
230
|
+
None, "--user", "-u", help="Attach a different user's studio (admin only)"
|
231
|
+
),
|
232
|
+
):
|
233
|
+
"""Attach your studio to an engine."""
|
234
|
+
from .studio_commands import attach_studio
|
235
|
+
return attach_studio(engine_name_or_id, user)
|
236
|
+
|
237
|
+
|
238
|
+
@studio_app.command("detach")
|
239
|
+
def detach_studio_cmd(
|
240
|
+
user: str = typer.Option(
|
241
|
+
None, "--user", "-u", help="Detach a different user's studio (admin only)"
|
242
|
+
),
|
243
|
+
):
|
244
|
+
"""Detach your studio from its current engine."""
|
245
|
+
from .studio_commands import detach_studio
|
246
|
+
return detach_studio(user)
|
247
|
+
|
248
|
+
|
249
|
+
@studio_app.command("delete")
|
250
|
+
def delete_studio_cmd(
|
251
|
+
user: str = typer.Option(
|
252
|
+
None, "--user", "-u", help="Delete a different user's studio (admin only)"
|
253
|
+
),
|
254
|
+
):
|
255
|
+
"""Delete your studio permanently."""
|
256
|
+
from .studio_commands import delete_studio
|
257
|
+
return delete_studio(user)
|
258
|
+
|
259
|
+
|
260
|
+
@studio_app.command("list")
|
261
|
+
def list_studios_cmd(
|
262
|
+
all_users: bool = typer.Option(
|
263
|
+
False, "--all", "-a", help="Show all users' studios"
|
264
|
+
),
|
265
|
+
):
|
266
|
+
"""List studios."""
|
267
|
+
from .studio_commands import list_studios
|
268
|
+
return list_studios(all_users)
|
269
|
+
|
270
|
+
|
271
|
+
@studio_app.command("reset")
|
272
|
+
def reset_studio_cmd(
|
273
|
+
user: str = typer.Option(
|
274
|
+
None, "--user", "-u", help="Reset a different user's studio"
|
275
|
+
),
|
276
|
+
):
|
277
|
+
"""Reset a stuck studio (admin operation)."""
|
278
|
+
from .studio_commands import reset_studio
|
279
|
+
return reset_studio(user)
|
280
|
+
|
281
|
+
|
282
|
+
@studio_app.command("resize")
|
283
|
+
def resize_studio_cmd(
|
284
|
+
size: int = typer.Option(..., "--size", "-s", help="New size in GB"),
|
285
|
+
user: str = typer.Option(
|
286
|
+
None, "--user", "-u", help="Resize a different user's studio (admin only)"
|
287
|
+
),
|
288
|
+
):
|
289
|
+
"""Resize your studio volume (requires detachment)."""
|
290
|
+
from .studio_commands import resize_studio
|
291
|
+
return resize_studio(size, user)
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
5
5
|
|
6
6
|
[project]
|
7
7
|
name = "dayhoff-tools"
|
8
|
-
version = "1.9.
|
8
|
+
version = "1.9.12"
|
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"}
|
@@ -1,49 +0,0 @@
|
|
1
|
-
"""Engine and Studio management commands for DHT CLI."""
|
2
|
-
|
3
|
-
import typer
|
4
|
-
|
5
|
-
# Initialize Typer apps
|
6
|
-
engine_app = typer.Typer(help="Manage compute engines for development.")
|
7
|
-
studio_app = typer.Typer(help="Manage persistent development studios.")
|
8
|
-
|
9
|
-
# Import all command functions
|
10
|
-
from .engine_core import engine_status, launch_engine, list_engines
|
11
|
-
from .engine_lifecycle import start_engine, stop_engine, terminate_engine
|
12
|
-
from .engine_maintenance import coffee, debug_engine, idle_timeout_cmd, repair_engine
|
13
|
-
from .engine_management import config_ssh, create_ami, resize_engine, ssh_engine
|
14
|
-
from .studio_commands import (
|
15
|
-
attach_studio,
|
16
|
-
create_studio,
|
17
|
-
delete_studio,
|
18
|
-
detach_studio,
|
19
|
-
list_studios,
|
20
|
-
reset_studio,
|
21
|
-
resize_studio,
|
22
|
-
studio_status,
|
23
|
-
)
|
24
|
-
|
25
|
-
# Register engine commands
|
26
|
-
engine_app.command("launch")(launch_engine)
|
27
|
-
engine_app.command("list")(list_engines)
|
28
|
-
engine_app.command("status")(engine_status)
|
29
|
-
engine_app.command("start")(start_engine)
|
30
|
-
engine_app.command("stop")(stop_engine)
|
31
|
-
engine_app.command("terminate")(terminate_engine)
|
32
|
-
engine_app.command("ssh")(ssh_engine)
|
33
|
-
engine_app.command("config-ssh")(config_ssh)
|
34
|
-
engine_app.command("resize")(resize_engine)
|
35
|
-
engine_app.command("gami")(create_ami)
|
36
|
-
engine_app.command("coffee")(coffee)
|
37
|
-
engine_app.command("idle")(idle_timeout_cmd)
|
38
|
-
engine_app.command("debug")(debug_engine)
|
39
|
-
engine_app.command("repair")(repair_engine)
|
40
|
-
|
41
|
-
# Register studio commands
|
42
|
-
studio_app.command("create")(create_studio)
|
43
|
-
studio_app.command("status")(studio_status)
|
44
|
-
studio_app.command("attach")(attach_studio)
|
45
|
-
studio_app.command("detach")(detach_studio)
|
46
|
-
studio_app.command("delete")(delete_studio)
|
47
|
-
studio_app.command("list")(list_studios)
|
48
|
-
studio_app.command("reset")(reset_studio)
|
49
|
-
studio_app.command("resize")(resize_studio)
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
File without changes
|
{dayhoff_tools-1.9.11 → dayhoff_tools-1.9.12}/dayhoff_tools/cli/engine/engine_maintenance.py
RENAMED
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
|