ols-3523: no longer download embedding models but keep them in the repository#2994
ols-3523: no longer download embedding models but keep them in the repository#2994raptorsun wants to merge 1 commit into
Conversation
|
@raptorsun: This pull request references ols-3523 which is a valid jira issue. DetailsIn response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the openshift-eng/jira-lifecycle-plugin repository. |
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
|
Warning Review limit reached
Next review available in: 19 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (11)
📝 WalkthroughWalkthroughThe change packages embedding models into chunks, reconstructs and validates them during the builder stage, copies them into the runtime image, removes generic Tekton prefetch entries, and clears the artifact lock contents. ChangesEmbedding model packaging and image integration
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant Makefile
participant BuilderStage
participant RuntimeStage
Makefile->>BuilderStage: provide chunked embedding model archives
BuilderStage->>BuilderStage: reconstruct and validate model.safetensors
BuilderStage->>RuntimeStage: copy embeddings_model
RuntimeStage->>RuntimeStage: use models in offline mode
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
🧹 Nitpick comments (1)
Makefile (1)
159-160: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick winClear stale chunk files before splitting to avoid corrupt reassembly on regeneration.
splitdoesn't remove pre-existing outputs. If a model is re-split after shrinking (fewer chunks than a prior run), stalemodel.safetensors.tar.gz.*files remain in the directory. Since the Containerfile reassembles viacat "…"/model.safetensors.tar.gz.*, those leftovers would be concatenated into the stream and corrupt the extracted safetensors.♻️ Proposed fix (apply to both targets)
cd embeddings_model/all-mpnet-base-v2 && \ + rm -f model.safetensors.tar.gz.* && \ tar czf - model.safetensors | split -b 95M - model.safetensors.tar.gz.cd embeddings_model/granite-embedding-30m-english && \ + rm -f model.safetensors.tar.gz.* && \ tar czf - model.safetensors | split -b 95M - model.safetensors.tar.gz.Also applies to: 166-167
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@Makefile` around lines 159 - 160, Before each split operation in the affected Makefile targets, remove existing model.safetensors.tar.gz.* chunk files, then run split as before; apply this cleanup to both target blocks around the model.safetensors tarball generation.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Nitpick comments:
In `@Makefile`:
- Around line 159-160: Before each split operation in the affected Makefile
targets, remove existing model.safetensors.tar.gz.* chunk files, then run split
as before; apply this cleanup to both target blocks around the model.safetensors
tarball generation.
ℹ️ Review info
⚙️ Run configuration
Configuration used: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: a78a6b44-06e3-447c-ab12-46baf9e60286
📒 Files selected for processing (11)
.tekton/lightspeed-service-pull-request.yaml.tekton/lightspeed-service-push.yamlContainerfileMakefileartifacts.lock.yamlembeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.aaembeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.abembeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.acembeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.adembeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.aeembeddings_model/granite-embedding-30m-english/model.safetensors.tar.gz.aa
💤 Files with no reviewable changes (3)
- .tekton/lightspeed-service-push.yaml
- artifacts.lock.yaml
- .tekton/lightspeed-service-pull-request.yaml
|
/retest |
|
/test ci/prow/ols-evaluation |
|
/test ols-evaluation |
| -o embeddings_model/all-mpnet-base-v2/model.safetensors \ | ||
| "https://huggingface.co/sentence-transformers/all-mpnet-base-v2/resolve/main/model.safetensors" | ||
| cd embeddings_model/all-mpnet-base-v2 && \ | ||
| tar czf - model.safetensors | split -b 95M - model.safetensors.tar.gz. |
There was a problem hiding this comment.
we can remove the original file model.safetensors , after split.
There was a problem hiding this comment.
we can keep the tensor file for local testing.
| COPY --chmod=775 embeddings_model ./embeddings_model | ||
| RUN for model_dir in all-mpnet-base-v2 granite-embedding-30m-english; do \ | ||
| cat "embeddings_model/${model_dir}"/model.safetensors.tar.gz.* | \ | ||
| tar xzf - --no-same-owner -C "embeddings_model/${model_dir}" && \ |
There was a problem hiding this comment.
We can have a error log if the tar fails here - than catching all.
There was a problem hiding this comment.
corrected. now it emits error message when tar command fails
xrajesh
left a comment
There was a problem hiding this comment.
Over all looks good - I think you tried the git lfs option too .
yes, i find complains about missing git LFS support in konflux, so I changed to this split - assembly approach. |
blublinsky
left a comment
There was a problem hiding this comment.
Minor review comment on the Makefile split targets.
| -o embeddings_model/all-mpnet-base-v2/model.safetensors \ | ||
| "https://huggingface.co/sentence-transformers/all-mpnet-base-v2/resolve/main/model.safetensors" | ||
| cd embeddings_model/all-mpnet-base-v2 && \ | ||
| tar czf - model.safetensors | split -b 95M - model.safetensors.tar.gz. |
There was a problem hiding this comment.
split does not remove pre-existing output files. If a model is re-split after shrinking (fewer chunks than a prior run), stale model.safetensors.tar.gz.* files remain. Since the Containerfile reassembles via cat … model.safetensors.tar.gz.*, those leftovers would be concatenated and corrupt the extracted model.
Suggest adding cleanup before each split:
cd embeddings_model/all-mpnet-base-v2 && \
rm -f model.safetensors.tar.gz.* && \
tar czf - model.safetensors | split -b 95M - model.safetensors.tar.gz.Same for the get-embeddings-okp target below.
…pository Signed-off-by: Haoyu Sun <hasun@redhat.com>
|
@raptorsun: The following tests failed, say
Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
To avoid an EC exception of downloading external files.
Description
Type of change
Related Tickets & Documents
Checklist before requesting a review
Testing
Summary by CodeRabbit
New Features
Bug Fixes
Chores