Skip to content

Commit 5a8431e

Browse files
committed
added parallelizing to metal job
Signed-off-by: Lior Sventitzky <liorsve@amazon.com>
1 parent 649d46e commit 5a8431e

File tree

1 file changed

+41
-6
lines changed

1 file changed

+41
-6
lines changed

.github/workflows/benchmark.yml

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -407,12 +407,8 @@ jobs:
407407
retention-days: 1
408408

409409
benchmark:
410-
needs: [prepare, build-sdv, build-glide]
411-
if: |
412-
always() &&
413-
needs.prepare.result == 'success' &&
414-
(needs.build-sdv.result == 'success' || needs.build-sdv.result == 'skipped') &&
415-
(needs.build-glide.result == 'success' || needs.build-glide.result == 'skipped')
410+
needs: [prepare]
411+
if: needs.prepare.result == 'success'
416412
runs-on: [self-hosted, Linux, x86, ephemeral, metal]
417413
timeout-minutes: 30
418414

@@ -511,6 +507,45 @@ jobs:
511507
echo "Workload: $WORKLOAD"
512508
echo "Workload config: $WORKLOAD_CONFIG"
513509
510+
- name: Wait for build jobs to complete
511+
if: needs.prepare.outputs.build_sdv == 'true' || needs.prepare.outputs.build_glide == 'true'
512+
env:
513+
GITHUB_TOKEN: ${{ github.token }}
514+
run: |
515+
API_URL="https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/jobs"
516+
echo "Waiting for build jobs to complete..."
517+
while true; do
518+
JOBS=$(curl -s -H "Authorization: Bearer $GITHUB_TOKEN" "$API_URL?per_page=100")
519+
520+
ALL_DONE=true
521+
for JOB_NAME in "build-sdv" "build-glide"; do
522+
STATUS=$(echo "$JOBS" | jq -r --arg name "$JOB_NAME" '.jobs[] | select(.name==$name) | .status' | head -1)
523+
CONCLUSION=$(echo "$JOBS" | jq -r --arg name "$JOB_NAME" '.jobs[] | select(.name==$name) | .conclusion' | head -1)
524+
525+
if [ -z "$STATUS" ]; then
526+
continue
527+
fi
528+
529+
echo " $JOB_NAME: status=$STATUS conclusion=$CONCLUSION"
530+
531+
if [ "$STATUS" = "completed" ]; then
532+
if [ "$CONCLUSION" = "failure" ] || [ "$CONCLUSION" = "cancelled" ]; then
533+
echo "ERROR: $JOB_NAME failed with conclusion: $CONCLUSION"
534+
exit 1
535+
fi
536+
else
537+
ALL_DONE=false
538+
fi
539+
done
540+
541+
if [ "$ALL_DONE" = "true" ]; then
542+
echo "✓ All build jobs completed successfully"
543+
break
544+
fi
545+
546+
sleep 10
547+
done
548+
514549
- name: Download SDV build artifacts
515550
if: needs.prepare.outputs.build_sdv == 'true'
516551
uses: actions/download-artifact@v4

0 commit comments

Comments
 (0)