@@ -2,11 +2,9 @@ name: E2E Tests via Tekton on RHOAI
22
33# =============================================================================
44# This workflow triggers E2E tests using Tekton Pipelines on RHOAI.
5- # Benefits over K8s Job approach:
6- # - Step isolation (each notebook in separate Pod)
7- # - Built-in retry per step
8- # - Better resource management
9- # - Tekton Dashboard visibility
5+ # Two modes available:
6+ # - Single Pod (default): Fast startup, simple debugging, all steps in one Pod
7+ # - Multi Pod: Step isolation, per-step retry, separate Pod per notebook
108# =============================================================================
119
1210on :
2220 - minimal
2321 - standard
2422 - extended
23+ mode :
24+ description : ' Execution mode'
25+ required : true
26+ default : ' single-pod'
27+ type : choice
28+ options :
29+ - single-pod
30+ - multi-pod
2531 skip_steps :
2632 description : ' Steps to skip (comma-separated, e.g., "1,5,6")'
2733 required : false
3339 default : ' main'
3440 type : string
3541
36- # Weekly scheduled run
42+ # Weekly scheduled run (uses single-pod mode)
3743 schedule :
3844 - cron : ' 0 3 * * 0' # Sundays at 3 AM UTC
3945
4046env :
4147 OPENSHIFT_NAMESPACE : e2e-tests
42- PIPELINE_NAME : e2e-knowledge-tuning
4348
4449jobs :
4550 # ==========================================================================
5055 runs-on : ubuntu-latest
5156 outputs :
5257 resources_ready : ${{ steps.check.outputs.ready }}
58+ pipeline_name : ${{ steps.check.outputs.pipeline_name }}
5359
5460 steps :
5561 - name : Checkout code
@@ -77,14 +83,20 @@ jobs:
7783 run : |
7884 echo "📦 Applying Tekton resources..."
7985
80- # Apply resources (PVCs, ServiceAccount)
81- oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/resources.yaml
86+ MODE="${{ github.event.inputs.mode || 'single-pod' }}"
8287
83- # Apply Task
84- oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/task-notebook-runner .yaml
88+ # Apply common resources (PVCs, ServiceAccount)
89+ oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/resources .yaml
8590
86- # Apply Pipeline
87- oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/pipeline-e2e.yaml
91+ if [ "$MODE" == "single-pod" ]; then
92+ echo "📦 Applying single-pod Task and Pipeline..."
93+ oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/task-e2e-single-pod.yaml
94+ oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/pipeline-single-pod.yaml
95+ else
96+ echo "📦 Applying multi-pod Task and Pipeline..."
97+ oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/task-notebook-runner.yaml
98+ oc apply -f tests/e2e/knowledge_tuning/rhoai/tekton/pipeline-e2e.yaml
99+ fi
88100
89101 echo "✅ Tekton resources applied"
90102
@@ -93,17 +105,28 @@ jobs:
93105 run : |
94106 echo "🔍 Verifying Tekton resources..."
95107
108+ MODE="${{ github.event.inputs.mode || 'single-pod' }}"
109+
110+ if [ "$MODE" == "single-pod" ]; then
111+ PIPELINE_NAME="e2e-knowledge-tuning-single-pod"
112+ TASK_NAME="e2e-knowledge-tuning-single-pod"
113+ else
114+ PIPELINE_NAME="e2e-knowledge-tuning"
115+ TASK_NAME="notebook-runner"
116+ fi
117+
96118 # Check Pipeline exists
97- oc get pipeline ${{ env. PIPELINE_NAME }} -n ${{ env.OPENSHIFT_NAMESPACE }}
119+ oc get pipeline $PIPELINE_NAME -n ${{ env.OPENSHIFT_NAMESPACE }}
98120
99121 # Check Task exists
100- oc get task notebook-runner -n ${{ env.OPENSHIFT_NAMESPACE }}
122+ oc get task $TASK_NAME -n ${{ env.OPENSHIFT_NAMESPACE }}
101123
102124 # Check PVCs
103125 oc get pvc -n ${{ env.OPENSHIFT_NAMESPACE }}
104126
127+ echo "pipeline_name=$PIPELINE_NAME" >> $GITHUB_OUTPUT
105128 echo "ready=true" >> $GITHUB_OUTPUT
106- echo "✅ All resources ready"
129+ echo "✅ All resources ready (mode: $MODE) "
107130
108131 # ==========================================================================
109132 # Job 2: Trigger Tekton Pipeline
@@ -174,10 +197,54 @@ jobs:
174197 id : trigger
175198 run : |
176199 PIPELINERUN_NAME="e2e-run-${{ github.run_id }}-${{ github.run_attempt }}"
200+ PIPELINE_NAME="${{ needs.setup-tekton.outputs.pipeline_name }}"
201+ MODE="${{ github.event.inputs.mode || 'single-pod' }}"
177202
178203 echo "🚀 Creating PipelineRun: $PIPELINERUN_NAME"
204+ echo " Pipeline: $PIPELINE_NAME"
205+ echo " Mode: $MODE"
179206
180- cat <<EOF | oc apply -f -
207+ # Single-pod mode doesn't use workspaces (uses emptyDir internally)
208+ if [ "$MODE" == "single-pod" ]; then
209+ cat <<EOF | oc apply -f -
210+ apiVersion: tekton.dev/v1beta1
211+ kind: PipelineRun
212+ metadata:
213+ name: ${PIPELINERUN_NAME}
214+ namespace: ${{ env.OPENSHIFT_NAMESPACE }}
215+ labels:
216+ app: e2e-tests
217+ trigger: github-actions
218+ mode: single-pod
219+ github-run-id: "${{ github.run_id }}"
220+ spec:
221+ pipelineRef:
222+ name: ${PIPELINE_NAME}
223+ serviceAccountName: e2e-pipeline-sa
224+ params:
225+ - name: git-url
226+ value: "https://github.com/${{ github.repository }}.git"
227+ - name: git-revision
228+ value: "${{ steps.params.outputs.git_branch }}"
229+ - name: test-profile
230+ value: "${{ steps.params.outputs.profile }}"
231+ - name: student-model
232+ value: "${{ steps.params.outputs.model }}"
233+ - name: teacher-model
234+ value: "${{ steps.params.outputs.model }}"
235+ - name: skip-steps
236+ value: "${{ steps.params.outputs.skip_steps }}"
237+ podTemplate:
238+ tolerations:
239+ - key: "nvidia.com/gpu"
240+ operator: "Exists"
241+ effect: "NoSchedule"
242+ nodeSelector:
243+ nvidia.com/gpu.present: "true"
244+ EOF
245+ else
246+ # Multi-pod mode uses PVC workspaces
247+ cat <<EOF | oc apply -f -
181248 apiVersion: tekton.dev/v1beta1
182249 kind: PipelineRun
183250 metadata:
@@ -186,10 +253,11 @@ jobs:
186253 labels:
187254 app: e2e-tests
188255 trigger: github-actions
256+ mode: multi-pod
189257 github-run-id: "${{ github.run_id }}"
190258 spec:
191259 pipelineRef:
192- name: ${{ env. PIPELINE_NAME } }
260+ name: ${PIPELINE_NAME}
193261 serviceAccountName: e2e-pipeline-sa
194262 params:
195263 - name: git-url
@@ -219,17 +287,20 @@ jobs:
219287 nodeSelector:
220288 nvidia.com/gpu.present: "true"
221289 EOF
290+ fi
222291
223292 echo "pipelinerun_name=$PIPELINERUN_NAME" >> $GITHUB_OUTPUT
224293 echo "✅ PipelineRun created"
225294
226295 - name : Generate summary
227296 run : |
297+ MODE="${{ github.event.inputs.mode || 'single-pod' }}"
228298 echo "## Tekton Pipeline Triggered" >> $GITHUB_STEP_SUMMARY
229299 echo "" >> $GITHUB_STEP_SUMMARY
230300 echo "| Parameter | Value |" >> $GITHUB_STEP_SUMMARY
231301 echo "|-----------|-------|" >> $GITHUB_STEP_SUMMARY
232302 echo "| PipelineRun | \`${{ steps.trigger.outputs.pipelinerun_name }}\` |" >> $GITHUB_STEP_SUMMARY
303+ echo "| Mode | $MODE |" >> $GITHUB_STEP_SUMMARY
233304 echo "| Profile | ${{ steps.params.outputs.profile }} |" >> $GITHUB_STEP_SUMMARY
234305 echo "| Model | ${{ steps.params.outputs.model }} |" >> $GITHUB_STEP_SUMMARY
235306 echo "| Branch | ${{ steps.params.outputs.git_branch }} |" >> $GITHUB_STEP_SUMMARY
0 commit comments