backport 1.10 - fix(lightspeed): pre-create /data/vector_db/notebooks in init container#3042
Conversation
PR Summary by QodoFix Lightspeed RAG permissions by creating vector_db/notebooks in init container Description
Diagram
High-Level Assessment
Files changed (3)
|
Code Review by Qodo
Context used✅ Tickets:
RHDHBUGS-3371 1. No fail-fast on missing data
|
|
The CI failures will be fixed by #2293 |
|
/build-images 2be164d |
|
✅ PR images built successfully! Images are available for testing:
Also available with PR number tag:
Triggered by @rm3l |
|
/cherry-pick main |
|
@rm3l: once the present PR merges, I will cherry-pick it on top of 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 kubernetes-sigs/prow repository. |
On EKS/AKS, the RAG init container copies /rag/. to /data/ but never creates the notebooks subdirectory. At runtime, llama-stack tries to write /rag-content/vector_db/notebooks/faiss_store.db (same volume, mounted at /rag-content in the sidecar) and fails with PermissionError because it cannot create the directory. OCP avoids this via fsGroup defaults; EKS/AKS do not. The fix pre-creates /data/vector_db/notebooks before the existing chmod so the directory exists and is writable when the sidecar starts. Fixes: RHDHBUGS-3371 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ebooks permissions Apply the same fix used in rhdh-chart: - Use cp --no-preserve=mode,ownership so copied RAG files get the container's default permissions rather than inheriting restrictive ones from the source image - Set podSecurityContext.fsGroup: 1001 so Kubernetes chowns volumes to GID 1001 on mount, matching how OCP handles this via SCCs on EKS/AKS where fsGroup is not set automatically Together with the existing mkdir -p /data/vector_db/notebooks this ensures the notebooks directory is writable on all Kubernetes flavours. Fixes: RHDHBUGS-3371 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
Mirror the final fix from rhdh-chart (backstage 5.12.5): - Remove podSecurityContext.fsGroup: 1001 added in previous commit; the chart does not set this on the deployment spec - Replace 'chmod -R 777 /data/vector_db' with 'chmod -R a+rwX /data/embeddings_model', matching the chart which only widens permissions on the embeddings_model directory and relies on --no-preserve=mode,ownership + mkdir -p for the rest The operator volume mounts /data in the init container and /rag-content in the sidecar from the same volume, so /data/embeddings_model maps to /rag-content/embeddings_model -- identical to the chart fix. Fixes: RHDHBUGS-3371 Co-Authored-By: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com>
…ent.yaml Co-authored-by: Armel Soro <armel@rm3l.org>
…9/go-toolset:9.8-1782377916 [skip-build] [skip-e2e] (redhat-developer#3113) Signed-off-by: rhdh-bot service account <rhdh-bot@redhat.com>
ab694f4 to
14b8bc0
Compare
Signed-off-by: Lucas <lyoon@redhat.com>
14b8bc0 to
fa4cb27
Compare
|
|
/build-images |
|
✅ PR images built successfully! Images are available for testing:
Also available with PR number tag:
Triggered by @rm3l |
2b81b22
into
redhat-developer:release-1.10
|
@rm3l: #3042 failed to apply on top of branch "main": 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 kubernetes-sigs/prow repository. |
… in init container (#3042) (#3134) * fix(lightspeed): pre-create /data/vector_db/notebooks in init container On EKS/AKS, the RAG init container copies /rag/. to /data/ but never creates the notebooks subdirectory. At runtime, llama-stack tries to write /rag-content/vector_db/notebooks/faiss_store.db (same volume, mounted at /rag-content in the sidecar) and fails with PermissionError because it cannot create the directory. OCP avoids this via fsGroup defaults; EKS/AKS do not. The fix pre-creates /data/vector_db/notebooks before the existing chmod so the directory exists and is writable when the sidecar starts. Fixes: RHDHBUGS-3371 * fix(lightspeed): use --no-preserve=mode,ownership and fsGroup for notebooks permissions Apply the same fix used in rhdh-chart: - Use cp --no-preserve=mode,ownership so copied RAG files get the container's default permissions rather than inheriting restrictive ones from the source image - Set podSecurityContext.fsGroup: 1001 so Kubernetes chowns volumes to GID 1001 on mount, matching how OCP handles this via SCCs on EKS/AKS where fsGroup is not set automatically Together with the existing mkdir -p /data/vector_db/notebooks this ensures the notebooks directory is writable on all Kubernetes flavours. Fixes: RHDHBUGS-3371 * fix(lightspeed): align init container permissions with rhdh-chart fix Mirror the final fix from rhdh-chart (backstage 5.12.5): - Remove podSecurityContext.fsGroup: 1001 added in previous commit; the chart does not set this on the deployment spec - Replace 'chmod -R 777 /data/vector_db' with 'chmod -R a+rwX /data/embeddings_model', matching the chart which only widens permissions on the embeddings_model directory and relies on --no-preserve=mode,ownership + mkdir -p for the rest The operator volume mounts /data in the init container and /rag-content in the sidecar from the same volume, so /data/embeddings_model maps to /rag-content/embeddings_model -- identical to the chart fix. Fixes: RHDHBUGS-3371 * Update config/profile/rhdh/default-config/flavours/lightspeed/deployment.yaml * chore: update release-1.10 to ubi9/go-toolset:9.8-1782736563 from ubi9/go-toolset:9.8-1782377916 [skip-build] [skip-e2e] (#3113) * chore: regenerate bundle manifests --------- Signed-off-by: rhdh-bot service account <rhdh-bot@redhat.com> Signed-off-by: Lucas <lyoon@redhat.com> Co-authored-by: Lucas Yoon <94267691+JslYoon@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.6 (1M context) <noreply@anthropic.com> Co-authored-by: rhdh-bot service account <rhdh-bot@redhat.com>



On EKS/AKS, the RAG init container copies /rag/. to /data/ but never creates the notebooks subdirectory. At runtime, llama-stack tries to write /rag-content/vector_db/notebooks/faiss_store.db (same volume, mounted at /rag-content in the sidecar) and fails with PermissionError because it cannot create the directory. OCP avoids this via fsGroup defaults; EKS/AKS do not.
The fix pre-creates /data/vector_db/notebooks before the existing chmod so the directory exists and is writable when the sidecar starts.
Fixes: RHDHBUGS-3371
Description
Which issue(s) does this PR fix or relate to
PR acceptance criteria
How to test changes / Special notes to the reviewer