perago.WorkspaceSyncPlan#

class perago.WorkspaceSyncPlan(upload_files, delete_object_paths)[源代码]#

Plan for synchronizing an attempt workspace to a LakeFS prefix.

Runtime code uses this plan during the stage phase of workspace publication. Uploads and deletes are calculated together so the staging branch mirrors the complete local projection for the task prefix.

Parameters:
upload_fileslist of WorkspaceUploadFile

Local files that should be uploaded to the staging branch.

delete_object_pathslist of str

Existing object paths under the workspace prefix that should be deleted from the staging branch because they are absent locally.

Attributes:
changed_object_countint

Number of remote object changes in this sync plan.

upload_bytesint

Total byte size of files selected for upload.

参数:

参见

build_workspace_sync_plan

Build the complete plan from local and remote state.

WorkspaceUploadFile

One file selected for upload.

Notes

The plan represents the complete projected contents of a WorkspaceSpec.prefix. It is not an append-only list of files created by the current task body.

Examples

>>> plan = WorkspaceSyncPlan(
...     upload_files=[WorkspaceUploadFile(Path("raw/input.wav"), "audio/render/raw/input.wav")],
...     delete_object_paths=["audio/render/old.tmp"],
... )
>>> plan.changed_object_count
2
__init__(upload_files, delete_object_paths)[源代码]#

Initialize a workspace sync plan.

Parameters:
upload_fileslist of WorkspaceUploadFile

Local files that should be uploaded to the staging branch.

delete_object_pathslist of str

Existing object paths under the workspace prefix that should be deleted.

参数:
返回类型:

None

Methods

__init__(upload_files, delete_object_paths)

Initialize a workspace sync plan.

Attributes

changed_object_count

Number of remote object changes in this sync plan.

upload_bytes

Total byte size of files selected for upload.

upload_files

delete_object_paths