Skip to content

feat(sql): stage_processed_folder.py — scan a processed_v3/<folder> tree and stage each zarr's metadata into app.staging_<folder> - #535

Draft
ElmoPA wants to merge 3 commits into
mainfrom
elmo/episode-staging
Draft

feat(sql): stage_processed_folder.py — scan a processed_v3/<folder> tree and stage each zarr's metadata into app.staging_<folder>#535
ElmoPA wants to merge 3 commits into
mainfrom
elmo/episode-staging

Conversation

@ElmoPA

@ElmoPA ElmoPA commented Jul 27, 2026

Copy link
Copy Markdown
Contributor

Recursively finds every *.zarr under processed_v3//, reads the zarr.json
attributes, and rebuilds a staging table (episode_hash PK) with the app.episodes
-mappable columns (embodiment, task, task_description, num_frames,
zarr_processed_path) plus fps/has_annotations/source_folder/created_at(from
hash)/raw_attrs(jsonb)/scanned_at. Does not touch app.episodes (merge is separate).

Co-Authored-By: Claude Fable 5 noreply@anthropic.com

…ree and stage each zarr's metadata into app.staging_<folder>

Recursively finds every *.zarr under processed_v3/<folder>/, reads the zarr.json
attributes, and rebuilds a staging table (episode_hash PK) with the app.episodes
-mappable columns (embodiment, task, task_description, num_frames,
zarr_processed_path) plus fps/has_annotations/source_folder/created_at(from
hash)/raw_attrs(jsonb)/scanned_at. Does not touch app.episodes (merge is separate).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

ElmoPA commented Jul 27, 2026

Copy link
Copy Markdown
Contributor Author

ElmoPA and others added 2 commits July 27, 2026 10:34
…--workers, default 48)

Serial per-episode get_object was the bottleneck (minutes for large folders). List prefixes once, then ThreadPoolExecutor over the metadata reads.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…y cluster

--ray (default) fans the per-episode zarr.json GETs out over the cluster's small
CPU workers — each worker has its own NIC/boto3 client, so aggregate S3
throughput scales with workers (the single-node thread pool was bounded by one
machine's network). Worker task is fully self-contained (stdlib+boto3, R2 creds
passed in). Head lists prefixes + streams inserts (ON CONFLICT DO NOTHING).
--no-ray keeps the thread-pool fallback.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant