Skip to content

Commit 4ea3387

Browse files
committed
move defaults for lightspeed to separate yaml file
Signed-off-by: Jordan Dubrick <jdubrick@redhat.com>
1 parent e3e85f6 commit 4ea3387

2 files changed

Lines changed: 153 additions & 145 deletions

File tree

charts/backstage/templates/_helpers.tpl

Lines changed: 9 additions & 145 deletions
Original file line numberDiff line numberDiff line change
@@ -61,150 +61,9 @@ Return the Lightspeed defaults as YAML so upgrades from charts that predate
6161
the feature can still render when values are reused.
6262
*/}}
6363
{{- define "rhdh.lightspeed.defaults" -}}
64-
enabled: true
65-
plugins:
66-
- 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
67-
disabled: false
68-
pluginConfig:
69-
dynamicPlugins:
70-
frontend:
71-
red-hat-developer-hub.backstage-plugin-lightspeed:
72-
translationResources:
73-
- importName: lightspeedTranslations
74-
module: Alpha
75-
ref: lightspeedTranslationRef
76-
dynamicRoutes:
77-
- path: /lightspeed
78-
importName: LightspeedPage
79-
mountPoints:
80-
- mountPoint: application/listener
81-
importName: LightspeedFAB
82-
- mountPoint: application/provider
83-
importName: LightspeedDrawerProvider
84-
- mountPoint: application/internal/drawer-state
85-
importName: LightspeedDrawerStateExposer
86-
config:
87-
id: lightspeed
88-
- mountPoint: application/internal/drawer-content
89-
importName: LightspeedChatContainer
90-
config:
91-
id: lightspeed
92-
priority: 100
93-
- 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
94-
disabled: false
95-
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:bs_1.45.3__0.1.5
96-
disabled: false
97-
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.45.3__0.4.1
98-
disabled: false
99-
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-techdocs-mcp-tool:bs_1.45.3__0.3.2
100-
disabled: false
101-
images:
102-
ragInit: quay.io/redhat-ai-dev/rag-content:release-1.9-lls-0.5.0-642c567fe10a62b5ff711654306b72912f341e05
103-
lightspeedCore: quay.io/lightspeed-core/lightspeed-stack:0.5.0
104-
resources:
105-
ragInit:
106-
requests:
107-
cpu: 50m
108-
memory: 150Mi
109-
limits:
110-
cpu: 100m
111-
memory: 500Mi
112-
lightspeedCore:
113-
requests:
114-
cpu: 100m
115-
memory: 512Mi
116-
limits:
117-
cpu: 1000m
118-
memory: 2Gi
119-
runtimeVolume:
120-
name: lightspeed-data
121-
mountPath: /tmp
122-
type: emptyDir
123-
emptyDir: {}
124-
persistentVolumeClaim: {}
125-
ragVolume:
126-
name: lightspeed-rag
127-
initMountPath: /rag-content
128-
mountPath: /rag-content
129-
emptyDir: {}
130-
configMaps:
131-
- name: stack
132-
nameOverride: ""
133-
mountPath: /app-root/lightspeed-stack.yaml
134-
subPath: lightspeed-stack.yaml
135-
sourceFile: lightspeed-stack.yaml
136-
optional: false
137-
- name: config
138-
nameOverride: ""
139-
mountPath: /app-root/config.yaml
140-
subPath: config.yaml
141-
sourceFile: config.yaml
142-
optional: false
143-
- name: rhdh-profile
144-
nameOverride: ""
145-
mountPath: /app-root/rhdh-profile.py
146-
subPath: rhdh-profile.py
147-
sourceFile: rhdh-profile.py
148-
optional: false
149-
secret:
150-
create: true
151-
name: ""
152-
optional: false
153-
sourceFile: secret.yaml
154-
initContainer:
155-
name: lightspeed-rag-init
156-
imagePullPolicy: IfNotPresent
157-
command:
158-
- sh
159-
- -c
160-
args:
161-
- >-
162-
mkdir -p /tmp/data &&
163-
echo 'Copying Lightspeed RAG data...' &&
164-
cp -r /rag/vector_db /rag-content/ &&
165-
cp -r /rag/embeddings_model /rag-content/ &&
166-
echo 'Copy complete.'
167-
env: []
168-
resources:
169-
requests:
170-
cpu: 50m
171-
memory: 150Mi
172-
limits:
173-
cpu: 100m
174-
memory: 500Mi
175-
securityContext:
176-
readOnlyRootFilesystem: true
177-
allowPrivilegeEscalation: false
178-
capabilities:
179-
drop:
180-
- ALL
181-
runAsNonRoot: true
182-
seccompProfile:
183-
type: "RuntimeDefault"
184-
sidecar:
185-
name: lightspeed-core
186-
imagePullPolicy: IfNotPresent
187-
portName: http-lightspeed
188-
containerPort: 8080
189-
command: []
190-
args: []
191-
env: []
192-
resources:
193-
requests:
194-
cpu: 100m
195-
memory: 512Mi
196-
limits:
197-
cpu: 1000m
198-
memory: 2Gi
199-
securityContext:
200-
readOnlyRootFilesystem: true
201-
allowPrivilegeEscalation: false
202-
capabilities:
203-
drop:
204-
- ALL
205-
runAsNonRoot: true
206-
seccompProfile:
207-
type: "RuntimeDefault"
64+
{{- $file := "defaults.yaml" -}}
65+
{{- $content := include "rhdh.lightspeed.fileContent" (dict "context" . "file" $file) -}}
66+
{{- required (printf "missing Lightspeed defaults file %s" (include "rhdh.lightspeed.filePath" $file)) $content -}}
20867
{{- end -}}
20968

