Skip to content

feat(file-service): add model version upload#6872

Draft
tanishqgandhi1908 wants to merge 23 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-version-upload
Draft

feat(file-service): add model version upload#6872
tanishqgandhi1908 wants to merge 23 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-version-upload

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

Completes the model management API (#6498) with file upload + versioning, building on the metadata/access PR. A model version is a folder of files assembled from uploads and committed as an immutable LakeFS version.

  • Schema: model_upload_session + model_upload_session_part in texera_ddl.sql + migration sql/updates/32.sql.
  • ModelResource: version create/list/latest/rootFileNodes; one-shot /{mid}/upload; staged-file delete; session-based multipart (/multipart-upload init/finish/abort + /multipart-upload/part).
  • File types: any file is accepted — a model bundles weights with config.json, tokenizer/vocab, sharded checkpoints, etc. framework ("pytorch") is stored as metadata;

Stacked on the metadata/access PR → #6860 (#6497) → #6502 (#6495);

Any related issues, documentation, discussions?

Closes #6498. Umbrella #6494.

How was this PR tested?

New ModelUploadResourceSpec (7): one-shot upload + version lifecycle, .pth acceptance, empty-version rejection, staged-file delete, companion-files-with- weights commit, multipart init→part→finish→version, and abort. Extraction verified
non-regressive: full DatasetResourceSpec passes (118).
sbt "FileService/testOnly *ModelUploadResourceSpec *DatasetResourceSpec"; scalafmtCheckAll + scalafixAll --check clean.

Was this PR authored or co-authored using generative AI tooling?

Generated-by: Claude Code (Claude Opus 4.8)

aicam and others added 23 commits July 1, 2026 13:57
… tests

Review fixes on apache#5911: use dataset owner email in retrieveLatestDatasetVersion,
replace brittle Option.get/.head with headOption, strip datasets prefix on
selection-modal reopen, clarify FileResolver docs; add FileResolver/DatasetFileNode
and frontend path-helper tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The datasets logical-path prefix strips four leading segments
(datasets/owner/dataset/version); update the cover-image test's input
path to include the prefix so the extracted relative path is the file
name, not an empty string.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Now that models are coming as a separate resource/table, the leading
resource-type segment is what selects the backing table, so an unprefixed
path can no longer be routed unambiguously. Make the "datasets" prefix
required instead of a tolerated fallback, and migrate existing data.

- FileResolver: a dataset path must start with the "datasets" segment;
  unprefixed paths are no longer treated as dataset paths.
- pytexera DatasetFileDocument: same rule, mirroring the backend.
- FileListerSourceOpExec: parse the now-prefixed datasetVersionPath
  (skip the "datasets" segment); extracted into a testable helper.
- Migration (sql/updates/29.sql): prepend "datasets/" to legacy paths
  stored in workflow.content and workflow_version.content, covering both
  the fileName (scan sources) and datasetVersionPath (file lister)
  operator properties. Only values whose first two segments match an
  existing (user.email, dataset.name) are rewritten, so local paths and
  URLs are left untouched; email format is irrelevant (owner may be a
  username without "@"). Uses create_missing=false and is idempotent.
- Example workflows: use datasets-prefixed paths.

Tests: FileResolverSpec and WorkflowExecutionsResourceSpec updated;
test_dataset_file_document.py updated; new FileListerSourceOpExecSpec.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…l-path-prefix

# Conflicts:
#	frontend/src/app/common/type/datasetVersionFileTree.spec.ts
…format python test

- dataset-selection-modal.component.spec.ts: expect the datasets-prefixed
  selectedPath in version (non-file) mode, matching the emitted path.
- test_dataset_file_document.py: apply ruff format (wrap an over-length line)
  so `ruff format --check` passes.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The cover-image endpoints resolve a dataset path built as
{owner}/{name}/{coverImage}. With the prefix now required by FileResolver,
these must carry the datasets/ segment; add it in the set-cover,
get-cover redirect, and cover-url handlers so cover images resolve again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…rage

# Conflicts:
#	common/workflow-core/src/test/scala/org/apache/texera/amber/core/storage/DocumentFactorySpec.scala
@github-actions github-actions Bot added feature engine ddl-change Changes to the TexeraDB DDL pyamber frontend Changes related to the frontend GUI infra common labels Jul 25, 2026
@github-actions github-actions Bot added the platform Non-amber Scala service paths label Jul 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Automated Reviewer Suggestions

Based on the git blame history of the changed files, we recommend the following reviewers:

  • Contributors with relevant context: @Ma77Ball, @aglinxinyuan, @Yicong-Huang
    You can notify them by mentioning @Ma77Ball, @aglinxinyuan, @Yicong-Huang in a comment.

@codecov-commenter

codecov-commenter commented Jul 25, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 70.55961% with 121 lines in your changes missing coverage. Please review.
✅ Project coverage is 77.34%. Comparing base (a351f44) to head (2a4715f).
⚠️ Report is 4 commits behind head on main.

Files with missing lines Patch % Lines
.../amber/core/storage/model/LakeFSFileDocument.scala 25.00% 49 Missing and 2 partials ⚠️
...apache/texera/service/resource/ModelResource.scala 75.74% 34 Missing and 15 partials ⚠️
...ache/texera/service/resource/DatasetResource.scala 0.00% 4 Missing ⚠️
...pache/texera/amber/core/storage/FileResolver.scala 91.17% 0 Missing and 3 partials ⚠️
...erator/source/dataset/FileListerSourceOpExec.scala 62.50% 2 Missing and 1 partial ⚠️
.../texera/service/resource/ModelAccessResource.scala 91.89% 1 Missing and 2 partials ⚠️
...he/texera/amber/core/storage/DocumentFactory.scala 0.00% 0 Missing and 2 partials ⚠️
.../scala/org/apache/texera/service/FileService.scala 0.00% 2 Missing ⚠️
...ache/texera/service/util/ResourceUploadUtils.scala 90.90% 1 Missing and 1 partial ⚠️
...amber/core/storage/model/DatasetFileDocument.scala 50.00% 1 Missing ⚠️
... and 1 more
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6872      +/-   ##
============================================
+ Coverage     77.30%   77.34%   +0.03%     
- Complexity     3524     3567      +43     
============================================
  Files          1161     1145      -16     
  Lines         45922    43141    -2781     
  Branches       5101     5137      +36     
============================================
- Hits          35501    33367    -2134     
+ Misses         8840     8170     -670     
- Partials       1581     1604      +23     
Flag Coverage Δ
access-control-service 70.00% <ø> (ø)
agent-service ?
amber 69.11% <51.58%> (+0.02%) ⬆️
computing-unit-managing-service 20.49% <ø> (ø)
config-service 66.66% <ø> (ø)
file-service 70.49% <77.52%> (+3.27%) ⬆️
frontend 82.57% <100.00%> (-0.01%) ⬇️
notebook-migration-service 78.94% <ø> (ø)
pyamber 92.16% <100.00%> (+<0.01%) ⬆️
workflow-compiling-service 55.14% <ø> (ø)

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@github-actions

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 4 better · 🔴 5 worse · ⚪ 6 noise (<±5%) · 0 without baseline

Compared against main 429be11 benchmarked on this same runner, so the delta is largely free of cross-runner hardware noise. The "7d avg" column still reflects the gh-pages dashboard. Treat <±5% as noise unless repeated.

Dashboard · Run

config throughput MB/s latency max Δ latest / 7d
🟢 bs=10 sw=10 sl=64 410 0.25 23,827/32,041/32,041 us 🟢 -46.5% / 🔴 +93.1%
🔴 bs=100 sw=10 sl=64 904 0.552 105,827/135,391/135,391 us 🔴 +12.2% / 🔴 +24.1%
bs=1000 sw=10 sl=64 1,082 0.661 924,662/958,816/958,816 us ⚪ within ±5% / 🟢 -10.7%
Baseline details

Latest main 429be11 from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 410 tuples/sec 360 tuples/sec 754.55 tuples/sec +13.9% -45.7%
bs=10 sw=10 sl=64 MB/s 0.25 MB/s 0.22 MB/s 0.461 MB/s +13.6% -45.7%
bs=10 sw=10 sl=64 p50 23,827 us 23,877 us 12,816 us -0.2% +85.9%
bs=10 sw=10 sl=64 p95 32,041 us 59,910 us 16,594 us -46.5% +93.1%
bs=10 sw=10 sl=64 p99 32,041 us 59,910 us 19,806 us -46.5% +61.8%
bs=100 sw=10 sl=64 throughput 904 tuples/sec 988 tuples/sec 969.38 tuples/sec -8.5% -6.7%
bs=100 sw=10 sl=64 MB/s 0.552 MB/s 0.603 MB/s 0.592 MB/s -8.5% -6.7%
bs=100 sw=10 sl=64 p50 105,827 us 100,211 us 103,584 us +5.6% +2.2%
bs=100 sw=10 sl=64 p95 135,391 us 120,707 us 109,097 us +12.2% +24.1%
bs=100 sw=10 sl=64 p99 135,391 us 120,707 us 117,304 us +12.2% +15.4%
bs=1000 sw=10 sl=64 throughput 1,082 tuples/sec 1,104 tuples/sec 1,004 tuples/sec -2.0% +7.8%
bs=1000 sw=10 sl=64 MB/s 0.661 MB/s 0.674 MB/s 0.613 MB/s -1.9% +7.9%
bs=1000 sw=10 sl=64 p50 924,662 us 900,133 us 1,002,357 us +2.7% -7.8%
bs=1000 sw=10 sl=64 p95 958,816 us 959,101 us 1,046,463 us -0.0% -8.4%
bs=1000 sw=10 sl=64 p99 958,816 us 959,101 us 1,073,661 us -0.0% -10.7%
Raw CSV
config_idx,batch_size,schema_width,string_len,num_batches,total_ms,total_tuples,total_bytes,tuples_per_sec,mb_per_sec,lat_p50_us,lat_p95_us,lat_p99_us
0,10,10,64,20,487.52,200,128000,410,0.250,23827.25,32041.38,32041.38
1,100,10,64,20,2213.06,2000,1280000,904,0.552,105826.99,135390.51,135390.51
2,1000,10,64,20,18481.03,20000,12800000,1082,0.661,924661.81,958815.52,958815.52

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common ddl-change Changes to the TexeraDB DDL engine feature frontend Changes related to the frontend GUI infra platform Non-amber Scala service paths pyamber

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add model management API

3 participants