Skip to content

Commit efe3573

Browse files
committed
OTA-1927: Eval cluster update prompts
Add comprehensive MCP test scenarios to evaluation dataset for validating OpenShift cluster update workflow AI responses. These scenarios establish quality benchmarks for LLM outputs across different update phases. Test Scenarios Added (conv_798-802): - Precheck: Pre-upgrade validation and readiness assessment Comprehensive analysis of cluster health, available updates, and upgrade blockers before initiating updates - Precheck-Specific: Targeted upgrade path validation Validates specific version availability and upgrade feasibility for planned update targets - No-Updates: Cluster health assessment at latest version Health monitoring and operational status when no updates are available in current channel - Progress: Real-time upgrade progress monitoring Tracks upgrade progress with component status, timeline analysis, and ETA calculations during active updates - Troubleshoot: Upgrade failure diagnosis and remediation Root cause analysis and conservative troubleshooting guidance for failed or stuck upgrade scenarios Each scenario includes: - Complete analysis prompts with constraints and requirements - Full ClusterVersion YAML data as attachments - Full ClusterOperator YAML data as attachments - Expected responses with Summary and TL;DR sections - Real cluster data from production-like scenarios These scenarios mirror the CONSOLE-5118 OLS integration workflow phases and provide the evaluation baseline for cluster update AI assistance. Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com> Signed-off-by: Fabricio Aguiar <fabricio.aguiar@gmail.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
1 parent 376a8d9 commit efe3573

12 files changed

Lines changed: 1442 additions & 48 deletions

Makefile

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# Put targets here if there is a risk that a target name might conflict with a filename.
22
# this list is probably overkill right now.
33
# See: https://www.gnu.org/software/make/manual/html_node/Phony-Targets.html
4-
.PHONY: test test-unit test-e2e test-eval test-lseval-periodic test-lseval-troubleshooting images run format verify get-embeddings get-embeddings-byok get-embeddings-okp
4+
.PHONY: test test-unit test-e2e test-eval test-lseval-periodic test-lseval-troubleshooting test-cluster-updates images run format verify get-embeddings get-embeddings-byok get-embeddings-okp
55

66
export PATH := $(HOME)/.local/bin:$(PATH)
77

@@ -110,6 +110,12 @@ test-lseval-periodic: ## Run LSEval periodic evaluation (full 797-question datas
110110
test-lseval-troubleshooting: ## DISABLED: LSEval troubleshooting (uncomment Makefile to re-enable)
111111
@echo "test-lseval-troubleshooting is disabled for now (troubleshooting LSEval commented out)." >&2
112112

113+
test-cluster-updates: ## Run cluster-updates evaluation (18 conversations, 35 evaluations) - requires running OLS server with OpenAI keys
114+
@echo "Running cluster-updates evaluation..."
115+
@echo "Reports will be written to ${ARTIFACT_DIR}"
116+
uv run --extra lseval --extra evaluation pytest tests/e2e/evaluation -vv -s --durations=0 -o junit_suite_name="${SUITE_ID}" --junit-prefix="${SUITE_ID}" --junit-xml="${ARTIFACT_DIR}/junit_e2e_${SUITE_ID}.xml" \
117+
--eval_out_dir ${ARTIFACT_DIR} -m cluster_updates
118+
113119
coverage-report: unit-tests-coverage-report integration-tests-coverage-report ## Export coverage reports into interactive HTML
114120

115121
unit-tests-coverage-report: test-unit ## Export unit test coverage report into interactive HTML

eval/README.md

Lines changed: 76 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,27 @@ source venv/bin/activate
3232
pip install git+https://github.com/lightspeed-core/lightspeed-evaluation.git
3333
```
3434

35+
### RBAC Setup for Cluster-Updates Evaluation
36+
37+
**IMPORTANT:** Cluster-updates evaluation requires proper RBAC permissions for OLS to access cluster resources via MCP servers.
38+
39+
```bash
40+
# Apply the RBAC manifest (creates ServiceAccount with cluster-reader + monitoring-edit permissions)
41+
oc apply -f eval/rbac-cluster-updates.yaml
42+
43+
# Generate an API token for the service account (valid for 24 hours)
44+
export API_KEY=$(oc create token cluster-update-user -n openshift-lightspeed --duration=24h)
45+
```
46+
47+
**Required Permissions:**
48+
49+
- **cluster-reader**: Access to ClusterVersion, ClusterOperator, Node resources
50+
- **monitoring-edit**: Access to Prometheus metrics and Alertmanager alerts
51+
52+
**Why These Permissions Matter:**
53+
54+
Without proper RBAC, OLS will respond with "unable to retrieve... due to access restrictions" instead of providing accurate cluster status analysis. The evaluation will still run but will fail quality checks with ~79% pass rate instead of the expected 85%+.
55+
3556
### Run Evaluation
3657

3758
```bash
@@ -50,17 +71,65 @@ lightspeed-eval --system-config system.yaml --eval-data eval_data_short.yaml --o
5071

