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
9 changes: 8 additions & 1 deletion .github/workflows/build-and-push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
- lcore-migration
workflow_dispatch: {}

env:
Expand Down Expand Up @@ -32,7 +33,13 @@ jobs:
BUNDLE_IMAGE=${IMAGE_TAG_BASE}-bundle:v${VERSION}
CATALOG_IMAGE=${IMAGE_TAG_BASE}-catalog:v${VERSION}

LATEST_TAG=latest
# `main` branch -> `latest` tag
Comment thread
lpiwowar marked this conversation as resolved.
# any other branch -> `[branch-name]-latest` tag
if [[ "${{ github.ref_name }}" == "main" ]]; then
LATEST_TAG=latest
else
LATEST_TAG=${{ github.ref_name }}-latest
fi
OPERATOR_IMAGE_LATEST=${IMAGE_TAG_BASE}:${LATEST_TAG}
BUNDLE_IMAGE_LATEST=${IMAGE_TAG_BASE}-bundle:${LATEST_TAG}
CATALOG_IMAGE_LATEST=${IMAGE_TAG_BASE}-catalog:${LATEST_TAG}
Expand Down
14 changes: 0 additions & 14 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,6 @@ endif
OPERATOR_SDK_VERSION ?= v1.38.0-ocp
# Image URL to use all building/pushing image targets
IMG ?= $(IMAGE_TAG_BASE):latest
# OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION defines the version injected into the operator (OLS operator version)
OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION ?= latest
# ENVTEST_K8S_VERSION refers to the version of kubebuilder assets to be downloaded by envtest binary.
ENVTEST_K8S_VERSION = 1.30.0

Expand Down Expand Up @@ -203,17 +201,6 @@ deploy: manifests kustomize ## Deploy controller to the K8s cluster specified in
cd config/manager && $(KUSTOMIZE) edit set image controller=${IMG}
$(KUSTOMIZE) build config/default | $(KUBECTL) apply -f -

.PHONY: ols-deploy
ols-deploy: export OUTPUT_DIR = out
ols-deploy: ## Deploy OpenShift Lightspeed Operator
bash scripts/gen-ols.sh
oc apply -f $(OUTPUT_DIR)/ols

.PHONY: ols-undeploy
ols-undeploy: export OUTPUT_DIR = out
ols-undeploy: ## Deploy OpenShift Lightspeed Operator
find $(OUTPUT_DIR)/ols -name "*.yaml" -printf " -f %p" | xargs oc delete --ignore-not-found=$(ignore-not-found)

.PHONY: undeploy
undeploy: kustomize ## Undeploy controller from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
$(KUSTOMIZE) build config/default | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
Expand Down Expand Up @@ -329,7 +316,6 @@ endif
bundle: manifests kustomize operator-sdk ## Generate bundle manifests and metadata, then validate generated files.
$(OPERATOR_SDK) generate kustomize manifests -q
cd config/manager && $(KUSTOMIZE) edit set image controller=$(IMG)
cd config/manager && $(KUSTOMIZE) edit add patch --kind Deployment --name controller-manager --patch "[{\"op\": \"replace\", \"path\": \"/spec/template/spec/containers/0/env/0/value\", \"value\": \"$(OPENSHIFT_LIGHTSPEED_OPERATOR_VERSION)\"}]"
$(KUSTOMIZE) build config/manifests | $(OPERATOR_SDK) generate bundle $(BUNDLE_GEN_FLAGS)
$(OPERATOR_SDK) bundle validate ./bundle

Expand Down
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -238,9 +238,5 @@ make kuttl-test-run
```

**Important Notes:**
- The tests use the `openshift-lightspeed` namespace to test in the exact namespace
where the OLS operator is expected to operate.
- The correct behavior of the OLS operator is not guaranteed outside of the
`openshift-lightspeed` namespace.
- Ensure the namespace is clean before running tests to avoid resource conflicts
or test failures.
6 changes: 6 additions & 0 deletions api/v1beta1/conditions.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,4 +63,10 @@ const (

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

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

// DeploymentsNotReadyMessage
DeploymentsNotReadyMessage = "Waiting for deployments to be ready: %s"
)
54 changes: 39 additions & 15 deletions api/v1beta1/openstacklightspeed_types.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,20 @@ import (
)

const (
// Container image fall-back defaults

// OpenStackLightspeedContainerImage is the fall-back container image for OpenStackLightspeed
OpenStackLightspeedContainerImage = "quay.io/openstack-lightspeed/rag-content:os-docs-2025.2"
MaxTokensForResponseDefault = 2048

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

// ExporterContainerImage is the fall-back container image for the Dataverse Exporter
ExporterContainerImage = "quay.io/lightspeed-core/lightspeed-to-dataverse-exporter:latest"

// PostgresContainerImage is the fall-back container image for PostgreSQL
PostgresContainerImage = "registry.redhat.io/rhel9/postgresql-16:latest"

// MaxTokensForResponseDefault is the default maximum number of tokens that should be used for response
MaxTokensForResponseDefault = 2048
)

// OpenStackLightspeedSpec defines the desired state of OpenStackLightspeed
Expand Down Expand Up @@ -82,16 +91,6 @@ type OpenStackLightspeedCore struct {
// MaxTokensForResponse defines the maximum number of tokens to be used for the response generation
MaxTokensForResponse int `json:"maxTokensForResponse,omitempty"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="openshift-marketplace"
// Namespace where the CatalogSource containing the OLS operator is located
CatalogSourceNamespace string `json:"catalogSourceNamespace"`

