Apievsys_sdk
_harbor_upload
Shared upload logic for harbor-format directories.
benchmark_upload registers a local \<dir>/ (tasks.jsonl +
metadata.yaml) with the dashboard. The reusable body lives here and the
wrapper passes in its create/add-rows/list callables, so a future harbor-style
entity can reuse it.
Re-uploading the same content is a no-op (we hash tasks.jsonl);
re-uploading changed content registers a new version.
attributeHARBOR_FORMAT= 'harbor'attribute__all__= ['HARBOR_FORMAT', 'HarborUploadResult', 'upload_harbor']funcupload_harbor(path, *, create_record, add_rows, list_existing, format=HARBOR_FORMAT) -> HarborUploadResultUpload (or re-upload) a harbor directory via the supplied store callables.
Steps:
- Load with
Benchmark.from_dir(catches malformed jsonl / metadata). - Hash
tasks.jsonlcontent for idempotency. - Look up an existing record with the same
name:- same hash → return
"unchanged". - different hash → create a new version row, push tasks.
- none → create version 1, push tasks.
- same hash → return
parampathstr | Pathparamcreate_recordCallable[..., dict]paramadd_rowsCallable[[str, list[dict]], Any]paramlist_existingCallable[[], list[dict] | None]paramformatstr= HARBOR_FORMATReturns
evsys_sdk._harbor_upload.HarborUploadResultfunc_hash_file(path) -> strparampathPathReturns
strfunc_find_existing(list_existing, name) -> dict | NoneReturn the highest-version record with name, if any.
paramlist_existingCallable[[], list[dict] | None]paramnamestrReturns
dict | None