Skip to content

Commit e188dd4

Browse files
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
1 parent afbf55c commit e188dd4

9 files changed

Lines changed: 105 additions & 80 deletions

File tree

skills/matmaster-dpa4-workflows/references/bundled-tools.md

Lines changed: 19 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,12 @@
33
## Contents
44

55
1. Compatibility policy
6-
2. Environment inventory
7-
3. Job-spec generation
8-
4. Bohrium CLI adapter
9-
5. Read-only OpenAPI probe
10-
6. Job template
11-
7. Missing prerequisites
6+
1. Environment inventory
7+
1. Job-spec generation
8+
1. Bohrium CLI adapter
9+
1. Read-only OpenAPI probe
10+
1. Job template
11+
1. Missing prerequisites
1212

1313
## Compatibility policy
1414

@@ -20,9 +20,9 @@ skill does not bundle the proprietary MatMaster UI, Bohrium credentials, the
2020
Use capabilities in this order:
2121

2222
1. installed MatMaster built-in skill/tool;
23-
2. bundled helper using an installed `bohr` CLI;
24-
3. bundled read-only OpenAPI probe;
25-
4. explicit prerequisite installation or user/platform intervention.
23+
1. bundled helper using an installed `bohr` CLI;
24+
1. bundled read-only OpenAPI probe;
25+
1. explicit prerequisite installation or user/platform intervention.
2626

2727
Never fabricate a missing submission API. The bundled OpenAPI helper is intentionally read-only.
2828

@@ -51,13 +51,13 @@ Generate a concrete `job.json` without editing a placeholder manually:
5151

5252
```bash
5353
python scripts/make_job_spec.py case-0001 \
54-
--output case-0001/job.json \
55-
--project-id 123 \
56-
--image registry.dp.tech/path/to/validated-dpa4:tag \
57-
--machine 'CURRENT_VALID_GPU_SKU' \
58-
--name dpa4-workflow-case-0001 \
59-
--backward run.log --backward logs/ --backward results/ \
60-
--max-run-time 1440 --max-reschedule-times 1
54+
--output case-0001/job.json \
55+
--project-id 123 \
56+
--image registry.dp.tech/path/to/validated-dpa4:tag \
57+
--machine 'CURRENT_VALID_GPU_SKU' \
58+
--name dpa4-workflow-case-0001 \
59+
--backward run.log --backward logs/ --backward results/ \
60+
--max-run-time 1440 --max-reschedule-times 1
6161
```
6262

6363
The script rejects incomplete image addresses, guessed `/root/input` commands, missing case directories, and absent `run.sh` for the default command.
@@ -88,11 +88,11 @@ python scripts/bohr_cli.py group-create --name run-v1 --project-id 123
8888
python scripts/bohr_cli.py group-create --name run-v1 --project-id 123 --execute
8989

