provrun.outputs

The outputter: record what a run hands back.

It hashes each file in the output folder and writes one output_artifact_created event for each, with the URI the file will have in the bundle. A link or any other special file in the output folder fails the run, because the bundle holds plain files only.

class Artifact

source

Artifact(path: Path, uri: str, sha256: str, size: int)

One file that a run handed back in its output folder.

Parameter Type Default Description
path Path required Where the file is in the run folder
uri str required Its URI in the bundle, /output/
sha256 str required The SHA-256 of the file
size int required Its size in bytes

class Outputter

source

Records each file that a run leaves in its output folder.

Outputter.collect

source

Outputter.collect(ctx: RunContext, run: RunSpec) -> list[Artifact]

Hash each file in the output folder and write its event.

Raises ValueError for a link or any other file that is not plain.

Parameter Type Default Description
ctx RunContext required The run; its recorder takes one output_artifact_created for each file
run RunSpec required The run spec, whose output folder is read
returns list[Artifact] One artifact for each file, in path order