Skip to content

Commit fefde72

Browse files
radofuchsRadovan Fuchs
authored andcommitted
LCORE-1221: Added tekton file for konflux e2e test run (lightspeed-core#1403)
* Add tekton file --------- Co-authored-by: Radovan Fuchs <rfuchs@rfuchs-thinkpadp1gen7.tpb.csb>
1 parent 40144b5 commit fefde72

21 files changed

Lines changed: 1651 additions & 81 deletions
Lines changed: 345 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,345 @@
1+
---
2+
apiVersion: tekton.dev/v1beta1
3+
kind: Pipeline
4+
metadata:
5+
name: lightspeed-stack-integration-tests-pipeline
6+
spec:
7+
description: |
8+
This pipeline automates the process of running end-to-end tests for Lightspeed Stack
9+
using a ROSA (Red Hat OpenShift Service on AWS cluster. The pipeline provisions
10+
the ROSA cluster, installs the Lightspeed Stack, runs the tests, collects artifacts,
11+
and finally deprovisions the ROSA cluster.
12+
params:
13+
- name: SNAPSHOT
14+
description: 'The JSON string representing the snapshot of the application under test (includes lightspeed-stack image).'
15+
default: '{"components": [{"name":"lightspeed-stack", "containerImage": "quay.io/example/lightspeed-stack:latest"}]}'
16+
type: string
17+
- name: llama-stack-image
18+
description: 'Llama Stack runs from source on UBI (init container clones repo and installs deps). Kept for logging/backwards compatibility.'
19+
default: 'run-from-source (UBI)'
20+
type: string
21+
- name: test-name
22+
description: 'The name of the test corresponding to a defined Konflux integration test.'
23+
default: 'lightspeed-stack-e2e-tests'
24+
- name: namespace
25+
description: 'Namespace to run tests in'
26+
default: 'lightspeed-stack'
27+
tasks:
28+
- name: eaas-provision-space
29+
taskRef:
30+
resolver: git
31+
params:
32+
- name: url
33+
value: https://github.com/konflux-ci/build-definitions.git
34+
- name: revision
35+
value: main
36+
- name: pathInRepo
37+
value: task/eaas-provision-space/0.1/eaas-provision-space.yaml
38+
params:
39+
- name: ownerKind
40+
value: PipelineRun
41+
- name: ownerName
42+
value: $(context.pipelineRun.name)
43+
- name: ownerUid
44+
value: $(context.pipelineRun.uid)
45+
- name: provision-cluster
46+
runAfter:
47+
- eaas-provision-space
48+
taskSpec:
49+
results:
50+
- name: clusterName
51+
value: "$(steps.create-cluster.results.clusterName)"
52+
steps:
53+
- name: pick-version
54+
ref:
55+
resolver: git
56+
params:
57+
- name: url
58+
value: https://github.com/konflux-ci/build-definitions.git
59+
- name: revision
60+
value: main
61+
- name: pathInRepo
62+
value: stepactions/eaas-get-latest-openshift-version-by-prefix/0.1/eaas-get-latest-openshift-version-by-prefix.yaml
63+
params:
64+
- name: prefix
65+
value: "4.19."
66+
- name: create-cluster
67+
ref:
68+
resolver: git
69+
params:
70+
- name: url
71+
value: https://github.com/konflux-ci/build-definitions.git
72+
- name: revision
73+
value: main
74+
- name: pathInRepo
75+
value: stepactions/eaas-create-ephemeral-cluster-hypershift-aws/0.1/eaas-create-ephemeral-cluster-hypershift-aws.yaml
76+
params:
77+
- name: eaasSpaceSecretRef
78+
value: $(tasks.eaas-provision-space.results.secretRef)
79+
- name: version
80+
value: "$(steps.pick-version.results.version)"
81+
- name: instanceType
82+
value: "m5.large"
83+
- name: get-stack-images
84+
description: Extract lightspeed-stack image and commit from SNAPSHOT (Llama Stack runs from source in-pod)
85+
runAfter:
86+
- provision-cluster
87+
params:
88+
- name: SNAPSHOT
89+
value: $(params.SNAPSHOT)
90+
- name: namespace
91+
value: "$(params.namespace)"
92+
taskSpec:
93+
results:
94+
- name: lightspeed-stack-image
95+
value: "$(steps.get-stack-images.results.lightspeed-stack-image)"
96+
- name: commit
97+
value: "$(steps.get-stack-images.results.commit)"
98+
params:
99+
- name: SNAPSHOT
100+
- name: namespace
101+
type: string
102+
volumes:
103+
- name: credentials
104+
emptyDir: {}
105+
steps:
106+
- name: get-stack-images
107+
image: registry.redhat.io/openshift4/ose-cli:latest
108+
env:
109+
- name: SNAPSHOT
110+
value: $(params.SNAPSHOT)
111+
results:
112+
- name: lightspeed-stack-image
113+
type: string
114+
description: "lightspeed-stack container image from snapshot"
115+
- name: commit
116+
type: string
117+
description: "commit sha to be used to store artifacts"
118+
script: |
119+
dnf -y install jq
120+
echo -n "$(jq -r --arg n "lightspeed-stack" '.components[] | select(.name == $n) | .containerImage // ""' <<< "$SNAPSHOT")" > $(step.results.lightspeed-stack-image.path)
121+
echo -n "$(jq -r --arg n "lightspeed-stack" '.components[] | select(.name == $n) | .source.git.revision // "latest"' <<< "$SNAPSHOT")" > $(step.results.commit.path)
122+
- name: echo-integration-params
123+
description: Echo all params passed to lightspeed-stack-integration-tests for verification before the test runs.
124+
runAfter:
125+
- get-stack-images
126+
params:
127+
- name: SNAPSHOT
128+
value: $(params.SNAPSHOT)
129+
- name: lightspeedstackimage
130+
value: $(tasks.get-stack-images.results.lightspeed-stack-image)
131+
- name: llamastackimage
132+
value: $(params.llama-stack-image)
133+
- name: commit
134+
value: $(tasks.get-stack-images.results.commit)
135+
- name: namespace
136+
value: "$(params.namespace)"
137+
taskSpec:
138+
params:
139+
- name: SNAPSHOT
140+
- name: lightspeedstackimage
141+
- name: llamastackimage
142+
- name: commit
143+
- name: namespace
144+
type: string
145+
steps:
146+
- name: echo-params
147+
image: registry.access.redhat.com/ubi9/ubi-minimal
148+
env:
149+
- name: LIGHTSPEED_STACK_IMAGE
150+
value: $(params.lightspeedstackimage)
151+
- name: LLAMA_STACK_IMAGE
152+
value: $(params.llamastackimage)
153+
- name: NAMESPACE
154+
value: $(params.namespace)
155+
- name: COMMIT
156+
value: $(params.commit)
157+
- name: SNAPSHOT
158+
value: $(params.SNAPSHOT)
159+
script: |
160+
echo "========== Integration test parameters (before lightspeed-stack-integration-tests) =========="
161+
echo "LIGHTSPEED_STACK_IMAGE=$LIGHTSPEED_STACK_IMAGE"
162+
echo "LLAMA_STACK_IMAGE=$LLAMA_STACK_IMAGE"
163+
echo "NAMESPACE=$NAMESPACE"
164+
echo "COMMIT=$COMMIT"
165+
echo "SNAPSHOT length: $(echo -n "$SNAPSHOT" | wc -c) chars"
166+
echo "SNAPSHOT (first 500 chars): $(echo -n "$SNAPSHOT" | head -c 500)"
167+
echo "========== End parameters =========="
168+
- name: lightspeed-stack-integration-tests
169+
description: Task to run integration tests from lightspeed-stack repository
170+
params:
171+
- name: SNAPSHOT
172+
value: $(params.SNAPSHOT)
173+
- name: lightspeedstackimage
174+
value: $(tasks.get-stack-images.results.lightspeed-stack-image)
175+
- name: llamastackimage
176+
value: $(params.llama-stack-image)
177+
- name: commit
178+
value: $(tasks.get-stack-images.results.commit)
179+
- name: namespace
180+
value: "$(params.namespace)"
181+
- name: spaceRequestSecretName
182+
value: $(tasks.eaas-provision-space.results.secretRef)
183+
- name: clusterName
184+
value: $(tasks.provision-cluster.results.clusterName)
185+
runAfter:
186+
- echo-integration-params
187+
taskSpec:
188+
params:
189+
- name: SNAPSHOT
190+
- name: lightspeedstackimage
191+
- name: llamastackimage
192+
- name: commit
193+
- name: namespace
194+
type: string
195+
- name: spaceRequestSecretName
196+
type: string
197+
- name: clusterName
198+
type: string
199+
results:
200+
- name: TEST_OUTPUT
201+
description: Standardized JSON output for Enterprise Contract
202+
volumes:
203+
# Secrets for pipeline-konflux.sh (e2e-prow): OpenAI API key (secret key must be "openai-api-key"), Quay pull for images
204+
- name: openai-api-key
205+
secret:
206+
secretName: openai-api-key
207+
- name: quay-aipcc-name
208+
secret:
209+
secretName: quay-aipcc-name
210+
- name: quay-aipcc-password
211+
secret:
212+
secretName: quay-aipcc-password
213+
- name: credentials
214+
emptyDir: {}
215+
steps:
216+
- name: get-kubeconfig
217+
ref:
218+
resolver: git
219+
params:
220+
- name: url
221+
value: https://github.com/konflux-ci/build-definitions.git
222+
- name: revision
223+
value: main
224+
- name: pathInRepo
225+
value: stepactions/eaas-get-ephemeral-cluster-credentials/0.1/eaas-get-ephemeral-cluster-credentials.yaml
226+
params:
227+
- name: eaasSpaceSecretRef
228+
value: $(params.spaceRequestSecretName)
229+
- name: clusterName
230+
value: "$(params.clusterName)"
231+
- name: credentials
232+
value: credentials
233+
- name: run-e2e-tests
234+
onError: continue
235+
resources:
236+
requests:
237+
cpu: '1'
238+
memory: 1Gi
239+
limits:
240+
memory: 10Gi
241+
volumeMounts:
242+
# Mount paths expected by pipeline-konflux.sh (tests/e2e-prow/rhoai/pipeline-konflux.sh)
243+
- name: openai-api-key
244+
mountPath: /var/run/openai
245+
- name: quay-aipcc-name
246+
mountPath: /var/run/quay-aipcc-name
247+
- name: quay-aipcc-password
248+
mountPath: /var/run/quay-aipcc-password
249+
- name: credentials
250+
mountPath: /credentials
251+
env:
252+
- name: KUBECONFIG
253+
value: "/credentials/$(steps.get-kubeconfig.results.kubeconfig)"
254+
- name: ARTIFACT_DIR
255+
value: "/workspace/artifacts"
256+
- name: SUITE_ID
257+
value: "nosuite"
258+
- name: KONFLUX_BOOL
259+
value: "true"
260+
- name: LIGHTSPEED_STACK_IMAGE
261+
value: "$(params.lightspeedstackimage)"
262+
- name: LLAMA_STACK_IMAGE
263+
value: "$(params.llamastackimage)"
264+
- name: NAMESPACE
265+
value: "$(params.namespace)"
266+
- name: SNAPSHOT
267+
value: $(params.SNAPSHOT)
268+
image: registry.access.redhat.com/ubi9/ubi-minimal
269+
script: |
270+
set +e
271+
echo "[e2e] 1/8 Starting run-e2e-tests step"
272+
echo "[e2e] 2/8 Installing deps (git, tar, jq, curl-minimal, python3, gettext for envsubst)..."
273+
microdnf -y install git tar jq curl-minimal python3 gettext
274+
echo "[e2e] 3/8 Downloading oc client..."
275+
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
276+
tar -xzf oc.tar.gz && chmod +x kubectl oc && mv oc kubectl /usr/local/bin/
277+
echo "[e2e] 4/8 SNAPSHOT (length ${#SNAPSHOT} chars; clone URL fixed — SNAPSHOT is main/upstream, not fork)..."
278+
# Fixed fork + branch: Konflux SNAPSHOT points at main repo/rev, not the PR/fork under test.
279+
REPO_URL=$(jq -r '.components[] | select(.name == "lightspeed-stack") | .source.git.url // "https://github.com/lightspeed-core/lightspeed-stack.git"' <<< "$SNAPSHOT")
280+
REPO_REV=$(jq -r '.components[] | select(.name == "lightspeed-stack") | .source.git.revision // "main"' <<< "$SNAPSHOT")
281+
echo "[e2e] 5/8 Clone $REPO_URL @ $REPO_REV"
282+
git clone -q "$REPO_URL" /workspace/lightspeed-stack
283+
cd /workspace/lightspeed-stack && git fetch origin "$REPO_REV" && git checkout -q "$REPO_REV"
284+
echo "[e2e] 6/8 Entering tests/e2e-prow/rhoai"
285+
cd tests/e2e-prow/rhoai && chmod +x pipeline-konflux.sh && ls -la pipeline-konflux.sh
286+
echo "[e2e] 7/8 Running pipeline-konflux.sh (this should take 10+ min)..."
287+
./pipeline-konflux.sh
288+
PIPELINE_EXIT=$?
289+
echo "[e2e] 8/8 pipeline-konflux.sh exited with code $PIPELINE_EXIT"
290+
exit $PIPELINE_EXIT
291+
# - name: gather-cluster-resources
292+
# onError: continue
293+
# ref:
294+
# resolver: git
295+
# params:
296+
# - name: url
297+
# value: https://github.com/konflux-ci/tekton-integration-catalog
298+
# - name: revision
299+
# value: main
300+
# - name: pathInRepo
301+
# value: stepactions/gather-cluster-resources/0.1/gather-cluster-resources.yaml
302+
# params:
303+
# - name: credentials
304+
# value: "credentials"
305+
# - name: kubeconfig
306+
# value: "$(steps.get-kubeconfig.results.kubeconfig)"
307+
# - name: artifact-dir
308+
# value: "/workspace/konflux-artifacts"
309+
# # validate that the cluster resources are available in another tekton step
310+
# - name: list-artifacts
311+
# onError: continue
312+
# image: quay.io/konflux-qe-incubator/konflux-qe-tools:latest
313+
# workingDir: "/workspace"
314+
# script: |
315+
# #!/bin/bash
316+
# ls -la /workspace
317+
# - name: push-artifacts
318+
# (requires volume ols-konflux-artifacts-bot-creds + Secret ols-konflux-artifacts-bot)
319+
# onError: continue
320+
# ref:
321+
# resolver: git
322+
# params:
323+
# - name: url
324+
# value: https://github.com/konflux-ci/tekton-integration-catalog.git
325+
# - name: revision
326+
# value: main
327+
# - name: pathInRepo
328+
# value: stepactions/secure-push-oci/0.1/secure-push-oci.yaml
329+
# params:
330+
# - name: workdir-path
331+
# value: /workspace
332+
# - name: oci-ref
333+
# value: "quay.io/openshift-lightspeed/ols-service-artifacts:$(params.commit)"
334+
# - name: credentials-volume-name
335+
# value: ols-konflux-artifacts-bot-creds
336+
# - name: fail-if-any-step-failed
337+
# ref:
338+
# resolver: git
339+
# params:
340+
# - name: url
341+
# value: https://github.com/konflux-ci/tekton-integration-catalog.git
342+
# - name: revision
343+
# value: main
344+
# - name: pathInRepo
345+
# value: stepactions/fail-if-any-step-failed/0.1/fail-if-any-step-failed.yaml

docs/e2e_testing.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -69,9 +69,11 @@ tests/e2e/
6969
tests/e2e-prow/
7070
└── rhoai/ # RHOAI / OpenShift E2E
7171
├── run-tests.sh # Entry to run E2E in Prow
72-
├── pipeline.sh # Main pipeline definition
73-
├── pipeline-services.sh # Services pipeline
74-
├── pipeline-vllm.sh # vLLM pipeline
72+
├── pipeline.sh # Prow: full vLLM + LCS + behave (main branch workflow)
73+
├── pipeline-konflux.sh # Konflux: OpenAI Llama run-from-source + run-ci.yaml + behave
74+
├── pipeline-services.sh # Services for Prow (vLLM llama-stack image + LCS)
75+
├── pipeline-services-konflux.sh # Services for Konflux (llama-stack-openai + templated LCS)
76+
├── pipeline-vllm.sh # vLLM cluster setup (called from pipeline.sh)
7577
├── pipeline-test-pod.sh # Test pod pipeline
7678
├── configs/ # Lightspeed-stack configs for Prow (used by environment.py when is_prow)
7779
│ ├── lightspeed-stack.yaml
@@ -80,7 +82,7 @@ tests/e2e-prow/
8082
│ ├── lightspeed-stack-auth-rh-identity.yaml
8183
│ ├── lightspeed-stack-no-cache.yaml
8284
│ ├── lightspeed-stack-invalid-feedback-storage.yaml
83-
│ └── run.yaml # Llama Stack run config for Prow
85+
│ └── run.yaml # vLLM Llama Stack config (used by pipeline.sh); Konflux uses tests/e2e/configs/run-ci.yaml via pipeline-konflux.sh
8486
├── scripts/
8587
│ ├── e2e-ops.sh # E2E ops (e.g. disrupt/restore llama-stack) — called from prow_utils
8688
│ ├── bootstrap.sh
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
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+
use_as_library_client: false
11+
url: http://${env.E2E_LLAMA_HOSTNAME}:8321
12+
api_key: xyzzy
13+
user_data_collection:
14+
feedback_enabled: true
15+
feedback_storage: "/tmp/data/feedback"
16+
transcripts_enabled: true
17+
transcripts_storage: "/tmp/data/transcripts"
18+
authentication:
19+
module: "noop"
20+
mcp_servers:
21+
- name: "mcp-file"
22+
provider_id: "model-context-protocol"
23+
url: "http://mock-mcp:3001"
24+
authorization_headers:
25+
Authorization: "/tmp/invalid-mcp-token"

0 commit comments

Comments
 (0)