Skip to content

feat(file-service): complete the model file API for the management UI - #6974

Closed
tanishqgandhi1908 wants to merge 25 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-api-for-ui
Closed

feat(file-service): complete the model file API for the management UI#6974
tanishqgandhi1908 wants to merge 25 commits into
apache:mainfrom
tanishqgandhi1908:feat/model-api-for-ui

Conversation

@tanishqgandhi1908

Copy link
Copy Markdown
Contributor

What changes were proposed in this PR?

The model REST API from #6869 and #6872 covers create / list / access / version upload. This PR extends and add more endpoints so the management UI can be built as frontend-only work.

New endpoints on ModelResource

Endpoint Purpose
GET /model/presign-download (+ -s3, public-, public--s3) short-lived signed URL for one file — file preview, and how a worker reads a model
GET /model/{mid}/diff staged (uncommitted) changes, so the upload page can list pending files
PUT /model/{mid}/diff?filePath= discard one staged change
POST /model/{mid}/existing-upload-files which of these files does the repo already hold at the same size — lets the client skip re-uploading large weights
GET /model/{mid}/versionZip?mvid=|latest=true download a whole version
GET /model/user-model-owners owner facet for the list page

Validation. framework and format are now checked against SUPPORTED_FRAMEWORKS (pytorch, tensorflow, onnx, sklearn) and SUPPORTED_FORMATS (torchscript, state-dict, safetensors, onnx, savedmodel, joblib, pickle), rejecting anything else with 400, so the loader in can dispatch on a known value.

Any related issues, documentation, discussions?

How was this PR tested?

sbt scalafixAll && sbt scalafmtAll
sbt "FileService/test"

Suites: completed 16, aborted 0 · Tests: succeeded 346, failed 0 — the whole file-service suite, not only the touched specs.

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

Generated-by: Claude Code (Claude Opus 5)

aicam and others added 24 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 labels Jul 28, 2026
@github-actions github-actions Bot added common platform Non-amber Scala service paths labels Jul 28, 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, @kunwp1
    You can notify them by mentioning @Ma77Ball, @aglinxinyuan, @kunwp1 in a comment.

@codecov-commenter

codecov-commenter commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 80.96515% with 71 lines in your changes missing coverage. Please review.
✅ Project coverage is 83.67%. Comparing base (a351f44) to head (609f1e8).
⚠️ Report is 37 commits behind head on main.

Files with missing lines Patch % Lines
...apache/texera/service/resource/ModelResource.scala 79.13% 35 Missing and 18 partials ⚠️
...ache/texera/service/resource/DatasetResource.scala 61.53% 4 Missing and 1 partial ⚠️
...ache/texera/service/util/ResourceUploadUtils.scala 86.20% 2 Missing and 2 partials ⚠️
.../texera/service/resource/ModelAccessResource.scala 91.89% 1 Missing and 2 partials ⚠️
...ache/texera/service/type/ResourceUploadTypes.scala 57.14% 3 Missing ⚠️
.../scala/org/apache/texera/service/FileService.scala 0.00% 2 Missing ⚠️
...e/texera/service/util/PresignedDownloadUtils.scala 92.30% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #6974      +/-   ##
============================================
+ Coverage     77.30%   83.67%   +6.36%     
+ Complexity     3524      189    -3335     
============================================
  Files          1161      484     -677     
  Lines         45922    26383   -19539     
  Branches       5101     3138    -1963     
============================================
- Hits          35501    22075   -13426     
+ Misses         8840     3544    -5296     
+ Partials       1581      764     -817     
Flag Coverage Δ
access-control-service 70.00% <ø> (ø)
agent-service ?
amber ?
computing-unit-managing-service 20.49% <ø> (ø)
config-service 66.66% <ø> (ø)
file-service 73.71% <80.00%> (+6.49%) ⬆️
frontend 82.99% <100.00%> (+0.41%) ⬆️
notebook-migration-service 78.94% <ø> (ø)
pyamber 95.39% <100.00%> (+3.23%) ⬆️
workflow-compiling-service 26.31% <ø> (-28.84%) ⬇️

☔ 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

github-actions Bot commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

⚠️ Benchmark changes need a look

🟢 2 better · 🔴 3 worse · ⚪ 10 noise (<±5%) · 0 without baseline

Compared against main 5040cad 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 427 0.26 22,619/33,339/33,339 us 🟢 -13.0% / 🔴 +111.0%
🔴 bs=100 sw=10 sl=64 928 0.566 108,101/123,821/123,821 us 🔴 +5.3% / 🔴 +15.4%
🔴 bs=1000 sw=10 sl=64 1,100 0.671 908,947/1,071,945/1,071,945 us 🔴 +12.0% / 🟢 -7.4%
Baseline details

Latest main 5040cad from same runner

config metric PR latest main 7d avg Δ latest Δ 7d
bs=10 sw=10 sl=64 throughput 427 tuples/sec 437 tuples/sec 787.55 tuples/sec -2.3% -45.8%
bs=10 sw=10 sl=64 MB/s 0.26 MB/s 0.267 MB/s 0.481 MB/s -2.6% -45.9%
bs=10 sw=10 sl=64 p50 22,619 us 21,943 us 12,255 us +3.1% +84.6%
bs=10 sw=10 sl=64 p95 33,339 us 38,304 us 15,802 us -13.0% +111.0%
bs=10 sw=10 sl=64 p99 33,339 us 38,304 us 19,008 us -13.0% +75.4%
bs=100 sw=10 sl=64 throughput 928 tuples/sec 953 tuples/sec 997.81 tuples/sec -2.6% -7.0%
bs=100 sw=10 sl=64 MB/s 0.566 MB/s 0.582 MB/s 0.609 MB/s -2.7% -7.1%
bs=100 sw=10 sl=64 p50 108,101 us 102,658 us 100,690 us +5.3% +7.4%
bs=100 sw=10 sl=64 p95 123,821 us 129,384 us 107,316 us -4.3% +15.4%
bs=100 sw=10 sl=64 p99 123,821 us 129,384 us 113,823 us -4.3% +8.8%
bs=1000 sw=10 sl=64 throughput 1,100 tuples/sec 1,096 tuples/sec 1,030 tuples/sec +0.4% +6.8%
bs=1000 sw=10 sl=64 MB/s 0.671 MB/s 0.669 MB/s 0.629 MB/s +0.3% +6.7%
bs=1000 sw=10 sl=64 p50 908,947 us 913,782 us 981,213 us -0.5% -7.4%
bs=1000 sw=10 sl=64 p95 1,071,945 us 957,192 us 1,027,605 us +12.0% +4.3%
bs=1000 sw=10 sl=64 p99 1,071,945 us 957,192 us 1,055,466 us +12.0% +1.6%
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,468.67,200,128000,427,0.260,22618.60,33338.78,33338.78
1,100,10,64,20,2155.33,2000,1280000,928,0.566,108101.42,123820.74,123820.74
2,1000,10,64,20,18187.22,20000,12800000,1100,0.671,908946.70,1071945.18,1071945.18

The explicit-access branch of listModels hardcoded size 0 while the public
branch computed it, so a user's own models reported no size. Compute it in
both, mirroring the dataset listing, and degrade to 0 rather than dropping
the row when LakeFS cannot answer.
@tanishqgandhi1908

Copy link
Copy Markdown
Contributor Author

Will reopen the PR once end to end prototype is working

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