• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1# upload alerts every 10 minutes
2
3name: Upload Alerts to AWS/Rockset
4
5on:
6  schedule:
7    - cron: '*/10 * * * *'
8  pull_request:
9    paths:
10      - 'tools/alerts/create_alerts.py'
11      - '.github/workflows/upload-alerts.yml'
12
13jobs:
14  upload-alerts:
15    if: ${{ github.repository_owner == 'pytorch' }}
16    runs-on: ubuntu-22.04
17    environment: upload-stats
18    steps:
19      - name: Checkout repo
20        uses: actions/checkout@v3
21        with:
22          fetch-depth: 1
23
24      - uses: actions/setup-python@v4
25        with:
26          python-version: '3.11'
27          cache: pip
28
29      - name: Install Python Packages
30        run: |
31          pip3 install rockset==1.0.3 boto3==1.19.12 requests==2.32.2
32
33      - name: Create alerts
34        run: |
35          output=$(PYTHONPATH=$PYTHONPATH:$(pwd) python3 "tools/alerts/create_alerts.py")
36          echo "uploading following alerts"
37          echo "$output"
38          echo "script-output=$output" >> "$GITHUB_OUTPUT"
39        id: alert_creation_step
40
41      - name: Upload alerts
42        env:
43          ROCKSET_API_KEY: ${{ secrets.ROCKSET_API_KEY }}
44          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
45          AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
46          AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
47        uses: pytorch/test-infra/.github/actions/upload-alerts@release/2.4
48        with:
49          alerts: '${{ steps.alert_creation_step.outputs.script-output }}'
50          organization: "pytorch"
51          repo: "pytorch"
52
53concurrency:
54  group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
55  cancel-in-progress: true
56