5172
# Full evaluation (797 questions)
5273
lightspeed-eval --system-config system.yaml --eval-data eval_data.yaml --output-dir ./results
74+
75+
# Cluster-updates evaluation (19 conversations, 20 test turns) - uses optimized config
76+
lightspeed-eval --system-config system_cluster_updates.yaml \
77+
--eval-data eval_data_cluster_updates.yaml \
78+
--output-dir ./results
79+
80+
# Run specific cluster-updates test category (e.g., critical tests)
81+
lightspeed-eval --system-config system_cluster_updates.yaml \
82+
--eval-data eval_data_cluster_updates.yaml \
83+
--tags cluster-updates-critical \
84+
--output-dir ./results
5385
```
5486

5587
## What's Included
5688

5789
### Datasets
58-
- **`eval_data_short.yaml`**: 10 conversations
59-
- **`eval_data.yaml`**: 797 conversations
60-
61-
### Configuration
62-
- **`system.yaml`**: Pre-configured for OLS at `localhost:8080`
63-
- **Default metrics**: answer correctness
90+
- **`eval_data_short.yaml`**: 10 conversations (quick smoke test)
91+
- **`eval_data.yaml`**: 797 general OpenShift knowledge questions (conv_001-797)
92+
- **`eval_data_cluster_updates.yaml`**: 19 cluster-updates test conversations (conv_001-019, 20 test turns)
93+
94+
### Test Categories (by tag)
95+
- **cluster-updates-scenarios**: Comprehensive health assessment with extensive constraints (conv_001-005, 5 conversations)
96+
- **cluster-updates-critical**: Condition status interpretation - MUST pass 100% (conv_006)
97+
- **cluster-updates-format**: Output format compliance (Summary + TL;DR) (conv_007)
98+
- **cluster-updates-blockers**: Admin-ack gates and upgrade blockers (conv_008)
99+
- **cluster-updates-risks**: Conditional update risk analysis (conv_009)
100+
- **cluster-updates-path**: Upgrade path validation (conv_010)
101+
- **cluster-updates-troubleshoot**: Upgrade failure diagnosis and remediation (conv_011)
102+
- **cluster-updates-conversation**: Multi-turn conversation handling (conv_012, 2 turns)
103+
- **cluster-updates-no-updates**: Cluster at latest version scenarios (conv_013)
104+
- **cluster-updates-channels**: Update channel understanding (conv_014)
105+
- **cluster-updates-mcp**: MachineConfigPool upgrade behavior (conv_015)
106+
- **cluster-updates-pdb**: PodDisruptionBudget impact on upgrades (conv_016)
107+
- **cluster-updates-eus**: Extended Update Support (EUS) upgrade paths (conv_017)
108+
- **cluster-updates-conditions**: Condition status interpretation (conv_018, conv_019)
109+
110+
### Configuration Files
111+
112+
Two configuration files are available depending on your use case:
113+
114+
#### `system.yaml` - Default Configuration
115+
- **Use for:** General OpenShift knowledge evaluation (conv_001-797)
116+
- **API Base:** `http://localhost:8080` (local development)
117+
- **Max Tokens:** 512 (standard responses)
118+
- **API Provider:** `openai`
119+
- **Metrics:** All standard metrics available (Ragas, DeepEval, custom)
120+
121+
#### `system_cluster_updates.yaml` - Cluster-Updates Optimized
122+
- **Use for:** Cluster-updates evaluation (conv_001-019)
123+
- **API Base:** `http://localhost:8080` (same as default)
124+
- **Max Tokens:** 2048 (detailed cluster analysis - 4x larger for complex responses)
125+
- **API Provider:** `openai` (cluster-specific configuration)
126+
- **Output Directory:** `./results` (organized test output)
127+
- **Available Metrics:**
128+
- `custom:answer_correctness` - Basic correctness evaluation
129+
- `geval:condition_status_accuracy` - Kubernetes condition interpretation (threshold: 0.99 - CRITICAL!)
130+
- `geval:output_format_compliance` - Response format validation (threshold: 0.80)
131+
- `geval:technical_accuracy` - OpenShift/Kubernetes domain knowledge (threshold: 0.80)
132+
- `geval:actionable_guidance` - Specific remediation steps (threshold: 0.7)
64133

65134

66135
## Results
@@ -72,4 +141,4 @@ Results are saved in output directories:
72141

73142

74143
## Data & Eval system setup
75-
Refer [Lightspeed Evaluation tool](https://github.com/lightspeed-core/lightspeed-evaluation#readme)
144+
Refer [Lightspeed Evaluation tool](https://github.com/lightspeed-core/lightspeed-evaluation#readme)

0 commit comments

Comments
 (0)