Skip to content

Commit bc07a1a

Browse files
author
Radovan Fuchs
committed
reduce log output
1 parent a949799 commit bc07a1a

File tree

2 files changed

+67
-76
lines changed

2 files changed

+67
-76
lines changed

.tekton/integration-tests/pipeline/lightspeed-stack-integration-test.yaml

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -234,27 +234,17 @@ spec:
234234
image: registry.access.redhat.com/ubi9/ubi-minimal
235235
script: |
236236
set -e
237-
echo "---------------------------------------------"
238-
echo "KUBECONFIG=$KUBECONFIG"
239-
echo "LIGHTSPEED_STACK_IMAGE=$LIGHTSPEED_STACK_IMAGE"
240-
echo "LLAMA_STACK_IMAGE=$LLAMA_STACK_IMAGE"
241-
echo "NAMESPACE=$NAMESPACE"
242-
echo "---------------------------------------------"
243-
microdnf -y install git tar jq curl
244-
curl -L -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-4.19/openshift-client-linux-amd64-rhel9.tar.gz \
245-
&& tar -xvzf oc.tar.gz \
246-
&& chmod +x kubectl oc \
247-
&& mv oc kubectl /usr/local/bin/
248-
oc version
237+
echo "[e2e] Starting (QUIET=1 for Konflux UI)."
238+
microdnf -y install git tar jq curl >/dev/null 2>&1
239+
curl -sL -o oc.tar.gz https://mirror.openshift.com/pub/openshift-v4/x86_64/clients/ocp/latest-4.19/openshift-client-linux-amd64-rhel9.tar.gz
240+
tar -xzf oc.tar.gz && chmod +x kubectl oc && mv oc kubectl /usr/local/bin/
249241
REPO_URL=$(echo "$SNAPSHOT" | jq -r --arg n "lightspeed-stack" '.components[] | select(.name == $n) | .source.git.url // "https://github.com/openshift/lightspeed-stack.git"')
250242
REPO_REV=$(echo "$SNAPSHOT" | jq -r --arg n "lightspeed-stack" '.components[] | select(.name == $n) | .source.git.revision // "main"')
251-
echo "Cloning $REPO_URL at $REPO_REV"
252-
git clone "$REPO_URL" /workspace/lightspeed-stack
253-
cd /workspace/lightspeed-stack
254-
git fetch origin "$REPO_REV"
255-
git checkout "$REPO_REV"
256-
cd tests/e2e-prow/rhoai
257-
chmod +x pipeline.sh
243+
echo "[e2e] Clone $REPO_URL @ $REPO_REV"
244+
git clone -q "$REPO_URL" /workspace/lightspeed-stack
245+
cd /workspace/lightspeed-stack && git fetch origin "$REPO_REV" && git checkout -q "$REPO_REV"
246+
cd tests/e2e-prow/rhoai && chmod +x pipeline.sh
247+
export QUIET=1
258248
./pipeline.sh
259249
- name: gather-cluster-resources
260250
onError: continue

tests/e2e-prow/rhoai/pipeline.sh

Lines changed: 58 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -8,42 +8,44 @@ export RUNNING_PROW=true
88
#========================================
99
# 1. GLOBAL CONFIG
1010
#========================================
11+
QUIET="${QUIET:-0}"
1112
NAMESPACE="${NAMESPACE:-e2e-rhoai-dsc}"
1213
MODEL_NAME="meta-llama/Llama-3.1-8B-Instruct"
1314
PIPELINE_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
15+
log() { [ "$QUIET" != "1" ] && echo "$@"; }
16+
# Always print progress so Konflux UI shows where we are (short one-liners)
17+
progress() { echo "[e2e] $*"; }
1418

1519
# Lightspeed-stack and llama-stack images (from Konflux SNAPSHOT or defaults)
1620
LIGHTSPEED_STACK_IMAGE="${LIGHTSPEED_STACK_IMAGE:-quay.io/lightspeed-core/lightspeed-stack:dev-latest}"
1721
LLAMA_STACK_IMAGE="${LLAMA_STACK_IMAGE:-quay.io/rhoai/odh-llama-stack-core-rhel9:rhoai-3.3}"
18-
echo "Using lightspeed-stack image: $LIGHTSPEED_STACK_IMAGE"
19-
echo "Using llama-stack image: $LLAMA_STACK_IMAGE"
22+
log "Using lightspeed-stack image: $LIGHTSPEED_STACK_IMAGE"
23+
log "Using llama-stack image: $LLAMA_STACK_IMAGE"
2024
export LIGHTSPEED_STACK_IMAGE
2125
export LLAMA_STACK_IMAGE
2226

