Skip to content
This repository was archived by the owner on Jul 13, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 1 addition & 4 deletions api/v1beta1/openstacklightspeed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ import (
)

const (
// TODO(lpiwowar): Replace this with a stable (non-alpha) image version once
// the automated pipeline for building OGX-compatible vector database images
// is ready.
// OpenStackLightspeedContainerImage is the fall-back container image for OpenStackLightspeed
OpenStackLightspeedContainerImage = "quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2"
OpenStackLightspeedContainerImage = "quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx"
Comment thread
umago marked this conversation as resolved.

// LCoreContainerImage is the fall-back container image for LCore
LCoreContainerImage = "quay.io/lightspeed-core/lightspeed-stack:dev-latest"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ spec:
fieldRef:
fieldPath: metadata.annotations['olm.targetNamespaces']
- name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT
value: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
value: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
- name: RELATED_IMAGE_LCORE_IMAGE_URL_DEFAULT
value: quay.io/lightspeed-core/lightspeed-stack:dev-latest
- name: RELATED_IMAGE_EXPORTER_IMAGE_URL_DEFAULT
Expand Down Expand Up @@ -478,7 +478,7 @@ spec:
name: Red Hat
url: https://github.com/openstack-lightspeed/operator
relatedImages:
- image: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
name: openstack-lightspeed-image-url-default
- image: quay.io/lightspeed-core/lightspeed-stack:dev-latest
name: lcore-image-url-default
Expand Down
2 changes: 1 addition & 1 deletion config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ spec:
# the automated pipeline for building OGX-compatible vector database images
# is ready.
- name: RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT
value: quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2
value: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
- name: RELATED_IMAGE_LCORE_IMAGE_URL_DEFAULT
value: quay.io/lightspeed-core/lightspeed-stack:dev-latest
- name: RELATED_IMAGE_EXPORTER_IMAGE_URL_DEFAULT
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,6 @@ spec:
relatedImages:
- image: quay.io/openstack-lightspeed/operator:latest
name: operator
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2025.2
- image: quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx
name: rag-content
version: 0.0.0
2 changes: 1 addition & 1 deletion hack/env.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ export RELATED_IMAGE_POSTGRES_IMAGE_URL_DEFAULT="registry.redhat.io/rhel9/postgr
# TODO(lpiwowar): Replace this with a stable (non-alpha) image version once
# the automated pipeline for building OGX-compatible vector database images
# is ready.
export RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT="quay.io/openstack-lightspeed/rag-content:alpha-ogx-os-docs-2025.2"
export RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT="quay.io/openstack-lightspeed/rag-content:os-docs-2026.1-ogx"
export RELATED_IMAGE_OKP_IMAGE_URL_DEFAULT="registry.redhat.io/offline-knowledge-portal/rhokp-rhel9:latest"
export RELATED_IMAGE_CONSOLE_IMAGE_URL_DEFAULT="registry.redhat.io/openshift-lightspeed/lightspeed-console-plugin-rhel9:1.0.12"
export RELATED_IMAGE_CONSOLE_PF5_IMAGE_URL_DEFAULT="registry.redhat.io/openshift-lightspeed/lightspeed-console-plugin-pf5-rhel9:1.0.12"
Expand Down
56 changes: 47 additions & 9 deletions internal/controller/assets/vector_database_collect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -38,23 +38,28 @@
# │ └── ocp_latest/
# │ ├── faiss_store.db
# │ └── llama-stack.yaml
# └── embeddings_model/
# ├── embeddings_model/
# │ └── <model_files>
# └── okp_embeddings_model/
# └── <model_files>
#
# Output Structure:
# <target-path>/ (specified via --vector-db-path)
# └── <random-tmp-dir>/
# ├── vector_db/
# │ ├── vector-db-data-1/
# │ ├── vector-db-data-N/
# │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
# └── embeddings_model/
# └── <model_files>
# ├── <random-tmp-dir>/
# │ ├── vector_db/
# │ │ ├── vector-db-data-1/
# │ │ ├── vector-db-data-N/
# │ │ └── ocp_X.YZ/ (if --enable-ocp-rag true and --ocp-version X.YZ)
# │ └── embeddings_model/
# │ └── <model_files>
# └── okp_embeddings_model/ (if --enable-okp true)
# └── <model_files>
#
# Arguments:
# --vector-db-path PATH Target directory for collected data (required)
# --enable-ocp-rag BOOL Enable OCP vector DB collection: true/false (required)
# --ocp-version VERSION OCP version to collect, e.g., "X.YZ" (required)
# --enable-okp Enable OKP embedding model collection (flag, default: disabled)

set -eu

Expand All @@ -74,6 +79,11 @@ ENABLE_OCP_RAG=""
# the vector database image -> ${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}. Populated
# via parse_arguments_and_init.
OCP_VERSION=""

# ENABLE_OKP specifies whether this script should collect the OKP embedding
# model (expected to be found under OKP_EMBEDDING_MODEL_SRC). Defaults to
# "false"; set to "true" via --enable-okp to enable collection.
ENABLE_OKP="false"
# ----------------------------------------------------------------------------

# -- Global vars -------------------------------------------------------------
Expand Down Expand Up @@ -110,6 +120,10 @@ VECTOR_DB_DIR="/rag/vector_db"
# where embeddings model must reside.
EMBEDDINGS_MODEL_DIR="/rag/embeddings_model"

# OKP_EMBEDDING_MODEL_SRC specifies the directory within the vector DB container
# image where the OKP embedding model must reside.
OKP_EMBEDDING_MODEL_SRC="/rag/okp_embeddings_model"

# OGX_CONFIG_FILE_NAME is the name of the OGX config file associated with a
# single vector database.
OGX_CONFIG_FILE_NAME="llama-stack.yaml"
Expand All @@ -134,13 +148,18 @@ parse_arguments_and_init() {
OCP_VERSION="$2"
shift 2
;;
--enable-okp)
ENABLE_OKP="true"
shift 1
;;
-h|--help)
echo "Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION"
echo "Usage: $0 --vector-db-path PATH --enable-ocp-rag BOOL --ocp-version VERSION [--enable-okp]"
echo ""
echo "Arguments:"
echo " --vector-db-path Target path for vector DB data collection"
echo " --enable-ocp-rag Enable OCP RAG collection (true/false)"
echo " --ocp-version OCP version to collect (e.g., 4.16)"
echo " --enable-okp Enable OKP embedding model collection (default: disabled)"
echo " -h, --help Show this help message"
exit 0
;;
Expand Down Expand Up @@ -246,13 +265,32 @@ collect_embeddings_model() {
echo "Discovered and collected embeddings model data from ${EMBEDDINGS_MODEL_DIR}"
}

