Skip to content

ols-3523: no longer download embedding models but keep them in the repository#2994

Open
raptorsun wants to merge 1 commit into
openshift:mainfrom
raptorsun:embedding-1
Open

ols-3523: no longer download embedding models but keep them in the repository#2994
raptorsun wants to merge 1 commit into
openshift:mainfrom
raptorsun:embedding-1

Conversation

@raptorsun

@raptorsun raptorsun commented Jul 10, 2026

Copy link
Copy Markdown
Contributor

To avoid an EC exception of downloading external files.

Description

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

Summary by CodeRabbit

  • New Features

    • Added support for packaging embedding models into compressed chunks during builds.
    • Embedding models are now bundled directly for offline runtime use.
  • Bug Fixes

    • Added validation to ensure reconstructed embedding model files are valid before completion.
    • Removed obsolete generic prefetch configuration.
  • Chores

    • Removed outdated model artifact lock entries and download-based runtime fallback logic.

@openshift-ci-robot openshift-ci-robot added the jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. label Jul 10, 2026
@openshift-ci-robot

openshift-ci-robot commented Jul 10, 2026

Copy link
Copy Markdown

@raptorsun: This pull request references ols-3523 which is a valid jira issue.

Details

In response to this:

To avoid an EC exception of downloading external files.

Description

Type of change

  • Refactor
  • New feature
  • Bug fix
  • CVE fix
  • Optimization
  • Documentation Update
  • Configuration Update
  • Bump-up dependent library
  • Bump-up library or tool used for development (does not change the final image)
  • CI configuration change
  • Konflux configuration change

Related Tickets & Documents

Checklist before requesting a review

  • I have performed a self-review of my code.
  • PR has passed all pre-merge test jobs.
  • If it is a core feature, I have added thorough tests.

Testing

  • Please provide detailed steps to perform tests related to this code change.
  • How were the fix/results from this change verified? Please provide relevant screenshots or results.

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.

@openshift-ci
openshift-ci Bot requested review from blublinsky and xrajesh July 10, 2026 07:44
@openshift-ci

openshift-ci Bot commented Jul 10, 2026

Copy link
Copy Markdown

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign blublinsky for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@coderabbitai

coderabbitai Bot commented Jul 10, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@raptorsun, you've reached your PR review limit, so we couldn't start this review.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Enterprise

Run ID: c49f867b-704c-4aed-8944-a25e33af0c7e

📥 Commits

Reviewing files that changed from the base of the PR and between f72638c and eff7384.

📒 Files selected for processing (11)
  • .tekton/lightspeed-service-pull-request.yaml
  • .tekton/lightspeed-service-push.yaml
  • Containerfile
  • Makefile
  • artifacts.lock.yaml
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.aa
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ab
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ac
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ad
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ae
  • embeddings_model/granite-embedding-30m-english/model.safetensors.tar.gz.aa
📝 Walkthrough

Walkthrough

The 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.

Changes

Embedding model packaging and image integration

Layer / File(s) Summary
Chunk embedding model artifacts
Makefile
BYOK and OKP embedding model files are compressed and split into 95M chunks.
Assemble and validate builder artifacts
Containerfile
The builder reconstructs and validates model.safetensors files from chunked archives.
Copy models into the runtime image
Containerfile
The runtime stage copies the builder-produced embeddings_model payload instead of downloading model files.
Update pipeline prefetch inputs
.tekton/lightspeed-service-pull-request.yaml, .tekton/lightspeed-service-push.yaml
Generic repository-root prefetch entries are removed while RPM entries remain.
Clear artifact lock contents
artifacts.lock.yaml
The artifact lock metadata and pinned model artifact entries are removed.

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
Loading
🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title matches the PR’s main goal of stopping embedding model downloads and retaining them in-repo.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧹 Nitpick comments (1)
Makefile (1)

159-160: 🗄️ Data Integrity & Integration | 🔵 Trivial | ⚡ Quick win

Clear stale chunk files before splitting to avoid corrupt reassembly on regeneration.

split doesn't remove pre-existing outputs. If a model is re-split after shrinking (fewer chunks than a prior run), stale model.safetensors.tar.gz.* files remain in the directory. Since the Containerfile reassembles via cat "…"/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

📥 Commits

Reviewing files that changed from the base of the PR and between 53802a3 and f72638c.

📒 Files selected for processing (11)
  • .tekton/lightspeed-service-pull-request.yaml
  • .tekton/lightspeed-service-push.yaml
  • Containerfile
  • Makefile
  • artifacts.lock.yaml
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.aa
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ab
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ac
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ad
  • embeddings_model/all-mpnet-base-v2/model.safetensors.tar.gz.ae
  • embeddings_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

@raptorsun

Copy link
Copy Markdown
Contributor Author

/retest

@raptorsun

Copy link
Copy Markdown
Contributor Author

/test ci/prow/ols-evaluation

@raptorsun

Copy link
Copy Markdown
Contributor Author

/test ols-evaluation

Comment thread Makefile
-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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can remove the original file model.safetensors , after split.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we can keep the tensor file for local testing.

Comment thread Containerfile Outdated
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}" && \

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can have a error log if the tar fails here - than catching all.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

corrected. now it emits error message when tar command fails

@xrajesh xrajesh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Over all looks good - I think you tried the git lfs option too .

@raptorsun

Copy link
Copy Markdown
Contributor Author

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 blublinsky left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor review comment on the Makefile split targets.

Comment thread Makefile
-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.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>
@openshift-ci

openshift-ci Bot commented Jul 20, 2026

Copy link
Copy Markdown

@raptorsun: The following tests failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/ols-evaluation eff7384 link true /test ols-evaluation
ci/prow/e2e-ols-cluster eff7384 link true /test e2e-ols-cluster

Full PR test history. Your PR dashboard.

Details

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 kubernetes-sigs/prow repository. I understand the commands that are listed here.

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

Labels

jira/valid-reference Indicates that this PR references a valid Jira ticket of any type.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants