@@ -10,6 +10,30 @@ name: E2E Deployment
1010# selecting which modes to run, skipping cleanup, and sending Slack notifications.
1111
1212on :
13+ workflow_call :
14+ inputs :
15+ run-connected :
16+ type : boolean
17+ default : true
18+ run-disconnected :
19+ type : boolean
20+ default : true
21+ storage-plugin :
22+ type : string
23+ default : ' lvms'
24+ skip-cleanup :
25+ type : boolean
26+ default : false
27+ capture-egress :
28+ type : boolean
29+ default : false
30+ outputs :
31+ egress-artifact-connected :
32+ description : " Artifact name for connected egress logs (empty if not captured)"
33+ value : ${{ jobs.e2e-connected.outputs.egress-artifact }}
34+ egress-artifact-disconnected :
35+ description : " Artifact name for disconnected egress logs (empty if not captured)"
36+ value : ${{ jobs.e2e-disconnected.outputs.egress-artifact }}
1337 schedule :
1438 # Run daily at 10:00 PM EST (03:00 UTC)
1539 - cron : ' 0 3 * * *'
@@ -113,6 +137,16 @@ jobs:
113137 echo "storage_plugins_connected=[\"${PLUGIN}\"]" >> $GITHUB_OUTPUT
114138 fi
115139 echo "Manual trigger - E2E will run (${PLUGIN})" | tee -a $GITHUB_STEP_SUMMARY
140+ elif [[ "${{ github.event_name }}" == "workflow_call" ]]; then
141+ echo "should_run=true" >> $GITHUB_OUTPUT
142+ PLUGIN="${{ inputs.storage-plugin || 'lvms' }}"
143+ echo "storage_plugins=[\"${PLUGIN}\"]" >> $GITHUB_OUTPUT
144+ if [[ "$PLUGIN" == "odf" ]]; then
145+ echo "storage_plugins_connected=[\"lvms\"]" >> $GITHUB_OUTPUT
146+ else
147+ echo "storage_plugins_connected=[\"${PLUGIN}\"]" >> $GITHUB_OUTPUT
148+ fi
149+ echo "Called as reusable workflow — E2E will run (${PLUGIN})" | tee -a $GITHUB_STEP_SUMMARY
116150 elif [[ "${{ github.event_name }}" == "schedule" ]]; then
117151 echo "should_run=true" >> $GITHUB_OUTPUT
118152 echo "storage_plugins=[\"lvms\"]" >> $GITHUB_OUTPUT
@@ -149,9 +183,12 @@ jobs:
149183 needs : check-e2e-needed
150184 if : >-
151185 needs.check-e2e-needed.outputs.should_run == 'true' &&
152- (github.event_name != 'workflow_dispatch' || inputs.run-connected == true)
186+ (github.event_name != 'workflow_dispatch' || inputs.run-connected == true) &&
187+ (github.event_name != 'workflow_call' || inputs.run-connected != false)
153188 runs-on : [self-hosted, enclave-large]
154189 timeout-minutes : 210
190+ outputs :
191+ egress-artifact : ${{ steps.egress_upload.outputs.artifact-id != '' && format('egress-logs-connected-{0}-{1}', env.ENCLAVE_CLUSTER_NAME, github.run_id) || '' }}
155192
156193 strategy :
157194 fail-fast : false
@@ -238,6 +275,13 @@ jobs:
238275 make -f Makefile.ci provision-landing-zone
239276 echo "Landing Zone provisioned" >> $GITHUB_STEP_SUMMARY
240277
278+ - name : Setup OpenSnitch for egress capture
279+ if : inputs.capture-egress == true
280+ run : |
281+ echo "## Setting up OpenSnitch" >> $GITHUB_STEP_SUMMARY
282+ make -f Makefile.ci setup-opensnitch
283+ echo "OpenSnitch running on Landing Zone" >> $GITHUB_STEP_SUMMARY
284+
241285 - name : Install Enclave Lab
242286 run : |
243287 echo "## Installing Enclave Lab" >> $GITHUB_STEP_SUMMARY
@@ -336,6 +380,20 @@ jobs:
336380 id : verify_cluster
337381 run : make -f Makefile.ci verify-cluster
338382
383+ - name : Collect egress logs
384+ if : inputs.capture-egress == true && !cancelled()
385+ run : make -f Makefile.ci collect-egress-logs
386+
387+ - name : Upload egress logs
388+ if : inputs.capture-egress == true && !cancelled()
389+ id : egress_upload
390+ uses : actions/upload-artifact@v4
391+ with :
392+ name : egress-logs-connected-${{ env.ENCLAVE_CLUSTER_NAME }}-${{ github.run_id }}
393+ path : artifacts/egress/
394+ retention-days : 7
395+ if-no-files-found : warn
396+
339397 - name : Collect artifacts
340398 if : always()
341399 uses : ./.github/actions/collect-artifacts
@@ -413,7 +471,10 @@ jobs:
413471 GH_TOKEN : ${{ github.token }}
414472
415473 - name : Cleanup infrastructure
416- if : always() && (github.event_name != 'workflow_dispatch' || inputs.skip-cleanup != true)
474+ if : >-
475+ always() &&
476+ !((github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') &&
477+ inputs.skip-cleanup == true)
417478 run : |
418479 echo "## Cleanup Infrastructure" >> $GITHUB_STEP_SUMMARY
419480 echo "" >> $GITHUB_STEP_SUMMARY
@@ -440,7 +501,10 @@ jobs:
440501 fi
441502
442503 - name : Cleanup skipped notice
443- if : always() && github.event_name == 'workflow_dispatch' && inputs.skip-cleanup == true
504+ if : >-
505+ always() &&
506+ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') &&
507+ inputs.skip-cleanup == true
444508 run : |
445509 echo "## Cleanup Skipped" >> $GITHUB_STEP_SUMMARY
446510 echo "" >> $GITHUB_STEP_SUMMARY
@@ -562,9 +626,12 @@ jobs:
562626 needs : check-e2e-needed
563627 if : >-
564628 needs.check-e2e-needed.outputs.should_run == 'true' &&
565- (github.event_name != 'workflow_dispatch' || inputs.run-disconnected == true)
629+ (github.event_name != 'workflow_dispatch' || inputs.run-disconnected == true) &&
630+ (github.event_name != 'workflow_call' || inputs.run-disconnected != false)
566631 runs-on : ${{ matrix.storage-plugin == 'odf' && fromJSON('["self-hosted", "enclave-large", "odf"]') || fromJSON('["self-hosted", "enclave-large"]') }}
567632 timeout-minutes : ${{ github.event_name == 'schedule' && 600 || 360 }}
633+ outputs :
634+ egress-artifact : ${{ steps.egress_upload.outputs.artifact-id != '' && format('egress-logs-disconnected-{0}-{1}', env.ENCLAVE_CLUSTER_NAME, github.run_id) || '' }}
568635
569636 strategy :
570637 fail-fast : false
@@ -651,6 +718,13 @@ jobs:
651718 make -f Makefile.ci provision-landing-zone
652719 echo "Landing Zone provisioned" >> $GITHUB_STEP_SUMMARY
653720
721+ - name : Setup OpenSnitch for egress capture
722+ if : inputs.capture-egress == true
723+ run : |
724+ echo "## Setting up OpenSnitch" >> $GITHUB_STEP_SUMMARY
725+ make -f Makefile.ci setup-opensnitch
726+ echo "OpenSnitch running on Landing Zone" >> $GITHUB_STEP_SUMMARY
727+
654728 - name : Install Enclave Lab
655729 run : |
656730 echo "## Installing Enclave Lab" >> $GITHUB_STEP_SUMMARY
@@ -758,6 +832,20 @@ jobs:
758832 echo "### Mirror Registry Status" >> $GITHUB_STEP_SUMMARY
759833 ssh $SSH_OPTS cloud-user@$LZ_IP "podman ps --filter name=quay --format 'table {{.Names}}\t{{.Status}}'" >> $GITHUB_STEP_SUMMARY || true
760834
835+ - name : Collect egress logs
836+ if : inputs.capture-egress == true && !cancelled()
837+ run : make -f Makefile.ci collect-egress-logs
838+
839+ - name : Upload egress logs
840+ if : inputs.capture-egress == true && !cancelled()
841+ id : egress_upload
842+ uses : actions/upload-artifact@v4
843+ with :
844+ name : egress-logs-disconnected-${{ env.ENCLAVE_CLUSTER_NAME }}-${{ github.run_id }}
845+ path : artifacts/egress/
846+ retention-days : 7
847+ if-no-files-found : warn
848+
761849 - name : Collect artifacts
762850 if : always()
763851 uses : ./.github/actions/collect-artifacts
@@ -835,7 +923,10 @@ jobs:
835923 GH_TOKEN : ${{ github.token }}
836924
837925 - name : Cleanup infrastructure
838- if : always() && (github.event_name != 'workflow_dispatch' || inputs.skip-cleanup != true)
926+ if : >-
927+ always() &&
928+ !((github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') &&
929+ inputs.skip-cleanup == true)
839930 run : |
840931 echo "## Cleanup Infrastructure" >> $GITHUB_STEP_SUMMARY
841932 echo "" >> $GITHUB_STEP_SUMMARY
@@ -862,7 +953,10 @@ jobs:
862953 fi
863954
864955 - name : Cleanup skipped notice
865- if : always() && github.event_name == 'workflow_dispatch' && inputs.skip-cleanup == true
956+ if : >-
957+ always() &&
958+ (github.event_name == 'workflow_dispatch' || github.event_name == 'workflow_call') &&
959+ inputs.skip-cleanup == true
866960 run : |
867961 echo "## Cleanup Skipped" >> $GITHUB_STEP_SUMMARY
868962 echo "" >> $GITHUB_STEP_SUMMARY
0 commit comments