2327
#========================================
2428
# 2. ENVIRONMENT SETUP
2529
#========================================
26-
echo "===== Setting up environment variables ====="
30+
log "===== Setting up environment variables ====="
2731
export HUGGING_FACE_HUB_TOKEN=$(cat /var/run/huggingface/hf-token-ces-lcore-test || true)
2832
export VLLM_API_KEY=$(cat /var/run/vllm/vllm-api-key-lcore-test || true)
2933
export QUAY_ROBOT_NAME=$(cat /var/run/quay-aipcc-name/lcore-quay-name-lcore-test || true)
3034
export QUAY_ROBOT_PASSWORD=$(cat /var/run/quay-aipcc-password/lcore-quay-password-lcore-test || true)
3135

3236

33-
[[ -n "$HUGGING_FACE_HUB_TOKEN" ]] && echo "✅ HUGGING_FACE_HUB_TOKEN is set" || { echo "❌ Missing HUGGING_FACE_HUB_TOKEN"; exit 1; }
34-
[[ -n "$VLLM_API_KEY" ]] && echo "✅ VLLM_API_KEY is set" || { echo "❌ Missing VLLM_API_KEY"; exit 1; }
35-
[[ -n "$QUAY_ROBOT_NAME" ]] && echo "✅ QUAY_ROBOT_NAME is set" || { echo "❌ Missing QUAY_ROBOT_NAME"; exit 1; }
36-
[[ -n "$QUAY_ROBOT_PASSWORD" ]] && echo "✅ QUAY_ROBOT_PASSWORD is set" || { echo "❌ Missing QUAY_ROBOT_PASSWORD"; exit 1; }
37+
[[ -n "$HUGGING_FACE_HUB_TOKEN" ]] && log "✅ HUGGING_FACE_HUB_TOKEN is set" || { echo "❌ Missing HUGGING_FACE_HUB_TOKEN"; exit 1; }
38+
[[ -n "$VLLM_API_KEY" ]] && log "✅ VLLM_API_KEY is set" || { echo "❌ Missing VLLM_API_KEY"; exit 1; }
39+
[[ -n "$QUAY_ROBOT_NAME" ]] && log "✅ QUAY_ROBOT_NAME is set" || { echo "❌ Missing QUAY_ROBOT_NAME"; exit 1; }
40+
[[ -n "$QUAY_ROBOT_PASSWORD" ]] && log "✅ QUAY_ROBOT_PASSWORD is set" || { echo "❌ Missing QUAY_ROBOT_PASSWORD"; exit 1; }
3741

38-
# Basic info
39-
ls -A || true
40-
oc version
41-
oc whoami
42+
# Basic info (skip when QUIET to keep Konflux UI focused on test logs)
43+
if [ "$QUIET" != "1" ]; then ls -A || true; oc version; oc whoami; fi
4244

4345
#========================================
4446
# 3. CREATE NAMESPACE & SECRETS
4547
#========================================
46-
echo "===== Creating namespace & secrets ====="
48+
progress "Creating namespace and secrets"
4749
oc get ns "$NAMESPACE" >/dev/null 2>&1 || oc create namespace "$NAMESPACE"
4850

4951
# Create NFD and NVIDIA namespaces
@@ -53,20 +55,20 @@ oc apply -f "$PIPELINE_DIR/manifests/namespaces/nvidia-operator.yaml"
5355

5456
create_secret() {
5557
local name=$1; shift
56-
echo "Creating secret $name..."
57-
oc create secret generic "$name" "$@" -n "$NAMESPACE" 2>/dev/null || echo "Secret $name exists"
58+
log "Creating secret $name..."
59+
oc create secret generic "$name" "$@" -n "$NAMESPACE" 2>/dev/null || log "Secret $name exists"
5860
}
5961

6062
create_secret hf-token-secret --from-literal=token="$HUGGING_FACE_HUB_TOKEN"
6163
create_secret vllm-api-key-secret --from-literal=key="$VLLM_API_KEY"
6264

