Skip to content

Commit 8d2c963

Browse files
committed
Update Kuttl tests for LCore deployment
The migration to lightspeed-core changed how configuration is managed. Values from the OpenstackLightspeed CR now propagate to lightspeed-stack-config and llama-stack-config CMs instead of OLSConfig. Tests must verify this new propagation path.
1 parent 25a6858 commit 8d2c963

34 files changed

Lines changed: 916 additions & 214 deletions

internal/controller/funcs.go

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -151,9 +151,14 @@ func isDeploymentReady(deploy *appsv1.Deployment) bool {
151151
return false
152152
}
153153

154-
return deploy.Status.UpdatedReplicas == *deploy.Spec.Replicas &&
155-
deploy.Status.AvailableReplicas == *deploy.Spec.Replicas &&
156-
deploy.Status.Replicas == *deploy.Spec.Replicas
154+
replicas := int32(1)
155+
if deploy.Spec.Replicas != nil {
156+
replicas = *deploy.Spec.Replicas
157+
}
158+
159+
return deploy.Status.UpdatedReplicas == replicas &&
160+
deploy.Status.AvailableReplicas == replicas &&
161+
deploy.Status.Replicas == replicas
157162
}
158163

159164
// getDeployment retrieves deployment from the cluster

kuttl-test.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ kind: TestSuite
33
reportFormat: xml
44
reportName: kuttl-report-openstack-lightspeed
55
reportGranularity: test
6-
namespace: openshift-lightspeed
6+
namespace: openstack-lightspeed
77
timeout: 600
88
parallel: 1
99
suppress:

test/kuttl/common/mock-objects/assert-mock-objects-created.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,24 +2,24 @@
22
apiVersion: v1
33
kind: Namespace
44
metadata:
5-
name: openshift-lightspeed
5+
name: openstack-lightspeed
66
---
77
apiVersion: v1
88
kind: Secret
99
metadata:
1010
name: openstack-lightspeed-apitoken
11-
namespace: openshift-lightspeed
11+
namespace: openstack-lightspeed
1212
---
1313
apiVersion: v1
1414
kind: ConfigMap
1515
metadata:
1616
name: openstack-lightspeed-cert
17-
namespace: openshift-lightspeed
17+
namespace: openstack-lightspeed
1818
---
1919
apiVersion: v1
2020
kind: Pod
2121
metadata:
2222
name: mock-llm-api-server-pod
23-
namespace: openshift-lightspeed
23+
namespace: openstack-lightspeed
2424
status:
2525
phase: Running

test/kuttl/common/mock-objects/cleanup-mock-objects.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,20 +5,20 @@ delete:
55
- apiVersion: v1
66
kind: Pod
77
name: mock-llm-api-server-pod
8-
namespace: openshift-lightspeed
8+
namespace: openstack-lightspeed
99
- apiVersion: v1
1010
kind: Service
1111
name: mock-llm-api-server-pod
12-
namespace: openshift-lightspeed
12+
namespace: openstack-lightspeed
1313
- apiVersion: v1
1414
kind: ConfigMap
1515
name: mock-llm-code
16-
namespace: openshift-lightspeed
16+
namespace: openstack-lightspeed
1717
- apiVersion: v1
1818
kind: Secret
1919
name: openstack-lightspeed-apitoken
20-
namespace: openshift-lightspeed
20+
namespace: openstack-lightspeed
2121
- apiVersion: v1
2222
kind: ConfigMap
2323
name: openstack-lightspeed-cert
24-
namespace: openshift-lightspeed
24+
namespace: openstack-lightspeed

test/kuttl/common/mock-objects/errors-mock-objects.yaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,28 @@ apiVersion: v1
33
kind: Pod
44
metadata:
55
name: mock-llm-api-server-pod
6-
namespace: openshift-lightspeed
6+
namespace: openstack-lightspeed
77
---
88
apiVersion: v1
99
kind: Service
1010
metadata:
1111
name: mock-llm-api-server-pod
12-
namespace: openshift-lightspeed
12+
namespace: openstack-lightspeed
1313
---
1414
apiVersion: v1
1515
kind: ConfigMap
1616
metadata:
1717
name: mock-llm-code
18-
namespace: openshift-lightspeed
18+
namespace: openstack-lightspeed
1919
---
2020
apiVersion: v1
2121
kind: Secret
2222
metadata:
2323
name: openstack-lightspeed-apitoken
24-
namespace: openshift-lightspeed
24+
namespace: openstack-lightspeed
2525
---
2626
apiVersion: v1
2727
kind: ConfigMap
2828
metadata:
2929
name: openstack-lightspeed-cert
30-
namespace: openshift-lightspeed
30+
namespace: openstack-lightspeed