9090
python scripts/bohr_cli.py job-submit \
91-
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID
91+
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID
9292
python scripts/bohr_cli.py job-submit \
93-
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID --validate
93+
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID --validate
9494
python scripts/bohr_cli.py job-submit \
95-
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID --execute
95+
--spec case-0001/job.json --input case-0001 --group-id GROUP_ID --execute
9696
```
9797

9898
The first form only prints a copy-safe command, `--validate` invokes Bohrium's native dry run without submission, and `--execute` performs the submission. Local validation rejects unresolved placeholders in the job spec and default `run.sh`. The sibling skill owns validation of scientific input files referenced by that wrapper. `job-terminate` and `job-kill` also require `--execute`. Resolve exact job IDs and preserve outputs before lifecycle changes.

skills/matmaster-dpa4-workflows/references/matmaster-operations.md

Lines changed: 40 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,23 @@
33
## Contents
44

55
1. Platform model
6-
2. Capability priority
7-
3. Session node and storage
8-
4. Images and resources
9-
5. Job packaging and submission
10-
6. Monitoring, collection, and lifecycle
11-
7. Authentication and safety
6+
1. Capability priority
7+
1. Session node and storage
8+
1. Images and resources
9+
1. Job packaging and submission
10+
1. Monitoring, collection, and lifecycle
11+
1. Authentication and safety
1212

1313
## Platform model
1414

1515
Keep four layers distinct:
1616

17-
| Layer | Purpose | Persistent? |
18-
|---|---|---|
19-
| MatMaster session node | prepare inputs, debug, inspect, and analyze | system disk: no guarantee; mounted data disks: yes |
20-
| `/personal` | user-scoped durable files | yes |
21-
| `/share` | project-shared durable files | yes, project permissions apply |
22-
| Bohrium container job | isolated production compute with chosen image/resource | job workspace is temporary; declared/downloaded outputs persist |
17+
| Layer | Purpose | Persistent? |
18+
| ---------------------- | ------------------------------------------------------ | --------------------------------------------------------------- |
19+
| MatMaster session node | prepare inputs, debug, inspect, and analyze | system disk: no guarantee; mounted data disks: yes |
20+
| `/personal` | user-scoped durable files | yes |
21+
| `/share` | project-shared durable files | yes, project permissions apply |
22+
| Bohrium container job | isolated production compute with chosen image/resource | job workspace is temporary; declared/downloaded outputs persist |
2323

2424
The session node and submitted job are different resources with different lifecycles and billing. Do not assume a package installed on the session node exists inside the job image.
2525

@@ -28,21 +28,21 @@ The session node and submitted job are different resources with different lifecy
2828
Use this order:
2929

3030
1. MatMaster built-in skill/tool for the exact operation;
31-
2. bundled helper scripts over an installed `bohr` CLI;
32-
3. bundled read-only OpenAPI probe for discovery;
33-
4. raw CLI/OpenAPI only when the packaged helpers lack the required operation.
31+
1. bundled helper scripts over an installed `bohr` CLI;
32+
1. bundled read-only OpenAPI probe for discovery;
33+
1. raw CLI/OpenAPI only when the packaged helpers lack the required operation.
3434

3535
Expected MatMaster platform capability families:
3636

37-
| Need | Capability |
38-
|---|---|
39-
| prepare/inspect files | workspace shell and file tools |
40-
| submit a job or batch | built-in `bohrium-submit` skill |
41-
| list/query jobs and groups | Bohrium query/list action |
42-
| view/download logs and results | Bohrium log/download action |
43-
| stop wrong work | Bohrium terminate/kill action after resolving exact IDs |
44-
| list machine/SKU availability | Bohrium resource-list action |
45-
| track long execution | planning/todo and monitoring capability |
37+
| Need | Capability |
38+
| ------------------------------ | ------------------------------------------------------- |
39+
| prepare/inspect files | workspace shell and file tools |
40+
| submit a job or batch | built-in `bohrium-submit` skill |
41+
| list/query jobs and groups | Bohrium query/list action |
42+
| view/download logs and results | Bohrium log/download action |
43+
| stop wrong work | Bohrium terminate/kill action after resolving exact IDs |
44+
| list machine/SKU availability | Bohrium resource-list action |
45+
| track long execution | planning/todo and monitoring capability |
4646

4747
Discover the installed schemas at runtime. Historical names are evidence, not an API contract.
4848

@@ -82,7 +82,12 @@ Bohrium expands the uploaded input into an unpredictable work directory. Use rel
8282
"job_name": "dpa4-workflow-case-0001",
8383
"command": "bash run.sh",
8484
"log_file": "run.log",
85-
"backward_files": ["run.log", "logs/", "results/", "provenance.json"],
85+
"backward_files": [
86+
"run.log",
87+
"logs/",
88+
"results/",
89+
"provenance.json"
90+
],
8691
"project_id": 123,
8792
"machine_type": "CURRENT_VALID_GPU_SKU",
8893
"image_address": "registry.dp.tech/.../validated-dpa4:tag",
@@ -124,19 +129,19 @@ result.
124129
For every group:
125130

126131
1. list all members and compare unique case IDs with the manifest;
127-
2. inspect logs for representative running and failed jobs;
128-
3. wait through expected image-cache/runtime-initialization startup before calling a job hung;
129-
4. download both finished and failed terminal jobs;
130-
5. audit platform/files, then route workflow-quality acceptance to the owning skill;
131-
6. retry only invalid cases.
132+
1. inspect logs for representative running and failed jobs;
133+
1. wait through expected image-cache/runtime-initialization startup before calling a job hung;
134+
1. download both finished and failed terminal jobs;
135+
1. audit platform/files, then route workflow-quality acceptance to the owning skill;
136+
1. retry only invalid cases.
132137

133138
Actions differ:
134139

135-
| Action | Outputs | Record | Use |
136-
|---|---|---|---|
137-
| terminate | normally retained | retained | stop while preserving recoverable state |
138-
| kill | may not be retained | retained | force-stop an unrecoverable run |
139-
| delete | removed | removed | destructive cleanup only when explicitly required |
140+
| Action | Outputs | Record | Use |
141+
| --------- | ------------------- | -------- | ------------------------------------------------- |
142+
| terminate | normally retained | retained | stop while preserving recoverable state |
143+
| kill | may not be retained | retained | force-stop an unrecoverable run |
144+
| delete | removed | removed | destructive cleanup only when explicitly required |
140145

141146
Resolve exact individual job IDs before lifecycle actions. Web UI group IDs and CLI-created group IDs may differ.
142147

skills/matmaster-dpa4-workflows/references/platform-validation.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
## Contents
44

55
1. Acceptance boundary
6-
2. Platform and file checks
7-
3. Batch and attempt checks
8-
4. Failure routing
9-
5. Minimum ledger
6+
1. Platform and file checks
7+
1. Batch and attempt checks
8+
1. Failure routing
9+
1. Minimum ledger
1010

1111
## Acceptance boundary
1212

1313
This skill accepts only the platform portion of a case:
1414

1515
1. scheduler identity and terminal state are reconciled with the manifest;
16-
2. submitted inputs and runtime metadata are traceable;
17-
3. declared results and failure evidence are recovered;
18-
4. batch counts and retry lineage are internally consistent.
16+
1. submitted inputs and runtime metadata are traceable;
17+
1. declared results and failure evidence are recovered;
18+
1. batch counts and retry lineage are internally consistent.
1919

2020
Training convergence and checkpoint selection, inference accuracy, model
2121
deployment, atom mapping, ensemble behavior, minimization/MD validity, and
@@ -68,6 +68,6 @@ Route to the owning DeepMD skill:
6868

6969
## Minimum ledger
7070

71-
| Case | Attempt | Job/group | Terminal | Files | Platform verdict | Evidence |
72-
|---|---|---|---|---|---|---|
73-
| case_id | 0 | IDs | state | pass/fail | valid/retry/excluded | concise paths/log lines |
71+
| Case | Attempt | Job/group | Terminal | Files | Platform verdict | Evidence |
72+
| ------- | ------- | --------- | -------- | --------- | -------------------- | ----------------------- |
73+
| case_id | 0 | IDs | state | pass/fail | valid/retry/excluded | concise paths/log lines |

skills/matmaster-dpa4-workflows/references/workflow-handoffs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33
## Contents
44

55
1. Common contract
6-
2. Training and fine-tuning
7-
3. Inference
8-
4. LAMMPS execution
9-
5. Handoff back to the owning skill
6+
1. Training and fine-tuning
7+
1. Inference
8+
1. LAMMPS execution
9+
1. Handoff back to the owning skill
1010

1111
## Common contract
1212

skills/matmaster-dpa4-workflows/scripts/audit_cases.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,20 @@
11
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: LGPL-3.0-or-later
23
"""Run a non-destructive first-pass audit of DPA4 workflow case folders."""
34

45
# ruff: noqa: T201 -- stdout is this command-line tool's result interface.
56

6-
from __future__ import annotations
7+
from __future__ import (
8+
annotations,
9+
)
710

811
import argparse
912
import json
1013
import math
1114
import re
12-
from pathlib import Path
13-
15+
from pathlib import (
16+
Path,
17+
)
1418

1519
FATAL_PATTERNS = {
1620
"unknown_dpa4": re.compile(r"Unknown model type:\s*dpa4", re.I),

skills/matmaster-dpa4-workflows/scripts/bohr_cli.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: LGPL-3.0-or-later
23
"""Safe adapter for common Bohrium job and group operations."""
34

45
# ruff: noqa: T201 -- stdout is this command-line tool's result interface.
56

6-
from __future__ import annotations
7+
from __future__ import (
8+
annotations,
9+
)
710

811
import argparse
912
import json
@@ -12,7 +15,9 @@
1215
import shlex
1316
import shutil
1417
import subprocess
15-
from pathlib import Path
18+
from pathlib import (
19+
Path,
20+
)
1621

1722

1823
def executable(required: bool = True) -> str:

skills/matmaster-dpa4-workflows/scripts/bohrium_readonly.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,12 @@
11
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: LGPL-3.0-or-later
23
"""Read-only Bohrium OpenAPI probes using only Python's standard library."""
34

45
# ruff: noqa: T201 -- stdout is this command-line tool's result interface.
56

6-
from __future__ import annotations
7+
from __future__ import (
8+
annotations,
9+
)
710

811
import argparse
912
import json
@@ -12,7 +15,6 @@
1215
import urllib.parse
1316
import urllib.request
1417

15-
1618
BASE = os.environ.get("BOHR_OPENAPI_BASE", "https://open.bohrium.com/openapi").rstrip(
1719
"/"
1820
)

skills/matmaster-dpa4-workflows/scripts/check_environment.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,22 @@
11
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: LGPL-3.0-or-later
23
"""Inventory a MatMaster/Bohrium job environment without exposing secrets."""
34

45
# ruff: noqa: T201 -- stdout is this command-line tool's result interface.
56

6-
from __future__ import annotations
7+
from __future__ import (
8+
annotations,
9+
)
710

811
import argparse
912
import hashlib
1013
import json
1114
import os
1215
import shutil
1316
import subprocess
14-
from pathlib import Path
15-
17+
from pathlib import (
18+
Path,
19+
)
1620

1721
COMMANDS = {
1822
"bohr": ["bohr", "version"],

skills/matmaster-dpa4-workflows/scripts/make_job_spec.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,19 @@
11
#!/usr/bin/env python3
2+
# SPDX-License-Identifier: LGPL-3.0-or-later
23
"""Generate and validate a Bohrium container job specification."""
34

45
# ruff: noqa: T201 -- stdout is this command-line tool's result interface.
56

6-
from __future__ import annotations
7+
from __future__ import (
8+
annotations,
9+
)
710

811
import argparse
912
import json
1013
import shlex
11-
from pathlib import Path
14+
from pathlib import (
15+
Path,
16+
)
1217

1318

1419
def main() -> int:

0 commit comments

Comments
 (0)