6365
# Create Quay pull secret for llama-stack images
64-
echo "Creating Quay pull secret..."
66+
log "Creating Quay pull secret..."
6567
oc create secret docker-registry quay-lightspeed-pull-secret \
6668
--docker-server=quay.io \
6769
--docker-username="$QUAY_ROBOT_NAME" \
6870
--docker-password="$QUAY_ROBOT_PASSWORD" \
69-
-n "$NAMESPACE" 2>/dev/null && echo "✅ Quay pull secret created" || echo "⚠️ Secret exists or creation failed"
71+
-n "$NAMESPACE" 2>/dev/null && log "✅ Quay pull secret created" || log "⚠️ Secret exists or creation failed"
7072

7173
# Link the secret to default service account for image pulls
7274
oc secrets link default quay-lightspeed-pull-secret --for=pull -n "$NAMESPACE" 2>/dev/null || echo "⚠️ Secret already linked to default SA"
@@ -75,7 +77,7 @@ oc secrets link default quay-lightspeed-pull-secret --for=pull -n "$NAMESPACE" 2
7577
#========================================
7678
# 4. CONFIGMAPS
7779
#========================================
78-
echo "===== Setting up configmaps ====="
80+
log "===== Setting up configmaps ====="
7981

8082
curl -sL -o tool_chat_template_llama3.1_json.jinja \
8183
https://raw.githubusercontent.com/vllm-project/vllm/main/examples/tool_chat_template_llama3.1_json.jinja \
@@ -88,9 +90,9 @@ oc create configmap vllm-chat-template -n "$NAMESPACE" \
8890
#========================================
8991
# 5. DEPLOY vLLM
9092
#========================================
91-
echo "===== Deploying vLLM ====="
93+
progress "Deploying vLLM"
9294
./pipeline-vllm.sh
93-
oc get pods -n "$NAMESPACE"
95+
[ "$QUIET" != "1" ] && oc get pods -n "$NAMESPACE"
9496

9597

9698
#========================================
@@ -99,7 +101,7 @@ oc get pods -n "$NAMESPACE"
99101
source pod.env
100102
oc wait --for=condition=Ready pod/$POD_NAME -n $NAMESPACE --timeout=600s
101103

102-
echo "===== Testing vLLM endpoint ====="
104+
progress "Testing vLLM endpoint"
103105
start_time=$(date +%s)
104106
timeout=200
105107

@@ -156,13 +158,13 @@ oc delete pod vllm-test-curl -n "$NAMESPACE" --ignore-not-found=true
156158
#========================================
157159
# 7. DEPLOY MOCK SERVERS (JWKS & MCP)
158160
#========================================
159-
echo "===== Deploying Mock Servers ====="
161+
progress "Deploying mock servers (JWKS, MCP)"
160162

161163
# Navigate to repo root to access server scripts
162164
REPO_ROOT="$(cd "$PIPELINE_DIR/../../.." && pwd)"
163165

164166
# Create ConfigMaps from server scripts
165-
echo "Creating mock server ConfigMaps..."
167+
log "Creating mock server ConfigMaps..."
166168
oc create configmap mock-jwks-script -n "$NAMESPACE" \
167169
--from-file=server.py="$REPO_ROOT/tests/e2e/mock_jwks_server/server.py" \
168170
--dry-run=client -o yaml | oc apply -f -
@@ -172,14 +174,14 @@ oc create configmap mcp-mock-server-script -n "$NAMESPACE" \
172174
--dry-run=client -o yaml | oc apply -f -
173175

174176
# Deploy mock server pods and services
175-
echo "Deploying mock-jwks..."
177+
log "Deploying mock-jwks..."
176178
oc apply -f "$PIPELINE_DIR/manifests/lightspeed/mock-jwks.yaml"
177179

178-
echo "Deploying mcp-mock-server..."
180+
log "Deploying mcp-mock-server..."
179181
oc apply -f "$PIPELINE_DIR/manifests/lightspeed/mcp-mock-server.yaml"
180182

181183
# Wait for mock servers to be ready
182-
echo "Waiting for mock servers to be ready..."
184+
log "Waiting for mock servers to be ready..."
183185
oc wait pod/mock-jwks pod/mcp-mock-server \
184186
-n "$NAMESPACE" --for=condition=Ready --timeout=120s || {
185187
echo "⚠️ Mock servers not ready, checking status..."
@@ -189,23 +191,23 @@ oc wait pod/mock-jwks pod/mcp-mock-server \
189191
echo "❌ Mock servers failed to become ready"
190192
exit 1
191193
}
192-
echo "✅ Mock servers deployed"
194+
log "✅ Mock servers deployed"
193195