// +kubebuilder:validation:Optional
// +kubebuilder:default="redhat-operators"
// Name of the CatalogSource that contains the OLS Operator
CatalogSourceName string `json:"catalogSourceName"`

// +kubebuilder:validation:Optional
// Project ID for LLM providers that require it (e.g., WatsonX)
LLMProjectID string `json:"llmProjectID,omitempty"`
Expand Down Expand Up @@ -131,10 +130,26 @@ type OpenStackLightspeedStatus struct {
// +kubebuilder:subresource:status
// +kubebuilder:printcolumn:name="Status",type="string",JSONPath=".status.conditions[0].status",description="Status"
// +kubebuilder:printcolumn:name="Message",type="string",JSONPath=".status.conditions[0].message",description="Message"
// +operator-sdk:csv:customresourcedefinitions:resources={{OLSConfig,v1alpha1,cluster}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,v1,lightspeed-stack-deployment}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Deployment,v1,lightspeed-postgres-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Service,v1,lightspeed-app-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Service,v1,lightspeed-postgres-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ConfigMap,v1,llama-stack-config}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ConfigMap,v1,lightspeed-stack-config}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ConfigMap,v1,lightspeed-postgres-conf}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Secret,v1,lightspeed-postgres-secret}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Secret,v1,lightspeed-postgres-bootstrap}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Secret,v1,metrics-reader-token}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Secret,v1,lightspeed-tls}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Secret,v1,lightspeed-postgres-certs}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ServiceAccount,v1,lightspeed-app-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{NetworkPolicy,v1,lightspeed-app-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{NetworkPolicy,v1,lightspeed-postgres-server}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ClusterRole,v1,lightspeed-app-server-sar-role}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ClusterRoleBinding,v1,lightspeed-app-server-sar-role-binding}}
// +operator-sdk:csv:customresourcedefinitions:resources={{Subscription,v1alpha1}}
// +operator-sdk:csv:customresourcedefinitions:resources={{ClusterServiceVersion,v1alpha1}}
// +operator-sdk:csv:customresourcedefinitions:resources={{InstallPlan,v1alpha}}
// +operator-sdk:csv:customresourcedefinitions:resources={{InstallPlan,v1alpha1}}

// OpenStackLightspeed is the Schema for the openstacklightspeeds API
type OpenStackLightspeed struct {
Expand Down Expand Up @@ -165,6 +180,9 @@ func (instance OpenStackLightspeed) IsReady() bool {

type OpenStackLightspeedDefaults struct {
RAGImageURL string
LCoreImageURL string
ExporterImageURL string
PostgresImageURL string
MaxTokensForResponse int
}

Expand All @@ -176,6 +194,12 @@ func SetupDefaults() {
openStackLightspeedDefaults := OpenStackLightspeedDefaults{
RAGImageURL: util.GetEnvVar(
"RELATED_IMAGE_OPENSTACK_LIGHTSPEED_IMAGE_URL_DEFAULT", OpenStackLightspeedContainerImage),
LCoreImageURL: util.GetEnvVar(
"RELATED_IMAGE_LCORE_IMAGE_URL_DEFAULT", LCoreContainerImage),
ExporterImageURL: util.GetEnvVar(
"RELATED_IMAGE_EXPORTER_IMAGE_URL_DEFAULT", ExporterContainerImage),
PostgresImageURL: util.GetEnvVar(
"RELATED_IMAGE_POSTGRES_IMAGE_URL_DEFAULT", PostgresContainerImage),
MaxTokensForResponse: MaxTokensForResponseDefault,
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,6 @@ spec:
spec:
description: OpenStackLightspeedSpec defines the desired state of OpenStackLightspeed
properties:
catalogSourceName:
default: redhat-operators
description: Name of the CatalogSource that contains the OLS Operator
type: string
catalogSourceNamespace:
default: openshift-marketplace
description: Namespace where the CatalogSource containing the OLS
operator is located
type: string
enableOCPRAG:
default: false
description: Enables automatic OCP documentation based on cluster
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
apiVersion: rbac.authorization.k8s.io/v1
kind: RoleBinding
metadata:
creationTimestamp: null
labels:
app.kubernetes.io/managed-by: kustomize
app.kubernetes.io/name: openstack-lightspeed-operator
name: openstack-lightspeed-operator-manager-rolebinding
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
name: manager-role
Comment thread
coderabbitai[bot] marked this conversation as resolved.
subjects:
- kind: ServiceAccount
name: openstack-lightspeed-operator-controller-manager
namespace: openstack-lightspeed-operator-system
Loading
Loading