EvSys

_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) -> HarborUploadResult

Upload (or re-upload) a harbor directory via the supplied store callables.

Steps:

  1. Load with Benchmark.from_dir (catches malformed jsonl / metadata).
  2. Hash tasks.jsonl content for idempotency.
  3. 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.
parampathstr | Path
paramcreate_recordCallable[..., dict]
paramadd_rowsCallable[[str, list[dict]], Any]
paramlist_existingCallable[[], list[dict] | None]
paramformatstr
= HARBOR_FORMAT

Returns

evsys_sdk._harbor_upload.HarborUploadResult
func_hash_file(path) -> str
parampathPath

Returns

str
func_find_existing(list_existing, name) -> dict | None

Return the highest-version record with name, if any.

paramlist_existingCallable[[], list[dict] | None]
paramnamestr

Returns

dict | None