Skip to content

Commit cac51f2

Browse files
are-cesclaude
andcommitted
LCORE-2860: fix RHOAI Prow e2e pipeline failures
- Remove --image flag from oc new-build that overrode the containerfile's FROM (ubi9/python-312) with ubi-minimal, which lacks dnf - Remove duplicate vector_stores registration from run.yaml (enrichment handles it) - Add RHOAI-specific lightspeed-stack config with vLLM defaults - Parametrize model name via vllm-model-secret so both pods read from a single source - Override inference defaults (default_model/default_provider) in Prow config swaps using E2E env vars - Create /tmp/data before starting lightspeed-stack pod for SQLite Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent 04fbd13 commit cac51f2

6 files changed

Lines changed: 81 additions & 17 deletions

File tree

tests/e2e-prow/rhoai/configs/run.yaml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -139,17 +139,7 @@ registered_resources:
139139
provider_id: vllm
140140
model_type: llm
141141
provider_model_id: null
142-
- model_id: all-mpnet-base-v2
143-
model_type: embedding
144-
provider_id: sentence-transformers
145-
provider_model_id: all-mpnet-base-v2
146-
metadata:
147-
embedding_dimension: 768
148-
vector_stores:
149-
- embedding_dimension: 768
150-
embedding_model: sentence-transformers/all-mpnet-base-v2
151-
provider_id: faiss
152-
vector_store_id: ${env.FAISS_VECTOR_STORE_ID}
142+
vector_stores: []
153143
shields:
154144
- shield_id: llama-guard
155145
provider_id: llama-guard

tests/e2e-prow/rhoai/manifests/lightspeed/lightspeed-stack.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ spec:
3737
key: key
3838
optional: true
3939
image: ${LIGHTSPEED_STACK_IMAGE}
40+
command: ["/bin/sh", "-c", "mkdir -p /tmp/data && exec python3.12 src/lightspeed_stack.py"]
4041
ports:
4142
- containerPort: 8080
4243
# TCP probes avoid HTTP/auth. LCS + Llama handshake and large images can take 60–120s before :8080 listens;

tests/e2e-prow/rhoai/manifests/lightspeed/llama-stack-prow.yaml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,10 @@ spec:
102102
name: vllm-api-key-secret
103103
key: key
104104
- name: INFERENCE_MODEL
105-
value: "meta-llama/Llama-3.1-8B-Instruct"
105+
valueFrom:
106+
secretKeyRef:
107+
name: vllm-model-secret
108+
key: key
106109
- name: OPENAI_API_KEY
107110
valueFrom:
108111
secretKeyRef:

