Repository navigation
fix(monitoring): remove --pid host, consolidate cpu smoke test into c… #84
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AIC AMD Cliff Benchmark | |
| on: | |
| workflow_dispatch: | |
| issue_comment: | |
| types: [created] | |
| jobs: | |
| # Validate /run-cliff slash command on PRs; skipped for other triggers | |
| authorize: | |
| if: > | |
| github.event_name != 'issue_comment' || ( | |
| github.event.issue.pull_request != null && | |
| contains(github.event.comment.body, '/run-cliff') | |
| ) | |
| runs-on: ubuntu-latest | |
| permissions: | |
| pull-requests: write | |
| outputs: | |
| sha: ${{ steps.resolve.outputs.sha }} | |
| pr_number: ${{ steps.resolve.outputs.pr_number }} | |
| target: ${{ steps.resolve.outputs.target }} | |
| should_run: ${{ steps.resolve.outputs.should_run }} | |
| steps: | |
| - name: Check commenter is a maintainer or admin | |
| if: github.event_name == 'issue_comment' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const { data } = await github.rest.repos.getCollaboratorPermissionLevel({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| username: context.actor, | |
| }); | |
| const level = data.permission; | |
| if (level !== 'admin' && level !== 'maintain' && level !== 'write') { | |
| core.setFailed(`@${context.actor} does not have write/maintain/admin permission (got: ${level})`); | |
| } | |
| - name: Resolve SHA, PR number, and cliff target | |
| id: resolve | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| if (context.eventName === 'issue_comment') { | |
| const { data: pr } = await github.rest.pulls.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| pull_number: context.issue.number, | |
| }); | |
| core.setOutput('sha', pr.head.sha); | |
| core.setOutput('pr_number', String(context.issue.number)); | |
| core.setOutput('target', 'cliff-short'); | |
| core.setOutput('should_run', 'true'); | |
| } else { | |
| // workflow_dispatch | |
| core.setOutput('sha', context.sha); | |
| core.setOutput('pr_number', ''); | |
| core.setOutput('target', 'cliff-short'); | |
| core.setOutput('should_run', 'true'); | |
| } | |
| - name: React to comment with eyes | |
| if: github.event_name == 'issue_comment' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| await github.rest.reactions.createForIssueComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| comment_id: context.payload.comment.id, | |
| content: 'eyes', | |
| }); | |
| cliff: | |
| needs: authorize | |
| if: needs.authorize.outputs.should_run == 'true' | |
| runs-on: [self-hosted, rocm-aic-cicd] | |
| timeout-minutes: 240 | |
| permissions: | |
| pull-requests: write | |
| statuses: write | |
| env: | |
| AIC_SPUR_HOST: ${{ secrets.AIC_SPUR_HOST }} | |
| AIC_SHARED_NFS: ${{ secrets.AIC_SHARED_NFS }} | |
| AIC_SPUR_CONTROLLER: ${{ secrets.AIC_SPUR_CONTROLLER }} | |
| steps: | |
| - name: Set commit status to pending | |
| if: needs.authorize.outputs.pr_number != '' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: '${{ needs.authorize.outputs.sha }}', | |
| state: 'pending', | |
| context: 'hardware-ci / cliff', | |
| description: 'Running cliff benchmark on the SPUR head node...', | |
| }); | |
| - name: Run cliff on the SPUR head node | |
| run: | | |
| bash /usr/local/lib/aic-ci/spur-cliff.sh \ | |
| "${{ needs.authorize.outputs.sha }}" \ | |
| "${{ needs.authorize.outputs.target }}" | |
| - name: Set commit status on success | |
| if: success() && needs.authorize.outputs.pr_number != '' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: '${{ needs.authorize.outputs.sha }}', | |
| state: 'success', | |
| context: 'hardware-ci / cliff', | |
| description: 'Cliff benchmark passed', | |
| }); | |
| - name: Set commit status on failure | |
| if: failure() && needs.authorize.outputs.pr_number != '' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| await github.rest.repos.createCommitStatus({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| sha: '${{ needs.authorize.outputs.sha }}', | |
| state: 'failure', | |
| context: 'hardware-ci / cliff', | |
| description: 'Cliff benchmark failed — check the run logs', | |
| }); | |
| - name: Post result comment on PR | |
| if: always() && needs.authorize.outputs.pr_number != '' | |
| uses: actions/github-script@v9 | |
| with: | |
| script: | | |
| const success = '${{ job.status }}' === 'success'; | |
| await github.rest.issues.createComment({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number: ${{ needs.authorize.outputs.pr_number || 0 }}, | |
| body: success | |
| ? `✅ Cliff benchmark passed for ${{ needs.authorize.outputs.sha }}.` | |
| : `❌ Cliff benchmark failed for ${{ needs.authorize.outputs.sha }}. [View logs](https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}).`, | |
| }); |