Skip to content

ingest: vendor buckets → conversion jobs → staff review → lance_commit (store, watcher, AWS deploy) - #720

Draft
SaveAanchal wants to merge 3 commits into
aanchal/mcap-to-lancefrom
aanchal/ingest
Draft

SaveAanchal wants to merge 3 commits into
aanchal/mcap-to-lancefrom
aanchal/ingest

Conversation

@SaveAanchal

@SaveAanchal SaveAanchal commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #719. The pipeline half of the original #720; the dashboard moved to its own PR on top.

vendor upload → convert (AWS Batch job) → staff approve → hand off to lance_commit → Lance

Aanchal's pipeline code is the first commit (authored by her, as of 5820f84); the two commits on top adapt it to the decisions in the ingest plan.

What changed from the original

  • Buckets. Store keys are logical and routed: deliveries/<vendor>/… lives in that vendor's own bucket ingest-<vendor> (a write key for exactly that bucket lets a vendor upload with its own S3 tools, finishing with _done.json); pipeline/… lives in the private ingest bucket, with vendors.json listing vendor buckets. The rldb read token is public, so nothing private lives there.
  • One Lance writer. stage.prepare() writes a staged delivery (commit.stage_delivery) plus stage.json (fingerprint, converter, settings, sha256 + size per file) and diff.json. commit_staged, the base-state pins and cut-off-commit recovery are gone. On approval the watcher copies the raw files to rldb/raw_v2/<vendor>/<delivery>/<stage>/ and the stage to rldb/lance_staging/<lab>/<vid>/ (meta.json last, with provenance), both server-side, and lance_commit commits it. A recording already in Lance needs lance_commit --replace (status commit_rejected until then).
  • Conversion off the box. convert_job.py converts one delivery and records its outcome under pipeline/jobs/; launch.py runs it on AWS Batch (or in-process for tests). The watcher caps jobs in flight (56) and, until a vendor has an approval at the current converter revision, converts only a canary of 3 of its deliveries.
  • AWS instead of SkyNet. run.py is the box's loop (a pass, then the committer, every 5 min). aws/Dockerfile, aws/setup_batch.py (Spot GPU compute environment, queue, job definition) and aws/README.md (runbook) replace skynet/.
  • Tools. onboard.py (admin, from their own machine: bucket, CORS, abandoned-upload lifecycle, bucket-scoped token, vendors.json entry) and review.py (list / show / approve / decline, bulk) .

Measured

One 3-minute Aria recording: 735 s on an A40 + 8 cores (MANO 553 s), about 4 machine-hours per footage-hour and 2.3 GB output per footage-hour. MANO on CPU alone is ~14x realtime, so jobs take a GPU.

Not run yet

No AWS or Cloudflare call has run for real (Batch submit, onboarding, tests/integration/test_ingest_r2.py): no write credentials here. The lab AWS account's G-instance quota is 0 in us-east-2; the Batch/Spot rollout is deferred for now.

Tests

tests/unit/test_ingest_{store,stage,formats,watch,tools}.py: 137 pass, including the full loop with in-process jobs and the committer.

https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd

@SaveAanchal
SaveAanchal force-pushed the aanchal/mcap-to-lance branch from eaa8bb1 to 47ebba9 Compare October 21, 2026 06:27
@SaveAanchal SaveAanchal changed the title ingest: the bucket the ingestion pipeline runs through ingest: vendor upload → validate → convert → staff review → Lance (store, watcher, SkyNet job, dashboard) Oct 21, 2026
@RyanPCo RyanPCo changed the title ingest: vendor upload → validate → convert → staff review → Lance (store, watcher, SkyNet job, dashboard) ingest: vendor buckets → conversion jobs → staff review → lance_commit (store, watcher, AWS deploy) Oct 22, 2026
SaveAanchal and others added 3 commits October 22, 2026 09:55
The pipeline half of #720 as Aanchal wrote it, squashed: the bucket
store (R2 and local, size-bound uploads, completion snapshots, staged
results by digest), staging with a reviewer diff, format detection
(MCAP first), the watcher pass and its SkyNet job, plus the
mcap_to_lance --mano-model-dir option and the ffmpeg mute in
validate.py. The dashboard half moves to its own branch.