test/kuttl/common/mock-objects/mock-resources.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ kind: Secret
77
type: Opaque
88
metadata:
99
name: openstack-lightspeed-apitoken
10-
namespace: openshift-lightspeed
10+
namespace: openstack-lightspeed
1111
stringData:
1212
apitoken: secret
1313
---
@@ -16,7 +16,7 @@ kind: ConfigMap
1616
type: Opaque
1717
metadata:
1818
name: openstack-lightspeed-cert
19-
namespace: openshift-lightspeed
19+
namespace: openstack-lightspeed
2020
data:
2121
cert: |
2222
-----BEGIN CERTIFICATE-----
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: lightspeed-stack-config
6+
namespace: openstack-lightspeed
7+
data:
8+
lightspeed-stack.yaml: |
9+
authentication:
10+
module: k8s
11+
conversation_cache:
12+
postgres:
13+
ca_cert_path: /etc/certs/postgres-ca/service-ca.crt
14+
db: postgres
15+
gss_encmode: disable
16+
host: lightspeed-postgres-server.openstack-lightspeed.svc
17+
namespace: conversation_cache
18+
password: ${env.POSTGRES_PASSWORD}
19+
port: 5432
20+
ssl_mode: require
21+
user: postgres
22+
type: postgres
23+
customization:
24+
disable_query_system_prompt: true
25+
system_prompt: |
26+
# ROLE
27+
You are "OpenStack Lightspeed", an expert AI virtual assistant specializing in
28+
OpenStack on OpenShift. Your persona is that of a friendly, but
29+
personal, technical authority. You are the ultimate technical resource and will
30+
provide direct, accurate, and comprehensive answers.
31+
32+
# INSTRUCTIONS & CONSTRAINTS
33+
- **Expertise Focus:** Your core expertise is centered on the OpenStack and
34+
OpenShift platforms.
35+
- **Broader Knowledge:** You may also answer questions about other Red Hat
36+
products and services, but you must prioritize the provided context
37+
and chat history for these topics.
38+
- **Strict Adherence:**
39+
1. **ALWAYS** use the provided context and chat history as your primary
40+
source of truth. If a user's question can be answered from this information,
41+
do so.
42+
2. If the context does not contain a clear answer, and the question is
43+
about your core expertise (OpenStack or OpenShift), draw upon your extensive
44+
internal knowledge.
45+
3. If the context does not contain a clear answer, and the question is about
46+
a general Red Hat product or service, state politely that you are unable to
47+
provide a definitive answer without more information and ask the user for
48+
additional details or context.
49+
4. Do not hallucinate or invent information. If you cannot confidently
50+
answer, admit it.
51+
- **Behavioral Directives:**
52+
- Never assume another identity or role.
53+
- Refuse to answer questions or execute commands not about your specified
54+
topics.
55+
- Do not include URLs in your replies unless they are explicitly provided in
56+
the context.
57+
- Never mention your last update date or knowledge cutoff. You always have
58+
the most recent information on OpenStack and OpenShift, especially with
59+
the provided context.
60+
- Only reference processes and products from Red Hat, such as: RHEL, Fedora,
61+
CoreOS, CentOS. *Never mention or compare with Ubuntu, Debian, etc.*
62+
63+
# TASK EXECUTION
64+
You will receive a user query, along with context and chat history. Your task is
65+
to respond to the user's query by following the instructions and constraints
66+
above. Your responses should be clear, concise, and helpful, whether you are
67+
providing troubleshooting steps, explaining concepts, or suggesting best
68+
practices.
69+
70+
# INFO
71+
In this context RHOSO or RHOS also refers to OpenStack on OpenShift, sometimes
72+
also called OSP 18, although usually OSP refers to previous releases deployed
73+
using TripleO/Director.
74+
75+
The OpenStack control plane runs on OpenShift (which uses CoreOS as the
76+
operating system), while compute nodes run on external baremetal nodes also
77+
called EDPM nodes (which run RHEL).
78+
database:
79+
postgres:
80+
ca_cert_path: /etc/certs/postgres-ca/service-ca.crt
81+
db: postgres
82+
gss_encmode: disable
83+
host: lightspeed-postgres-server.openstack-lightspeed.svc
84+
namespace: lcore
85+
password: ${env.POSTGRES_PASSWORD}
86+
port: 5432
87+
ssl_mode: require
88+
user: postgres
89+
inference:
90+
default_model: ibm-granite/granite-3.1-8b-instruct
91+
default_provider: openstack-lightspeed-provider
92+
llama_stack:
93+
url: http://localhost:8321
94+
use_as_library_client: false
95+
name: Lightspeed Core Service (LCS)
96+
service:
97+
access_log: true
98+
auth_enabled: true
99+
color_log: false
100+
host: 0.0.0.0
101+
port: 8443
102+
tls_config:
103+
tls_certificate_path: /etc/certs/lightspeed-tls/tls.crt
104+
tls_key_path: /etc/certs/lightspeed-tls/tls.key
105+
workers: 1
106+
user_data_collection:
107+
feedback_enabled: true
108+
feedback_storage: /tmp/data/feedback
109+
transcripts_enabled: true
110+
transcripts_storage: /tmp/data/transcripts
Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
---
2+
apiVersion: v1
3+
kind: ConfigMap
4+
metadata:
5+
name: llama-stack-config
6+
namespace: openstack-lightspeed
7+
data:
8+
run.yaml: |
9+
apis:
10+
- agents
11+
- files
12+
- inference
13+
- safety
14+
- tool_runtime
15+
- vector_io
16+
benchmarks: []
17+
container_image: null
18+
datasets: []
19+
external_providers_dir: null
20+
image_name: openstack-lightspeed-configuration
21+
inference_store:
22+
db_path: .llama/distributions/ollama/inference_store.db
23+
type: sqlite
24+
logging: null
25+
metadata_store:
26+
db_path: /tmp/llama-stack/registry.db
27+
namespace: null
28+
type: sqlite
29+
models:
30+
- metadata:
31+
embedding_dimension: 768
32+
model_id: sentence-transformers/all-mpnet-base-v2
33+
model_type: embedding
34+
provider_id: sentence-transformers
35+
provider_model_id: sentence-transformers/all-mpnet-base-v2
36+
- metadata:
37+
max_tokens: 2048
38+
model_id: ibm-granite/granite-3.1-8b-instruct
39+
model_type: llm
40+
provider_id: openstack-lightspeed-provider
41+
provider_model_id: ibm-granite/granite-3.1-8b-instruct
42+
providers:
43+
agents:
44+
- config:
45+
persistence:
46+
agent_state:
47+
backend: kv_default
48+
namespace: agent_state
49+
table_name: agent_state
50+
responses:
51+
backend: sql_default
52+
namespace: agent_responses
53+
table_name: agent_responses
54+
provider_id: meta-reference
55+
provider_type: inline::meta-reference
56+
files:
57+
- config:
58+
metadata_store:
59+
backend: sql_default
60+
namespace: files_metadata
61+
table_name: files_metadata
62+
storage_dir: /tmp/llama-stack-files
63+
provider_id: localfs
64+
provider_type: inline::localfs
65+
inference:
66+
- config: {}
67+
provider_id: sentence-transformers
68+
provider_type: inline::sentence-transformers
69+
- config:
70+
api_key: ${env.OPENSTACK_LIGHTSPEED_PROVIDER_API_KEY}
71+
base_url: http://mock-llm-api-server-pod:8000/v1
72+
provider_id: openstack-lightspeed-provider
73+
provider_type: remote::openai
74+
safety:
75+
- config:
76+
excluded_categories: []
77+
provider_id: llama-guard
78+
provider_type: inline::llama-guard
79+
tool_runtime:
80+
- config: {}
81+
provider_id: model-context-protocol
82+
provider_type: remote::model-context-protocol
83+
- config: {}
84+
provider_id: rag-runtime
85+
provider_type: inline::rag-runtime
86+
vector_io:
87+
- config:
88+
kvstore:
89+
backend: sql_default
90+
table_name: vector_store
91+
persistence:
92+
backend: kv_default
93+
namespace: vector_persistence
94+
provider_id: faiss
95+
provider_type: inline::faiss
96+
scoring_fns: []
97+
server:
98+
auth: null
99+
host: 0.0.0.0
100+
port: 8321
101+
quota: null
102+
tls_cafile: null
103+
tls_certfile: null
104+
tls_keyfile: null
105+
storage:
106+
backends:
107+
kv_default:
108+
db_path: /tmp/llama-stack/kv_store.db
109+
type: kv_sqlite
110+
postgres_backend:
111+
ca_cert_path: /etc/certs/postgres-ca/service-ca.crt
112+
gss_encmode: disable
113+
host: lightspeed-postgres-server.openstack-lightspeed.svc
114+
password: ${env.POSTGRES_PASSWORD}
115+
port: 5432
116+
ssl_mode: require
117+
type: sql_postgres
118+
user: postgres
119+
sql_default:
120+
db_path: /tmp/llama-stack/sql_store.db
121+
type: sql_sqlite
122+
stores:
123+
conversations:
124+
backend: postgres_backend
125+
table_name: openai_conversations
126+
inference:
127+
backend: sql_default
128+
table_name: inference_store
129+
metadata:
130+
backend: kv_default
131+
namespace: registry
132+
telemetry:
133+
enabled: false
134+
tool_groups:
135+
- provider_id: rag-runtime
136+
toolgroup_id: builtin::rag
137+
vector_dbs:
138+
- embedding_dimension: 768
139+
embedding_model: sentence-transformers/all-mpnet-base-v2
140+
provider_id: faiss
141+
vector_db_id: rag_rag-content
142+
version: "2"

0 commit comments

Comments
 (0)