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
Draft
Conversation
…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>
Contributor
Author
This stack of pull requests is managed by Graphite. Learn more about stacking. |
…--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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

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