Skip to content

[RHIDP-11653] Include Lightspeed By Default#202

Draft
Jdubrick wants to merge 12 commits intoredhat-developer:mainfrom
Jdubrick:lightspeed-as-default-install
Draft

[RHIDP-11653] Include Lightspeed By Default#202
Jdubrick wants to merge 12 commits intoredhat-developer:mainfrom
Jdubrick:lightspeed-as-default-install

Conversation

@Jdubrick
Copy link
Copy Markdown
Contributor

@Jdubrick Jdubrick commented Apr 28, 2026

Description

  • Moves Lightspeed to the main default compose.yaml
  • Moves all Lightspeed configs/files to the root level /configs
    • Subsequently removed the /developer-lightspeed directory
  • Disables the FAB plugin as it is conflicting with the Lightspeed FAB
    • I was told this is being removed anyway, so disabled for now with a comment
  • Splits Lightspeed documentation into 2 pieces
    1. For users wanting to setup an LLM
    2. For maintainers wanting to update configs / plugin etc
  • Updates CI tests as Lightspeed enabled by default so I removed the dedicated Lightspeed compose test
  • Uses {{inherit}} for lightspeed plugin
    • Updated catalog index image to 1.10 to include lightspeed. Also resolves CI errors for other default plugins
  • Adds nightly GH workflow to grab config changes for lightspeed
    • When release is cut we can update this to only check from the designated release branch to get any patch fixes

Which issue(s) does this PR fix or relate to

https://redhat.atlassian.net/browse/RHIDP-11653
https://redhat.atlassian.net/browse/RHIDP-11654

PR acceptance criteria

  • Tests updated and passing
  • Documentation updated
  • Built-in TechDocs updated if needed. Note that TechDocs changes may need to be reviewed by a Product Manager and/or Architect to ensure content accuracy, clarity, and alignment with user needs.

How to test changes / Special notes to the reviewer

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
… scripts

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
…ault

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@openshift-ci openshift-ci Bot requested review from rm3l and subhashkhileri April 28, 2026 20:33
@rhdh-qodo-merge
Copy link
Copy Markdown
Contributor

rhdh-qodo-merge Bot commented Apr 28, 2026

Code Review by Qodo

🐞 Bugs (2) 📘 Rule violations (0) 📎 Requirement gaps (0)

Grey Divider


Action required

1. rag-init shell command broken 🐞 Bug ☼ Reliability
Description
In compose.yaml, rag-init uses entrypoint ["/bin/sh","-c"] but passes a command string that
begins/ends with literal double quotes, so the shell treats the whole script as one quoted word and
fails to execute it. This causes rag-init to exit non-zero and blocks lightspeed-core (depends_on:
service_completed_successfully), leaving Lightspeed non-functional by default.
Code

compose.yaml[R83-91]

+    entrypoint: [ "/bin/sh", "-c" ]
+    command: |
+      "set -e; echo 'Copying RAG data...' && \
+      mkdir -p /data/vector_db /data/embeddings_model && \
+      cp -r /rag/vector_db/* /data/vector_db/ && \
+      cp -r /rag/embeddings_model/* /data/embeddings_model/ && \
+      chown -R 1001:0 /data/vector_db /data/embeddings_model || true && \
+      chmod -R a+rwX /data/vector_db /data/embeddings_model && \
+      echo 'Copy complete.'"
Relevance

⭐⭐⭐ High

