Skip to content

Commit

Permalink
chore: add slack alert when stopping EC2 instances fails in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
RomanBredehoft committed Jun 12, 2024
1 parent ec58bca commit a3d5509
Showing 1 changed file with 29 additions and 3 deletions.
32 changes: 29 additions & 3 deletions .github/workflows/continuous-integration.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -1112,8 +1112,8 @@ jobs:
# basically when the `matrix-preparation` has not been skipped
# Side note: environmental variables cannot be used for jobs conditions, so we need to determine
# if the job should be run or not in an previous job and store it in its output
send-report:
name: Send Slack report
slack-report:
name: Slack report
runs-on: ubuntu-20.04
if: |
always()
Expand Down Expand Up @@ -1198,7 +1198,7 @@ jobs:
echo "EOF" >> "$GITHUB_ENV"
- name: Slack report
- name: Send Slack report
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
Expand All @@ -1210,3 +1210,29 @@ jobs:
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
SLACKIFY_MARKDOWN: true


stop-ec2-failure-slack-alert:
name: Stop EC2 failure Slack alert
runs-on: ubuntu-20.04
if: |
always()
&& needs.matrix-preparation.result != 'skipped'
&& needs.stop-runner-linux.result == 'failure'
timeout-minutes: 2
needs:
[
matrix-preparation,
stop-runner-linux,
]

steps:
- name: Send stop EC2 failure Slack alert
uses: rtCamp/action-slack-notify@4e5fb42d249be6a45a298f3c9543b111b02f7907
env:
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
SLACK_ICON: https://pbs.twimg.com/profile_images/1274014582265298945/OjBKP9kn_400x400.png
SLACK_COLOR: 'failure'
SLACK_TITLE: 'Stopping EC2 instances (linux) failed ❌'
SLACK_MESSAGE: '@machinelearning EC2 instances must be terminated manually as soon as possible'
SLACK_USERNAME: ${{ secrets.BOT_USERNAME }}
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}

0 comments on commit a3d5509

Please sign in to comment.