From 05de774602655ca31c3dc88aa88cc7df0212ddb1 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:08:33 -0400 Subject: [PATCH 01/79] init --- .github/workflows/azure-ci-dispatcher.yml | 85 +++++------------------ 1 file changed, 18 insertions(+), 67 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index b7afe23e720..02afe1db788 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -26,10 +26,6 @@ on: - staging - main - release-staging/rocm-rel-7.* - paths-ignore: - - '.github/**' - - 'docs/**' - - '*.md' concurrency: group: azure-ci-dispatcher-${{ github.event.pull_request.number || github.ref }} @@ -39,7 +35,6 @@ jobs: dispatch-azure-ci: name: Dispatch Azure CI runs-on: ubuntu-latest - timeout-minutes: 720 steps: - name: Generate a token id: generate-token @@ -124,7 +119,7 @@ jobs: run_id=$(echo "$response" | jq -r '.id' || echo "null") if [ "$run_id" != "null" ]; then echo "Run ID for $project_name: $run_id" - echo "https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" + echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" run_ids+=("$run_id") else echo "Failed to request run for $project_name" @@ -138,70 +133,26 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT - - name: Wait for and report Azure CI status + - name: Create summary check if: steps.dispatch.outputs.run_ids - timeout-minutes: 720 run: | run_ids=(${{ steps.dispatch.outputs.run_ids }}) - echo "Waiting on runs: ${run_ids[*]}" - - all_finished=0 - exit_status=0 - - while [[ $all_finished -eq 0 ]]; do - sleep 120 - all_finished=1 - echo "==================================================================" - - for run_id in "${run_ids[@]}"; do - max_attempts=3 - retry_delay=5 - attempt=1 - success=false - - while [ $attempt -le $max_attempts ]; do - response=$(curl -sSX GET https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?api-version=7.1 \ - -u ":${{ secrets.AZ_PAT }}" \ - -H "Content-Type: application/json") - - if [[ $? -eq 0 ]]; then - success=true - break - fi - - echo "Attempt $attempt failed. Retrying in $retry_delay seconds..." - sleep $retry_delay - attempt=$((attempt + 1)) - done - - if [[ "$success" == true ]]; then - pipeline_name=$(echo "$response" | jq -r '.definition.name') - status=$(echo "$response" | jq -r '.status') - result=$(echo "$response" | jq -r '.result') - - if [[ "$status" == "completed" ]]; then - echo "$pipeline_name - run $run_id is finished with result: $result" - echo "https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" - if [[ "$result" != "succeeded" ]]; then - exit_status=1 - fi - else - all_finished=0 - echo "$pipeline_name - run $run_id is in progress..." - echo "https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" - fi - else - echo "Failed to fetch status for run $run_id after $max_attempts attempts" - echo "https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" - exit_status=1 - continue - fi - done - done - - if [[ $exit_status -ne 0 ]] then - exit $exit_status - fi + echo "Creating summary check for runs: ${run_ids[*]}" + + curl -sSX POST \ + -H "Authorization: token ${{ steps.generate-token.outputs.token }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/repos/ROCm/rocm-libraries/check-runs \ + -d '{ + "name": "Azure CI Summary", + "head_sha": "${{ github.sha }}", + "status": "in_progress", + "output": { + "title": "Azure CI Summary", + "summary": "## Azure CI Runs\n\nThis is a summary of Azure CI runs.\n\n- CI Run 1: Pending\n- CI Run 2: Pending", + "text": "This check run serves as a summary of Azure CI runs." + } + }' - name: Cancel Azure CI runs if: ${{ cancelled() }} From 0b104e5f9c241a984740fe4efe25fe15c8bc5938 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:10:27 -0400 Subject: [PATCH 02/79] test branches --- .github/workflows/azure-ci-dispatcher.yml | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 02afe1db788..e4d4a0e4d60 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -22,10 +22,11 @@ on: - reopened - ready_for_review branches: - - develop - - staging - - main - - release-staging/rocm-rel-7.* + # - develop + # - staging + # - main + # - release-staging/rocm-rel-7.* + - users/danielsu/az-dispatch-nonpolling concurrency: group: azure-ci-dispatcher-${{ github.event.pull_request.number || github.ref }} From 3a3d0c05768cb53d87ab57eaf39fdbc54064d8fa Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:19:30 -0400 Subject: [PATCH 03/79] use event.pr.head.sha --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index e4d4a0e4d60..99b3c5bc546 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -146,7 +146,7 @@ jobs: https://api.github.com/repos/ROCm/rocm-libraries/check-runs \ -d '{ "name": "Azure CI Summary", - "head_sha": "${{ github.sha }}", + "head_sha": "${{ github.event.pull_request.head.sha }}", "status": "in_progress", "output": { "title": "Azure CI Summary", From 3be607a050bc94b72bbe1262083a5c74cc5f133e Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:36:29 -0400 Subject: [PATCH 04/79] project names, use gh cli --- .github/workflows/azure-ci-dispatcher.yml | 47 +++++++++++++++-------- 1 file changed, 30 insertions(+), 17 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 99b3c5bc546..d83874bed18 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -44,6 +44,8 @@ jobs: app-id: ${{ secrets.APP_ID }} private-key: ${{ secrets.APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} + repositories: | + ROCm/rocm-libraries - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 @@ -82,6 +84,7 @@ jobs: > resolved_subtrees.txt run_ids=() + project_names=() while IFS= read -r line; do IFS='=' read -r project_name definition_id <<< "$line" @@ -122,6 +125,7 @@ jobs: echo "Run ID for $project_name: $run_id" echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" run_ids+=("$run_id") + project_names+=("$project_name") else echo "Failed to request run for $project_name" fi @@ -133,27 +137,36 @@ jobs: done < resolved_subtrees.txt echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT + echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT + echo "Outputted run IDs: ${run_ids[*]}" + echo "Outputted project names: ${project_names[*]}" - name: Create summary check - if: steps.dispatch.outputs.run_ids + if: steps.dispatch.outputs.run_ids && steps.dispatch.outputs.project_names + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | run_ids=(${{ steps.dispatch.outputs.run_ids }}) - echo "Creating summary check for runs: ${run_ids[*]}" - - curl -sSX POST \ - -H "Authorization: token ${{ steps.generate-token.outputs.token }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/repos/ROCm/rocm-libraries/check-runs \ - -d '{ - "name": "Azure CI Summary", - "head_sha": "${{ github.event.pull_request.head.sha }}", - "status": "in_progress", - "output": { - "title": "Azure CI Summary", - "summary": "## Azure CI Runs\n\nThis is a summary of Azure CI runs.\n\n- CI Run 1: Pending\n- CI Run 2: Pending", - "text": "This check run serves as a summary of Azure CI runs." - } - }' + project_names=(${{ steps.dispatch.outputs.project_names }}) + + summary="| Project | Run ID | Status |\n" + summary+="|--------------|--------|--------|\n" + for i in "${!project_names[@]}"; do + summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n" + done + + text="" + for i in "${!project_names[@]}"; do + text+="${run_ids[i]}=pending;" + done + + gh api repos/ROCm/rocm-libraries/check-runs \ + -F name='Azure CI Summary' \ + -F head_sha='${{ github.event.pull_request.head.sha }}' \ + -F status='in_progress' \ + -F output.title='Azure CI Summary' \ + -F output.summary="$summary" \ + -F output.text='This check run serves as a summary of Azure CI runs.' - name: Cancel Azure CI runs if: ${{ cancelled() }} From 58949c9a11b3f1957049f267c95a7df5bb9a0463 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:42:52 -0400 Subject: [PATCH 05/79] fix token repo --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index d83874bed18..4e916f6f95b 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -45,7 +45,7 @@ jobs: private-key: ${{ secrets.APP_PRIVATE_KEY }} owner: ${{ github.repository_owner }} repositories: | - ROCm/rocm-libraries + rocm-libraries - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 From f51afab1d27b32fd953fc4f856669ac9f1d10094 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 11:57:52 -0400 Subject: [PATCH 06/79] print debug --- .github/workflows/azure-ci-dispatcher.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 4e916f6f95b..0929817b2e1 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -160,6 +160,9 @@ jobs: text+="${run_ids[i]}=pending;" done + echo $summary + echo $text + gh api repos/ROCm/rocm-libraries/check-runs \ -F name='Azure CI Summary' \ -F head_sha='${{ github.event.pull_request.head.sha }}' \ From 4b981eb9116b8fe3b416599b360d54486c32d2ab Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:08:23 -0400 Subject: [PATCH 07/79] fix output --- .github/workflows/azure-ci-dispatcher.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 0929817b2e1..086c9413674 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -167,9 +167,7 @@ jobs: -F name='Azure CI Summary' \ -F head_sha='${{ github.event.pull_request.head.sha }}' \ -F status='in_progress' \ - -F output.title='Azure CI Summary' \ - -F output.summary="$summary" \ - -F output.text='This check run serves as a summary of Azure CI runs.' + -F output='{"title":"Azure CI Summary","summary":"$summary","text":"$text"}' - name: Cancel Azure CI runs if: ${{ cancelled() }} From 3407d4fc75f104be667a3cd436c19aa855b11a54 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:10:49 -0400 Subject: [PATCH 08/79] escape quotes --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 086c9413674..84a22018c96 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -167,7 +167,7 @@ jobs: -F name='Azure CI Summary' \ -F head_sha='${{ github.event.pull_request.head.sha }}' \ -F status='in_progress' \ - -F output='{"title":"Azure CI Summary","summary":"$summary","text":"$text"}' + -F output="{\"title\":\"Azure CI Summary\",\"summary\":\"$summary\",\"text\":\"$text\"}" - name: Cancel Azure CI runs if: ${{ cancelled() }} From e9322e0629ed312fe78bd9dbacd506b937cc5fe9 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:16:30 -0400 Subject: [PATCH 09/79] fix subkey --- .github/workflows/azure-ci-dispatcher.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 84a22018c96..c19221b08b7 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -167,7 +167,9 @@ jobs: -F name='Azure CI Summary' \ -F head_sha='${{ github.event.pull_request.head.sha }}' \ -F status='in_progress' \ - -F output="{\"title\":\"Azure CI Summary\",\"summary\":\"$summary\",\"text\":\"$text\"}" + -F output[title]='Azure CI Summary' \ + -F output[summary]="$summary" \ + -F output[text]="$text" - name: Cancel Azure CI runs if: ${{ cancelled() }} From eed20f43896a9659d9c3804b8f030cf6b2e2d321 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:25:47 -0400 Subject: [PATCH 10/79] double newline --- .github/workflows/azure-ci-dispatcher.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index c19221b08b7..370a69bb323 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -149,10 +149,10 @@ jobs: run_ids=(${{ steps.dispatch.outputs.run_ids }}) project_names=(${{ steps.dispatch.outputs.project_names }}) - summary="| Project | Run ID | Status |\n" - summary+="|--------------|--------|--------|\n" + summary="| Project | Run ID | Status |\n\n" + summary+="|--------------|--------|--------|\n\n" for i in "${!project_names[@]}"; do - summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n" + summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n\n" done text="" @@ -164,12 +164,12 @@ jobs: echo $text gh api repos/ROCm/rocm-libraries/check-runs \ - -F name='Azure CI Summary' \ - -F head_sha='${{ github.event.pull_request.head.sha }}' \ - -F status='in_progress' \ - -F output[title]='Azure CI Summary' \ - -F output[summary]="$summary" \ - -F output[text]="$text" + -F 'name=Azure CI Summary' \ + -F 'head_sha=${{ github.event.pull_request.head.sha }}' \ + -F 'status=in_progress' \ + -F 'output[title]=Azure CI Summary' \ + -F "output[summary]=$summary" \ + -F "output[text]=$text" - name: Cancel Azure CI runs if: ${{ cancelled() }} From 862f2a5e02e9eaa8087f13c6b480626df54d74d7 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:29:13 -0400 Subject: [PATCH 11/79] raw string flag --- .github/workflows/azure-ci-dispatcher.yml | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 370a69bb323..4b8d85b31da 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -164,12 +164,12 @@ jobs: echo $text gh api repos/ROCm/rocm-libraries/check-runs \ - -F 'name=Azure CI Summary' \ - -F 'head_sha=${{ github.event.pull_request.head.sha }}' \ - -F 'status=in_progress' \ - -F 'output[title]=Azure CI Summary' \ - -F "output[summary]=$summary" \ - -F "output[text]=$text" + -f 'name=Azure CI Summary' \ + -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ + -f 'status=in_progress' \ + -f 'output[title]=Azure CI Summary' \ + -f "output[summary]=$summary" \ + -f "output[text]=$text" - name: Cancel Azure CI runs if: ${{ cancelled() }} From 5201c92bfcf119cb6be952ccff2d78ebdfa1536f Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:33:37 -0400 Subject: [PATCH 12/79] try newlines again --- .github/workflows/azure-ci-dispatcher.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 4b8d85b31da..ee77905684d 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -149,10 +149,10 @@ jobs: run_ids=(${{ steps.dispatch.outputs.run_ids }}) project_names=(${{ steps.dispatch.outputs.project_names }}) - summary="| Project | Run ID | Status |\n\n" - summary+="|--------------|--------|--------|\n\n" + summary=$"| Project | Run ID | Status |\n" + summary+=$"|--------------|--------|--------|\n" for i in "${!project_names[@]}"; do - summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n\n" + summary+=$"| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n" done text="" From 1a2664b7af6899860336e9ef27c7a980a2582ff7 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:37:24 -0400 Subject: [PATCH 13/79] newline again --- .github/workflows/azure-ci-dispatcher.yml | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index ee77905684d..bc3fa0a172e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -149,10 +149,12 @@ jobs: run_ids=(${{ steps.dispatch.outputs.run_ids }}) project_names=(${{ steps.dispatch.outputs.project_names }}) - summary=$"| Project | Run ID | Status |\n" - summary+=$"|--------------|--------|--------|\n" + newline=$'\n' + + summary="| Project | Run ID | Status |${newline}" + summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do - summary+=$"| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |\n" + summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |${newline}" done text="" From 5e434ab31c509bd717109f42d009c63547908242 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:49:28 -0400 Subject: [PATCH 14/79] cancel previous inprogress runs --- .github/workflows/azure-ci-dispatcher.yml | 49 ++++++++++++++++------- 1 file changed, 35 insertions(+), 14 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index bc3fa0a172e..46968994edf 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -71,6 +71,41 @@ jobs: --config ".github/repos-config.json" \ --require-auto-push + - name: Cancel previous runs + if: steps.detect.outputs.subtrees + run: | + pr_number=${{ github.event.pull_request.number }} + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$top=100&api-version=7.1" \ + -H "Content-Type: application/json") + + if [ $? -ne 0 ]; then + echo "Failed to fetch Azure runs" + exit 1 + fi + + runs=$(echo "$res" | jq -r '.value[] | select(.sourceBranch | contains("refs/pull/'"$pr_number"'/merge")) | .id') + + if [ -z "$runs" ]; then + echo "No in-progress runs found for PR #$pr_number" + exit 0 + fi + + echo "Found in-progress runs for PR #$pr_number: $runs" + + for run_id in $runs; do + echo "Cancelling run ID: $run_id" + response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?api-version=7.1" \ + -u ":${{ secrets.AZ_PAT }}" \ + -H "Content-Type: application/json" \ + -d '{"status": "cancelling"}') + + if [ $? -ne 0 ]; then + echo "Failed to cancel run ID: $run_id" + else + echo "Cancelled run ID: $run_id" + fi + done + - name: Dispatch Azure CI runs id: dispatch if: steps.detect.outputs.subtrees @@ -172,17 +207,3 @@ jobs: -f 'output[title]=Azure CI Summary' \ -f "output[summary]=$summary" \ -f "output[text]=$text" - - - name: Cancel Azure CI runs - if: ${{ cancelled() }} - run: | - run_ids=(${{ steps.dispatch.outputs.run_ids }}) - echo "Cancelling runs: ${run_ids[*]}" - - for run_id in "${run_ids[@]}"; do - response=$(curl -sSX PATCH https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?api-version=7.1 \ - -u ":${{ secrets.AZ_PAT }}" \ - -H "Content-Type: application/json" \ - -d '{"status": "cancelling"}') - echo $response | jq -r '.status' || echo "Failed to cancel run $run_id" - done From f690b1d568e15d6dd349071e0e2bce9d35492f00 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 12:56:36 -0400 Subject: [PATCH 15/79] fix api url --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 46968994edf..d45edeac344 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -75,7 +75,7 @@ jobs: if: steps.detect.outputs.subtrees run: | pr_number=${{ github.event.pull_request.number }} - res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$top=100&api-version=7.1" \ + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&api-version=7.1" \ -H "Content-Type: application/json") if [ $? -ne 0 ]; then From 3eb0006a40c3024abef1820f96112fa24d5c93dd Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 13:01:04 -0400 Subject: [PATCH 16/79] filter repo --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index d45edeac344..d51a5b7cdf5 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -83,7 +83,7 @@ jobs: exit 1 fi - runs=$(echo "$res" | jq -r '.value[] | select(.sourceBranch | contains("refs/pull/'"$pr_number"'/merge")) | .id') + runs=$(echo "$res" | jq -r '.value[] | select((.sourceBranch | contains("refs/pull/'"$pr_number"'/merge")) and (.repository.id == "ROCm/rocm-libraries")) | .id') if [ -z "$runs" ]; then echo "No in-progress runs found for PR #$pr_number" From 64a0786bb4b503c50bc6c6083a0e26da66ce021a Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 13:47:54 -0400 Subject: [PATCH 17/79] more output --- .github/workflows/azure-ci-dispatcher.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index d51a5b7cdf5..2694de21c3e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -86,14 +86,15 @@ jobs: runs=$(echo "$res" | jq -r '.value[] | select((.sourceBranch | contains("refs/pull/'"$pr_number"'/merge")) and (.repository.id == "ROCm/rocm-libraries")) | .id') if [ -z "$runs" ]; then - echo "No in-progress runs found for PR #$pr_number" + echo "No in-progress runs found for ROCm/rocm-libraries PR #$pr_number" exit 0 fi - echo "Found in-progress runs for PR #$pr_number: $runs" + echo "Found in-progress runs for ROCm/rocm-libraries PR #$pr_number: $runs" for run_id in $runs; do echo "Cancelling run ID: $run_id" + echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?api-version=7.1" \ -u ":${{ secrets.AZ_PAT }}" \ -H "Content-Type: application/json" \ From 2a31657cf9f323387d98ce20589360776f707a82 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:27:52 -0400 Subject: [PATCH 18/79] init check report --- .azuredevops/rocrand.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index edabd72327e..e9b9f5b9b84 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -43,3 +43,4 @@ jobs: parameters: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} + - template: templates/report-summary.yml From 928562ed4d2cb3de8a33814a06db12b56cef6816 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:28:25 -0400 Subject: [PATCH 19/79] report template --- .../templates/report-summary-check.yml | 99 +++++++++++++++++++ 1 file changed, 99 insertions(+) create mode 100644 .azuredevops/templates/report-summary-check.yml diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml new file mode 100644 index 00000000000..1fd102d0014 --- /dev/null +++ b/.azuredevops/templates/report-summary-check.yml @@ -0,0 +1,99 @@ +jobs: +- job: report-summary-check + displayName: Report CI status to GitHub PR Summary Check + condition: always() + variables: + - group: assistant-librarian + pool: + vmImage: ubuntu-latest + steps: + - checkout: none + - task: Bash@3 + displayName: Install GitHub CLI + inputs: + targetType: 'inline' + script: | + (type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \ + && sudo mkdir -p -m 755 /etc/apt/keyrings \ + && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + && sudo mkdir -p -m 755 /etc/apt/sources.list.d \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + && sudo apt update \ + && sudo apt install gh -y + - task: Bash@3 + displayName: Report CI status to GitHub PR Summary Check + env: + APP_ID: $(APP_ID) + APP_INSTALLATION_ID: $(APP_INSTALLATION_ID) + APP_PRIVATE_KEY: $(APP_PRIVATE_KEY) + inputs: + targetType: 'inline' + script: | + if [[ ! "$(Build.SourceBranchName)" =~ ^refs/pull/ ]]; then + echo "This is not a PR build. Exiting." + exit 0 + fi + + create_jwt() { + local header=$(echo -n '{"alg":"RS256","typ":"JWT"}' | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') + local payload=$(echo -n "{\"iat\":$(date +%s),\"exp\":$(($(date +%s) + 600)),\"iss\":\"$APP_ID\"}" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') + local unsigned_token="${header}.${payload}" + local signature=$(echo -n "$unsigned_token" | openssl dgst -sha256 -sign <(echo -n "$APP_PRIVATE_KEY") | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') + echo "${unsigned_token}.${signature}" + } + JWT=$(create_jwt) + GH_TOKEN=$(curl -sSX POST \ + -H "Authorization: Bearer $JWT" \ + -H "Accept: application/vnd.github+json" \ + "https://api.github.com/app/installations/$APP_INSTALLATION_ID/access_tokens" | jq -r .token) + + PR_HEAD_SHA=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/branches/$(Build.SourceBranchName)" | jq -r '.commit.sha') + CHECK=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/commits/$PR_HEAD_SHA/check-runs" | jq -r '.check_runs[] | select(.name == "Azure CI Summary")') + CHECK_ID=$(echo "$CHECK" | jq -r '.id') + CHECK_SUMMARY=$(echo "$CHECK" | jq -r '.output.summary') + CHECK_TEXT=$(echo "$CHECK" | jq -r '.output.text') + + if [ -z "$CHECK_ID" ]; then + echo "No Azure CI Summary check found for commit $PR_HEAD_SHA" + exit 0 + fi + + # also update the summary table with the build status + # the summary table is in the format + # | Project | Run ID | Status | + # |--------------|--------|--------| + # where the Run ID is the Azure DevOps build ID + # "| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |${newline}" + # replace the status of the current build in the summary table + + if [[ "$CHECK_SUMMARY" == *"$(Build.BuildId)"* ]]; then + CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/.*$(Build.BuildId)=[^|]*/| $(Build.DefinitionName) | [$(Build.BuildId)](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$(Build.BuildId)) | $(variables['Agent.JobStatus']) |/") + fi + + echo "updated check summary" + echo $CHECK_SUMMARY + + # the check test is in the format + # =;=;... + # where is one of "pending", "success", "failure", "error" + # replace the status of the current build with variables['Agent.JobStatus'] + + if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/.*$(Build.BuildId)=[^;]*/$CURRENT_BUILD_ID=$(variables['Agent.JobStatus'])/") + fi + + echo "updated check text" + echo $CHECK_TEXT + + CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q 'pending' && echo "in_progress" || echo "completed") + + gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ + -X PATCH \ + -f 'name=Azure CI Summary' \ + -f "head_sha=$PR_HEAD_SHA" \ + -f 'status=$CHECK_STATUS' \ + -f "output[title]=Azure CI Summary" \ + -f "output[summary]=$CHECK_SUMMARY" \ + -f "output[text]=$CHECK_TEXT" From 62e5177b81632fdbf5fe3b98199530e88c339b48 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:36:17 -0400 Subject: [PATCH 20/79] debug --- .github/workflows/azure-ci-dispatcher.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 2694de21c3e..56afa23a991 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -144,6 +144,7 @@ jobs: } } }') + echo $response if [ $? -eq 0 ]; then success=true From 5276d4cccc05f8fe63bce4c2c5c0c64d90ecc524 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:37:59 -0400 Subject: [PATCH 21/79] fix template call --- .azuredevops/rocrand.yml | 2 +- .github/workflows/azure-ci-dispatcher.yml | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index e9b9f5b9b84..b7f5c74f9bc 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -43,4 +43,4 @@ jobs: parameters: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} - - template: templates/report-summary.yml + - template: templates/report-summary-check.yml diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 56afa23a991..2694de21c3e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -144,7 +144,6 @@ jobs: } } }') - echo $response if [ $? -eq 0 ]; then success=true From 47c4ca5777fecd9a0b66485cd876bff8b93937d9 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:40:12 -0400 Subject: [PATCH 22/79] fix job name --- .azuredevops/templates/report-summary-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 1fd102d0014..68514a5d002 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -1,5 +1,5 @@ jobs: -- job: report-summary-check +- job: report_summary_check displayName: Report CI status to GitHub PR Summary Check condition: always() variables: From bb0abacb00485cc7991da85722023f38c4a48431 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:49:52 -0400 Subject: [PATCH 23/79] use stages for sequentialness --- .azuredevops/rocrand.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index b7f5c74f9bc..9e6b607c7bf 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -38,9 +38,11 @@ trigger: pr: none -jobs: +stages: +- stage: rocrand - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo parameters: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} +- stage: report_summary_check - template: templates/report-summary-check.yml From 5bd6a8a5d2fea53e049c289e0178bfccaae7ddbd Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:52:55 -0400 Subject: [PATCH 24/79] add stage jobs --- .azuredevops/rocrand.yml | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 9e6b607c7bf..1ade62f69d0 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -40,9 +40,11 @@ pr: none stages: - stage: rocrand - - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo - parameters: - sparseCheckoutDir: projects/rocrand - triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} + - jobs: + - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo + parameters: + sparseCheckoutDir: projects/rocrand + triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} - stage: report_summary_check - - template: templates/report-summary-check.yml + - jobs: + - template: templates/report-summary-check.yml From d3e8482c58218431288f9b65c9c1f4b3f84aa7c6 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:54:15 -0400 Subject: [PATCH 25/79] fix indent --- .azuredevops/rocrand.yml | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 1ade62f69d0..b5c8476a97e 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -40,11 +40,11 @@ pr: none stages: - stage: rocrand - - jobs: - - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo - parameters: - sparseCheckoutDir: projects/rocrand - triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} + jobs: + - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo + parameters: + sparseCheckoutDir: projects/rocrand + triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} - stage: report_summary_check - - jobs: - - template: templates/report-summary-check.yml + jobs: + - template: templates/report-summary-check.yml From f810bb698fea3ac3369e04d27bc2b28f5c5366dd Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 15:59:12 -0400 Subject: [PATCH 26/79] always report check --- .azuredevops/rocrand.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index b5c8476a97e..f63fe63d713 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -46,5 +46,6 @@ stages: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} - stage: report_summary_check + condition: always() jobs: - template: templates/report-summary-check.yml From ce46fdea098414fbcf86cc9558d839c1804181ab Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:05:22 -0400 Subject: [PATCH 27/79] debug --- .azuredevops/templates/report-summary-check.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 68514a5d002..d9a231e56ae 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -31,6 +31,7 @@ jobs: inputs: targetType: 'inline' script: | + echo $(Build.SourceBranchName) if [[ ! "$(Build.SourceBranchName)" =~ ^refs/pull/ ]]; then echo "This is not a PR build. Exiting." exit 0 From 63ea83351bf47316de0cfafcc94fe1c8b99c4982 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:08:50 -0400 Subject: [PATCH 28/79] change sourcebranchname to sourcebranch --- .azuredevops/templates/report-summary-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index d9a231e56ae..1851b909420 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -31,8 +31,8 @@ jobs: inputs: targetType: 'inline' script: | - echo $(Build.SourceBranchName) - if [[ ! "$(Build.SourceBranchName)" =~ ^refs/pull/ ]]; then + echo $(Build.SourceBranch) + if [[ ! "$(Build.SourceBranch)" =~ ^refs/pull/ ]]; then echo "This is not a PR build. Exiting." exit 0 fi From d7326940ebb50188972937e48a99513845063cbd Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:14:21 -0400 Subject: [PATCH 29/79] key file --- .azuredevops/templates/report-summary-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 1851b909420..413bd27bee7 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -37,11 +37,12 @@ jobs: exit 0 fi + echo $APP_PRIVATE_KEY | /tmp/app_private_key.pem create_jwt() { local header=$(echo -n '{"alg":"RS256","typ":"JWT"}' | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') local payload=$(echo -n "{\"iat\":$(date +%s),\"exp\":$(($(date +%s) + 600)),\"iss\":\"$APP_ID\"}" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') local unsigned_token="${header}.${payload}" - local signature=$(echo -n "$unsigned_token" | openssl dgst -sha256 -sign <(echo -n "$APP_PRIVATE_KEY") | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') + local signature=$(echo -n "$unsigned_token" | openssl dgst -sha256 -sign "/tmp/app_private_key.pem" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') echo "${unsigned_token}.${signature}" } JWT=$(create_jwt) From e0b9f981d89843274f1ddc9154d5a58d44cb2743 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:19:23 -0400 Subject: [PATCH 30/79] key file again --- .azuredevops/templates/report-summary-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 413bd27bee7..d2d07b8056f 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -37,12 +37,12 @@ jobs: exit 0 fi - echo $APP_PRIVATE_KEY | /tmp/app_private_key.pem + echo $APP_PRIVATE_KEY > app_private_key.pem create_jwt() { local header=$(echo -n '{"alg":"RS256","typ":"JWT"}' | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') local payload=$(echo -n "{\"iat\":$(date +%s),\"exp\":$(($(date +%s) + 600)),\"iss\":\"$APP_ID\"}" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') local unsigned_token="${header}.${payload}" - local signature=$(echo -n "$unsigned_token" | openssl dgst -sha256 -sign "/tmp/app_private_key.pem" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') + local signature=$(echo -n "$unsigned_token" | openssl dgst -sha256 -sign "app_private_key.pem" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') echo "${unsigned_token}.${signature}" } JWT=$(create_jwt) From 66693d7894023dc2d558b370d9761a7ca81fc7c4 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:53:02 -0400 Subject: [PATCH 31/79] more key file --- .azuredevops/templates/report-summary-check.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index d2d07b8056f..64122c70d79 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -37,7 +37,9 @@ jobs: exit 0 fi - echo $APP_PRIVATE_KEY > app_private_key.pem + newline=$'\n' + echo $(echo $APP_PRIVATE_KEY | sed 's/\\n/${newline}/g') > app_private_key.pem + chmod 600 app_private_key.pem create_jwt() { local header=$(echo -n '{"alg":"RS256","typ":"JWT"}' | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') local payload=$(echo -n "{\"iat\":$(date +%s),\"exp\":$(($(date +%s) + 600)),\"iss\":\"$APP_ID\"}" | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') From 38e937cb1ea8365b1a9f3f23b9e2e763633e3d65 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 16:59:11 -0400 Subject: [PATCH 32/79] try base64 --- .azuredevops/templates/report-summary-check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 64122c70d79..a7c1df25eb3 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -37,8 +37,7 @@ jobs: exit 0 fi - newline=$'\n' - echo $(echo $APP_PRIVATE_KEY | sed 's/\\n/${newline}/g') > app_private_key.pem + echo "$APP_PRIVATE_KEY" | base64 -d > app_private_key.pem chmod 600 app_private_key.pem create_jwt() { local header=$(echo -n '{"alg":"RS256","typ":"JWT"}' | openssl base64 -e | tr -d '=' | tr '/+' '_-' | tr -d '\n') From 25af58d12f6dac13c900e9d1953784c0804f3f20 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 17:14:13 -0400 Subject: [PATCH 33/79] use PR number --- .azuredevops/templates/report-summary-check.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index a7c1df25eb3..9441a815d7b 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -52,7 +52,8 @@ jobs: -H "Accept: application/vnd.github+json" \ "https://api.github.com/app/installations/$APP_INSTALLATION_ID/access_tokens" | jq -r .token) - PR_HEAD_SHA=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/branches/$(Build.SourceBranchName)" | jq -r '.commit.sha') + PR_NUMBER=$(echo "$(Build.SourceBranch)" | sed 's|refs/pull/\([0-9]*\)/.*|\1|') + PR_HEAD_SHA=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/pulls/$PR_NUMBER" | jq -r '.head.sha') CHECK=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/commits/$PR_HEAD_SHA/check-runs" | jq -r '.check_runs[] | select(.name == "Azure CI Summary")') CHECK_ID=$(echo "$CHECK" | jq -r '.id') CHECK_SUMMARY=$(echo "$CHECK" | jq -r '.output.summary') From 35018124210c08b143d5caed6022403eac352d0b Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 17:19:02 -0400 Subject: [PATCH 34/79] job status, gh auth --- .azuredevops/templates/report-summary-check.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 9441a815d7b..3c472f43e1d 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -37,6 +37,7 @@ jobs: exit 0 fi + # APP_PRIVATE_KEY is generated with `base64 app_private_key.pem | tr -d '\n'` echo "$APP_PRIVATE_KEY" | base64 -d > app_private_key.pem chmod 600 app_private_key.pem create_jwt() { @@ -47,7 +48,7 @@ jobs: echo "${unsigned_token}.${signature}" } JWT=$(create_jwt) - GH_TOKEN=$(curl -sSX POST \ + export GH_TOKEN=$(curl -sSX POST \ -H "Authorization: Bearer $JWT" \ -H "Accept: application/vnd.github+json" \ "https://api.github.com/app/installations/$APP_INSTALLATION_ID/access_tokens" | jq -r .token) @@ -73,7 +74,7 @@ jobs: # replace the status of the current build in the summary table if [[ "$CHECK_SUMMARY" == *"$(Build.BuildId)"* ]]; then - CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/.*$(Build.BuildId)=[^|]*/| $(Build.DefinitionName) | [$(Build.BuildId)](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$(Build.BuildId)) | $(variables['Agent.JobStatus']) |/") + CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/.*$(Build.BuildId)=[^|]*/| $(Build.DefinitionName) | [$(Build.BuildId)](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$(Build.BuildId)) | $(Agent.JobStatus) |/") fi echo "updated check summary" @@ -85,7 +86,7 @@ jobs: # replace the status of the current build with variables['Agent.JobStatus'] if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then - CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/.*$(Build.BuildId)=[^;]*/$CURRENT_BUILD_ID=$(variables['Agent.JobStatus'])/") + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/.*$(Build.BuildId)=[^;]*/$CURRENT_BUILD_ID=$(Agent.JobStatus)/") fi echo "updated check text" From 0d46f000f1f642d689cfbf77ca2f37d649fa1219 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 17:36:01 -0400 Subject: [PATCH 35/79] fix check summary sed --- .azuredevops/templates/report-summary-check.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 3c472f43e1d..68bf1d5c914 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -74,7 +74,7 @@ jobs: # replace the status of the current build in the summary table if [[ "$CHECK_SUMMARY" == *"$(Build.BuildId)"* ]]; then - CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/.*$(Build.BuildId)=[^|]*/| $(Build.DefinitionName) | [$(Build.BuildId)](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$(Build.BuildId)) | $(Agent.JobStatus) |/") + CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | $(Agent.JobStatus) |/") fi echo "updated check summary" @@ -92,13 +92,13 @@ jobs: echo "updated check text" echo $CHECK_TEXT - CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q 'pending' && echo "in_progress" || echo "completed") + CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ -X PATCH \ - -f 'name=Azure CI Summary' \ + -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ - -f 'status=$CHECK_STATUS' \ + -f "status=$CHECK_STATUS" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ -f "output[text]=$CHECK_TEXT" From a34fe400f9943ae2c52236b827f7dc249526a4fb Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Wed, 9 Jul 2025 17:46:56 -0400 Subject: [PATCH 36/79] map azure to github status --- .../templates/report-summary-check.yml | 56 ++++++++++++++++--- 1 file changed, 47 insertions(+), 9 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 68bf1d5c914..11b1c36a8d9 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -86,19 +86,57 @@ jobs: # replace the status of the current build with variables['Agent.JobStatus'] if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then - CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/.*$(Build.BuildId)=[^;]*/$CURRENT_BUILD_ID=$(Agent.JobStatus)/") + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/;$(Build.BuildId)=[^;]*;/;$CURRENT_BUILD_ID=$(Agent.JobStatus);/") fi echo "updated check text" echo $CHECK_TEXT + map_status() { + local azure_status="$1" + local gh_conclusion + case "$azure_status" in + "Canceled") + gh_conclusion="cancelled" + ;; + "Failed") + gh_conclusion="failure" + ;; + "Succeeded") + gh_conclusion="success" + ;; + "SucceededWithIssues") + gh_conclusion="success" + ;; + "Skipped") + gh_conclusion="skipped" + ;; + *) + gh_conclusion="neutral" # Default mapping for any unknown status + ;; + esac + echo "$gh_conclusion" + } + CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") - gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ - -X PATCH \ - -f "name=Azure CI Summary" \ - -f "head_sha=$PR_HEAD_SHA" \ - -f "status=$CHECK_STATUS" \ - -f "output[title]=Azure CI Summary" \ - -f "output[summary]=$CHECK_SUMMARY" \ - -f "output[text]=$CHECK_TEXT" + if [[ "$CHECK_STATUS" == "completed" ]]; then + CHECK_CONCLUSION=$(map_status "$(Agent.JobStatus)") + gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ + -X PATCH \ + -f "name=Azure CI Summary" \ + -f "head_sha=$PR_HEAD_SHA" \ + -f "status=$CHECK_STATUS" \ + -f "conclusion=$CHECK_CONCLUSION" \ + -f "output[title]=Azure CI Summary" \ + -f "output[summary]=$CHECK_SUMMARY" \ + -f "output[text]=$CHECK_TEXT" + else + gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ + -X PATCH \ + -f "name=Azure CI Summary" \ + -f "head_sha=$PR_HEAD_SHA" \ + -f "output[title]=Azure CI Summary" \ + -f "output[summary]=$CHECK_SUMMARY" \ + -f "output[text]=$CHECK_TEXT" + fi From 645728904a00ce61ce28a84d3acacd41aefb5d4a Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 10:24:03 -0400 Subject: [PATCH 37/79] fix semicolon --- .azuredevops/templates/report-summary-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 11b1c36a8d9..e41dd2ac3a5 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -86,7 +86,7 @@ jobs: # replace the status of the current build with variables['Agent.JobStatus'] if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then - CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/;$(Build.BuildId)=[^;]*;/;$CURRENT_BUILD_ID=$(Agent.JobStatus);/") + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/;$CURRENT_BUILD_ID=$(Agent.JobStatus);/") fi echo "updated check text" From 2f03a0230e19091481342f9fc57abe479847fb0f Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 10:33:02 -0400 Subject: [PATCH 38/79] conditionally set check conclusioon --- .../templates/report-summary-check.yml | 55 +++++++++---------- 1 file changed, 26 insertions(+), 29 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index e41dd2ac3a5..d7665d90f5e 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -1,15 +1,38 @@ jobs: - job: report_summary_check displayName: Report CI status to GitHub PR Summary Check - condition: always() variables: - group: assistant-librarian pool: vmImage: ubuntu-latest steps: - checkout: none + + - task: Bash@3 + displayName: Run is successful + condition: succeeded() + inputs: + targetType: 'inline' + script: | + echo "##vso[task.setvariable variable=CHECK_CONCLUSION]success" + - task: Bash@3 + displayName: Run is failed + condition: failed() + inputs: + targetType: 'inline' + script: | + echo "##vso[task.setvariable variable=CHECK_CONCLUSION]failure" + - task: Bash@3 + displayName: Run is cancelled + condition: cancelled() + inputs: + targetType: 'inline' + script: | + echo "##vso[task.setvariable variable=CHECK_CONCLUSION]cancelled" + - task: Bash@3 displayName: Install GitHub CLI + condition: always() inputs: targetType: 'inline' script: | @@ -24,6 +47,7 @@ jobs: && sudo apt install gh -y - task: Bash@3 displayName: Report CI status to GitHub PR Summary Check + condition: always() env: APP_ID: $(APP_ID) APP_INSTALLATION_ID: $(APP_INSTALLATION_ID) @@ -92,42 +116,15 @@ jobs: echo "updated check text" echo $CHECK_TEXT - map_status() { - local azure_status="$1" - local gh_conclusion - case "$azure_status" in - "Canceled") - gh_conclusion="cancelled" - ;; - "Failed") - gh_conclusion="failure" - ;; - "Succeeded") - gh_conclusion="success" - ;; - "SucceededWithIssues") - gh_conclusion="success" - ;; - "Skipped") - gh_conclusion="skipped" - ;; - *) - gh_conclusion="neutral" # Default mapping for any unknown status - ;; - esac - echo "$gh_conclusion" - } - CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") if [[ "$CHECK_STATUS" == "completed" ]]; then - CHECK_CONCLUSION=$(map_status "$(Agent.JobStatus)") gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ -X PATCH \ -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ -f "status=$CHECK_STATUS" \ - -f "conclusion=$CHECK_CONCLUSION" \ + -f "conclusion=$(CHECK_CONCLUSION)" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ -f "output[text]=$CHECK_TEXT" From f5f2c90714cb2e924c6a171b6f30a85a26d4d2f4 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 10:37:26 -0400 Subject: [PATCH 39/79] fix semicolons again --- .azuredevops/templates/report-summary-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index d7665d90f5e..45ef5833a00 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -110,7 +110,7 @@ jobs: # replace the status of the current build with variables['Agent.JobStatus'] if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then - CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/;$CURRENT_BUILD_ID=$(Agent.JobStatus);/") + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=$(Agent.JobStatus);/") fi echo "updated check text" From 345d57b2a02fd0aa6fcee201ae743c5ff3a28f13 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 10:47:01 -0400 Subject: [PATCH 40/79] canceled has one l apparently --- .azuredevops/templates/report-summary-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 45ef5833a00..bd13bf9f0c8 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -24,7 +24,7 @@ jobs: echo "##vso[task.setvariable variable=CHECK_CONCLUSION]failure" - task: Bash@3 displayName: Run is cancelled - condition: cancelled() + condition: canceled() inputs: targetType: 'inline' script: | From 64dca9aab9fcca9ee6b69cb06fdd22de5ee5fae5 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 10:53:27 -0400 Subject: [PATCH 41/79] stage conditional --- .azuredevops/rocrand.yml | 12 ++++- .../templates/report-summary-check.yml | 53 +++++++++++-------- 2 files changed, 41 insertions(+), 24 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index f63fe63d713..4aa6d361117 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -45,7 +45,15 @@ stages: parameters: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} -- stage: report_summary_check - condition: always() +- stage: report_summary_check_successful + condition: succeeded() + jobs: + - template: templates/report-summary-check.yml +- stage: report_summary_check_failed + condition: failed() + jobs: + - template: templates/report-summary-check.yml +- stage: report_summary_check_canceled + condition: canceled() jobs: - template: templates/report-summary-check.yml diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index bd13bf9f0c8..cfcd0d1515c 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -1,3 +1,12 @@ +parameters: +- name: checkConclusion + type: string + default: success + values: + - success + - failure + - cancelled + jobs: - job: report_summary_check displayName: Report CI status to GitHub PR Summary Check @@ -8,27 +17,27 @@ jobs: steps: - checkout: none - - task: Bash@3 - displayName: Run is successful - condition: succeeded() - inputs: - targetType: 'inline' - script: | - echo "##vso[task.setvariable variable=CHECK_CONCLUSION]success" - - task: Bash@3 - displayName: Run is failed - condition: failed() - inputs: - targetType: 'inline' - script: | - echo "##vso[task.setvariable variable=CHECK_CONCLUSION]failure" - - task: Bash@3 - displayName: Run is cancelled - condition: canceled() - inputs: - targetType: 'inline' - script: | - echo "##vso[task.setvariable variable=CHECK_CONCLUSION]cancelled" + # - task: Bash@3 + # displayName: Run is successful + # condition: succeeded() + # inputs: + # targetType: 'inline' + # script: | + # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]success" + # - task: Bash@3 + # displayName: Run is failed + # condition: failed() + # inputs: + # targetType: 'inline' + # script: | + # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]failure" + # - task: Bash@3 + # displayName: Run is cancelled + # condition: canceled() + # inputs: + # targetType: 'inline' + # script: | + # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]cancelled" - task: Bash@3 displayName: Install GitHub CLI @@ -124,7 +133,7 @@ jobs: -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ -f "status=$CHECK_STATUS" \ - -f "conclusion=$(CHECK_CONCLUSION)" \ + -f "conclusion=${{ parameters.checkConclusion }}" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ -f "output[text]=$CHECK_TEXT" From d25a20975d3743cd9fbd4dca2fbeab7f9439f832 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 11:05:34 -0400 Subject: [PATCH 42/79] use checkconclusion param --- .azuredevops/rocrand.yml | 10 ++++++++-- .azuredevops/templates/report-summary-check.yml | 4 ++-- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 4aa6d361117..59a8ec70b73 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -49,11 +49,17 @@ stages: condition: succeeded() jobs: - template: templates/report-summary-check.yml + parameters: + checkConclusion: success - stage: report_summary_check_failed condition: failed() jobs: - template: templates/report-summary-check.yml -- stage: report_summary_check_canceled - condition: canceled() + parameters: + checkConclusion: failure +- stage: report_summary_check_cancelled + condition: canceled() # note: only 1 L in canceled() jobs: - template: templates/report-summary-check.yml + parameters: + checkConclusion: cancelled diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index cfcd0d1515c..23e87f73796 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -107,7 +107,7 @@ jobs: # replace the status of the current build in the summary table if [[ "$CHECK_SUMMARY" == *"$(Build.BuildId)"* ]]; then - CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | $(Agent.JobStatus) |/") + CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | ${{ parameters.checkConclusion }} |/") fi echo "updated check summary" @@ -119,7 +119,7 @@ jobs: # replace the status of the current build with variables['Agent.JobStatus'] if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then - CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=$(Agent.JobStatus);/") + CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=${{ parameters.checkConclusion }};/") fi echo "updated check text" From 8fc939fbccd473f904e668006fe2e38840a154fc Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 11:08:52 -0400 Subject: [PATCH 43/79] test rocrand --- .azuredevops/rocrand.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 59a8ec70b73..259344d137d 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -44,7 +44,7 @@ stages: - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo parameters: sparseCheckoutDir: projects/rocrand - triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} + triggerDownstreamJobs: false # todo: revert - stage: report_summary_check_successful condition: succeeded() jobs: From 528ff8a9bcd18f443adb71bef1f1d8dc5beb9af6 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 14:32:03 -0400 Subject: [PATCH 44/79] rerun previous failed --- .azuredevops/rocrand.yml | 6 +-- .../templates/report-summary-check.yml | 50 ++----------------- .github/workflows/azure-ci-dispatcher.yml | 50 +++++++++++++++++-- 3 files changed, 52 insertions(+), 54 deletions(-) diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 259344d137d..fb92280a324 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -45,19 +45,19 @@ stages: parameters: sparseCheckoutDir: projects/rocrand triggerDownstreamJobs: false # todo: revert -- stage: report_summary_check_successful +- stage: report_successful condition: succeeded() jobs: - template: templates/report-summary-check.yml parameters: checkConclusion: success -- stage: report_summary_check_failed +- stage: report_failed condition: failed() jobs: - template: templates/report-summary-check.yml parameters: checkConclusion: failure -- stage: report_summary_check_cancelled +- stage: report_cancelled condition: canceled() # note: only 1 L in canceled() jobs: - template: templates/report-summary-check.yml diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index 23e87f73796..fb1aff78f0d 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -9,36 +9,13 @@ parameters: jobs: - job: report_summary_check - displayName: Report CI status to GitHub PR Summary Check + displayName: 'Report check status: ${{ parameters.checkConclusion }}' variables: - group: assistant-librarian pool: vmImage: ubuntu-latest steps: - checkout: none - - # - task: Bash@3 - # displayName: Run is successful - # condition: succeeded() - # inputs: - # targetType: 'inline' - # script: | - # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]success" - # - task: Bash@3 - # displayName: Run is failed - # condition: failed() - # inputs: - # targetType: 'inline' - # script: | - # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]failure" - # - task: Bash@3 - # displayName: Run is cancelled - # condition: canceled() - # inputs: - # targetType: 'inline' - # script: | - # echo "##vso[task.setvariable variable=CHECK_CONCLUSION]cancelled" - - task: Bash@3 displayName: Install GitHub CLI condition: always() @@ -53,7 +30,7 @@ jobs: && sudo mkdir -p -m 755 /etc/apt/sources.list.d \ && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ && sudo apt update \ - && sudo apt install gh -y + && sudo apt install gh jq -y - task: Bash@3 displayName: Report CI status to GitHub PR Summary Check condition: always() @@ -93,38 +70,17 @@ jobs: CHECK_SUMMARY=$(echo "$CHECK" | jq -r '.output.summary') CHECK_TEXT=$(echo "$CHECK" | jq -r '.output.text') - if [ -z "$CHECK_ID" ]; then + if [[ -z "$CHECK_ID" ]]; then echo "No Azure CI Summary check found for commit $PR_HEAD_SHA" exit 0 fi - - # also update the summary table with the build status - # the summary table is in the format - # | Project | Run ID | Status | - # |--------------|--------|--------| - # where the Run ID is the Azure DevOps build ID - # "| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |${newline}" - # replace the status of the current build in the summary table - if [[ "$CHECK_SUMMARY" == *"$(Build.BuildId)"* ]]; then CHECK_SUMMARY=$(echo "$CHECK_SUMMARY" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | ${{ parameters.checkConclusion }} |/") fi - - echo "updated check summary" - echo $CHECK_SUMMARY - - # the check test is in the format - # =;=;... - # where is one of "pending", "success", "failure", "error" - # replace the status of the current build with variables['Agent.JobStatus'] - if [[ "$CHECK_TEXT" == *"$(Build.BuildId)="* ]]; then CHECK_TEXT=$(echo "$CHECK_TEXT" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=${{ parameters.checkConclusion }};/") fi - echo "updated check text" - echo $CHECK_TEXT - CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") if [[ "$CHECK_STATUS" == "completed" ]]; then diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 2694de21c3e..2fbda8a3ff6 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -12,7 +12,7 @@ # Requires an Azure Personal Access Token with permissions to manage builds. # The token should be stored in the repository secrets as `AZ_PAT`. -name: Dispatch Azure CI +name: Trigger Azure CI on: pull_request_target: @@ -34,7 +34,8 @@ concurrency: jobs: dispatch-azure-ci: - name: Dispatch Azure CI + name: Trigger Azure CI + if: github.repository == 'ROCm/rocm-libraries' runs-on: ubuntu-latest steps: - name: Generate a token @@ -71,7 +72,8 @@ jobs: --config ".github/repos-config.json" \ --require-auto-push - - name: Cancel previous runs + - name: Cancel in-progress runs + id: cancel-in-progress if: steps.detect.outputs.subtrees run: | pr_number=${{ github.event.pull_request.number }} @@ -87,10 +89,12 @@ jobs: if [ -z "$runs" ]; then echo "No in-progress runs found for ROCm/rocm-libraries PR #$pr_number" + echo "status=false" >> $GITHUB_OUTPUT exit 0 fi echo "Found in-progress runs for ROCm/rocm-libraries PR #$pr_number: $runs" + echo "status=true" >> $GITHUB_OUTPUT for run_id in $runs; do echo "Cancelling run ID: $run_id" @@ -107,9 +111,47 @@ jobs: fi done + - name: Rerun previous failed runs for current PR SHA + id: rerun-failed + if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' + run: | + pr_number=${{ github.event.pull_request.number }} + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=failed&sourceBranch=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" \ + -H "Content-Type: application/json") + + if [ $? -ne 0 ]; then + echo "Failed to fetch Azure runs" + exit 1 + fi + + runs=$(echo "$res" | jq -r '.value[] | select((.sourceBranch | contains("refs/pull/'"$pr_number"'/merge") and (.sourceVersion | contains("${{ github.event.pull_request.head.sha }}"))) | .id') + + if [ -z "$runs" ]; then + echo "No failed runs found for ROCm/rocm-libraries PR #$pr_number" + echo "status=false" >> $GITHUB_OUTPUT + exit 0 + fi + + echo "Found failed runs for ROCm/rocm-libraries PR #$pr_number: $runs" + echo "status=true" >> $GITHUB_OUTPUT + + for run_id in $runs; do + echo "Rerunning failed run ID: $run_id" + echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" + response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id/retry=true?api-version=7.1" \ + -u ":${{ secrets.AZ_PAT }}" \ + -H "Content-Type: application/json") + + if [ $? -ne 0 ]; then + echo "Failed to rerun run ID: $run_id" + else + echo "Rerun requested for run ID: $run_id" + fi + done + - name: Dispatch Azure CI runs id: dispatch - if: steps.detect.outputs.subtrees + if: steps.detect.outputs.subtrees && steps.rerun-failed.outputs.status == 'false' env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | From c96e3f258193a58f4b1d4ab2b28f4468becae4c0 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 14:52:59 -0400 Subject: [PATCH 45/79] improve rerun --- .github/workflows/azure-ci-dispatcher.yml | 32 +++++++++++------------ 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 2fbda8a3ff6..c3abf0db74f 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -72,20 +72,17 @@ jobs: --config ".github/repos-config.json" \ --require-auto-push - - name: Cancel in-progress runs + - name: Cancel in-progress runs for current PR id: cancel-in-progress if: steps.detect.outputs.subtrees run: | pr_number=${{ github.event.pull_request.number }} - res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&api-version=7.1" \ - -H "Content-Type: application/json") + pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - if [ $? -ne 0 ]; then - echo "Failed to fetch Azure runs" - exit 1 - fi + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$pr_filter_query" \ + -H "Content-Type: application/json") - runs=$(echo "$res" | jq -r '.value[] | select((.sourceBranch | contains("refs/pull/'"$pr_number"'/merge")) and (.repository.id == "ROCm/rocm-libraries")) | .id') + runs=$(echo "$res" | jq -r '.value[] | .id') if [ -z "$runs" ]; then echo "No in-progress runs found for ROCm/rocm-libraries PR #$pr_number" @@ -111,20 +108,21 @@ jobs: fi done - - name: Rerun previous failed runs for current PR SHA + - name: Rerun previous failed runs for current PR HEAD id: rerun-failed if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | pr_number=${{ github.event.pull_request.number }} - res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=failed&sourceBranch=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" \ - -H "Content-Type: application/json") + pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - if [ $? -ne 0 ]; then - echo "Failed to fetch Azure runs" - exit 1 - fi + failed_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=failed&$pr_filter_query" \ + -H "Content-Type: application/json") + cancelled_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=canceled&$pr_filter_query" \ + -H "Content-Type: application/json") - runs=$(echo "$res" | jq -r '.value[] | select((.sourceBranch | contains("refs/pull/'"$pr_number"'/merge") and (.sourceVersion | contains("${{ github.event.pull_request.head.sha }}"))) | .id') + failed_runs=$(echo "$failed_res" | jq -r '.value[] | select(.sourceVersion | contains("${{ github.event.pull_request.head.sha }}")) | .id') + cancelled_runs=$(echo "$cancelled_res" | jq -r '.value[] | select(.sourceVersion | contains("${{ github.event.pull_request.head.sha }}")) | .id') + runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) if [ -z "$runs" ]; then echo "No failed runs found for ROCm/rocm-libraries PR #$pr_number" @@ -149,7 +147,7 @@ jobs: fi done - - name: Dispatch Azure CI runs + - name: Trigger Azure CI runs id: dispatch if: steps.detect.outputs.subtrees && steps.rerun-failed.outputs.status == 'false' env: From 9e8f6dea5d0face9396aea568e8763b81a3b0484 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 15:06:02 -0400 Subject: [PATCH 46/79] fix new run logic --- .github/workflows/azure-ci-dispatcher.yml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index c3abf0db74f..24721ed261a 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -108,7 +108,7 @@ jobs: fi done - - name: Rerun previous failed runs for current PR HEAD + - name: Rerun previous failed/cancelled runs for current PR HEAD id: rerun-failed if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | @@ -125,12 +125,12 @@ jobs: runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) if [ -z "$runs" ]; then - echo "No failed runs found for ROCm/rocm-libraries PR #$pr_number" + echo "No failed/cancelled runs found for ROCm/rocm-libraries PR #$pr_number" echo "status=false" >> $GITHUB_OUTPUT exit 0 fi - echo "Found failed runs for ROCm/rocm-libraries PR #$pr_number: $runs" + echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number: $runs" echo "status=true" >> $GITHUB_OUTPUT for run_id in $runs; do @@ -147,9 +147,9 @@ jobs: fi done - - name: Trigger Azure CI runs + - name: Start new Azure CI runs id: dispatch - if: steps.detect.outputs.subtrees && steps.rerun-failed.outputs.status == 'false' + if: steps.detect.outputs.subtrees && (steps.cancel-in-progress.outputs.status == 'true' || steps.rerun-failed.outputs.status == 'false') env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | From 15b6504f5faccfe08168ad62454a5d429314e357 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 15:13:16 -0400 Subject: [PATCH 47/79] cancel notstarted jobs as well --- .github/workflows/azure-ci-dispatcher.yml | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 24721ed261a..9783ca8be7c 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -79,10 +79,14 @@ jobs: pr_number=${{ github.event.pull_request.number }} pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$pr_filter_query" \ + inprogress_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$pr_filter_query" \ + -H "Content-Type: application/json") + notstarted_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=notStarted&$pr_filter_query" \ -H "Content-Type: application/json") - runs=$(echo "$res" | jq -r '.value[] | .id') + inprogress_runs=$(echo "$inprogress_res" | jq -r '.value[] | .id') + notstarted_runs=$(echo "$notstarted_res" | jq -r '.value[] | .id') + runs=$(echo -e "$inprogress_runs\n$notstarted_runs" | sort -u) if [ -z "$runs" ]; then echo "No in-progress runs found for ROCm/rocm-libraries PR #$pr_number" @@ -214,8 +218,6 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT - echo "Outputted run IDs: ${run_ids[*]}" - echo "Outputted project names: ${project_names[*]}" - name: Create summary check if: steps.dispatch.outputs.run_ids && steps.dispatch.outputs.project_names @@ -238,13 +240,13 @@ jobs: text+="${run_ids[i]}=pending;" done - echo $summary - echo $text - - gh api repos/ROCm/rocm-libraries/check-runs \ + gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ -f 'name=Azure CI Summary' \ -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ -f 'status=in_progress' \ -f 'output[title]=Azure CI Summary' \ -f "output[summary]=$summary" \ - -f "output[text]=$text" + -f "output[text]=$text") + + echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" + echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" From 7cd6578048b3f87c117e2063e8be8ef5036cbcd2 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 15:41:45 -0400 Subject: [PATCH 48/79] get pr merge commit through gh api --- .azuredevops/templates/report-summary-check.yml | 11 +++++++---- .github/workflows/azure-ci-dispatcher.yml | 13 +++++++------ 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index fb1aff78f0d..e7605ea3250 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -84,7 +84,7 @@ jobs: CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") if [[ "$CHECK_STATUS" == "completed" ]]; then - gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ + gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ -X PATCH \ -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ @@ -92,13 +92,16 @@ jobs: -f "conclusion=${{ parameters.checkConclusion }}" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ - -f "output[text]=$CHECK_TEXT" + -f "output[text]=$CHECK_TEXT") else - gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ + gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ -X PATCH \ -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ - -f "output[text]=$CHECK_TEXT" + -f "output[text]=$CHECK_TEXT") fi + + echo "Reported status '${{ parameters.checkConclusion }}' to summary check: $(echo "$gh_output" | jq -r '.id')" + echo "Summary check URL: $(echo "$gh_output" | jq -r '.html_url')" diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 9783ca8be7c..bc38d181252 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -72,7 +72,7 @@ jobs: --config ".github/repos-config.json" \ --require-auto-push - - name: Cancel in-progress runs for current PR + - name: Cancel in-progress/not-started runs for current PR id: cancel-in-progress if: steps.detect.outputs.subtrees run: | @@ -89,12 +89,12 @@ jobs: runs=$(echo -e "$inprogress_runs\n$notstarted_runs" | sort -u) if [ -z "$runs" ]; then - echo "No in-progress runs found for ROCm/rocm-libraries PR #$pr_number" + echo "No in-progress/not-started runs found for ROCm/rocm-libraries PR #$pr_number" echo "status=false" >> $GITHUB_OUTPUT exit 0 fi - echo "Found in-progress runs for ROCm/rocm-libraries PR #$pr_number: $runs" + echo "Found in-progress/not-started runs for ROCm/rocm-libraries PR #$pr_number: $runs" echo "status=true" >> $GITHUB_OUTPUT for run_id in $runs; do @@ -112,20 +112,21 @@ jobs: fi done - - name: Rerun previous failed/cancelled runs for current PR HEAD + - name: Rerun previous failed/cancelled runs for current PR merge commit id: rerun-failed if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | pr_number=${{ github.event.pull_request.number }} pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" + pr_merge_sha=$(curl -sSX GET "https://api.github.com/repos/ROCm/rocm-libraries/git/ref/pull/${pr_number}/merge" | jq -r '.object.sha') failed_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=failed&$pr_filter_query" \ -H "Content-Type: application/json") cancelled_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=canceled&$pr_filter_query" \ -H "Content-Type: application/json") - failed_runs=$(echo "$failed_res" | jq -r '.value[] | select(.sourceVersion | contains("${{ github.event.pull_request.head.sha }}")) | .id') - cancelled_runs=$(echo "$cancelled_res" | jq -r '.value[] | select(.sourceVersion | contains("${{ github.event.pull_request.head.sha }}")) | .id') + failed_runs=$(echo "$failed_res" | jq -r '.value[] | select(.sourceVersion | contains("$pr_merge_sha")) | .id') + cancelled_runs=$(echo "$cancelled_res" | jq -r '.value[] | select(.sourceVersion | contains("$pr_merge_sha")) | .id') runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) if [ -z "$runs" ]; then From 03b84976273285cef4500f24a41d3990d6d967e8 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 15:44:43 -0400 Subject: [PATCH 49/79] rm print --- .azuredevops/templates/report-summary-check.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index e7605ea3250..a7efbcab5bc 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -41,7 +41,6 @@ jobs: inputs: targetType: 'inline' script: | - echo $(Build.SourceBranch) if [[ ! "$(Build.SourceBranch)" =~ ^refs/pull/ ]]; then echo "This is not a PR build. Exiting." exit 0 From 2086c127b1ffe8836776338fbbfd815fde47716c Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 16:04:55 -0400 Subject: [PATCH 50/79] properly quote jq --- .github/workflows/azure-ci-dispatcher.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index bc38d181252..06d0f85996c 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -125,8 +125,8 @@ jobs: cancelled_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=canceled&$pr_filter_query" \ -H "Content-Type: application/json") - failed_runs=$(echo "$failed_res" | jq -r '.value[] | select(.sourceVersion | contains("$pr_merge_sha")) | .id') - cancelled_runs=$(echo "$cancelled_res" | jq -r '.value[] | select(.sourceVersion | contains("$pr_merge_sha")) | .id') + failed_runs=$(echo "$failed_res" | jq -r ".value[] | select(.sourceVersion | contains(\"$pr_merge_sha\")) | .id") + cancelled_runs=$(echo "$cancelled_res" | jq -r ".value[] | select(.sourceVersion | contains(\"$pr_merge_sha\")) | .id") runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) if [ -z "$runs" ]; then From af187ee47fd3a7af74d9ab71fe5bc2552edec327 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 16:10:47 -0400 Subject: [PATCH 51/79] fix retry api endpoint --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 06d0f85996c..fb8c4927130 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -141,7 +141,7 @@ jobs: for run_id in $runs; do echo "Rerunning failed run ID: $run_id" echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" - response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id/retry=true?api-version=7.1" \ + response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?retry=true&api-version=7.1" \ -u ":${{ secrets.AZ_PAT }}" \ -H "Content-Type: application/json") From f20ef1b5ce4aaa4554bea04bb2c33b4e4089e4fd Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 16:32:12 -0400 Subject: [PATCH 52/79] update existing summary check for rerun jobs --- .github/workflows/azure-ci-dispatcher.yml | 45 ++++++++++++++++++++--- 1 file changed, 40 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index fb8c4927130..17a051c3c09 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -130,12 +130,12 @@ jobs: runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) if [ -z "$runs" ]; then - echo "No failed/cancelled runs found for ROCm/rocm-libraries PR #$pr_number" + echo "No failed/cancelled runs found for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha" echo "status=false" >> $GITHUB_OUTPUT exit 0 fi - echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number: $runs" + echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha: $runs" echo "status=true" >> $GITHUB_OUTPUT for run_id in $runs; do @@ -152,6 +152,40 @@ jobs: fi done + - name: Update existing summary check for rerun jobs + if: steps.rerun-failed.outputs.status == 'true' + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + pr_number=${{ github.event.pull_request.number }} + pr_head_sha=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/pulls/$pr_number" | jq -r '.head.sha') + check=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/commits/$pr_head_sha/check-runs" | jq -r '.check_runs[] | select(.name == "Azure CI Summary")') + check_id=$(echo "$check" | jq -r '.id') + check_summary=$(echo "$check" | jq -r '.output.summary') + check_text=$(echo "$check" | jq -r '.output.text') + + if [[ -z "$check_id" ]]; then + echo "No Azure CI Summary check found for commit $pr_head_sha" + exit 0 + fi + + if [[ "$check_summary" == *"$(Build.BuildId)"* ]]; then + check_summary=$(echo "$check_summary" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | pending |/") + fi + + if [[ "$check_text" == *"$(Build.BuildId)="* ]]; then + check_text=$(echo "$check_text" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=pending;/") + fi + + gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$check_id \ + -X PATCH \ + -f "name=Azure CI Summary" \ + -f "head_sha=$pr_head_sha" \ + -f "status=in_progress" \ + -f "output[title]=Azure CI Summary" \ + -f "output[summary]=$check_summary" \ + -f "output[text]=$check_text") + - name: Start new Azure CI runs id: dispatch if: steps.detect.outputs.subtrees && (steps.cancel-in-progress.outputs.status == 'true' || steps.rerun-failed.outputs.status == 'false') @@ -220,7 +254,7 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT - - name: Create summary check + - name: Create new summary check if: steps.dispatch.outputs.run_ids && steps.dispatch.outputs.project_names env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} @@ -230,10 +264,11 @@ jobs: newline=$'\n' - summary="| Project | Run ID | Status |${newline}" + summary="### Azure CI Summary for [PR #${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do - summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | Pending |${newline}" + summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done text="" From 24f4a5957de2b71cc7f14a11e52b11938879693d Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 16:42:28 -0400 Subject: [PATCH 53/79] fix summary update job ids --- .github/workflows/azure-ci-dispatcher.yml | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 17a051c3c09..64c4ad9f1bb 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -138,6 +138,8 @@ jobs: echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha: $runs" echo "status=true" >> $GITHUB_OUTPUT + run_ids=() + for run_id in $runs; do echo "Rerunning failed run ID: $run_id" echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" @@ -149,14 +151,19 @@ jobs: echo "Failed to rerun run ID: $run_id" else echo "Rerun requested for run ID: $run_id" + run_ids+=("$run_id") fi done + echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT + - name: Update existing summary check for rerun jobs if: steps.rerun-failed.outputs.status == 'true' env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | + run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) + pr_number=${{ github.event.pull_request.number }} pr_head_sha=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/pulls/$pr_number" | jq -r '.head.sha') check=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/commits/$pr_head_sha/check-runs" | jq -r '.check_runs[] | select(.name == "Azure CI Summary")') @@ -169,13 +176,14 @@ jobs: exit 0 fi - if [[ "$check_summary" == *"$(Build.BuildId)"* ]]; then - check_summary=$(echo "$check_summary" | sed "s/buildId=$(Build.BuildId)[^|]*|[^|]*|/buildId=$(Build.BuildId)) | pending |/") - fi - - if [[ "$check_text" == *"$(Build.BuildId)="* ]]; then - check_text=$(echo "$check_text" | sed "s/$(Build.BuildId)=[^;]*;/$(Build.BuildId)=pending;/") - fi + for run_id in "${run_ids[@]}"; do + if [[ "$check_summary" == *"$(Build.BuildId)"* ]]; then + check_summary=$(echo "$check_summary" | sed "s/buildId=$run_id[^|]*|[^|]*|/buildId=$run_id) | pending |/") + fi + if [[ "$check_text" == *"$run_id="* ]]; then + check_text=$(echo "$check_text" | sed "s/$run_id=[^;]*;/$run_id=pending;/") + fi + done gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$check_id \ -X PATCH \ From d1ebb45145b90bab344b6ad69e78c80c552a4c84 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 16:47:47 -0400 Subject: [PATCH 54/79] missed one --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 64c4ad9f1bb..c2777806ee2 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -177,7 +177,7 @@ jobs: fi for run_id in "${run_ids[@]}"; do - if [[ "$check_summary" == *"$(Build.BuildId)"* ]]; then + if [[ "$check_summary" == *"$run_id"* ]]; then check_summary=$(echo "$check_summary" | sed "s/buildId=$run_id[^|]*|[^|]*|/buildId=$run_id) | pending |/") fi if [[ "$check_text" == *"$run_id="* ]]; then From b2ee59072fb71990a590446c22a398a4e7a349d3 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:05:13 -0400 Subject: [PATCH 55/79] you cant edit completed checks, so create a new one --- .github/workflows/azure-ci-dispatcher.yml | 73 +++++++++++------------ 1 file changed, 36 insertions(+), 37 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index c2777806ee2..c4c67ffe47a 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -139,6 +139,7 @@ jobs: echo "status=true" >> $GITHUB_OUTPUT run_ids=() + project_names=() for run_id in $runs; do echo "Rerunning failed run ID: $run_id" @@ -152,47 +153,12 @@ jobs: else echo "Rerun requested for run ID: $run_id" run_ids+=("$run_id") + project_name+=($(echo "$response" | jq -r '.definition.name')) fi done echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT - - - name: Update existing summary check for rerun jobs - if: steps.rerun-failed.outputs.status == 'true' - env: - GH_TOKEN: ${{ steps.generate-token.outputs.token }} - run: | - run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) - - pr_number=${{ github.event.pull_request.number }} - pr_head_sha=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/pulls/$pr_number" | jq -r '.head.sha') - check=$(curl -s "https://api.github.com/repos/ROCm/rocm-libraries/commits/$pr_head_sha/check-runs" | jq -r '.check_runs[] | select(.name == "Azure CI Summary")') - check_id=$(echo "$check" | jq -r '.id') - check_summary=$(echo "$check" | jq -r '.output.summary') - check_text=$(echo "$check" | jq -r '.output.text') - - if [[ -z "$check_id" ]]; then - echo "No Azure CI Summary check found for commit $pr_head_sha" - exit 0 - fi - - for run_id in "${run_ids[@]}"; do - if [[ "$check_summary" == *"$run_id"* ]]; then - check_summary=$(echo "$check_summary" | sed "s/buildId=$run_id[^|]*|[^|]*|/buildId=$run_id) | pending |/") - fi - if [[ "$check_text" == *"$run_id="* ]]; then - check_text=$(echo "$check_text" | sed "s/$run_id=[^;]*;/$run_id=pending;/") - fi - done - - gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$check_id \ - -X PATCH \ - -f "name=Azure CI Summary" \ - -f "head_sha=$pr_head_sha" \ - -f "status=in_progress" \ - -f "output[title]=Azure CI Summary" \ - -f "output[summary]=$check_summary" \ - -f "output[text]=$check_text") + echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT - name: Start new Azure CI runs id: dispatch @@ -294,3 +260,36 @@ jobs: echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" + + - name: Create rerun summary check + if: steps.rerun-failed.outputs.run_ids && steps.rerun-failed.outputs.project_names + env: + GH_TOKEN: ${{ steps.generate-token.outputs.token }} + run: | + run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) + project_names=(${{ steps.rerun-failed.outputs.project_names }}) + + newline=$'\n' + + summary="### Summary for [PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title}}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary+="| Project | Run ID | Status |${newline}" + summary+="|--------------|--------|--------|${newline}" + for i in "${!project_names[@]}"; do + summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" + done + + text="" + for i in "${!project_names[@]}"; do + text+="${run_ids[i]}=pending;" + done + + gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ + -f 'name=Azure CI Summary' \ + -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ + -f 'status=in_progress' \ + -f 'output[title]=Azure CI Summary' \ + -f "output[summary]=$summary" \ + -f "output[text]=$text") + + echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" + echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" From 20868bd26d0b326cb31f3277b8ed974e3ea52146 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:13:02 -0400 Subject: [PATCH 56/79] consolidate check creation --- .../templates/report-summary-check.yml | 30 +++++------ .github/workflows/azure-ci-dispatcher.yml | 52 ++++++------------- 2 files changed, 30 insertions(+), 52 deletions(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index a7efbcab5bc..ff2e90b48bf 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -16,21 +16,21 @@ jobs: vmImage: ubuntu-latest steps: - checkout: none - - task: Bash@3 - displayName: Install GitHub CLI - condition: always() - inputs: - targetType: 'inline' - script: | - (type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \ - && sudo mkdir -p -m 755 /etc/apt/keyrings \ - && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ - && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ - && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ - && sudo mkdir -p -m 755 /etc/apt/sources.list.d \ - && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ - && sudo apt update \ - && sudo apt install gh jq -y + # - task: Bash@3 + # displayName: Install GitHub CLI + # condition: always() + # inputs: + # targetType: 'inline' + # script: | + # (type -p wget >/dev/null || (sudo apt update && sudo apt install wget -y)) \ + # && sudo mkdir -p -m 755 /etc/apt/keyrings \ + # && out=$(mktemp) && wget -nv -O$out https://cli.github.com/packages/githubcli-archive-keyring.gpg \ + # && cat $out | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \ + # && sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \ + # && sudo mkdir -p -m 755 /etc/apt/sources.list.d \ + # && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \ + # && sudo apt update \ + # && sudo apt install gh jq -y - task: Bash@3 displayName: Report CI status to GitHub PR Summary Check condition: always() diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index c4c67ffe47a..b037a29126e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -160,6 +160,9 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT + echo "Rerun IDs: ${run_ids[*]}" + echo "Project Names: ${project_names[*]}" + - name: Start new Azure CI runs id: dispatch if: steps.detect.outputs.subtrees && (steps.cancel-in-progress.outputs.status == 'true' || steps.rerun-failed.outputs.status == 'false') @@ -228,17 +231,24 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT - - name: Create new summary check - if: steps.dispatch.outputs.run_ids && steps.dispatch.outputs.project_names + - name: Create summary check env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | - run_ids=(${{ steps.dispatch.outputs.run_ids }}) - project_names=(${{ steps.dispatch.outputs.project_names }}) + if [[ -n "${{ steps.dispatch.outputs.run_ids }}" && -n "${{ steps.dispatch.outputs.project_names }}" ]]; then + run_ids=(${{ steps.dispatch.outputs.run_ids }}) + project_names=(${{ steps.dispatch.outputs.project_names }}) + elif [[ -n "${{ steps.rerun-failed.outputs.run_ids }}" && -n "${{ steps.rerun-failed.outputs.project_names }}" ]]; then + run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) + project_names=(${{ steps.rerun-failed.outputs.project_names }}) + else + echo "No run IDs or project names found, skipping summary check creation." + exit 0 + fi newline=$'\n' - summary="### Azure CI Summary for [PR #${{ github.event.pull_request.number }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary="### Summary for [PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do @@ -261,35 +271,3 @@ jobs: echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" - - name: Create rerun summary check - if: steps.rerun-failed.outputs.run_ids && steps.rerun-failed.outputs.project_names - env: - GH_TOKEN: ${{ steps.generate-token.outputs.token }} - run: | - run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) - project_names=(${{ steps.rerun-failed.outputs.project_names }}) - - newline=$'\n' - - summary="### Summary for [PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title}}](${{ github.event.pull_request.html_url }})${newline}${newline}" - summary+="| Project | Run ID | Status |${newline}" - summary+="|--------------|--------|--------|${newline}" - for i in "${!project_names[@]}"; do - summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" - done - - text="" - for i in "${!project_names[@]}"; do - text+="${run_ids[i]}=pending;" - done - - gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ - -f 'name=Azure CI Summary' \ - -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ - -f 'status=in_progress' \ - -f 'output[title]=Azure CI Summary' \ - -f "output[summary]=$summary" \ - -f "output[text]=$text") - - echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" - echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" From 3e6377d2fd46d75557fcddb480d86400e3ca2f59 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:16:23 -0400 Subject: [PATCH 57/79] missing an s --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index b037a29126e..a7201ce98d0 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -153,7 +153,7 @@ jobs: else echo "Rerun requested for run ID: $run_id" run_ids+=("$run_id") - project_name+=($(echo "$response" | jq -r '.definition.name')) + project_names+=($(echo "$response" | jq -r '.definition.name')) fi done From 5a4f7bb56006f1c0aae0e3f293b516fb8766192f Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:36:11 -0400 Subject: [PATCH 58/79] make summary more descriptive --- .github/workflows/azure-ci-dispatcher.yml | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index a7201ce98d0..5b9ef45b9a4 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -160,9 +160,6 @@ jobs: echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT - echo "Rerun IDs: ${run_ids[*]}" - echo "Project Names: ${project_names[*]}" - - name: Start new Azure CI runs id: dispatch if: steps.detect.outputs.subtrees && (steps.cancel-in-progress.outputs.status == 'true' || steps.rerun-failed.outputs.status == 'false') @@ -248,12 +245,14 @@ jobs: newline=$'\n' - summary="### Summary for [PR #${{ github.event.pull_request.number }} - ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary="### [PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary+="HEAD: [${{ github.event.pull_request.head.sha }}](${{ github.event.pull_request.head.repo.html_url }}/commit/${{ github.event.pull_request.head.sha }})${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done + summary+="To request Azure to rerun jobs, click the "Re-run all jobs" button on the [corresponding `Trigger Azure CI` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}) text="" for i in "${!project_names[@]}"; do @@ -261,7 +260,7 @@ jobs: done gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ - -f 'name=Azure CI Summary' \ + -f 'name=Azure CI Summary (click me!)' \ -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ -f 'status=in_progress' \ -f 'output[title]=Azure CI Summary' \ From 6b552ae44bfbd101518400c1004d2673fa618832 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:37:35 -0400 Subject: [PATCH 59/79] end quote --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 5b9ef45b9a4..6d63a40af3e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -252,7 +252,7 @@ jobs: for i in "${!project_names[@]}"; do summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done - summary+="To request Azure to rerun jobs, click the "Re-run all jobs" button on the [corresponding `Trigger Azure CI` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}) + summary+="To request Azure to rerun jobs, click the "Re-run all jobs" button on the [corresponding `Trigger Azure CI` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})" text="" for i in "${!project_names[@]}"; do From 6493e2195300e583b42b3b7831a0dbb63ec03332 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:39:15 -0400 Subject: [PATCH 60/79] escape quotes --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 6d63a40af3e..ce10758c373 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -252,7 +252,7 @@ jobs: for i in "${!project_names[@]}"; do summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done - summary+="To request Azure to rerun jobs, click the "Re-run all jobs" button on the [corresponding `Trigger Azure CI` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})" + summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})" text="" for i in "${!project_names[@]}"; do From 35875d19b4bf9c433431c33da55c01e6ffa69882 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 17:43:32 -0400 Subject: [PATCH 61/79] fix summary formatting --- .github/workflows/azure-ci-dispatcher.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index ce10758c373..58ef4a51770 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -245,14 +245,15 @@ jobs: newline=$'\n' - summary="### [PR #${{ github.event.pull_request.number }}: ${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary="PR #${{ github.event.pull_request.number }}: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" summary+="HEAD: [${{ github.event.pull_request.head.sha }}](${{ github.event.pull_request.head.repo.html_url }}/commit/${{ github.event.pull_request.head.sha }})${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done - summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})" + summary+="${newline}${newline}" + summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})". text="" for i in "${!project_names[@]}"; do From f258cd58b39108c76a39e6d5e8e5511dd9e02094 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:03:16 -0400 Subject: [PATCH 62/79] add explanation on how rerun works --- .github/workflows/azure-ci-dispatcher.yml | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 58ef4a51770..58292be4523 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -117,8 +117,8 @@ jobs: if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | pr_number=${{ github.event.pull_request.number }} + pr_merge_sha=${{ github.event.pull_request.merge_commit_sha }} pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - pr_merge_sha=$(curl -sSX GET "https://api.github.com/repos/ROCm/rocm-libraries/git/ref/pull/${pr_number}/merge" | jq -r '.object.sha') failed_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=failed&$pr_filter_query" \ -H "Content-Type: application/json") @@ -243,10 +243,15 @@ jobs: exit 0 fi + pr_head_sha=${{ github.event.pull_request.head.sha }} + pr_merge_sha=${{ github.event.pull_request.merge_commit_sha }} + newline=$'\n' - summary="PR #${{ github.event.pull_request.number }}: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" - summary+="HEAD: [${{ github.event.pull_request.head.sha }}](${{ github.event.pull_request.head.repo.html_url }}/commit/${{ github.event.pull_request.head.sha }})${newline}${newline}" + summary="PR ${{ github.event.pull_request.number }}: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary+="HEAD: [$pr_head_sha](https://github.com/ROCm/rocm-libraries/commit/pr_head_sha)${newline}${newline}" + summary+="MERGE: [$pr_merge_sha](https://github.com/ROCm/rocm-libraries/commit/$pr_merge_sha)${newline}${newline}" + summary+="### Pipelines triggered for this PR${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" for i in "${!project_names[@]}"; do @@ -254,6 +259,9 @@ jobs: done summary+="${newline}${newline}" summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})". + summary+="If there are any pending runs for this PR, they will be cancelled, and new runs will be started." + summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, those existing runs will be rerun." + summary+="Otherwise, new runs will be started." text="" for i in "${!project_names[@]}"; do @@ -262,7 +270,7 @@ jobs: gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ -f 'name=Azure CI Summary (click me!)' \ - -f 'head_sha=${{ github.event.pull_request.head.sha }}' \ + -f 'head_sha=$pr_head_sha' \ -f 'status=in_progress' \ -f 'output[title]=Azure CI Summary' \ -f "output[summary]=$summary" \ @@ -270,4 +278,3 @@ jobs: echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')" echo "Summary check URL: https://github.com/ROCm/rocm-libraries/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')" - From 53cd755d99e28a401efebf9cf492934a669c33cf Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:05:28 -0400 Subject: [PATCH 63/79] use double quotes --- .github/workflows/azure-ci-dispatcher.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 58292be4523..f65168c2a69 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -269,10 +269,10 @@ jobs: done gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ - -f 'name=Azure CI Summary (click me!)' \ - -f 'head_sha=$pr_head_sha' \ - -f 'status=in_progress' \ - -f 'output[title]=Azure CI Summary' \ + -f "name=Azure CI Summary (click me!)"" \ + -f "head_sha=$pr_head_sha" \ + -f "status=in_progress" \ + -f "output[title]=Azure CI Summary" \ -f "output[summary]=$summary" \ -f "output[text]=$text") From 5652bc65293cf9fdbd443b63478b1059b3ce9ff6 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:09:02 -0400 Subject: [PATCH 64/79] another dangling quote --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index f65168c2a69..9ecebdaea20 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -269,7 +269,7 @@ jobs: done gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ - -f "name=Azure CI Summary (click me!)"" \ + -f "name=Azure CI Summary (click me!)" \ -f "head_sha=$pr_head_sha" \ -f "status=in_progress" \ -f "output[title]=Azure CI Summary" \ From e185dd336182bd0715a2ad5526fb0268a1d126df Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:11:26 -0400 Subject: [PATCH 65/79] markdown formatting --- .github/workflows/azure-ci-dispatcher.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 9ecebdaea20..651452c26dd 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -258,10 +258,10 @@ jobs: summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done summary+="${newline}${newline}" - summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }})". - summary+="If there are any pending runs for this PR, they will be cancelled, and new runs will be started." - summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, those existing runs will be rerun." - summary+="Otherwise, new runs will be started." + summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}).${newline}${newline}" + summary+="If there are any pending runs for this PR, they will be cancelled, and new runs will be started.${newline}${newline}" + summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, those existing runs will be rerun.${newline}${newline}" + summary+="Otherwise, new runs will be started.${newline}${newline}" text="" for i in "${!project_names[@]}"; do From 76fdef1c8ef4acf138963f6e7c1d8ca3c96fa4b8 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:17:18 -0400 Subject: [PATCH 66/79] back to old merge commit method --- .github/workflows/azure-ci-dispatcher.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 651452c26dd..1f6101f79af 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -117,8 +117,8 @@ jobs: if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | pr_number=${{ github.event.pull_request.number }} - pr_merge_sha=${{ github.event.pull_request.merge_commit_sha }} pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" + pr_merge_sha=$(curl -sSX GET "https://api.github.com/repos/ROCm/rocm-libraries/git/ref/pull/${pr_number}/merge" | jq -r '.object.sha') failed_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=failed&$pr_filter_query" \ -H "Content-Type: application/json") @@ -243,13 +243,14 @@ jobs: exit 0 fi + pr_number=${{ github.event.pull_request.number }} pr_head_sha=${{ github.event.pull_request.head.sha }} - pr_merge_sha=${{ github.event.pull_request.merge_commit_sha }} + pr_merge_sha=$(curl -sSX GET "https://api.github.com/repos/ROCm/rocm-libraries/git/ref/pull/${pr_number}/merge" | jq -r '.object.sha') newline=$'\n' - summary="PR ${{ github.event.pull_request.number }}: [${{ github.event.pull_request.title }}](${{ github.event.pull_request.html_url }})${newline}${newline}" - summary+="HEAD: [$pr_head_sha](https://github.com/ROCm/rocm-libraries/commit/pr_head_sha)${newline}${newline}" + summary="PR: [${{ github.event.pull_request.title }} #$pr_number](${{ github.event.pull_request.html_url }})${newline}${newline}" + summary+="HEAD: [$pr_head_sha](https://github.com/ROCm/rocm-libraries/commit/$pr_head_sha)${newline}${newline}" summary+="MERGE: [$pr_merge_sha](https://github.com/ROCm/rocm-libraries/commit/$pr_merge_sha)${newline}${newline}" summary+="### Pipelines triggered for this PR${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" @@ -260,7 +261,7 @@ jobs: summary+="${newline}${newline}" summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}).${newline}${newline}" summary+="If there are any pending runs for this PR, they will be cancelled, and new runs will be started.${newline}${newline}" - summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, those existing runs will be rerun.${newline}${newline}" + summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, the existing runs will be rerun.${newline}${newline}" summary+="Otherwise, new runs will be started.${newline}${newline}" text="" From a0f3d1144feeef61642e932ed27e4e1f710c0045 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:24:32 -0400 Subject: [PATCH 67/79] rocprim test --- .azuredevops/rocprim.yml | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/.azuredevops/rocprim.yml b/.azuredevops/rocprim.yml index ef421aafc36..d472e5ea227 100644 --- a/.azuredevops/rocprim.yml +++ b/.azuredevops/rocprim.yml @@ -40,8 +40,28 @@ trigger: pr: none -jobs: +stages: +- stage: rocrand + jobs: - template: ${{ variables.CI_COMPONENT_PATH }}/rocPRIM.yml@pipelines_repo parameters: sparseCheckoutDir: projects/rocprim - triggerDownstreamJobs: ${{ parameters.triggerDownstreamJobs }} + triggerDownstreamJobs: false # todo: revert +- stage: report_successful + condition: succeeded() + jobs: + - template: templates/report-summary-check.yml + parameters: + checkConclusion: success +- stage: report_failed + condition: failed() + jobs: + - template: templates/report-summary-check.yml + parameters: + checkConclusion: failure +- stage: report_cancelled + condition: canceled() # note: only 1 L in canceled() + jobs: + - template: templates/report-summary-check.yml + parameters: + checkConclusion: cancelled \ No newline at end of file From a1997fb66a6c2a18696fd91d66926f7876aaafba Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:25:21 -0400 Subject: [PATCH 68/79] newline --- .azuredevops/rocprim.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/rocprim.yml b/.azuredevops/rocprim.yml index d472e5ea227..32310606e2e 100644 --- a/.azuredevops/rocprim.yml +++ b/.azuredevops/rocprim.yml @@ -64,4 +64,4 @@ stages: jobs: - template: templates/report-summary-check.yml parameters: - checkConclusion: cancelled \ No newline at end of file + checkConclusion: cancelled From 74a417f3141211f023b2b65acf57ba3b8c4b64fa Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Thu, 10 Jul 2025 18:25:59 -0400 Subject: [PATCH 69/79] fix rocprim stage name --- .azuredevops/rocprim.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.azuredevops/rocprim.yml b/.azuredevops/rocprim.yml index 32310606e2e..8750ebefedc 100644 --- a/.azuredevops/rocprim.yml +++ b/.azuredevops/rocprim.yml @@ -41,7 +41,7 @@ trigger: pr: none stages: -- stage: rocrand +- stage: rocprim jobs: - template: ${{ variables.CI_COMPONENT_PATH }}/rocPRIM.yml@pipelines_repo parameters: From b4bc42294d6ec6573b1be508ae1d0ecc19325e98 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 10:10:09 -0400 Subject: [PATCH 70/79] change check name --- .github/workflows/azure-ci-dispatcher.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 1f6101f79af..c6a3f97de9e 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -270,7 +270,7 @@ jobs: done gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs \ - -f "name=Azure CI Summary (click me!)" \ + -f "name=Azure CI Summary" \ -f "head_sha=$pr_head_sha" \ -f "status=in_progress" \ -f "output[title]=Azure CI Summary" \ From 340a57ea201ace7ea8f9926e24ff8926293cf8b6 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 10:11:17 -0400 Subject: [PATCH 71/79] temp test job --- .azuredevops/rocprim.yml | 19 ++++++++++++++----- .azuredevops/rocrand.yml | 19 ++++++++++++++----- 2 files changed, 28 insertions(+), 10 deletions(-) diff --git a/.azuredevops/rocprim.yml b/.azuredevops/rocprim.yml index 8750ebefedc..485e854be94 100644 --- a/.azuredevops/rocprim.yml +++ b/.azuredevops/rocprim.yml @@ -41,12 +41,21 @@ trigger: pr: none stages: -- stage: rocprim +# - stage: rocprim +# jobs: +# - template: ${{ variables.CI_COMPONENT_PATH }}/rocPRIM.yml@pipelines_repo +# parameters: +# sparseCheckoutDir: projects/rocprim +# triggerDownstreamJobs: false # todo: revert +- stage: temp_test jobs: - - template: ${{ variables.CI_COMPONENT_PATH }}/rocPRIM.yml@pipelines_repo - parameters: - sparseCheckoutDir: projects/rocprim - triggerDownstreamJobs: false # todo: revert + - job: temp_test + displayName: 'Temporary test stage' + pool: + vmImage: ubuntu-latest + steps: + - script: | + exit 1 - stage: report_successful condition: succeeded() jobs: diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index fb92280a324..4173a766924 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -39,12 +39,21 @@ trigger: pr: none stages: -- stage: rocrand +# - stage: rocrand +# jobs: +# - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo +# parameters: +# sparseCheckoutDir: projects/rocrand +# triggerDownstreamJobs: false # todo: revert +- stage: temp_test jobs: - - template: ${{ variables.CI_COMPONENT_PATH }}/rocRAND.yml@pipelines_repo - parameters: - sparseCheckoutDir: projects/rocrand - triggerDownstreamJobs: false # todo: revert + - job: temp_test + displayName: 'Temporary test stage' + pool: + vmImage: ubuntu-latest + steps: + - script: | + exit 0 - stage: report_successful condition: succeeded() jobs: From ee37fe581ca36a4d5477a32b277e8b25e1866f4b Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 10:28:24 -0400 Subject: [PATCH 72/79] fix test jobs --- .azuredevops/rocprim.yml | 4 ++-- .azuredevops/rocrand.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.azuredevops/rocprim.yml b/.azuredevops/rocprim.yml index 485e854be94..a7dc1519ac9 100644 --- a/.azuredevops/rocprim.yml +++ b/.azuredevops/rocprim.yml @@ -54,8 +54,8 @@ stages: pool: vmImage: ubuntu-latest steps: - - script: | - exit 1 + - checkout: none + - script: exit 1 - stage: report_successful condition: succeeded() jobs: diff --git a/.azuredevops/rocrand.yml b/.azuredevops/rocrand.yml index 4173a766924..388540a1f2a 100644 --- a/.azuredevops/rocrand.yml +++ b/.azuredevops/rocrand.yml @@ -52,8 +52,8 @@ stages: pool: vmImage: ubuntu-latest steps: - - script: | - exit 0 + - checkout: none + - script: exit 0 - stage: report_successful condition: succeeded() jobs: From 478c4c493926184590f7e7a310af974f109fd1f0 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 11:02:58 -0400 Subject: [PATCH 73/79] fix conclusion logic --- .azuredevops/templates/report-summary-check.yml | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/.azuredevops/templates/report-summary-check.yml b/.azuredevops/templates/report-summary-check.yml index ff2e90b48bf..ae540bb35be 100644 --- a/.azuredevops/templates/report-summary-check.yml +++ b/.azuredevops/templates/report-summary-check.yml @@ -81,6 +81,7 @@ jobs: fi CHECK_STATUS=$(echo "$CHECK_TEXT" | grep -q "pending" && echo "in_progress" || echo "completed") + CHECK_CONCLUSION=$(echo "$CHECK_TEXT" | grep -q -e "cancelled" -e "failure" && echo "failure" || echo "success") if [[ "$CHECK_STATUS" == "completed" ]]; then gh_output=$(gh api repos/ROCm/rocm-libraries/check-runs/$CHECK_ID \ @@ -88,7 +89,7 @@ jobs: -f "name=Azure CI Summary" \ -f "head_sha=$PR_HEAD_SHA" \ -f "status=$CHECK_STATUS" \ - -f "conclusion=${{ parameters.checkConclusion }}" \ + -f "conclusion=$CHECK_CONCLUSION" \ -f "output[title]=Azure CI Summary" \ -f "output[summary]=$CHECK_SUMMARY" \ -f "output[text]=$CHECK_TEXT") @@ -103,4 +104,9 @@ jobs: fi echo "Reported status '${{ parameters.checkConclusion }}' to summary check: $(echo "$gh_output" | jq -r '.id')" + if [[ "$CHECK_STATUS" == "completed" ]]; then + echo "All checks completed with overall conclusion: $CHECK_CONCLUSION" + else + echo "Some checks are still in progress: $CHECK_STATUS" + fi echo "Summary check URL: $(echo "$gh_output" | jq -r '.html_url')" From 388168e09c5303a5026d7659dfd8e9d50eed5aab Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 11:34:33 -0400 Subject: [PATCH 74/79] carry forward successful runs in rerun summaries --- .github/workflows/azure-ci-dispatcher.yml | 88 ++++++++++++++++------- 1 file changed, 62 insertions(+), 26 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index c6a3f97de9e..ae059eec7b6 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -79,14 +79,10 @@ jobs: pr_number=${{ github.event.pull_request.number }} pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - inprogress_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=inProgress&$pr_filter_query" \ - -H "Content-Type: application/json") - notstarted_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?statusFilter=notStarted&$pr_filter_query" \ + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?$pr_filter_query" \ -H "Content-Type: application/json") - inprogress_runs=$(echo "$inprogress_res" | jq -r '.value[] | .id') - notstarted_runs=$(echo "$notstarted_res" | jq -r '.value[] | .id') - runs=$(echo -e "$inprogress_runs\n$notstarted_runs" | sort -u) + runs=$(echo "$res" | jq -r ".value[] | select(.status == \"inProgress\" or .status == \"notStarted\") | .id") if [ -z "$runs" ]; then echo "No in-progress/not-started runs found for ROCm/rocm-libraries PR #$pr_number" @@ -117,31 +113,48 @@ jobs: if: steps.detect.outputs.subtrees && steps.cancel-in-progress.outputs.status == 'false' run: | pr_number=${{ github.event.pull_request.number }} - pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" pr_merge_sha=$(curl -sSX GET "https://api.github.com/repos/ROCm/rocm-libraries/git/ref/pull/${pr_number}/merge" | jq -r '.object.sha') + pr_filter_query="branchName=refs/pull/$pr_number/merge&repositoryType=GitHub&repositoryId=ROCm/rocm-libraries&api-version=7.1" - failed_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=failed&$pr_filter_query" \ - -H "Content-Type: application/json") - cancelled_res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?resultFilter=canceled&$pr_filter_query" \ + res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?$pr_filter_query" \ -H "Content-Type: application/json") - failed_runs=$(echo "$failed_res" | jq -r ".value[] | select(.sourceVersion | contains(\"$pr_merge_sha\")) | .id") - cancelled_runs=$(echo "$cancelled_res" | jq -r ".value[] | select(.sourceVersion | contains(\"$pr_merge_sha\")) | .id") - runs=$(echo -e "$failed_runs\n$cancelled_runs" | sort -u) + failed_runs_info=$(echo "$res" | jq -r ".value[] | + select((.result == \"failed\" or .result == \"canceled\") + and (.sourceVersion | contains(\"$pr_merge_sha\"))) + | {id: .id, name: .definition.name}") + success_runs_info=$(echo "$res" | jq -r ".value[] | + select((.result == \"succeeded\") + and (.sourceVersion | contains(\"$pr_merge_sha\"))) + | {id: .id, name: .definition.name}") - if [ -z "$runs" ]; then + failed_run_ids=() + failed_project_names=() + success_run_ids=() + success_project_names=() + + while IFS= read -r line; do + failed_run_ids+=($(echo "$line" | jq -r '.id')) + failed_project_names+=($(echo "$line" | jq -r '.name')) + done <<< "$failed_runs_info" + while IFS= read -r line; do + success_run_ids+=($(echo "$line" | jq -r '.id')) + success_project_names+=($(echo "$line" | jq -r '.name')) + done <<< "$success_runs_info" + + if [ -z "$failed_run_ids" ]; then echo "No failed/cancelled runs found for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha" echo "status=false" >> $GITHUB_OUTPUT exit 0 fi - echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha: $runs" + echo "Found failed/cancelled runs for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha: ${failed_run_ids[*]}" + echo "Found successful runs for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha: ${success_run_ids[*]}" echo "status=true" >> $GITHUB_OUTPUT - run_ids=() - project_names=() + new_run_ids=() - for run_id in $runs; do + for run_id in $failed_run_ids; do echo "Rerunning failed run ID: $run_id" echo "Run URL: https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=$run_id" response=$(curl -sSX PATCH "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds/$run_id?retry=true&api-version=7.1" \ @@ -152,13 +165,14 @@ jobs: echo "Failed to rerun run ID: $run_id" else echo "Rerun requested for run ID: $run_id" - run_ids+=("$run_id") - project_names+=($(echo "$response" | jq -r '.definition.name')) + new_run_ids+=("$run_id") fi done - echo "run_ids=${run_ids[*]}" >> $GITHUB_OUTPUT - echo "project_names=${project_names[*]}" >> $GITHUB_OUTPUT + echo "run_ids=${new_run_ids[*]}" >> $GITHUB_OUTPUT + echo "project_names=${failed_project_names[*]}" >> $GITHUB_OUTPUT + echo "success_run_ids=${success_run_ids[*]}" >> $GITHUB_OUTPUT + echo "success_project_names=${success_project_names[*]}" >> $GITHUB_OUTPUT - name: Start new Azure CI runs id: dispatch @@ -232,12 +246,16 @@ jobs: env: GH_TOKEN: ${{ steps.generate-token.outputs.token }} run: | - if [[ -n "${{ steps.dispatch.outputs.run_ids }}" && -n "${{ steps.dispatch.outputs.project_names }}" ]]; then + if [[ -n "${{ steps.dispatch.outputs.run_ids }}" && -n "${{ steps.dispatch.outputs.project_names }}" ]]; then # If new runs were started run_ids=(${{ steps.dispatch.outputs.run_ids }}) project_names=(${{ steps.dispatch.outputs.project_names }}) - elif [[ -n "${{ steps.rerun-failed.outputs.run_ids }}" && -n "${{ steps.rerun-failed.outputs.project_names }}" ]]; then + append_title="" + elif [[ -n "${{ steps.rerun-failed.outputs.run_ids }}" && -n "${{ steps.rerun-failed.outputs.project_names }}" ]]; then # If reruns were requested run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) project_names=(${{ steps.rerun-failed.outputs.project_names }}) + success_run_ids=(${{ steps.rerun-failed.outputs.success_run_ids }}) + success_project_names=(${{ steps.rerun-failed.outputs.success_project_names }}) + append_title=" (rerun)" else echo "No run IDs or project names found, skipping summary check creation." exit 0 @@ -255,16 +273,34 @@ jobs: summary+="### Pipelines triggered for this PR${newline}${newline}" summary+="| Project | Run ID | Status |${newline}" summary+="|--------------|--------|--------|${newline}" + + if [[ -n "${success_run_ids[*]}" ]]; then + summary+="| **Successful runs** | | |${newline}" + for i in "${!success_project_names[@]}"; do + summary+="| ${success_project_names[i]} | [${success_run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${success_run_ids[i]}) | success |${newline}" + done + summary+="${newline}" + fi + for i in "${!project_names[@]}"; do summary+="| ${project_names[i]} | [${run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${run_ids[i]}) | pending |${newline}" done + summary+="${newline}${newline}" - summary+="To request Azure to rerun jobs, click the \"Re-run all jobs\" button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}).${newline}${newline}" + summary+="### Rerun instructions${newline}${newline}" + summary+="To request Azure to rerun jobs, click the \`Re-run all jobs\` button on the [corresponding \`Trigger Azure CI\` run](https://github.com/ROCm/rocm-libraries/actions/runs/${{ github.run_id }}).${newline}${newline}" summary+="If there are any pending runs for this PR, they will be cancelled, and new runs will be started.${newline}${newline}" summary+="If there are no pending runs, but there are existing failed or cancelled runs for this PR and merge SHA, the existing runs will be rerun.${newline}${newline}" summary+="Otherwise, new runs will be started.${newline}${newline}" text="" + + if [[ -n "${success_run_ids[*]}" ]]; then + for i in "${!success_run_ids[@]}"; do + text+="${success_run_ids[i]}=success;" + done + fi + for i in "${!project_names[@]}"; do text+="${run_ids[i]}=pending;" done @@ -273,7 +309,7 @@ jobs: -f "name=Azure CI Summary" \ -f "head_sha=$pr_head_sha" \ -f "status=in_progress" \ - -f "output[title]=Azure CI Summary" \ + -f "output[title]=Azure CI Summary$append_title" \ -f "output[summary]=$summary" \ -f "output[text]=$text") From 1d668d68c114006b9244cecdc28847951ab497ba Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 11:44:04 -0400 Subject: [PATCH 75/79] fix project jq parsing --- .github/workflows/azure-ci-dispatcher.yml | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index ae059eec7b6..8651b9a5471 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -128,19 +128,10 @@ jobs: and (.sourceVersion | contains(\"$pr_merge_sha\"))) | {id: .id, name: .definition.name}") - failed_run_ids=() - failed_project_names=() - success_run_ids=() - success_project_names=() - - while IFS= read -r line; do - failed_run_ids+=($(echo "$line" | jq -r '.id')) - failed_project_names+=($(echo "$line" | jq -r '.name')) - done <<< "$failed_runs_info" - while IFS= read -r line; do - success_run_ids+=($(echo "$line" | jq -r '.id')) - success_project_names+=($(echo "$line" | jq -r '.name')) - done <<< "$success_runs_info" + failed_run_ids=$(echo "$failed_runs_info" | jq -r '.id') + failed_project_names=$(echo "$failed_runs_info" | jq -r '.name') + success_run_ids=$(echo "$success_runs_info" | jq -r '.id') + success_project_names=$(echo "$success_runs_info" | jq -r '.name') if [ -z "$failed_run_ids" ]; then echo "No failed/cancelled runs found for ROCm/rocm-libraries PR #$pr_number at merge commit $pr_merge_sha" From 181e49fa89b4fa911356a9128e93008a43332bcf Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 11:51:51 -0400 Subject: [PATCH 76/79] fix table formatting --- .github/workflows/azure-ci-dispatcher.yml | 2 -- 1 file changed, 2 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 8651b9a5471..549374ececc 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -266,11 +266,9 @@ jobs: summary+="|--------------|--------|--------|${newline}" if [[ -n "${success_run_ids[*]}" ]]; then - summary+="| **Successful runs** | | |${newline}" for i in "${!success_project_names[@]}"; do summary+="| ${success_project_names[i]} | [${success_run_ids[i]}](https://dev.azure.com/ROCm-CI/ROCm-CI/_build/results?buildId=${success_run_ids[i]}) | success |${newline}" done - summary+="${newline}" fi for i in "${!project_names[@]}"; do From f036a8be32cb22f8f501207d3b535209d678c4c3 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 12:03:04 -0400 Subject: [PATCH 77/79] wait for merge ref to exist --- .github/workflows/azure-ci-dispatcher.yml | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/.github/workflows/azure-ci-dispatcher.yml b/.github/workflows/azure-ci-dispatcher.yml index 549374ececc..9ca3f6a3380 100644 --- a/.github/workflows/azure-ci-dispatcher.yml +++ b/.github/workflows/azure-ci-dispatcher.yml @@ -48,6 +48,22 @@ jobs: repositories: | rocm-libraries + - name: Wait until refs/pull/${{ github.event.pull_request.number }}/merge exists + run: | + merge_ref="refs/pull/${{ github.event.pull_request.number }}/merge" + check_merge_ref() { + git ls-remote "https://github.com/ROCm/rocm-libraries" "$merge_ref" | grep -q "$merge_ref" + } + while true; do + if check_merge_ref; then + echo "$merge_ref found." + break + else + echo "$merge_ref not found. Retrying in 60 seconds..." + sleep 60 + fi + done + - name: Checkout code uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 with: @@ -240,13 +256,11 @@ jobs: if [[ -n "${{ steps.dispatch.outputs.run_ids }}" && -n "${{ steps.dispatch.outputs.project_names }}" ]]; then # If new runs were started run_ids=(${{ steps.dispatch.outputs.run_ids }}) project_names=(${{ steps.dispatch.outputs.project_names }}) - append_title="" elif [[ -n "${{ steps.rerun-failed.outputs.run_ids }}" && -n "${{ steps.rerun-failed.outputs.project_names }}" ]]; then # If reruns were requested run_ids=(${{ steps.rerun-failed.outputs.run_ids }}) project_names=(${{ steps.rerun-failed.outputs.project_names }}) success_run_ids=(${{ steps.rerun-failed.outputs.success_run_ids }}) success_project_names=(${{ steps.rerun-failed.outputs.success_project_names }}) - append_title=" (rerun)" else echo "No run IDs or project names found, skipping summary check creation." exit 0 @@ -298,7 +312,7 @@ jobs: -f "name=Azure CI Summary" \ -f "head_sha=$pr_head_sha" \ -f "status=in_progress" \ - -f "output[title]=Azure CI Summary$append_title" \ + -f "output[title]=Azure CI Summary" \ -f "output[summary]=$summary" \ -f "output[text]=$text") From 780b9b76c76276ea4bebe6de04624c3dda280e18 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 12:05:55 -0400 Subject: [PATCH 78/79] add large diff cli fallback to detect_subtrees script --- .github/scripts/pr_category_label.py | 1 - .github/scripts/pr_detect_changed_subtrees.py | 16 ++++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/scripts/pr_category_label.py b/.github/scripts/pr_category_label.py index 13efa9cab30..827ab6056fa 100644 --- a/.github/scripts/pr_category_label.py +++ b/.github/scripts/pr_category_label.py @@ -92,7 +92,6 @@ def main(argv=None) -> None: client = GitHubCLIClient() changed_files = [file for file in client.get_changed_files(args.repo, int(args.pr))] - if not changed_files: logger.warning("REST API failed or returned no changed files. Falling back to Git CLI...") try: diff --git a/.github/scripts/pr_detect_changed_subtrees.py b/.github/scripts/pr_detect_changed_subtrees.py index caeb0817c66..8570843dc96 100644 --- a/.github/scripts/pr_detect_changed_subtrees.py +++ b/.github/scripts/pr_detect_changed_subtrees.py @@ -113,6 +113,22 @@ def main(argv=None) -> None: client = GitHubCLIClient() config = load_repo_config(args.config) changed_files = client.get_changed_files(args.repo, int(args.pr)) + + if not changed_files: + logger.warning("REST API failed or returned no changed files. Falling back to Git CLI...") + try: + # Ensure fetch is safe + os.system("git fetch origin +refs/pull/*/merge:refs/remotes/origin/pr/*") + # Get merge commit ref for this PR + base_ref = f"origin/{os.getenv('GITHUB_BASE_REF', 'main')}" + head_ref = "HEAD" # Assumes checkout to PR merge ref + result = os.popen(f"git diff --name-only {base_ref}...{head_ref}").read() + changed_files = result.strip().splitlines() + logger.info(f"Fallback changed files: {changed_files}") + except Exception as e: + logger.error(f"Git CLI fallback failed: {e}") + sys.exit(1) + valid_prefixes = get_valid_prefixes(config, args.require_auto_pull, args.require_auto_push) matched_subtrees = find_matched_subtrees(changed_files, valid_prefixes) output_subtrees(matched_subtrees, args.dry_run) From 64c99cefb883c79c253d69f2a3c64f326994c5b1 Mon Sep 17 00:00:00 2001 From: Daniel Su Date: Fri, 11 Jul 2025 12:42:27 -0400 Subject: [PATCH 79/79] rocprim rocrand test --- projects/rocprim/README.md | 2 +- projects/rocrand/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/projects/rocprim/README.md b/projects/rocprim/README.md index b58914679dc..945b4a4b00c 100644 --- a/projects/rocprim/README.md +++ b/projects/rocprim/README.md @@ -1,4 +1,4 @@ -# rocPRIM +# rocPRIM test > [!NOTE] > The published rocPRIM documentation is available [here](https://rocm.docs.amd.com/projects/rocPRIM/en/latest/) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the `docs` folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html). diff --git a/projects/rocrand/README.md b/projects/rocrand/README.md index 78032c41df1..8b85e20b532 100644 --- a/projects/rocrand/README.md +++ b/projects/rocrand/README.md @@ -1,4 +1,4 @@ -# rocRAND +# rocRAND test > [!NOTE] > The published rocRAND documentation is available [here](https://rocm.docs.amd.com/projects/rocRAND/en/latest/) in an organized, easy-to-read format, with search and a table of contents. The documentation source files reside in the `docs` folder of this repository. As with all ROCm projects, the documentation is open source. For more information on contributing to the documentation, see [Contribute to ROCm documentation](https://rocm.docs.amd.com/en/latest/contribute/contributing.html).