21069
{{/*
@@ -349,7 +208,12 @@ Return the relative path for a Lightspeed payload file.
349208
Return rendered content of a Lightspeed payload file.
350209
*/}}
351210
{{- define "rhdh.lightspeed.fileContent" -}}
352-
{{- .context.Files.Get (include "rhdh.lightspeed.filePath" .file) -}}
211+
{{- $path := include "rhdh.lightspeed.filePath" .file -}}
212+
{{- $content := .context.Files.Get $path -}}
213+
{{- if and (empty $content) .context.Subcharts (hasKey .context.Subcharts "upstream") -}}
214+
{{- $content = .context.Subcharts.upstream.Files.Get $path -}}
215+
{{- end -}}
216+
{{- $content -}}
353217
{{- end -}}
354218

355219
{{/*
Lines changed: 144 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,144 @@
1+
enabled: true
2+
plugins:
3+
- 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
4+
disabled: false
5+
pluginConfig:
6+
dynamicPlugins:
7+
frontend:
8+
red-hat-developer-hub.backstage-plugin-lightspeed:
9+
translationResources:
10+
- importName: lightspeedTranslations
11+
module: Alpha
12+
ref: lightspeedTranslationRef
13+
dynamicRoutes:
14+
- path: /lightspeed
15+
importName: LightspeedPage
16+
mountPoints:
17+
- mountPoint: application/listener
18+
importName: LightspeedFAB
19+
- mountPoint: application/provider
20+
importName: LightspeedDrawerProvider
21+
- mountPoint: application/internal/drawer-state
22+
importName: LightspeedDrawerStateExposer
23+
config:
24+
id: lightspeed
25+
- mountPoint: application/internal/drawer-content
26+
importName: LightspeedChatContainer
27+
config:
28+
id: lightspeed
29+
priority: 100
30+
- 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
31+
disabled: false
32+
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/backstage-plugin-mcp-actions-backend:bs_1.45.3__0.1.5
33+
disabled: false
34+
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-software-catalog-mcp-tool:bs_1.45.3__0.4.1
35+
disabled: false
36+
- package: oci://ghcr.io/redhat-developer/rhdh-plugin-export-overlays/red-hat-developer-hub-backstage-plugin-techdocs-mcp-tool:bs_1.45.3__0.3.2
37+
disabled: false
38+
images:
39+
ragInit: quay.io/redhat-ai-dev/rag-content:release-1.9-lls-0.5.0-642c567fe10a62b5ff711654306b72912f341e05
40+
lightspeedCore: quay.io/lightspeed-core/lightspeed-stack:0.5.0
41+
resources:
42+
ragInit:
43+
requests:
44+
cpu: 50m
45+
memory: 150Mi
46+
limits:
47+
cpu: 100m
48+
memory: 500Mi
49+
lightspeedCore:
50+
requests:
51+
cpu: 100m
52+
memory: 512Mi
53+
limits:
54+
cpu: 1000m
55+
memory: 2Gi
56+
runtimeVolume:
57+
name: lightspeed-data
58+
mountPath: /tmp
59+
type: emptyDir
60+
emptyDir: {}
61+
persistentVolumeClaim: {}
62+
ragVolume:
63+
name: lightspeed-rag
64+
initMountPath: /rag-content
65+
mountPath: /rag-content
66+
emptyDir: {}
67+
configMaps:
68+
- name: stack
69+
nameOverride: ""
70+
mountPath: /app-root/lightspeed-stack.yaml
71+
subPath: lightspeed-stack.yaml
72+
sourceFile: lightspeed-stack.yaml
73+
optional: false
74+
- name: config
75+
nameOverride: ""
76+
mountPath: /app-root/config.yaml
77+
subPath: config.yaml
78+
sourceFile: config.yaml
79+
optional: false
80+
- name: rhdh-profile
81+
nameOverride: ""
82+
mountPath: /app-root/rhdh-profile.py
83+
subPath: rhdh-profile.py
84+
sourceFile: rhdh-profile.py
85+
optional: false
86+
secret:
87+
create: true
88+
name: ""
89+
optional: false
90+
sourceFile: secret.yaml
91+
initContainer:
92+
name: lightspeed-rag-init
93+
imagePullPolicy: IfNotPresent
94+
command:
95+
- sh
96+
- -c
97+
args:
98+
- >-
99+
mkdir -p /tmp/data &&
100+
echo 'Copying Lightspeed RAG data...' &&
101+
cp -r /rag/vector_db /rag-content/ &&
102+
cp -r /rag/embeddings_model /rag-content/ &&
103+
echo 'Copy complete.'
104+
env: []
105+
resources:
106+
requests:
107+
cpu: 50m
108+
memory: 150Mi
109+
limits:
110+
cpu: 100m
111+
memory: 500Mi
112+
securityContext:
113+
readOnlyRootFilesystem: true
114+
allowPrivilegeEscalation: false
115+
capabilities:
116+
drop:
117+
- ALL
118+
runAsNonRoot: true
119+
seccompProfile:
120+
type: "RuntimeDefault"
121+
sidecar:
122+
name: lightspeed-core
123+
imagePullPolicy: IfNotPresent
124+
portName: http-lightspeed
125+
containerPort: 8080
126+
command: []
127+
args: []
128+
env: []
129+
resources:
130+
requests:
131+
cpu: 100m
132+
memory: 512Mi
133+
limits:
134+
cpu: 1000m
135+
memory: 2Gi
136+
securityContext:
137+
readOnlyRootFilesystem: true
138+
allowPrivilegeEscalation: false
139+
capabilities:
140+
drop:
141+
- ALL
142+
runAsNonRoot: true
143+
seccompProfile:
144+
type: "RuntimeDefault"

0 commit comments

Comments
 (0)