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