From b00c44c8f55782a9567e8ad8eb8739309e9ac15f Mon Sep 17 00:00:00 2001 From: Lucas Alvares Gomes Date: Tue, 23 Jun 2026 11:26:37 +0100 Subject: [PATCH] Use pre-cached OKP embeddings model from rag-docs (if available) When the rag-docs repository is cloned and contains the okp_embeddings_model directory, copy it directly instead of downloading from Hugging Face. This allows hermetic builds (e.g. Konflux) to supply the model via the rag-docs repo without requiring network access during the container build. Signed-off-by: Lucas Alvares Gomes --- Containerfile | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Containerfile b/Containerfile index 836b5f6..8610952 100644 --- a/Containerfile +++ b/Containerfile @@ -166,8 +166,13 @@ RUN if [ "$BUILD_OCP_DOCS" = "true" ] && [ -d "/rag-content/rag-docs/ocp-product mkdir -p /rag-content/ocp_vector_db; \ fi -# Download the OKP embeddings model -RUN python ./scripts/download_okp_embeddings.py --output-dir okp_embeddings_model +# Use the OKP embeddings model from the rag-docs repo if available, otherwise download it +RUN if [ -d "rag-docs/okp_embeddings_model" ]; then \ + echo "Using cached OKP embeddings model from rag-docs"; \ + cp -r rag-docs/okp_embeddings_model okp_embeddings_model; \ + else \ + python ./scripts/download_okp_embeddings.py --output-dir okp_embeddings_model; \ + fi # Clean up the OKP content RUN rm -rf ./okp-content