Team historically accepts compose/runtime-breaking fixes (compose merge/healthcheck failures fixed
in PR #177; compose lint fixes PR #32).

PR-#177
PR-#32

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The command passed to /bin/sh -c starts with a literal " and ends with a literal ", which
makes the shell parse the entire script as a single token (a quoted word) instead of a sequence of
shell commands. Because lightspeed-core depends on rag-init completing successfully, this failure
prevents lightspeed-core from starting.

compose.yaml[74-127]
compose.yaml[94-107]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
`rag-init` sets `entrypoint: ["/bin/sh", "-c"]` but the `command: |` content is wrapped in literal double quotes. With `sh -c`, those quotes are part of the command string and cause the shell to interpret the entire multi-command script as one quoted word, so the init container fails and `lightspeed-core` never starts.

### Issue Context
This is now in the default `compose.yaml`, so it impacts every default install.

### Fix Focus Areas
- compose.yaml[74-92]

### Suggested fix
Remove the leading/trailing `"..."` from the `command` block and keep the script as plain shell, e.g.:
```yaml
entrypoint: ["/bin/sh", "-c"]
command: |
 set -e
 echo 'Copying RAG data...'
 mkdir -p /data/vector_db /data/embeddings_model
 cp -r /rag/vector_db/* /data/vector_db/
 cp -r /rag/embeddings_model/* /data/embeddings_model/
 chown -R 1001:0 /data/vector_db /data/embeddings_model || true
 chmod -R a+rwX /data/vector_db /data/embeddings_model
 echo 'Copy complete.'
```
(Keep the existing logic; only fix how it’s passed to `sh -c`.)

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


2. Invalid Lightspeed prompts YAML🐞 Bug ≡ Correctness
Description
configs/app-config/app-config.yaml has lightspeed.prompts defined, but the list item is not
indented under prompts:, making the YAML invalid and preventing Backstage from loading the app
config. This can break RHDH startup (or at minimum fail to apply the Lightspeed configuration).
Code

configs/app-config/app-config.yaml[R256-263]

+lightspeed:
+  # OPTIONAL: Custom user prompts displayed in the Lightspeed UI
+  # These appear as suggested questions/prompts to help users get started
+  # If not provided, the plugin uses built-in default prompts
+  prompts:
+  - title: 'Getting Started with Red Hat Developer Hub'
+    message: Can you guide me through the first steps to start using Developer Hub as a developer, like exploring the Software Catalog and adding my service?
+
Relevance

⭐⭐⭐ High

Team fixes app-config changes that prevent startup (bad config/path fixes accepted in PR #83; config
precedence fixes PR #34).

PR-#83
PR-#34

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The - title: line is aligned with prompts: instead of being nested beneath it, which is invalid
YAML for a sequence value and will cause parsing errors when app-config is loaded.

configs/app-config/app-config.yaml[250-263]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The `lightspeed.prompts` YAML is malformed because the list items are not indented under the `prompts:` key. YAML parsers will reject this, and RHDH may fail to start or ignore the Lightspeed config.

### Issue Context
Current snippet:
```yaml
lightspeed:
 prompts:
 - title: ...
```

### Fix Focus Areas
- configs/app-config/app-config.yaml[256-263]

### Suggested fix
Indent the list under `prompts:`:
```yaml
lightspeed:
 prompts:
   - title: 'Getting Started with Red Hat Developer Hub'
     message: Can you guide me through ...
```

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools



Remediation recommended

3. CSP enables unsafe-eval 🐞 Bug ⛨ Security
Description
configs/app-config/app-config.yaml adds backend.csp.script-src with 'unsafe-eval', which weakens
CSP and increases impact of any XSS by allowing execution via eval/new Function. If this is only
needed for specific dev functionality, it should be gated/limited to avoid broad exposure.
Code

configs/app-config/app-config.yaml[R152-155]

+   script-src:
+     - "'self'"
+     - "'unsafe-eval'"
+     - "https://cdn.jsdelivr.net"
Relevance

⭐⭐ Medium

Repo previously allowed 'unsafe-eval' in Lightspeed app-config example (PR #125 era); no clear
precedent to forbid it.

PR-#125

ⓘ Recommendations generated based on similar findings in past PRs

Evidence
The CSP configuration explicitly permits 'unsafe-eval' in script-src, which relaxes the
browser’s script execution restrictions.

configs/app-config/app-config.yaml[142-155]

Agent prompt
The issue below was found during a code review. Follow the provided context and guidance below and implement a solution

### Issue description
The app-config CSP now includes `script-src: ['self', 'unsafe-eval', ...]`. Allowing `unsafe-eval` meaningfully weakens CSP defenses.

### Issue Context
This may be required for certain Backstage features, but enabling it globally should be an explicit, justified tradeoff.

### Fix Focus Areas
- configs/app-config/app-config.yaml[142-155]

### Suggested fix options
1. If not strictly required, remove `'unsafe-eval'`.
2. If required, add an explicit comment explaining why and consider scoping it (e.g., only in dev/local builds or via a separate optional local override config) so default installs can keep a stricter CSP when possible.

ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation tools


Grey Divider

Qodo Logo

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@rhdh-qodo-merge
Copy link
Copy Markdown
Contributor

Review Summary by Qodo

Include Lightspeed by default in RHDH Local

✨ Enhancement

Grey Divider

Walkthroughs

Description
• Moves Lightspeed to default compose.yaml, enabling it by default
• Consolidates Lightspeed configs from developer-lightspeed to root /configs
• Disables FAB plugin due to conflict with Lightspeed FAB
• Splits Lightspeed documentation into user and maintainer guides
• Updates CI tests to remove dedicated Lightspeed compose test
Diagram
flowchart LR
  A["developer-lightspeed/<br/>directory structure"] -->|"consolidate configs"| B["configs/extra-files/<br/>lightspeed files"]
  C["developer-lightspeed/<br/>compose.yaml"] -->|"merge into"| D["compose.yaml<br/>default services"]
  E["developer-lightspeed/<br/>README.md"] -->|"split into"| F["docs/lightspeed/<br/>working-with-lightspeed.md"]
  E -->|"split into"| G["docs/lightspeed/<br/>maintaining-lightspeed.md"]
  H["start/stop scripts"] -->|"remove"| I["use standard<br/>compose commands"]
  J["FAB plugin"] -->|"disable"| K["avoid conflict<br/>with Lightspeed FAB"]
Loading

Grey Divider

File Changes

1. developer-lightspeed/scripts/start-lightspeed.sh Removal +0/-92

Removed dedicated Lightspeed startup script

developer-lightspeed/scripts/start-lightspeed.sh


2. developer-lightspeed/scripts/stop-lightspeed.sh Removal +0/-132

Removed dedicated Lightspeed cleanup script

developer-lightspeed/scripts/stop-lightspeed.sh


3. wait-for-plugins-and-start.sh ✨ Enhancement +0/-6

Removed Lightspeed-specific config loading logic

wait-for-plugins-and-start.sh


View more (17)
4. configs/extra-files/rhdh-profile.py ✨ Enhancement +47/-58

Updated system prompts and question validation logic

configs/extra-files/rhdh-profile.py


5. .github/workflows/test.yml ⚙️ Configuration changes +0/-2

Removed dedicated developer-lightspeed compose test

.github/workflows/test.yml


6. README.md 📝 Documentation +2/-1

Updated Lightspeed documentation links to new locations

README.md


7. compose.yaml ✨ Enhancement +56/-0

Added Lightspeed services to default compose configuration

compose.yaml


8. configs/app-config/app-config.yaml ✨ Enhancement +31/-1

Added Lightspeed plugin config and CSP settings

configs/app-config/app-config.yaml


9. configs/dynamic-plugins/dynamic-plugins.yaml ✨ Enhancement +38/-1

Added Lightspeed plugins, disabled FAB plugin

configs/dynamic-plugins/dynamic-plugins.yaml


10. configs/extra-files/config.yaml ✨ Enhancement +38/-48

Updated Llama Stack validation provider configuration

configs/extra-files/config.yaml


11. default.env 📝 Documentation +1/-1

Updated documentation reference for Lightspeed config

default.env


12. developer-lightspeed/README.md Removal +0/-469

Removed old Lightspeed setup documentation

developer-lightspeed/README.md


13. developer-lightspeed/compose.yaml Removal +0/-66

Removed separate Lightspeed compose file

developer-lightspeed/compose.yaml


14. developer-lightspeed/configs/app-config/app-config.lightspeed.local.example.yaml Removal +0/-49

Removed Lightspeed-specific app config example

developer-lightspeed/configs/app-config/app-config.lightspeed.local.example.yaml


15. developer-lightspeed/configs/dynamic-plugins/dynamic-plugins.lightspeed.yaml Removal +0/-43

Removed separate Lightspeed dynamic plugins config

developer-lightspeed/configs/dynamic-plugins/dynamic-plugins.lightspeed.yaml


16. docs/lightspeed/maintaining-lightspeed.md 📝 Documentation +96/-0

New maintainer guide for Lightspeed configuration

docs/lightspeed/maintaining-lightspeed.md


17. docs/lightspeed/working-with-lightspeed.md 📝 Documentation +327/-0

New user guide for configuring Lightspeed providers

docs/lightspeed/working-with-lightspeed.md


18. configs/extra-files/lightspeed-stack.yaml Additional files +0/-0

...

configs/extra-files/lightspeed-stack.yaml


19. configs/extra-files/templates/placeholder.json Additional files +0/-0

...

configs/extra-files/templates/placeholder.json


20. scripts/sync-lightspeed-configs.sh Additional files +0/-0

...

scripts/sync-lightspeed-configs.sh


Grey Divider

Qodo Logo

@rhdh-qodo-merge rhdh-qodo-merge Bot added documentation Improvements or additions to documentation enhancement New feature or request Tests labels Apr 28, 2026
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@Jdubrick
Copy link
Copy Markdown
Contributor Author

Comment about rag init is not the case, functioning as expected.

@maysunfaisal
Copy link
Copy Markdown
Contributor

IIRC UI team had an interest in the FAB pieces, previously we set it aside to merge the PR

Copy link
Copy Markdown
Contributor

@maysunfaisal maysunfaisal left a comment

Choose a reason for hiding this comment

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

generally lgtm

@Jdubrick
Copy link
Copy Markdown
Contributor Author

/cc @karthikjeeyar

@openshift-ci openshift-ci Bot requested a review from karthikjeeyar April 28, 2026 21:15
Copy link
Copy Markdown
Member

@karthikjeeyar karthikjeeyar left a comment

Choose a reason for hiding this comment

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

Verified locally! Changes looks good to me. I have one small request to include notebook configuration.

Image

Comment thread configs/app-config/app-config.yaml
@karthikjeeyar
Copy link
Copy Markdown
Member

Even though it works, I have noticed this double slash in the embedding_model sentence-transformers//rag-content/embeddings_model, could you please fix this?

https://github.com/Jdubrick/rhdh-local/blob/bd3ac1d49709b1a0421df711d225bbb29326e13c/configs/extra-files/config.yaml#L192

@Jdubrick
Copy link
Copy Markdown
Contributor Author

Even though it works, I have noticed this double slash in the embedding_model sentence-transformers//rag-content/embeddings_model, could you please fix this?

https://github.com/Jdubrick/rhdh-local/blob/bd3ac1d49709b1a0421df711d225bbb29326e13c/configs/extra-files/config.yaml#L192

@karthikjeeyar That unfortunately has to be there, the way Llama Stack references the embedding model since its mounted locally and not remote needs that for the pathing :/

Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@Jdubrick
Copy link
Copy Markdown
Contributor Author

Jdubrick commented Apr 30, 2026

@karthikjeeyar I updated the config for notebooks. I think tests are failing because of changes to the default plugins (non lightspeed)

@JslYoon can you confirm the config I added?

Jdubrick added 3 commits May 1, 2026 13:55
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
@sonarqubecloud
Copy link
Copy Markdown

sonarqubecloud Bot commented May 1, 2026

@Jdubrick Jdubrick requested a review from karthikjeeyar May 1, 2026 18:42
@Jdubrick Jdubrick requested review from JslYoon and maysunfaisal May 1, 2026 18:42
Comment on lines +94 to +118
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-lightspeed:
translationResources:
- importName: lightspeedTranslations
module: Alpha
ref: lightspeedTranslationRef
dynamicRoutes:
- path: /lightspeed
importName: LightspeedPage
mountPoints:
- mountPoint: application/listener
importName: LightspeedFAB
- mountPoint: application/provider
importName: LightspeedDrawerProvider
- mountPoint: application/internal/drawer-state
importName: LightspeedDrawerStateExposer
config:
id: lightspeed
- mountPoint: application/internal/drawer-content
importName: LightspeedChatContainer
config:
id: lightspeed
priority: 100
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
pluginConfig:
dynamicPlugins:
frontend:
red-hat-developer-hub.backstage-plugin-lightspeed:
translationResources:
- importName: lightspeedTranslations
module: Alpha
ref: lightspeedTranslationRef
dynamicRoutes:
- path: /lightspeed
importName: LightspeedPage
mountPoints:
- mountPoint: application/listener
importName: LightspeedFAB
- mountPoint: application/provider
importName: LightspeedDrawerProvider
- mountPoint: application/internal/drawer-state
importName: LightspeedDrawerStateExposer
config:
id: lightspeed
- mountPoint: application/internal/drawer-content
importName: LightspeedChatContainer
config:
id: lightspeed
priority: 100

Similar comment to redhat-developer/rhdh-operator#2756 (comment)
With {{inherit}}, we should be able to also inherit the pluginConfig from the DPDY. So I think we can further simplify this.. (unless there is a specific difference in the config)

Comment thread default.env
# Default plugin catalog index image
# Requires RHDH 1.9+ to be handled.
CATALOG_INDEX_IMAGE=quay.io/rhdh/plugin-catalog-index:1.9
CATALOG_INDEX_IMAGE=quay.io/rhdh/plugin-catalog-index:1.10
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Since main should point to a stable GA release of RHDH, this PR should target the release-1.10 branch first (once it is created), and only be cherry-picked to main once 1.10 is out.

/hold

Comment on lines +247 to +257
## Disabling Lightspeed

Developer Lightspeed is included by default. If you don't configure an LLM provider, Lightspeed will remain in an unconfigured/dormant state and not affect your RHDH experience.

To fully remove Lightspeed from your setup:

1. **Remove the Lightspeed plugins** from `configs/dynamic-plugins/dynamic-plugins.yaml` (or your `dynamic-plugins.override.yaml` if using one). Delete or comment out the two Lightspeed plugin entries (the frontend and backend packages).

2. **Remove the Lightspeed services** from `compose.yaml`. Delete or comment out the `rag-init` and `lightspeed-core` service blocks, and the `rag_embeddings` and `rag_vector_db` volume declarations.

3. **Remove the Lightspeed configuration** from `configs/app-config/app-config.yaml`. Delete or comment out the `lightspeed:` section at the bottom of the file.
Copy link
Copy Markdown
Member

@rm3l rm3l May 4, 2026

Choose a reason for hiding this comment

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

We strive to avoid making users modify version-controlled files. Otherwise they might run into conflicts when pulling the latest changes.
To make the opt-out experience seamless, I'd suggest taking a look at Compose profiles and/or an env-var-driven approach (or any other approach that doesn't require modifying any version-controlled files).

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Might make sense to render these 2 docs files as techdocs in the running RHDH instance, I think.

# - package: 'oci://quay.io/rhdh/red-hat-developer-hub-backstage-plugin-global-floating-action-button:{{inherit}}'
- package: ./dynamic-plugins/dist/red-hat-developer-hub-backstage-plugin-global-floating-action-button
disabled: false
disabled: true # disabled as conflicts with Lightspeed FAB
Copy link
Copy Markdown
Member

@rm3l rm3l May 4, 2026

Choose a reason for hiding this comment

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

It conflicts with Lightspeed FAB, but is this re-enabled if users disable Lightspeed ?

@Jdubrick
Copy link
Copy Markdown
Contributor Author

Jdubrick commented May 4, 2026

@rm3l marking this as a draft to make the changes you suggested as well as wait for the 1.10 release, since we need the catalog index updated to take advantage of the inherit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge/hold do-not-merge/work-in-progress documentation Improvements or additions to documentation enhancement New feature or request Tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants