clabe.reports ¶
Debug bundles and issue reports.
A bundle is one zip of everything needed to understand a run so far: its records (run.json,
events.jsonl, outputs.jsonl, launcher.log), the tail of this machine's daemon log and a rig.json
describing the machine. Users download it (Export logs) or file it as a report with a comment (Report an
issue): a report is saved on this machine, under reports_dir, until the hub collects it (and then deletes it here).
ReportInfo ¶
Bases: BaseModel
What a report is about: who, where, when, and the user's comment. Stored as report.json in its zip.
reports_dir ¶
reports_dir() -> Path
Where this machine keeps reports until the hub collects them (%LOCALAPPDATA%\clabe\reports).
rig_info ¶
The machine, as put in rig.json: host, OS, Python, clabe, disk, time.
Source code in src/clabe/reports.py
make_bundle ¶
A zip of the run's records so far, the daemon log's tail, rig.json and extra files (name → content).
Missing files are skipped: a bundle can be made at any moment of a run, or with no run at all.
Source code in src/clabe/reports.py
save_report ¶
save_report(
record_dir: Path | None,
info: dict[str, Any],
*,
directory: Path | None = None,
) -> ReportInfo
Saves a report (a bundle with report.json) under reports_dir for the hub to collect.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record_dir
|
Path | None
|
The run's record directory, if any. |
required |
info
|
dict[str, Any]
|
The |
required |
directory
|
Path | None
|
Where to save it; by default |
None
|
Source code in src/clabe/reports.py
describe_launcher ¶
Session id, subject, experimenter, repository and commit, from a launcher's report_info (when it has one).
Never raises: a launcher that cannot describe itself gives nothing.
Source code in src/clabe/reports.py
report_run ¶
report_run(
run: Run,
comment: str = "",
*,
reported_from: str = "local",
directory: Path | None = None,
) -> ReportInfo
Files an issue report about run: its bundle, the comment, and what is known about the run and its launcher.
What every client files (the web UI through POST /api/report, the terminal UI with F3, the exit prompt).
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
run
|
Run
|
The run reported on (running or finished). |
required |
comment
|
str
|
What went wrong, in the user's words. |
''
|
reported_from
|
str
|
The client the report is made from. |
'local'
|
directory
|
Path | None
|
Where to save it; by default |
None
|
Source code in src/clabe/reports.py
list_reports ¶
list_reports(
directory: Path | None = None,
) -> list[ReportInfo]
The reports saved on this machine and not collected yet, oldest first.
Source code in src/clabe/reports.py
count_reports ¶
How many reports wait on this machine (their zips, without opening them).
report_path ¶
The zip of report report_id on this machine (it may not exist).
Raises:
| Type | Description |
|---|---|
ValueError
|
|
Source code in src/clabe/reports.py
delete_report ¶
Deletes report report_id from this machine; False if there was no such report.
Source code in src/clabe/reports.py
read_report_info ¶
read_report_info(data: bytes | Path) -> ReportInfo
The ReportInfo of a report's zip (its bytes or its path).
Raises:
| Type | Description |
|---|---|
ValueError
|
Not a zip, or no valid |