Skip to content

Commit d9686fb

Browse files
committed
Use local OKP embeddings from rag-content
The rag-content image now ships the OKP embedding model in it and we no longer need for OGX to download it at runtime via HF. Signed-off-by: Lucas Alvares Gomes <lucasagomes@gmail.com>
1 parent 48b5142 commit d9686fb

14 files changed

Lines changed: 53 additions & 38 deletions

api/v1beta1/openstacklightspeed_types.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ const (
2929
// the automated pipeline for building OGX-compatible vector database images
3030
// is ready.
3131
// OpenStackLightspeedContainerImage is the fall-back container image for OpenStackLightspeed
32-
OpenStackLightspeedContainerImage = "quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2"
32+
OpenStackLightspeedContainerImage = "quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx"
3333

3434
// LCoreContainerImage is the fall-back container image for LCore
3535
LCoreContainerImage = "quay.io/lightspeed-core/lightspeed-stack:dev-latest"

bundle/manifests/openstack-lightspeed-operator.clusterserviceversion.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ metadata:
2525
]
2626
capabilities: Basic Install
2727
categories: AI/Machine Learning
28-
createdAt: "2026-06-11T09:06:59Z"
28+
createdAt: "2026-06-19T15:37:35Z"
2929
description: AI-powered virtual assistant for Red Hat OpenStack Services on OpenShift
3030
features.operators.openshift.io/cnf: "false"
3131
features.operators.openshift.io/cni: "false"
@@ -292,7 +292,7 @@ spec:
292292
fieldRef:
293293
fieldPath: metadata.annotations['olm.targetNamespaces']
294294
- name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT
295-
value: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
295+
value: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
296296
- name: RELATED_IMAGE_LCORE_IMAGE_URL_DEFAULT
297297
value: quay.io/lightspeed-core/lightspeed-stack:dev-latest
298298
- name: RELATED_IMAGE_EXPORTER_IMAGE_URL_DEFAULT
@@ -474,7 +474,7 @@ spec:
474474
name: Red Hat
475475
url: https://github.com/openstack-lightspeed/operator
476476
relatedImages:
477-
- image: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
477+
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
478478
name: openstack-lightspeed-image-url-default
479479
- image: quay.io/lightspeed-core/lightspeed-stack:dev-latest
480480
name: lcore-image-url-default

config/manager/manager.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ spec:
7474
# the automated pipeline for building OGX-compatible vector database images
7575
# is ready.
7676
- name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT
77-
value: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
77+
value: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
7878
- name: RELATED_IMAGE_LCORE_IMAGE_URL_DEFAULT
7979
value: quay.io/lightspeed-core/lightspeed-stack:dev-latest
8080
- name: RELATED_IMAGE_EXPORTER_IMAGE_URL_DEFAULT

config/manifests/bases/openstack-lightspeed-operator.clusterserviceversion.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,6 @@ spec:
171171
relatedImages:
172172
- image: quay.io/openstack-lightspeed/operator:latest
173173
name: operator
174-
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2025.2
174+
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
175175
name: rag-content
176176
version: 0.0.0

hack/env.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,6 @@ export RELATED_IMAGE_POSTGRES_IMAGE_URL_DEFAULT="registry.redhat.io/rhel9/postgr
55
# TODO(lpiwowar): Replace this with a stable (non-alpha) image version once
66
# the automated pipeline for building OGX-compatible vector database images
77
# is ready.
8-
export RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT="quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2"
8+
export RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT="quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx"
99
export RELATED_IMAGE_OKP_IMAGE_URL_DEFAULT="registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latest"
1010
export WATCH_NAMESPACE="openstack-lightspeed"

internal/controller/assets/vector_database_collect.sh

Lines changed: 29 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -38,18 +38,22 @@
3838
# │ └── ocp_latest/
3939
# │ ├── faiss_store.db
4040
# │ └── llama-stack.yaml
41-
# └── embeddings_model/
41+
# ├── embeddings_model/
42+
# │ └── <model_files>
43+
# └── okp_embeddings_model/
4244
# └── <model_files>
4345
#
4446
# Output Structure:
4547
# <target-path>/ (specified via --vector-db-path)
46-
# └── <random-tmp-dir>/
47-
# ├── vector_db/
48-
# │ ├── vector-db-data-1/
49-
# │ ├── vector-db-data-N/
50-
# │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
51-
# └── embeddings_model/
52-
# └── <model_files>
48+
# ├── <random-tmp-dir>/
49+
# │ ├── vector_db/
50+
# │ │ ├── vector-db-data-1/
51+
# │ │ ├── vector-db-data-N/
52+
# │ │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
53+
# │ └── embeddings_model/
54+
# │ └── <model_files>
55+
# └── okp_embeddings_model/ (if present in the image)
56+
# └── <model_files>
5357
#
5458
# Arguments:
5559
# --vector-db-path PATH Target directory for collected data (required)
@@ -110,6 +114,10 @@ VECTOR_DB_DIR="/rag/vector_db"
110114
# where embeddings model must reside.
111115
EMBEDDINGS_MODEL_DIR="/rag/embeddings_model"
112116