194196
#========================================
195197
# 8. DEPLOY LIGHTSPEED STACK AND LLAMA STACK
196198
#========================================
197-
echo "===== Deploying Services ====="
199+
progress "Deploying lightspeed-stack and llama-stack"
198200

199201
create_secret api-url-secret --from-literal=key="$KSVC_URL"
200202
oc create configmap llama-stack-config -n "$NAMESPACE" --from-file=configs/run.yaml
201203
oc create configmap lightspeed-stack-config -n "$NAMESPACE" --from-file=configs/lightspeed-stack.yaml
202204

203205
# Create RAG data ConfigMap from the e2e test RAG data
204-
echo "Creating RAG data ConfigMap..."
206+
log "Creating RAG data ConfigMap..."
205207
RAG_DB_PATH="$REPO_ROOT/tests/e2e/rag/kv_store.db"
206208
if [ -f "$RAG_DB_PATH" ]; then
207209
# Extract vector store ID from kv_store.db using Python (sqlite3 CLI may not be available)
208-
echo "Extracting vector store ID from kv_store.db..."
210+
log "Extracting vector store ID from kv_store.db..."
209211
# Key format is: vector_stores:v3::vs_xxx or openai_vector_stores:v3::vs_xxx
210212
export FAISS_VECTOR_STORE_ID=$(python3 -c "
211213
import sqlite3
@@ -223,7 +225,7 @@ conn.close()
223225
" 2>/dev/null || echo "")
224226

225227
if [ -n "$FAISS_VECTOR_STORE_ID" ]; then
226-
echo "✅ Extracted FAISS_VECTOR_STORE_ID: $FAISS_VECTOR_STORE_ID"
228+
log "✅ Extracted FAISS_VECTOR_STORE_ID: $FAISS_VECTOR_STORE_ID"
227229
# Create secret for llama-stack to use
228230
create_secret faiss-vector-store-secret --from-literal=id="$FAISS_VECTOR_STORE_ID"
229231
else
@@ -233,14 +235,14 @@ conn.close()
233235
gzip -c "$RAG_DB_PATH" > /tmp/kv_store.db.gz
234236
oc create configmap rag-data -n "$NAMESPACE" --from-file=kv_store.db.gz=/tmp/kv_store.db.gz
235237
rm /tmp/kv_store.db.gz
236-
echo "✅ RAG data ConfigMap created from $RAG_DB_PATH"
238+
log "✅ RAG data ConfigMap created from $RAG_DB_PATH"
237239
else
238-
echo "⚠️ No kv_store.db found at $RAG_DB_PATH"
240+
log "⚠️ No kv_store.db found at $RAG_DB_PATH"
239241
fi
240242

241243
./pipeline-services.sh
242244

243-
echo "--> Final wait for both lightspeed-stack-service and llama-stack-service pods..."
245+
progress "Waiting for lightspeed-stack and llama-stack pods"
244246
if ! oc wait pod/lightspeed-stack-service pod/llama-stack-service \
245247
-n "$NAMESPACE" --for=condition=Ready --timeout=600s; then
246248
echo ""
@@ -265,17 +267,18 @@ if ! oc wait pod/lightspeed-stack-service pod/llama-stack-service \
265267
oc get events -n "$NAMESPACE" --sort-by='.lastTimestamp' | tail -20 || true
266268
exit 1
267269
fi
268-
echo "✅ Both service pods are ready"
269-
270-
oc get pods -n "$NAMESPACE"
271-
272-
echo "logs lightspeed"
273-
oc logs lightspeed-stack-service -n "$NAMESPACE" || true
274-
echo "logs llama"
275-
oc logs llama-stack-service -n "$NAMESPACE" || true
276-
277-
oc describe pod lightspeed-stack-service -n "$NAMESPACE" || true
278-
oc describe pod llama-stack-service -n "$NAMESPACE" || true
270+
log "✅ Both service pods are ready"
271+
272+
# When QUIET, skip verbose pod/log dumps so Konflux UI shows test output
273+
if [ "$QUIET" != "1" ]; then
274+
oc get pods -n "$NAMESPACE"
275+
echo "logs lightspeed"
276+
oc logs lightspeed-stack-service -n "$NAMESPACE" || true
277+
echo "logs llama"
278+
oc logs llama-stack-service -n "$NAMESPACE" || true
279+
oc describe pod lightspeed-stack-service -n "$NAMESPACE" || true
280+
oc describe pod llama-stack-service -n "$NAMESPACE" || true
281+
fi
279282

280283

281284
#========================================
@@ -290,25 +293,24 @@ oc expose pod lightspeed-stack-service \
290293
-n $NAMESPACE
291294

292295
# Kill any existing processes on ports 8080 and 8000
293-
echo "Checking for existing processes on ports 8080 and 8000..."
294296
lsof -ti:8080 | xargs kill -9 2>/dev/null || true
295297
lsof -ti:8000 | xargs kill -9 2>/dev/null || true
296298

297299
# Start port-forward for lightspeed-stack
298-
echo "Starting port-forward for lightspeed-stack..."
300+
progress "Starting port-forward, then E2E tests"
299301
oc port-forward svc/lightspeed-stack-service-svc 8080:8080 -n $NAMESPACE &
300302
PF_LCS_PID=$!
301303

302304
# Start port-forward for mock-jwks (needed for RBAC tests to get tokens)
303-
echo "Starting port-forward for mock-jwks..."
305+
log "Starting port-forward for mock-jwks..."
304306
oc port-forward svc/mock-jwks 8000:8000 -n $NAMESPACE &
305307
PF_JWKS_PID=$!
306308

307309
# Wait for port-forward to be usable (app may not be listening immediately; port-forward can drop)
308-
echo "Waiting for port-forward to lightspeed-stack to be ready..."
310+
log "Waiting for port-forward to lightspeed-stack to be ready..."
309311
for i in $(seq 1 36); do
310312
if curl -sf http://localhost:8080/v1/models > /dev/null 2>&1; then
311-
echo "✅ Port-forward ready after $(( i * 5 ))s"
313+
log "✅ Port-forward ready after $(( i * 5 ))s"
312314
break
313315
fi
314316
if [ $i -eq 36 ]; then
@@ -319,7 +321,7 @@ for i in $(seq 1 36); do
319321
fi
320322
# If port-forward process died, restart it (e.g. "connection refused" / "lost connection to pod")
321323
if ! kill -0 $PF_LCS_PID 2>/dev/null; then
322-
echo "Port-forward died, restarting (attempt $i)..."
324+
log "Port-forward died, restarting (attempt $i)..."
323325
oc port-forward svc/lightspeed-stack-service-svc 8080:8080 -n $NAMESPACE &
324326
PF_LCS_PID=$!
325327
fi
@@ -328,15 +330,15 @@ done
328330

329331
export E2E_LSC_HOSTNAME="localhost"
330332
export E2E_JWKS_HOSTNAME="localhost"
331-
echo "LCS accessible at: http://$E2E_LSC_HOSTNAME:8080"
332-
echo "Mock JWKS accessible at: http://$E2E_JWKS_HOSTNAME:8000"
333+
log "LCS accessible at: http://$E2E_LSC_HOSTNAME:8080"
334+
log "Mock JWKS accessible at: http://$E2E_JWKS_HOSTNAME:8000"
333335

334336

335337

336338
#========================================
337339
# 10. RUN TESTS
338340
#========================================
339-
echo "===== Running E2E tests ====="
341+
progress "Running E2E tests"
340342

341343
# Ensure run-tests.sh is executable
342344
chmod +x ./run-tests.sh
@@ -357,12 +359,11 @@ wait $PF_JWKS_PID 2>/dev/null || true
357359
set -e
358360
trap 'echo "❌ Pipeline failed at line $LINENO"; exit 1' ERR
359361

360-
echo "===== E2E COMPLETE ====="
361-
362+
progress "E2E complete"
362363
if [ "${TEST_EXIT_CODE:-1}" -ne 0 ]; then
363-
echo "❌ E2E tests failed with exit code $TEST_EXIT_CODE"
364+
echo "[e2e] ❌ FAILED (exit code $TEST_EXIT_CODE)"
364365
else
365-
echo "✅ E2E tests succeeded"
366+
echo "[e2e] ✅ SUCCESS"
366367
fi
367368

368369
exit $TEST_EXIT_CODE

0 commit comments

Comments
 (0)