perago.WorkspaceSpec#
- class perago.WorkspaceSpec(*, prefix='/', pre=<factory>, post=<factory>, read_only=False)[源代码]#
Workspace declaration for a workspace task.
WorkspaceSpectells Perago which LakeFS object prefix should be projected into the local attempt workspace and which guardrails should run before and after the task body.- Parameters:
- prefixstr, default="/"
Workspace object prefix.
"/"maps the whole repository root; other values are normalized to relative POSIX-style prefixes without a leading slash.- prelist of workspace guardrails, optional
Guardrails evaluated after workspace download and before the task body.
- postlist of workspace guardrails, optional
Guardrails evaluated after the task body and before publication.
- read_onlybool, default=False
Whether this workspace task consumes workspace input without publishing workspace changes. Read-only tasks still receive a local workspace path and return workspace output, but the output ref stays equal to the input ref.
- Raises:
- TaskDefinitionError
If
prefixis empty, escapes the repository, or uses backslash separators.
- 参数:
Notes
WorkspaceSpecis frozen and rejects unknown fields. Guardrails are runtime metadata; they are not serialized into generated Conductor TaskDefs.Examples
>>> WorkspaceSpec(prefix="/audio/render", pre=[require_file("raw/manifest.json")]) WorkspaceSpec(...)
Methods
validate_prefix(value)Normalize and validate a workspace object prefix.
Attributes
prefixprepostread_only