This commit is her code as of origin/aanchal/ingest 5820f84; the
next commits adapt it to the staged-delivery committer and AWS, so it
does not pass tests on its own.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd
The pipeline now feeds lance_commit instead of writing Lance itself:

- store: logical keys route to buckets. deliveries/<vendor>/ lives in
  that vendor's ingest-<vendor> bucket (a write key for exactly that
  bucket lets a vendor upload with its own S3 tools, finishing with
  _done.json); pipeline/ lives in the private ingest bucket, with
  vendors.json listing the vendor buckets. copy_out copies an object out
  server-side (R2 managed copy), so hand-offs never leave R2.
- stage: prepare() writes a staged delivery (commit.stage_delivery) plus
  stage.json (fingerprint, converter, settings, sha256 and size of every
  file) and the reviewer's diff.json. commit_staged, the base-state
  pins and the cut-off-commit recovery go: the committer owns commits.
- convert_job: one delivery's conversion as a job (download, prepare,
  store the stage, record the outcome under pipeline/jobs/), launched by
  launch.py on AWS Batch or in-process for tests and local runs.
- watch: a pass collects job outcomes, submits new or re-uploaded
  deliveries (at most --max-in-flight at once; while a vendor has
  nothing approved at the current converter revision, only --canary of
  its deliveries), and on approval copies the raw files to
  raw_v2/<vendor>/<delivery>/<stage>/ and the stage to
  lance_staging/<lab>/<vendor recording id>/ with provenance in
  meta.json, then deletes the delivery and stage. It follows handed-off
  deliveries to committed or commit_rejected.
- run: the box's loop, a pass and then the committer every 5 minutes.

Claude-Session: https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd
Replaces the SkyNet job:

- aws/Dockerfile: one CUDA image for the Batch conversion jobs and the
  box's loop (static ffmpeg with SVT-AV1, the locked venv, MANO from
  its pinned commit; the license-gated model files come in as a build
  secret). aws/setup_batch.py creates a Spot compute environment of
  1-GPU g6/g5.2xlarge instances (min 0, max 448 vCPU = 56 jobs), its
  queue and the job definition, with Spot reclaims retried; --dry-run
  prints the calls. aws/README.md is the runbook, with measured cost:
  ~4 GPU machine-hours and 2.3 GB of output per footage-hour. The lab
  account's G-instance quotas are 0 in us-east-2 and need raising first.
- onboard.py: an admin creates ingest-<vendor>, its CORS and abandoned-
  upload lifecycle rules, an account token limited to that bucket (S3
  keys printed once) and the vendors.json entry, from their own machine.
- review.py: list, show, approve / decline (one, several or every ready
  delivery of a vendor), each decision bound to the status's stage.

The R2 integration test runs against the ingest buckets.

Claude-Session: https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd
RyanPCo pushed a commit that referenced this pull request Oct 22, 2026
The dashboard half of #720 as Aanchal wrote it, squashed: accounts
(scrypt hashes, created by staff), login with CSRF, throttling and
strict cookies, vendor and staff views, presigned multipart uploads
bound to their declared sizes, staff approve / decline one at a time
or in bulk, and the standard-library upload CLI it serves. Adds the
dashboard extra (flask) to pyproject.toml.

Her code as of origin/aanchal/ingest 5820f84; the next commit points
it at the per-vendor buckets and the new watcher states.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Kt1E8T2x8kdV9akAvbJyVd
@RyanPCo
RyanPCo force-pushed the aanchal/mcap-to-lance branch from 4815a4f to dca8ff9 Compare October 22, 2026 14:06
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.

2 participants