Skip to content

Commit

Permalink
Install alerting (#9311)
Browse files Browse the repository at this point in the history
* ci: Send Slack alerts on CI failure

Signed-off-by: Oliver Koenig <[email protected]>

* chore: Set live

Signed-off-by: Oliver Koenig <[email protected]>

---------

Signed-off-by: Oliver Koenig <[email protected]>
  • Loading branch information
ko3n1g authored May 24, 2024
1 parent c3f19e9 commit 251cf66
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 4 deletions.
23 changes: 23 additions & 0 deletions .github/scripts/slackHelper.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#!/bin/bash

function sendSlackMessage() {

WEBHOOK_URL="$1"
PIPELINE_URL="$2"

curl -X POST -H "Content-type: application/json" --data "{
\"blocks\": [
{
\"type\": \"section\",
\"text\": {
\"type\": \"mrkdwn\",
\"text\": \"\
🚨 *CI/CD failure at <$PIPELINE_URL|NeMo CI>*:
\"
}
}
]
}" $WEBHOOK_URL

}
21 changes: 17 additions & 4 deletions .github/workflows/cicd-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6482,9 +6482,8 @@ jobs:
- uses: "NVIDIA/NeMo/.github/actions/cancel-workflow@main"
if: "failure()"


Nemo_CICD_Test:
needs:
needs:
- L0_Unit_Tests_GPU
- L0_Unit_Tests_CPU
- L2_Community_LLM_Checkpoints_tests_Llama
Expand Down Expand Up @@ -6598,8 +6597,22 @@ jobs:
- L2_TTS_Fast_dev_runs_1_Mixer-TTS
- L2_TTS_Fast_dev_runs_1_Hifigan
- Speech_Checkpoints_tests

if: always()
runs-on: ubuntu-latest
steps:
# This should depend on all the tests so we block/unblock based on all tests passing
- run: exit 0
- if: ${{ contains(needs.*.result, 'success') }}
run: exit 0

- if: ${{ contains(needs.*.result, 'failure') }}
name: Checkout repository
uses: actions/checkout@v4

- if: ${{ contains(needs.*.result, 'failure') }}
run: |
source .github/scripts/slackHelper.sh
WEBHOOK_URL=${{ secrets.SLACK_WEBHOOK }}
PIPELINE_URL=${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
sendSlackMessage "$WEBHOOK_URL" "$PIPELINE_URL"

0 comments on commit 251cf66

Please sign in to comment.