dayhoff-tools 1.14.12__tar.gz → 1.14.13__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.14.12 → dayhoff_tools-1.14.13}/PKG-INFO +1 -1
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/cancel.py +66 -2
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/pyproject.toml +1 -1
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/README.md +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/batch/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/batch/workers/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/batch/workers/base.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/batch/workers/boltz.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/batch/workers/embed_t5.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/chemistry/standardizer.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/chemistry/utils.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/aws_batch.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/boltz.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/clean.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/embed_t5.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/finalize.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/list_jobs.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/local.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/logs.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/retry.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/status.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/submit.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/job_id.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/manifest.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/cloud_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_core.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_lifecycle.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_maintenance.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_management.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/shared.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/studio_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/__init__.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/api_client.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/auth.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/engine-studio-cli.md +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/engine_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/progress.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/cli-simulators.md +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/demo.sh +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/engine_list_simulator.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/engine_status_simulator.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/idle_status_simulator.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/simulator_utils.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/studio_list_simulator.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/studio_status_simulator.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/ssh_config.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/studio_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/github_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/main.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/swarm_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/utility_commands.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/base.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/deploy_aws.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/deploy_gcp.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/deploy_utils.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/job_runner.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/processors.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/deployment/swarm.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/embedders.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/fasta.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/file_ops.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/h5.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/gcp.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/gtdb.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/kegg.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/mmseqs.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/structure.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/intake/uniprot.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/logs.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/sqlite.py +0 -0
- {dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/warehouse.py +0 -0
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
"""Cancel command for stopping running jobs."""
|
|
2
2
|
|
|
3
|
+
import re
|
|
4
|
+
|
|
3
5
|
import click
|
|
4
6
|
|
|
5
7
|
from ..aws_batch import BatchClient, BatchError
|
|
@@ -11,6 +13,14 @@ from ..manifest import (
|
|
|
11
13
|
)
|
|
12
14
|
|
|
13
15
|
|
|
16
|
+
def _parse_retry_job_id(job_id: str) -> tuple[str, str | None]:
|
|
17
|
+
"""Parse a job ID to extract parent job ID and retry suffix."""
|
|
18
|
+
match = re.match(r"^(.+)(-r\d+)$", job_id)
|
|
19
|
+
if match:
|
|
20
|
+
return match.group(1), job_id
|
|
21
|
+
return job_id, None
|
|
22
|
+
|
|
23
|
+
|
|
14
24
|
@click.command()
|
|
15
25
|
@click.argument("job_id")
|
|
16
26
|
@click.option("--force", is_flag=True, help="Force termination of running containers")
|
|
@@ -19,19 +29,29 @@ def cancel(job_id, force, base_path):
|
|
|
19
29
|
"""Cancel a running batch job.
|
|
20
30
|
|
|
21
31
|
Cancels the job in AWS Batch and updates the manifest status.
|
|
32
|
+
Also supports cancelling retry jobs by their ID (e.g., job-id-r1).
|
|
22
33
|
|
|
23
34
|
\b
|
|
24
35
|
Examples:
|
|
25
36
|
dh batch cancel dma-embed-20260109-a3f2
|
|
37
|
+
dh batch cancel dma-embed-20260109-a3f2-r1 # Cancel specific retry
|
|
26
38
|
dh batch cancel dma-embed-20260109-a3f2 --force
|
|
27
39
|
"""
|
|
40
|
+
# Check if this is a retry job ID
|
|
41
|
+
parent_job_id, retry_id = _parse_retry_job_id(job_id)
|
|
42
|
+
|
|
28
43
|
# Load manifest
|
|
29
44
|
try:
|
|
30
|
-
manifest = load_manifest(
|
|
45
|
+
manifest = load_manifest(parent_job_id, base_path)
|
|
31
46
|
except FileNotFoundError:
|
|
32
|
-
click.echo(f"Job not found: {
|
|
47
|
+
click.echo(f"Job not found: {parent_job_id}", err=True)
|
|
33
48
|
raise SystemExit(1)
|
|
34
49
|
|
|
50
|
+
# If cancelling a specific retry job
|
|
51
|
+
if retry_id:
|
|
52
|
+
_cancel_retry_job(manifest, retry_id, force, base_path)
|
|
53
|
+
return
|
|
54
|
+
|
|
35
55
|
# Check if job can be cancelled
|
|
36
56
|
if manifest.status in (
|
|
37
57
|
JobStatus.SUCCEEDED,
|
|
@@ -94,3 +114,47 @@ def cancel(job_id, force, base_path):
|
|
|
94
114
|
except BatchError as e:
|
|
95
115
|
click.echo(click.style(f"✗ Failed to cancel job: {e}", fg="red"), err=True)
|
|
96
116
|
raise SystemExit(1)
|
|
117
|
+
|
|
118
|
+
|
|
119
|
+
def _cancel_retry_job(manifest, retry_id: str, force: bool, base_path: str):
|
|
120
|
+
"""Cancel a specific retry job."""
|
|
121
|
+
# Find the retry info
|
|
122
|
+
retry_info = None
|
|
123
|
+
for retry in manifest.retries:
|
|
124
|
+
if retry.retry_id == retry_id:
|
|
125
|
+
retry_info = retry
|
|
126
|
+
break
|
|
127
|
+
|
|
128
|
+
if not retry_info:
|
|
129
|
+
click.echo(f"Retry job not found: {retry_id}", err=True)
|
|
130
|
+
click.echo(f"Known retries: {[r.retry_id for r in manifest.retries]}", err=True)
|
|
131
|
+
raise SystemExit(1)
|
|
132
|
+
|
|
133
|
+
if not retry_info.batch_job_id:
|
|
134
|
+
click.echo(f"Retry job {retry_id} has no AWS Batch job ID.", err=True)
|
|
135
|
+
raise SystemExit(1)
|
|
136
|
+
|
|
137
|
+
# Cancel in AWS Batch
|
|
138
|
+
try:
|
|
139
|
+
client = BatchClient()
|
|
140
|
+
|
|
141
|
+
if force:
|
|
142
|
+
click.echo(f"Terminating retry job {retry_info.batch_job_id}...")
|
|
143
|
+
client.terminate_job(
|
|
144
|
+
retry_info.batch_job_id,
|
|
145
|
+
reason="Terminated by user via dh batch cancel --force",
|
|
146
|
+
)
|
|
147
|
+
else:
|
|
148
|
+
click.echo(f"Cancelling retry job {retry_info.batch_job_id}...")
|
|
149
|
+
client.cancel_job(
|
|
150
|
+
retry_info.batch_job_id,
|
|
151
|
+
reason="Cancelled by user via dh batch cancel",
|
|
152
|
+
)
|
|
153
|
+
|
|
154
|
+
click.echo()
|
|
155
|
+
click.echo(click.style(f"✓ Retry job {retry_id} cancelled successfully", fg="green"))
|
|
156
|
+
click.echo(f"Parent job: {manifest.job_id}")
|
|
157
|
+
|
|
158
|
+
except BatchError as e:
|
|
159
|
+
click.echo(click.style(f"✗ Failed to cancel retry job: {e}", fg="red"), err=True)
|
|
160
|
+
raise SystemExit(1)
|
|
@@ -5,7 +5,7 @@ build-backend = "poetry.core.masonry.api"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "dayhoff-tools"
|
|
8
|
-
version = "1.14.
|
|
8
|
+
version = "1.14.13"
|
|
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
|
|
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
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/__init__.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/embed_t5.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/finalize.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/batch/commands/list_jobs.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
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_lifecycle.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_maintenance.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/engine_management.py
RENAMED
|
File without changes
|
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engine1/studio_commands.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/__init__.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/api_client.py
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/engine_commands.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/progress.py
RENAMED
|
File without changes
|
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/simulators/demo.sh
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/ssh_config.py
RENAMED
|
File without changes
|
{dayhoff_tools-1.14.12 → dayhoff_tools-1.14.13}/dayhoff_tools/cli/engines_studios/studio_commands.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
|