Skip to content

Commit d92e72a

Browse files
authored
[RHIDP-12571] Add Developer Lightspeed (#351)
* add script for syncing from rhdh ai upstream configs Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add lightspeed specific configs/secrets Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add lightspeed components to chart Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * documentation updates for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add ci case for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * bump chart version Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add mcp plugins for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add secret syncing for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * replace [ with [[ for sonarcloud check Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * attempted fix for ci failures due to write permissions in Kind cluster Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add resource defaults for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * move defaults for lightspeed to separate yaml file Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add mcp to the lightspeed stack config Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove MCP plugins from default lightspeed install Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add rhdh ai team as codeowner of lightspeed defaults Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * add fast fail for lightspeed files Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove plugins from defaults for lightspeed, keep defined in values Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * move enabled and image defaults out, rely solely on values file Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * move checksum for lightspeed plugin to vendored template Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * move lightspeed files to parent chart Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * update codeowners and docs for new lightspeed file location Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * consolidate lightspeed fields in values.yaml Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * remove mcp servers addition from sync in favour of upstream containing it Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * update schemas for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * fix volume schema issues for lightspeed Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * regen schema Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * move lightspeed templates to dedicated /lightspeed dir Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * use @default for global.lightspeed generated description Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * allow for customized configs Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> * run commit hook Signed-off-by: Jordan Dubrick <jdubrick@redhat.com> --------- Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent de01c7d commit d92e72a

20 files changed

Lines changed: 1796 additions & 10 deletions

.github/CODEOWNERS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,6 @@
1717
# Documentation:
1818
*.md.gotmpl @redhat-developer/RHDH-content
1919
/README.md @redhat-developer/RHDH-content
20+
21+
# Lightspeed:
22+
/charts/backstage/files/lightspeed/ @redhat-developer/rhdh-ai

.github/actions/test-charts/action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -166,6 +166,9 @@ runs:
166166
"--set route.enabled=false"
167167
"--set upstream.ingress.enabled=true"
168168
"--set global.host=rhdh.127.0.0.1.sslip.io"
169+
"--set upstream.backstage.podSecurityContext.runAsUser=1001"
170+
"--set upstream.backstage.podSecurityContext.runAsGroup=1001"
171+
"--set upstream.backstage.podSecurityContext.fsGroup=1001"
169172
)
170173
if [[ -n "$INPUT_EXTRA_HELM_ARGS" ]]; then
171174
IFS=' ' read -ra ADDITIONAL_ARGS <<< "$INPUT_EXTRA_HELM_ARGS"

CONTRIBUTING.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,32 @@ It is important to use `--squash` to avoid pulling the entire commit history of
4141
4242
*Note: If merge conflicts occur, resolve them in your editor, then `git add` and `git commit` the resolution as a normal merge.*
4343

44+
### Sync Lightspeed vendored config files
45+
46+
The Lightspeed config files under [`charts/backstage/files/lightspeed`](./charts/backstage/files/lightspeed) are synced separately from the Backstage subtree by [`hack/sync-lightspeed-configs.sh`](./hack/sync-lightspeed-configs.sh).
47+
48+
Use the default upstream branch:
49+
50+
```bash
51+
./hack/sync-lightspeed-configs.sh
52+
```
53+
54+
Sync from a release branch or a tag:
55+
56+
```bash
57+
./hack/sync-lightspeed-configs.sh --ref release-1.9
58+
./hack/sync-lightspeed-configs.sh --ref v0.5.0
59+
```
60+
61+
Verify the vendored files are already in sync without writing changes:
62+
63+
```bash
64+
./hack/sync-lightspeed-configs.sh --ref main --check
65+
```
66+
67+
The script copies the upstream config files directly, except it appends the chart-managed `mcp_servers` block to `lightspeed-stack.yaml` and renders `secret.yaml` from upstream `env/default-values.env` by dropping comment lines plus `LIGHTSPEED_CORE_IMAGE` and `RAG_CONTENT_IMAGE`, then converting each remaining `KEY=value` line into the chart's YAML secret payload.
68+
Choose the upstream branch or tag that matches the Lightspeed release you want to vendor.
69+
4470
**Important:** After any change to the dependency structure or version of the vendored chart, you must rebuild the lock file and local subchart dependencies:
4571

4672
```bash

charts/backstage/Chart.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,4 +47,4 @@ sources: []
4747
# Versions are expected to follow Semantic Versioning (https://semver.org/)
4848
# Note that when this chart is published to https://github.com/openshift-helm-charts/charts
4949
# it will follow the RHDH versioning 1.y.z
50-
version: 5.7.1
50+
version: 5.8.0

charts/backstage/README.md

Lines changed: 43 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11

22
# RHDH Backstage Helm Chart for OpenShift
33

4-
![Version: 5.7.1](https://img.shields.io/badge/Version-5.7.1-informational?style=flat-square)
4+
![Version: 5.8.0](https://img.shields.io/badge/Version-5.8.0-informational?style=flat-square)
55
![Type: application](https://img.shields.io/badge/Type-application-informational?style=flat-square)
66

77
A Helm chart for deploying Red Hat Developer Hub, which is a Red Hat supported version of Backstage.
@@ -29,7 +29,7 @@ For the **Generally Available** version of this chart, see:
2929
helm repo add bitnami https://charts.bitnami.com/bitnami
3030
helm repo add redhat-developer https://redhat-developer.github.io/rhdh-chart
3131

32-
helm install my-backstage redhat-developer/backstage --version 5.7.1
32+
helm install my-backstage redhat-developer/backstage --version 5.8.0
3333
```
3434

3535
## Introduction
@@ -174,6 +174,35 @@ Kubernetes: `>= 1.27.0-0`
174174
| global.dynamic.includes[0] | List of dynamic plugins included inside the `rhdh` container image, some of which are disabled by default. This file ONLY works with the `rhdh` container image. | string | `"dynamic-plugins.default.yaml"` |
175175
| global.dynamic.plugins | List of dynamic plugins, possibly overriding the plugins listed in `includes` files. Every item defines the plugin `package` as a [NPM package spec](https://docs.npmjs.com/cli/v10/using-npm/package-spec), an optional `pluginConfig` with plugin-specific backstage configuration, and an optional `disabled` flag to disable/enable a plugin listed in `includes` files. It also includes an `integrity` field that is used to verify the plugin package [integrity](https://w3c.github.io/webappsec-subresource-integrity/#integrity-metadata-description). | list | `[]` |
176176
| global.host | Custom hostname shorthand, overrides `global.clusterRouterBase`, `upstream.ingress.host`, `route.host`, and url values in `upstream.backstage.appConfig`. | string | `""` |
177+
| global.lightspeed | Built-in Lightspeed feature configuration. | object | Use Lightspeed compatible settings / configurations. |
178+
| global.lightspeed.configMaps[0].create | Whether to create this ConfigMap from the bundled source file. Set to false and provide `nameOverride` to use a pre-existing ConfigMap. | bool | `true` |
179+
| global.lightspeed.configMaps[0].nameOverride | Name of an existing ConfigMap to use instead. Required when `create` is false. | string | `""` |
180+
| global.lightspeed.configMaps[0].sourceFile | Bundled file used to populate the ConfigMap data when `create` is true. | string | `"lightspeed-stack.yaml"` |
181+
| global.lightspeed.configMaps[1].create | Whether to create this ConfigMap from the bundled source file. Set to false and provide `nameOverride` to use a pre-existing ConfigMap. | bool | `true` |
182+
| global.lightspeed.configMaps[1].nameOverride | Name of an existing ConfigMap to use instead. Required when `create` is false. | string | `""` |
183+
| global.lightspeed.configMaps[1].sourceFile | Bundled file used to populate the ConfigMap data when `create` is true. | string | `"config.yaml"` |
184+
| global.lightspeed.configMaps[2].create | Whether to create this ConfigMap from the bundled source file. Set to false and provide `nameOverride` to use a pre-existing ConfigMap. | bool | `true` |
185+
| global.lightspeed.configMaps[2].nameOverride | Name of an existing ConfigMap to use instead. Required when `create` is false. | string | `""` |
186+
| global.lightspeed.configMaps[2].sourceFile | Bundled file used to populate the ConfigMap data when `create` is true. | string | `"rhdh-profile.py"` |
187+
| global.lightspeed.enabled | Enable or disable the built-in Lightspeed feature. | bool | `true` |
188+
| global.lightspeed.initContainer.image | Full image reference for the Lightspeed RAG bootstrap init container. Override for disconnected environments. | string | `"quay.io/redhat-ai-dev/rag-content:release-1.9-lls-0.5.0-642c567fe10a62b5ff711654306b72912f341e05"` |
189+
| global.lightspeed.initContainer.resources | Resource requests/limits for the Lightspeed RAG bootstrap init container. | object | `{"limits":{"cpu":"100m","memory":"500Mi"},"requests":{"cpu":"50m","memory":"150Mi"}}` |
190+
| global.lightspeed.plugins | Lightspeed plugins and their configuration. Override package references for disconnected environments. | list | `[{"disabled":false,"package":"oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed:bs_1.45.3__1.4.0!red-hat-developer-hub-backstage-plugin-lightspeed","pluginConfig":{"dynamicPlugins":{"frontend":{"red-hat-developer-hub.backstage-plugin-lightspeed":{"dynamicRoutes":[{"importName":"LightspeedPage","path":"/lightspeed"}],"mountPoints":[{"importName":"LightspeedFAB","mountPoint":"application/listener"},{"importName":"LightspeedDrawerProvider","mountPoint":"application/provider"},{"config":{"id":"lightspeed"},"importName":"LightspeedDrawerStateExposer","mountPoint":"application/internal/drawer-state"},{"config":{"id":"lightspeed","priority":100},"importName":"LightspeedChatContainer","mountPoint":"application/internal/drawer-content"}],"translationResources":[{"importName":"lightspeedTranslations","module":"Alpha","ref":"lightspeedTranslationRef"}]}}}}},{"disabled":false,"package":"oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-lightspeed-backend:bs_1.45.3__1.4.0!red-hat-developer-hub-backstage-plugin-lightspeed-backend"}]` |
191+
| global.lightspeed.ragVolume.emptyDir | `emptyDir` configuration for the RAG data volume. | object | `{}` |
192+
| global.lightspeed.ragVolume.initMountPath | Mount path inside the init container for seeding RAG data. | string | `"/rag-content"` |
193+
| global.lightspeed.ragVolume.mountPath | Mount path inside the sidecar container for serving RAG data. | string | `"/rag-content"` |
194+
| global.lightspeed.ragVolume.name | Name of the Kubernetes volume used for Lightspeed RAG data. | string | `"lightspeed-rag"` |
195+
| global.lightspeed.runtimeVolume.emptyDir | `emptyDir` configuration for the Lightspeed runtime data volume when `runtimeVolume.type=emptyDir`. | object | `{}` |
196+
| global.lightspeed.runtimeVolume.mountPath | Mount path inside the container for Lightspeed runtime storage. | string | `"/tmp"` |
197+
| global.lightspeed.runtimeVolume.name | Name of the Kubernetes volume used for writable Lightspeed runtime storage. | string | `"lightspeed-data"` |
198+
| global.lightspeed.runtimeVolume.persistentVolumeClaim | Existing PVC reference for the Lightspeed runtime data volume when `runtimeVolume.type=persistentVolumeClaim`. | object | `{}` |
199+
| global.lightspeed.runtimeVolume.type | Volume source used for writable Lightspeed runtime storage mounted at `/tmp`. Supported values: `emptyDir`, `persistentVolumeClaim`. | string | `"emptyDir"` |
200+
| global.lightspeed.secret.create | Whether to create a Lightspeed Secret from the bundled source file. | bool | `true` |
201+
| global.lightspeed.secret.name | Name of an existing Secret to use instead. Required when `create` is false. | string | `""` |
202+
| global.lightspeed.secret.optional | Whether the Secret reference is optional in the pod spec. | bool | `false` |
203+
| global.lightspeed.secret.sourceFile | Bundled file used to populate the Secret's `stringData` keys. | string | `"secret.yaml"` |
204+
| global.lightspeed.sidecar.image | Full image reference for the Lightspeed Core sidecar. Override for disconnected environments. | string | `"quay.io/lightspeed-core/lightspeed-stack:0.5.0"` |
205+
| global.lightspeed.sidecar.resources | Resource requests/limits for the Lightspeed Core sidecar. | object | `{"limits":{"cpu":"1000m","memory":"2Gi"},"requests":{"cpu":"100m","memory":"512Mi"}}` |
177206
| nameOverride | | string | `"developer-hub"` |
178207
| orchestrator.enabled | | bool | `false` |
179208
| orchestrator.plugins | Orchestrator plugins and their configuration | list | `[{"disabled":false,"package":"oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-backend:{{ \"{{inherit}}\" }}"},{"disabled":false,"package":"oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator-form-widgets:{{ \"{{inherit}}\" }}"},{"disabled":false,"package":"oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-orchestrator:{{ \"{{inherit}}\" }}"},{"disabled":false,"package":"oci://registry.access.redhat.com/rhdh/red-hat-developer-hub-backstage-plugin-scaffolder-backend-module-orchestrator:{{ \"{{inherit}}\" }}"}]` |
@@ -304,6 +333,18 @@ The chart supports automatic plugin discovery through a catalog index OCI image.
304333

305334
For detailed information on configuring the catalog index, including how to override the default image or use a private registry, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
306335

336+
### Lightspeed
337+
338+
Use `global.lightspeed.enabled` to enable or disable the built-in Lightspeed feature.
339+
340+
When enabled, the chart adds the default Lightspeed dynamic plugins, a RAG bootstrap init container, a Lightspeed Core sidecar listening on port `8080`, chart-generated ConfigMaps, a chart-generated Secret, and separate runtime and RAG data volumes. Override `global.lightspeed.plugins` for disconnected environments.
341+
342+
Use `global.lightspeed.runtimeVolume` to change the writable `/tmp` runtime storage between `emptyDir` and an existing PVC reference. The chart mounts that volume at `/tmp` so both generated temp files and `/tmp/data` remain writable. The `/rag-content` volume stays chart-managed and `emptyDir`-backed because the RAG assets are repopulated by the init container on each Pod start.
343+
344+
When using the built-in Lightspeed feature, do not also keep Lightspeed plugin packages in `global.dynamic.plugins`. Existing installations that previously configured Lightspeed there should remove those entries if the built-in defaults are sufficient, or move their custom package definitions to `global.lightspeed.plugins`; otherwise the rendered `dynamic-plugins.yaml` will contain duplicate Lightspeed plugin entries.
345+
346+
The Lightspeed Core sidecar loads the chart-created Lightspeed Secret as environment variables. If you update that Secret outside of Helm, Kubernetes does not guarantee that the Backstage Pod restarts automatically. Use a no-op `helm upgrade` or manually restart the Backstage deployment after changing the secret data.
347+
307348
### Vanilla Kubernetes compatibility mode
308349

309350
To deploy this chart on vanilla Kubernetes or any other non-OCP platform, apply the following changes. Note that further customizations might be required, depending on your exact Kubernetes setup:

charts/backstage/README.md.gotmpl

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,6 +236,18 @@ The chart supports automatic plugin discovery through a catalog index OCI image.
236236

237237
For detailed information on configuring the catalog index, including how to override the default image or use a private registry, see the [Catalog Index Configuration documentation](../../docs/catalog-index-configuration.md).
238238

239+
### Lightspeed
240+
241+
Use `global.lightspeed.enabled` to enable or disable the built-in Lightspeed feature.
242+
243+
When enabled, the chart adds the default Lightspeed dynamic plugins, a RAG bootstrap init container, a Lightspeed Core sidecar listening on port `8080`, chart-generated ConfigMaps, a chart-generated Secret, and separate runtime and RAG data volumes. Override `global.lightspeed.plugins` for disconnected environments.
244+
245+
Use `global.lightspeed.runtimeVolume` to change the writable `/tmp` runtime storage between `emptyDir` and an existing PVC reference. The chart mounts that volume at `/tmp` so both generated temp files and `/tmp/data` remain writable. The `/rag-content` volume stays chart-managed and `emptyDir`-backed because the RAG assets are repopulated by the init container on each Pod start.
246+
247+
When using the built-in Lightspeed feature, do not also keep Lightspeed plugin packages in `global.dynamic.plugins`. Existing installations that previously configured Lightspeed there should remove those entries if the built-in defaults are sufficient, or move their custom package definitions to `global.lightspeed.plugins`; otherwise the rendered `dynamic-plugins.yaml` will contain duplicate Lightspeed plugin entries.
248+
249+
The Lightspeed Core sidecar loads the chart-created Lightspeed Secret as environment variables. If you update that Secret outside of Helm, Kubernetes does not guarantee that the Backstage Pod restarts automatically. Use a no-op `helm upgrade` or manually restart the Backstage deployment after changing the secret data.
250+
239251
### Vanilla Kubernetes compatibility mode
240252

241253
To deploy this chart on vanilla Kubernetes or any other non-OCP platform, apply the following changes. Note that further customizations might be required, depending on your exact Kubernetes setup:
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# Workaround for kind cluster in CI which has no Routes and no PVCs
2+
route:
3+
enabled: false
4+
5+
global:
6+
lightspeed:
7+
enabled: false
8+
9+
upstream:
10+
postgresql:
11+
primary:
12+
persistence:
13+
enabled: false

0 commit comments

Comments
 (0)