117+
# OKP_EMBEDDING_MODEL_SRC specifies the directory within the vector DB container
118+
# image where the OKP embedding model must reside.
119+
OKP_EMBEDDING_MODEL_SRC="/rag/okp_embeddings_model"
120+
113121
# OGX_CONFIG_FILE_NAME is the name of the OGX config file associated with a
114122
# single vector database.
115123
OGX_CONFIG_FILE_NAME="llama-stack.yaml"
@@ -246,13 +254,26 @@ collect_embeddings_model() {
246254
echo "Discovered and collected embeddings model data from ${EMBEDDINGS_MODEL_DIR}"
247255
}
248256

257+
collect_okp_embeddings_model() {
258+
if [ ! -d "${OKP_EMBEDDING_MODEL_SRC}" ]; then
259+
echo "OKP embedding model not found under ${OKP_EMBEDDING_MODEL_SRC} => Skipping"
260+
return
261+
fi
262+
263+
echo "Collecting OKP embedding model ..."
264+
rm -rf "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model"
265+
cp -rL "${OKP_EMBEDDING_MODEL_SRC}" "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model"
266+
echo "Discovered and collected OKP embedding model from ${OKP_EMBEDDING_MODEL_SRC}"
267+
}
268+
249269
main() {
250270
# NOTE: parse_arguments_and_init must be called first to ensure all global
251271
# variables are initialized before proceeding.
252272
parse_arguments_and_init "$@"
253273
collect_vector_db_data
254274
collect_ocp_vector_db_data
255275
collect_embeddings_model
276+
collect_okp_embeddings_model
256277
}
257278

258279
main "$@"

internal/controller/constants.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -134,6 +134,11 @@ const (
134134
// init container responsible for assembling the final Lightspeed Stack config.
135135
VectorDBVolumeLightspeedStackConfigPath = VectorDBVolumeMountPath + "/lightspeed-stack.yaml"
136136

137+
// OKPEmbeddingModelMountPath specifies the path within the VectorDBVolumeName
138+
// volume where the OKP embedding model is stored after being extracted from the
139+
// rag-content image by the vector-database-collect init container.
140+
OKPEmbeddingModelMountPath = VectorDBVolumeMountPath + "/okp_embeddings_model"
141+
137142
// OGXConfigInitContainerMountPath specifies the path where the operator-generated
138143
// OGX config file is mounted in the init container responsible for assembling
139144
// the final OGX configuration, which includes information about RAG.

internal/controller/lcore_deployment.go

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,13 +570,6 @@ func buildLlamaStackEnvVars(h *common_helper.Helper, ctx context.Context, instan
570570
Name: "RH_SERVER_OKP",
571571
Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort),
572572
})
573-
// FIXME(lucasagomes): Llama-Stack expects HF_HOME to be set when OKP is enabled because it uses the
574-
// Hugging Face Hub client to fetch the embedding model for OKP. Ideally we would include the model it
575-
// downloads in the container image to avoid this.
576-
envVars = append(envVars, corev1.EnvVar{
577-
Name: "HF_HOME",
578-
Value: "/tmp/huggingface",
579-
})
580573
}
581574

582575
return envVars, nil

internal/controller/llama_stack_config.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func buildOKPVectorIOProvider(instance *apiv1beta1.OpenStackLightspeed) map[stri
257257
"content_field": "${env.SOLR_CONTENT_FIELD:=chunk}",
258258
"vector_field": "${env.SOLR_VECTOR_FIELD:=chunk_vector}",
259259
"embedding_dimension": "${env.SOLR_EMBEDDING_DIM:=384}",
260-
"embedding_model": "${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}",
260+
"embedding_model": "sentence-transformers" + OKPEmbeddingModelMountPath,
261261
"persistence": map[string]interface{}{
262262
"backend": "kv_default",
263263
"namespace": "portal-rag",
@@ -366,7 +366,7 @@ func buildLlamaStackModels(_ *common_helper.Helper, instance *apiv1beta1.OpenSta
366366
"model_id": "solr_embedding",
367367
"model_type": "embedding",
368368
"provider_id": "sentence-transformers",
369-
"provider_model_id": "${env.SOLR_EMBEDDING_MODEL:=ibm-granite/granite-embedding-30m-english}",
369+
"provider_model_id": OKPEmbeddingModelMountPath,
370370
"metadata": map[string]interface{}{
371371
"embedding_dimension": 384,
372372
},
@@ -383,7 +383,7 @@ func buildLlamaStackVectorStores(_ *common_helper.Helper, instance *apiv1beta1.O
383383
"vector_store_id": "portal-rag",
384384
"provider_id": "okp_solr",
385385
"embedding_dimension": 384,
386-
"embedding_model": "${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}",
386+
"embedding_model": "sentence-transformers" + OKPEmbeddingModelMountPath,
387387
})
388388
}
389389
return stores

kuttl-test.yaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,3 @@ reportGranularity: test
66
namespace: openstack-lightspeed
77
timeout: 1380
88
parallel: 1
9-
suppress:
10-
- events

0 commit comments

Comments
 (0)