tests/e2e-prow/rhoai/pipeline.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ create_secret() {
6464
create_secret hf-token-secret --from-literal=token="$HUGGING_FACE_HUB_TOKEN"
6565
create_secret vllm-api-key-secret --from-literal=key="$VLLM_API_KEY"
6666
create_secret openai-api-key-secret --from-literal=key=""
67+
create_secret vllm-model-secret --from-literal=key="$MODEL_NAME"
6768

6869
# MCP token secrets for lightspeed-stack
6970
REPO_ROOT="$(cd "$PIPELINE_DIR/../../.." && pwd)"
@@ -225,7 +226,6 @@ export LLAMA_STACK_IMAGE
225226
oc new-build --name=llama-stack-e2e \
226227
--binary \
227228
--strategy=docker \
228-
--image="registry.access.redhat.com/ubi9/ubi-minimal" \
229229
--to="llama-stack-e2e:latest" \
230230
-n "$NAMESPACE" 2>/dev/null || echo "BuildConfig llama-stack-e2e already exists"
231231

@@ -256,7 +256,7 @@ create_secret api-url-secret --from-literal=key="$KSVC_URL"
256256
oc create configmap llama-stack-config -n "$NAMESPACE" \
257257
--from-file="$REPO_ROOT/tests/e2e-prow/rhoai/configs/run.yaml"
258258
oc create configmap lightspeed-stack-config -n "$NAMESPACE" \
259-
--from-file="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack.yaml"
259+
--from-file=lightspeed-stack.yaml="$REPO_ROOT/tests/e2e/configuration/server-mode/lightspeed-stack-rhoai.yaml"
260260

261261
# Create RAG data ConfigMap from the e2e test RAG data
262262
echo "Creating RAG data ConfigMap..."
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
name: Lightspeed Core Service (LCS)
2+
service:
3+
host: 0.0.0.0
4+
port: 8080
5+
auth_enabled: false
6+
workers: 1
7+
color_log: true
8+
access_log: true
9+
llama_stack:
10+
# Server mode - connects to separate llama-stack service
11+
use_as_library_client: false
12+
url: http://${env.E2E_LLAMA_HOSTNAME}:8321
13+
api_key: xyzzy
14+
user_data_collection:
15+
feedback_enabled: true
16+
feedback_storage: "/tmp/data/feedback"
17+
transcripts_enabled: true
18+
transcripts_storage: "/tmp/data/transcripts"
19+
authentication:
20+
module: "noop"
21+
inference:
22+
default_provider: vllm
23+
default_model: ${env.VLLM_MODEL}
24+
byok_rag:
25+
- rag_id: e2e-test-docs
26+
rag_type: inline::faiss
27+
embedding_model: sentence-transformers/all-mpnet-base-v2
28+
embedding_dimension: 768
29+
vector_db_id: ${env.FAISS_VECTOR_STORE_ID}
30+
db_path: ${env.KV_RAG_PATH:=~/.llama/storage/rag/kv_store.db}
31+
score_multiplier: 1.0
32+
33+
rag:
34+
tool:
35+
- e2e-test-docs

tests/e2e/utils/prow_utils.py

Lines changed: 38 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"""
66

77
import os
8+
import re
89
import subprocess
910
import tempfile
1011
from typing import Optional
@@ -234,6 +235,24 @@ def remove_configmap_backup(backup_key: str) -> None:
234235
print(f"ConfigMap backup {backup_key} removed from memory")
235236

236237

238+
def _apply_inference_overrides(content: str) -> str:
239+
"""Override inference defaults from E2E env vars if set.
240+
241+
When E2E_DEFAULT_MODEL_OVERRIDE or E2E_DEFAULT_PROVIDER_OVERRIDE are set,
242+
patch the YAML content so every config swap uses the correct model/provider
243+
for the current environment (e.g. vLLM instead of OpenAI in RHOAI Prow).
244+
"""
245+
model = os.getenv("E2E_DEFAULT_MODEL_OVERRIDE")
246+
provider = os.getenv("E2E_DEFAULT_PROVIDER_OVERRIDE")
247+
if not model and not provider:
248+
return content
249+
if model:
250+
content = re.sub(r"(default_model:\s*).*", rf"\g<1>{model}", content)
251+
if provider:
252+
content = re.sub(r"(default_provider:\s*).*", rf"\g<1>{provider}", content)
253+
return content
254+
255+
237256
def _recreate_configmap(
238257
configmap_name: str,
239258
source_file: str,
@@ -270,7 +289,7 @@ def update_config_configmap(
270289
"""
271290
# Check if source is a backup key (restore from memory)
272291
if source in _configmap_backups:
273-
config_content = _configmap_backups[source]
292+
config_content = _apply_inference_overrides(_configmap_backups[source])
274293
print(f"Restoring ConfigMap {configmap_name} from memory backup...")
275294

276295
# Write content to temp file (oc create configmap requires a file)
@@ -289,12 +308,28 @@ def update_config_configmap(
289308
os.remove(temp_path)
290309
return
291310

292-
# Otherwise, source is a file path
311+
# Otherwise, source is a file path — apply inference overrides if needed
293312
print(f"Updating ConfigMap {configmap_name} with config from {source}...")
294313

314+
source_to_apply = source
315+
temp_path = None
295316
try:
296-
_recreate_configmap(configmap_name, source, configmap_key)
317+
with open(source) as f:
318+
patched = _apply_inference_overrides(f.read())
319+
with open(source) as f:
320+
original = f.read()
321+
if patched != original:
322+
tmp = tempfile.NamedTemporaryFile(mode="w", suffix=".yaml", delete=False)
323+
tmp.write(patched)
324+
tmp.close()
325+
source_to_apply = tmp.name
326+
temp_path = tmp.name
327+
328+
_recreate_configmap(configmap_name, source_to_apply, configmap_key)
297329
print(f"ConfigMap {configmap_name} updated successfully")
298330
except subprocess.CalledProcessError as e:
299331
print(f"Failed to update ConfigMap: {e}")
300332
raise
333+
finally:
334+
if temp_path and os.path.exists(temp_path):
335+
os.remove(temp_path)

0 commit comments

Comments
 (0)