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
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,9 @@ metadata:
}
}
]
capabilities: Basic Install
capabilities: Seamless Upgrades
console.openshift.io/operator-monitoring-default: "true"
createdAt: "2025-12-18T10:30:55Z"
createdAt: "2026-01-28T20:15:15Z"
features.operators.openshift.io/cnf: "false"
features.operators.openshift.io/cni: "false"
features.operators.openshift.io/csi: "false"
Expand Down Expand Up @@ -606,6 +606,7 @@ spec:
- --cert-dir=/etc/tls/private
- --lcore-image=quay.io/lightspeed-core/lightspeed-stack:dev-latest
- --use-lcore=false
- --lcore-server=true
- --service-image=quay.io/openshift-lightspeed/lightspeed-service-api:latest
- --console-image=quay.io/openshift-lightspeed/lightspeed-console-plugin:latest
- --console-image-pf5=quay.io/openshift-lightspeed/lightspeed-console-plugin-pf5:latest
Expand Down
10 changes: 10 additions & 0 deletions cmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func main() {
var dataverseExporterImage string
var ocpRagImage string
var useLCore bool
var lcoreServerMode bool
flag.StringVar(&metricsAddr, "metrics-bind-address", ":8080", "The address the metric endpoint binds to.")
flag.StringVar(&probeAddr, "health-probe-bind-address", ":8081", "The address the probe endpoint binds to.")
flag.BoolVar(&enableLeaderElection, "leader-elect", false,
Expand All @@ -197,6 +198,7 @@ func main() {
flag.StringVar(&dataverseExporterImage, "dataverse-exporter-image", utils.DataverseExporterImageDefault, "The image of the dataverse exporter container.")
flag.StringVar(&ocpRagImage, "ocp-rag-image", utils.OcpRagImageDefault, "The image with the OCP RAG databases.")
flag.BoolVar(&useLCore, "use-lcore", false, "Use LCore instead of AppServer for the application server deployment.")
flag.BoolVar(&lcoreServerMode, "lcore-server", true, "Use LCore in a server mode.")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We may use the already existing use-lcore parameter, making it a string enum type, having 3 candidate values:

  1. disabled
  2. server
  3. library

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying not to change existing behaviour

opts := zap.Options{
Development: true,
}
Expand All @@ -219,6 +221,13 @@ func main() {
}
setupLog.Info("========================================")
setupLog.Info(">>> BACKEND CONFIGURATION <<<", "backendType", backendType)
if useLCore {
deploymentMode := "server"
if !lcoreServerMode {
deploymentMode = "library"
}
setupLog.Info(">>> LCORE DEPLOYMENT MODE <<<", "mode", deploymentMode)
}
setupLog.Info("========================================")

setupLog.Info("Starting the operator", "metricsAddr", metricsAddr, "probeAddr", probeAddr, "certDir", certDir, "certName", certName, "keyName", keyName, "namespace", namespace)
Expand Down Expand Up @@ -430,6 +439,7 @@ func main() {
DataverseExporterImage: imagesMap["dataverse-exporter-image"],
LightspeedCoreImage: imagesMap["lightspeed-core"],
UseLCore: useLCore,
LCoreServerMode: lcoreServerMode,
Namespace: namespace,
PrometheusAvailable: prometheusAvailable,
},
Expand Down
1 change: 1 addition & 0 deletions config/manager/manager.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ spec:
- "--cert-dir=/etc/tls/private"
- "--lcore-image=quay.io/lightspeed-core/lightspeed-stack:dev-latest"
- "--use-lcore=false"
- "--lcore-server=true"
image: quay.io/openshift-lightspeed/lightspeed-operator:latest
imagePullPolicy: Always
name: manager
Expand Down
17 changes: 14 additions & 3 deletions internal/controller/lcore/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -709,12 +709,23 @@ func buildLCoreServiceConfig(_ reconciler.Reconciler, cr *olsv1alpha1.OLSConfig)
}
}

func buildLCoreLlamaStackConfig(_ reconciler.Reconciler, _ *olsv1alpha1.OLSConfig) map[string]interface{} {
return map[string]interface{}{
"use_as_library_client": false,
func buildLCoreLlamaStackConfig(r reconciler.Reconciler, _ *olsv1alpha1.OLSConfig) map[string]interface{} {
// Server mode: llama-stack runs as a separate service (container)
// Library mode: llama-stack runs as an embedded library
isLibraryMode := r != nil && !r.GetLCoreServerMode()

llamaStackConfig := map[string]interface{}{
"use_as_library_client": isLibraryMode,
"url": "http://localhost:8321",
"api_key": "xyzzy",
}

// In library mode, add path to llama-stack config file
if isLibraryMode {
llamaStackConfig["library_client_config_path"] = utils.LlamaStackConfigMountPath
}

return llamaStackConfig
}

func buildLCoreUserDataCollectionConfig(_ reconciler.Reconciler, cr *olsv1alpha1.OLSConfig) map[string]interface{} {
Expand Down
Loading