Skip to content

Commit 2831297

Browse files
committed
Enhance KUTTL tests to validate generated configuration files
This commit enhances the KUTTL tests to validate the generated ogx_config.yaml and lightspeed-stack.yaml files using the initContainers approach introduced in commit b2c6719. The implementation uses a workaround strategy: A) TestAssert steps extract the generated config files from the Lightspeed Stack and OGX containers B) The diff command compares the extracted config files against expected reference files prepared in test/kuttl This ensures comprehensive validation of the operator's config generation functionality during testing. Assisted-By: Claude <noreply@anthropic.com>
1 parent e60139e commit 2831297

29 files changed

Lines changed: 642 additions & 516 deletions

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,8 @@ $(KUTTL): $(LOCALBIN)
274274

275275
.PHONY: kuttl-test
276276
kuttl-test: kuttl ## Run kuttl tests
277+
@command -v diff >/dev/null 2>&1 || { echo "ERROR: 'diff' command is required for KUTTL tests but not found in PATH" >&2; exit 1; }
278+
@command -v oc >/dev/null 2>&1 || { echo "ERROR: 'oc' command is required for KUTTL tests but not found in PATH" >&2; exit 1; }
277279
$(LOCALBIN)/kubectl-kuttl test --config kuttl-test.yaml test/kuttl/tests $(KUTTL_ARGS)
278280

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

0 commit comments

Comments
 (0)