Upload Alerts to AWS/Rockset #8447
This file contains 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
# upload alerts every 10 minutes | |
name: Upload Alerts to AWS/Rockset | |
on: | |
schedule: | |
- cron: '*/10 * * * *' | |
pull_request: | |
paths: | |
- 'tools/alerts/create_alerts.py' | |
- '.github/workflows/upload-alerts.yml' | |
jobs: | |
upload-alerts: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: ubuntu-22.04 | |
environment: upload-stats | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 1 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.11' | |
cache: pip | |
- name: Install Python Packages | |
run: | | |
pip3 install rockset==1.0.3 boto3==1.19.12 requests==2.32.2 | |
- name: Create alerts | |
run: | | |
output=$(PYTHONPATH=$PYTHONPATH:$(pwd) python3 "tools/alerts/create_alerts.py") | |
echo "uploading following alerts" | |
echo "$output" | |
echo "script-output=$output" >> "$GITHUB_OUTPUT" | |
id: alert_creation_step | |
- name: Upload alerts | |
env: | |
ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
uses: pytorch/test-infra/.github/actions/upload-alerts@main | |
with: | |
alerts: '${{ steps.alert_creation_step.outputs.script-output }}' | |
organization: "pytorch" | |
repo: "pytorch" | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | |
cancel-in-progress: true |