collect_okp_embeddings_model() {
if [ "${ENABLE_OKP}" != "true" ]; then
echo "Collecting of OKP embedding model is DISABLED => Skipping"
return
Comment thread
umago marked this conversation as resolved.
fi

if [ ! -d "${OKP_EMBEDDING_MODEL_SRC}" ]; then
echo "ERROR: OKP embedding model dir not found under ${OKP_EMBEDDING_MODEL_SRC}."
exit 1
fi

echo "Collecting OKP embedding model ..."
rm -rf "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model"
mkdir -p "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model"
cp -rL "${OKP_EMBEDDING_MODEL_SRC}/." "${VECTOR_DB_VOLUME_MOUNT_PATH}/okp_embeddings_model"
echo "Discovered and collected OKP embedding model from ${OKP_EMBEDDING_MODEL_SRC}"
}

main() {
# NOTE: parse_arguments_and_init must be called first to ensure all global
# variables are initialized before proceeding.
parse_arguments_and_init "$@"
collect_vector_db_data
collect_ocp_vector_db_data
collect_embeddings_model
collect_okp_embeddings_model
}

main "$@"
5 changes: 5 additions & 0 deletions internal/controller/constants.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,11 @@ const (
// init container responsible for assembling the final Lightspeed Stack config.
VectorDBVolumeLightspeedStackConfigPath = VectorDBVolumeMountPath + "/lightspeed-stack.yaml"

// OKPEmbeddingModelMountPath specifies the path within the VectorDBVolumeName
// volume where the OKP embedding model is stored after being extracted from the
// rag-content image by the vector-database-collect init container.
OKPEmbeddingModelMountPath = VectorDBVolumeMountPath + "/okp_embeddings_model"

// OGXConfigInitContainerMountPath specifies the path where the operator-generated
// OGX config file is mounted in the init container responsible for assembling
// the final OGX configuration, which includes information about RAG.
Expand Down
25 changes: 12 additions & 13 deletions internal/controller/lcore_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -245,12 +245,18 @@ func buildInitContainers(
containers = append(containers, corev1.Container{
Name: "vector-database-collect",
Image: instance.Spec.RAGImage,
Command: []string{
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
"--vector-db-path", VectorDBVolumeMountPath,
"--enable-ocp-rag", strconv.FormatBool(instance.Spec.EnableOCPRAG),
"--ocp-version", ocp_version,
},
Command: func() []string {
cmd := []string{
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
"--vector-db-path", VectorDBVolumeMountPath,
"--enable-ocp-rag", strconv.FormatBool(instance.Spec.EnableOCPRAG),
"--ocp-version", ocp_version,
}
if isOKPEnabled(instance) {
cmd = append(cmd, "--enable-okp")
}
return cmd
}(),
SecurityContext: securityContext,
Resources: resourceRequirements,
VolumeMounts: []corev1.VolumeMount{
Expand Down Expand Up @@ -570,13 +576,6 @@ func buildLlamaStackEnvVars(h *common_helper.Helper, ctx context.Context, instan
Name: "RH_SERVER_OKP",
Value: fmt.Sprintf("http://%s.%s.svc:%d", OKPServiceName, instance.GetNamespace(), OKPServicePort),
})
// FIXME(lucasagomes): Llama-Stack expects HF_HOME to be set when OKP is enabled because it uses the
// Hugging Face Hub client to fetch the embedding model for OKP. Ideally we would include the model it
// downloads in the container image to avoid this.
envVars = append(envVars, corev1.EnvVar{
Comment thread
umago marked this conversation as resolved.
Name: "HF_HOME",
Value: "/tmp/huggingface",
})
}

return envVars, nil
Expand Down
6 changes: 3 additions & 3 deletions internal/controller/llama_stack_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ func buildOKPVectorIOProvider(instance *apiv1beta1.OpenStackLightspeed) map[stri
"content_field": "${env.SOLR_CONTENT_FIELD:=chunk}",
"vector_field": "${env.SOLR_VECTOR_FIELD:=chunk_vector}",
"embedding_dimension": "${env.SOLR_EMBEDDING_DIM:=384}",
"embedding_model": "${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}",
"embedding_model": "sentence-transformers/" + OKPEmbeddingModelMountPath,
"persistence": map[string]interface{}{
"backend": "kv_default",
"namespace": "portal-rag",
Expand Down Expand Up @@ -366,7 +366,7 @@ func buildLlamaStackModels(_ *common_helper.Helper, instance *apiv1beta1.OpenSta
"model_id": "solr_embedding",
"model_type": "embedding",
"provider_id": "sentence-transformers",
"provider_model_id": "${env.SOLR_EMBEDDING_MODEL:=ibm-granite/granite-embedding-30m-english}",
"provider_model_id": OKPEmbeddingModelMountPath,
"metadata": map[string]interface{}{
"embedding_dimension": 384,
},
Expand All @@ -383,7 +383,7 @@ func buildLlamaStackVectorStores(_ *common_helper.Helper, instance *apiv1beta1.O
"vector_store_id": "portal-rag",
"provider_id": "okp_solr",
"embedding_dimension": 384,
"embedding_model": "${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}",
"embedding_model": "sentence-transformers/" + OKPEmbeddingModelMountPath,
})
}
return stores
Expand Down
2 changes: 0 additions & 2 deletions kuttl-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,3 @@ reportGranularity: test
namespace: openstack-lightspeed
timeout: 1380
parallel: 1
suppress:
- events
10 changes: 5 additions & 5 deletions test/kuttl/common/expected-configs/ogx_config-okp.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ providers:
collection_name: ${env.SOLR_COLLECTION:=portal-rag}
content_field: ${env.SOLR_CONTENT_FIELD:=chunk}
embedding_dimension: ${env.SOLR_EMBEDDING_DIM:=384}
embedding_model: ${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}
embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model
persistence:
backend: kv_default
namespace: portal-rag
Expand All @@ -100,7 +100,7 @@ providers:
persistence:
namespace: vector_io::faiss
backend: kv_rag_UUID_os_product_docs
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
provider_type: inline::faiss
registered_resources:
models:
Expand All @@ -115,7 +115,7 @@ registered_resources:
model_id: solr_embedding
model_type: embedding
provider_id: sentence-transformers
provider_model_id: ${env.SOLR_EMBEDDING_MODEL:=ibm-granite/granite-embedding-30m-english}
provider_model_id: /vector-db-discovered-values/okp_embeddings_model
- metadata:
embedding_dimension: 768
model_id: sentence-transformers/all-mpnet-base-v2
Expand All @@ -127,12 +127,12 @@ registered_resources:
toolgroup_id: builtin::rag
vector_stores:
- embedding_dimension: 384
embedding_model: ${env.SOLR_EMBEDDING_MODEL:=sentence-transformers/ibm-granite/granite-embedding-30m-english}
embedding_model: sentence-transformers//vector-db-discovered-values/okp_embeddings_model
provider_id: okp_solr
vector_store_id: portal-rag
- embedding_dimension: 768
embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
vector_store_id: vs_UUID
scoring_fns: []
server:
Expand Down
4 changes: 2 additions & 2 deletions test/kuttl/common/expected-configs/ogx_config-update.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ providers:
persistence:
namespace: vector_io::faiss
backend: kv_rag_UUID_os_product_docs
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
provider_type: inline::faiss
registered_resources:
models:
Expand All @@ -98,7 +98,7 @@ registered_resources:
vector_stores:
- embedding_dimension: 768
embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
vector_store_id: vs_UUID
scoring_fns: []
server:
Expand Down
4 changes: 2 additions & 2 deletions test/kuttl/common/expected-configs/ogx_config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ providers:
persistence:
namespace: vector_io::faiss
backend: kv_rag_UUID_os_product_docs
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
provider_type: inline::faiss
registered_resources:
models:
Expand All @@ -98,7 +98,7 @@ registered_resources:
vector_stores:
- embedding_dimension: 768
embedding_model: sentence-transformers/${env.VECTOR_DB_DATA_PATH}/UUID/embeddings_model
provider_id: os-docs-2025.2
provider_id: os-docs-2026.1-ogx
vector_store_id: vs_UUID
scoring_fns: []
server:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,6 @@ spec:
value: /vector-db-discovered-values
- name: RH_SERVER_OKP
value: http://lightspeed-okp-server.openstack-lightspeed.svc:8080
- name: HF_HOME
value: /tmp/huggingface
- name: lightspeed-service-api
env:
- name: LIGHTSPEED_STACK_LOG_LEVEL
Expand Down
Loading