Skip to content
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
18 changes: 0 additions & 18 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,6 @@ const (
// OpenShift Lightspeed Operator Status=True condition which indicates if OpenShift Lightspeed is installed and
// operational and it can be used by OpenStack Lightspeed operator.
OpenShiftLightspeedOperatorReadyCondition condition.Type = "OpenShiftLightspeedOperatorReady"

// OCPRAGCondition Status=True condition which indicates the OCP RAG version resolution status
OCPRAGCondition condition.Type = "OCPRAGReady"
)

// Common Messages used by API objects.
Expand All @@ -49,21 +46,6 @@ const (
// OpenShiftLightspeedOperatorReady
OpenShiftLightspeedOperatorReady = "OpenShift Lightspeed operator is ready."

// OCPRAGDisabledMessage
OCPRAGDisabledMessage = "OCP RAG is disabled"

// OCPRAGVersionResolvedMessage
OCPRAGVersionResolvedMessage = "OCP RAG version resolved: %s"

// OCPRAGVersionFallbackMessage
OCPRAGVersionFallbackMessage = "Cluster version %s is not explicitly supported. Using 'latest' OCP documentation. Supported versions: %v"

// OCPRAGDetectionFailedMessage
OCPRAGDetectionFailedMessage = "Failed to detect OCP cluster version"

// OCPRAGOverrideInvalidMessage
OCPRAGOverrideInvalidMessage = "Invalid OCP RAG version override"

// DeploymentCheckFailedMessage
DeploymentCheckFailedMessage = "Failed to check deployment status: %s"

Expand Down
15 changes: 0 additions & 15 deletions api/v1beta1/openstacklightspeed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -95,16 +95,6 @@ type DatabaseSpec struct {
type OpenStackLightspeedSpec struct {
OpenStackLightspeedCore `json:",inline"`

// +kubebuilder:validation:Optional
// +kubebuilder:default=false
// Enables automatic OCP documentation based on cluster version
EnableOCPRAG bool `json:"enableOCPRAG,omitempty"`

// +kubebuilder:validation:Optional
// Allows forcing a specific OCP version instead of auto-detection.
// Format should be like "4.15", "4.16", etc.
OCPRAGVersionOverride string `json:"ocpVersionOverride,omitempty"`

// +kubebuilder:validation:Optional
// Database configures persistent storage for PostgreSQL data.
// When omitted, an emptyDir volume is used (data is lost on pod reschedule).
Expand Down Expand Up @@ -211,11 +201,6 @@ type OpenStackLightspeedStatus struct {

// ObservedGeneration - the most recent generation observed for this object.
ObservedGeneration int64 `json:"observedGeneration,omitempty"`

// +optional
// ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
// Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
ActiveOCPRAGVersion string `json:"activeOCPRAGVersion,omitempty"`
}

// +kubebuilder:object:root=true
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ spec:
This section is not part of the stable API and may change at any time without backward compatibility.
type: object
x-kubernetes-preserve-unknown-fields: true
enableOCPRAG:
default: false
description: Enables automatic OCP documentation based on cluster
version
type: boolean
feedbackDisabled:
description: Disable feedback collection
type: boolean
Expand Down Expand Up @@ -155,11 +150,6 @@ spec:
description: Name of the model to use at the API endpoint provided
in LLMEndpoint
type: string
ocpVersionOverride:
description: |-
Allows forcing a specific OCP version instead of auto-detection.
Format should be like "4.15", "4.16", etc.
type: string
okp:
description: OKP configures the Offline Knowledge Portal (OKP) RAG
source.
Expand Down Expand Up @@ -193,11 +183,6 @@ spec:
status:
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
properties:
activeOCPRAGVersion:
description: |-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
type: string
conditions:
description: Conditions
items:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ metadata:
]
capabilities: Basic Install
categories: AI/Machine Learning
createdAt: "2026-07-03T16:05:52Z"
createdAt: "2026-07-09T10:17:14Z"
description: AI-powered virtual assistant for Red Hat OpenStack Services on OpenShift
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "false"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,6 @@ spec:
This section is not part of the stable API and may change at any time without backward compatibility.
type: object
x-kubernetes-preserve-unknown-fields: true
enableOCPRAG:
default: false
description: Enables automatic OCP documentation based on cluster
version
type: boolean
feedbackDisabled:
description: Disable feedback collection
type: boolean
Expand Down Expand Up @@ -155,11 +150,6 @@ spec:
description: Name of the model to use at the API endpoint provided
in LLMEndpoint
type: string
ocpVersionOverride:
description: |-
Allows forcing a specific OCP version instead of auto-detection.
Format should be like "4.15", "4.16", etc.
type: string
okp:
description: OKP configures the Offline Knowledge Portal (OKP) RAG
source.
Expand Down Expand Up @@ -193,11 +183,6 @@ spec:
status:
description: OpenStackLightspeedStatus defines the observed state of OpenStackLightspeed
properties:
activeOCPRAGVersion:
description: |-
ActiveOCPRAGVersion contains the OCP version being used for RAG configuration
Will be one of: "4.16", "4.18", "latest", or empty if OCP RAG is disabled
type: string
conditions:
description: Conditions
items:
Expand Down
3 changes: 0 additions & 3 deletions internal/controller/assets/vector_database_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,6 @@
│ ├── <vector-db-name>/
│ │ ├── llama-stack.yaml
│ │ └── faiss_store.db
│ └── ocp_X.YZ/ (optional, when OCP RAG is enabled)
│ ├── llama-stack.yaml
│ └── faiss_store.db
└── embeddings_model/

Output (written to --vector-db-path, same basenames as the base configs):
Expand Down
80 changes: 4 additions & 76 deletions internal/controller/assets/vector_database_collect.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,13 +31,6 @@
# │ └── vector-db-data-N/
# │ ├── faiss_store.db
# │ └── llama-stack.yaml
# ├── ocp_vector_db/
# │ ├── ocp_X.YZ/
# │ │ ├── faiss_store.db
# │ │ └── llama-stack.yaml
# │ └── ocp_latest/
# │ ├── faiss_store.db
# │ └── llama-stack.yaml
# ├── embeddings_model/
# │ └── <model_files>
# └── okp_embeddings_model/
Expand All @@ -48,17 +41,14 @@
# ├── <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)
# │ │ └── vector-db-data-N/
# │ └── 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 @@ -69,17 +59,6 @@ set -eu
# image is mounted. Populated via parse_arguments_and_init.
VECTOR_DB_VOLUME_MOUNT_PATH=""

# ENABLE_OCP_RAG specifies whether this script should collect vector database
# content related to OCP (expected to be found under OCP_VECTOR_DB_DIR).
# Must be set to "true" for the collection to be enabled. Populated via
# parse_arguments_and_init.
ENABLE_OCP_RAG=""

# OCP_VERSION specifies what version of OCP content should be collected from
# 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.
Expand All @@ -102,16 +81,6 @@ VECTOR_DB_DATA_COLLECT_DIR=""
# embeddings model should be stored. Populated via parse_arguments_and_init.
EMBEDDINGS_MODEL_DATA_COLLECT_DIR=""

# OCP_VECTOR_DB_DIR specifies the directory within the vector DB container image
# where OCP-specific vector DB data must reside. This script expects to find the
# OCP data exclusively at this location.
OCP_VECTOR_DB_DIR="/rag/ocp_vector_db"

# OCP_VECTOR_DB_DIR_FALLBACK specifies the directory within the vector DB container
# image that contains the default OCP vector DB data. This path is used when no data
# matching the version specified via --ocp-version is found.
OCP_VECTOR_DB_DIR_FALLBACK="/rag/ocp_vector_db/ocp_latest"

# VECTOR_DB_DIR specifies the directory within the vector DB container image
# where general vector DB data must reside.
VECTOR_DB_DIR="/rag/vector_db"
Expand Down Expand Up @@ -140,25 +109,15 @@ parse_arguments_and_init() {
VECTOR_DB_VOLUME_MOUNT_PATH="$2"
shift 2
;;
--enable-ocp-rag)
ENABLE_OCP_RAG="$2"
shift 2
;;
--ocp-version)
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 [--enable-okp]"
echo "Usage: $0 --vector-db-path PATH [--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 All @@ -176,16 +135,6 @@ parse_arguments_and_init() {
exit 1
fi

if [ -z "${ENABLE_OCP_RAG:-}" ]; then
echo "ERROR: --enable-ocp-rag is required"
exit 1
fi

if [ -z "${OCP_VERSION:-}" ]; then
echo "ERROR: --ocp-version is required"
exit 1
fi

COLLECT_DIR=$(mktemp -d "${VECTOR_DB_VOLUME_MOUNT_PATH}/XXXXXXXXXX")
VECTOR_DB_DATA_COLLECT_DIR="${COLLECT_DIR}/vector_db/"
EMBEDDINGS_MODEL_DATA_COLLECT_DIR="${COLLECT_DIR}/embeddings_model"
Expand All @@ -210,26 +159,6 @@ validate_vector_db_dir() {
fi
}

collect_ocp_vector_db_data() {
if [ "${ENABLE_OCP_RAG}" != "true" ]; then
echo "Collecting of OCP vector db data is DISABLED => Skipping"
return
fi

echo "Collecting OCP vector DB data ..."
mkdir -p "${VECTOR_DB_DATA_COLLECT_DIR}"

ocp_dir="${OCP_VECTOR_DB_DIR}/ocp_${OCP_VERSION}"
if [ ! -d "${ocp_dir}" ]; then
echo "Data for OCP version ${OCP_VERSION} not found. Using: ${OCP_VECTOR_DB_DIR_FALLBACK}"
ocp_dir=${OCP_VECTOR_DB_DIR_FALLBACK}
fi

validate_vector_db_dir "${ocp_dir}"
cp -rL "${ocp_dir}" "${VECTOR_DB_DATA_COLLECT_DIR}"
echo "Discovered and collected OCP vector DB data from ${ocp_dir}"
}

collect_vector_db_data() {
echo "Collecting vector DB data ..."
mkdir -p "${VECTOR_DB_DATA_COLLECT_DIR}"
Expand All @@ -243,8 +172,8 @@ collect_vector_db_data() {
echo "Discovered and collected vector DB data from ${dir}"
done

if [ "${ENABLE_OCP_RAG}" != "true" ] && [ ${vector_db_data_collected} != "true" ]; then
echo "ERROR: ENABLE_OCP_RAG='${ENABLE_OCP_RAG}' and no generic vector db data found."
if [ ${vector_db_data_collected} != "true" ]; then
echo "ERROR: no generic vector db data found."
exit 1
fi
}
Expand Down Expand Up @@ -288,7 +217,6 @@ main() {
# 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
}
Expand Down
34 changes: 8 additions & 26 deletions internal/controller/lcore_deployment.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ import (
"fmt"
"path"
"slices"
"strconv"
"strings"

common_helper "github.com/openstack-k8s-operators/lib-common/modules/common/helper"
Expand Down Expand Up @@ -212,10 +211,7 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins
return corev1.PodTemplateSpec{}, err
}

initContainers, err := buildInitContainers(ctx, h, instance)
if err != nil {
return corev1.PodTemplateSpec{}, err
}
initContainers := buildInitContainers(instance)

return corev1.PodTemplateSpec{
ObjectMeta: metav1.ObjectMeta{
Expand All @@ -237,16 +233,7 @@ func buildLCorePodTemplateSpec(h *common_helper.Helper, ctx context.Context, ins
// and Lightspeed Stack configuration files, incorporating information from
// the provided vector database images. For details on their logic, see:
// (1) assets/vector_database_collect.sh and (2) assets/vector_database_build.py.
func buildInitContainers(
ctx context.Context,
helper *common_helper.Helper,
instance *apiv1beta1.OpenStackLightspeed,
) ([]corev1.Container, error) {
ocp_version, err := DetectOCPVersion(ctx, helper)
if err != nil {
return []corev1.Container{}, err
}

func buildInitContainers(instance *apiv1beta1.OpenStackLightspeed) []corev1.Container {
securityContext := &corev1.SecurityContext{
RunAsNonRoot: &[]bool{true}[0],
AllowPrivilegeEscalation: &[]bool{false}[0],
Expand All @@ -270,16 +257,11 @@ func buildInitContainers(
containers = append(containers, corev1.Container{
Name: "vector-database-collect",
Image: apiv1beta1.OpenStackLightspeedDefaultValues.RAGImageURL,
Command: func() []string {
cmd := []string{
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
"--vector-db-path", VectorDBVolumeMountPath,
"--enable-ocp-rag", strconv.FormatBool(instance.Spec.EnableOCPRAG),
"--ocp-version", ocp_version,
}
cmd = append(cmd, "--enable-okp")
return cmd
}(),
Command: []string{
"sh", VectorDBScriptsMountPath + "/" + VectorDBCollectScriptKey,
"--vector-db-path", VectorDBVolumeMountPath,
"--enable-okp",
},
SecurityContext: securityContext,
Resources: resourceRequirements,
VolumeMounts: []corev1.VolumeMount{
Expand Down Expand Up @@ -335,7 +317,7 @@ func buildInitContainers(
},
})

return containers, nil
return containers
}

// buildLightspeedStackConfigVolume returns the volume for the lightspeed-stack config.
Expand Down
Loading
Loading