Skip to content

Update test file ratings for TD Heuristics #78

Update test file ratings for TD Heuristics

Update test file ratings for TD Heuristics #78

name: Update test file ratings for TD Heuristics
on:
schedule:
- cron: 5 11 * * * # At 11:05 UTC every day or about 4am PT
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }}-${{ github.event_name == 'workflow_dispatch' }}
cancel-in-progress: true
permissions:
contents: write
id-token: write
jobs:
update-test-file-ratings:
runs-on: ubuntu-latest
steps:
- name: Checkout pytorch/test-infra
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: test-infra
- name: Checkout pytorch/pytorch
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: pytorch/pytorch
path: pytorch
fetch-depth: 0
- name: Install Dependencies
run: |
pip3 install --upgrade pip
pip3 install boto3==1.35.42 clickhouse-connect==0.8.14
cd test-infra/tools/torchci
pip3 install -e .
- name: configure aws credentials
uses: aws-actions/configure-aws-credentials@50ac8dd1e1b10d09dac7b8727528b91bed831ac0 # v3.0.2
with:
role-to-assume: arn:aws:iam::308535385114:role/upload_to_ossci_raw_job_status
aws-region: us-east-1
- name: Get merge base info
run: |
python3 test-infra/tools/torchci/td/get_merge_base_info.py
env:
CLICKHOUSE_ENDPOINT: ${{ secrets.CLICKHOUSE_HUD_USER_URL }}
CLICKHOUSE_USERNAME: ${{ secrets.CLICKHOUSE_HUD_USER_USERNAME }}
CLICKHOUSE_PASSWORD: ${{ secrets.CLICKHOUSE_HUD_USER_PASSWORD }}
- name: Generate file test ratings
run: |
set -ex
python3 test-infra/tools/torchci/td/historical_file_failure_correlation.py
python3 test-infra/tools/torchci/td/historical_class_failure_correlation.py
python3 test-infra/tools/torchci/td/td_heuristic_historical_edited_files.py
# Do not run this one, it won't change
# python3 test-infra/tools/torchci/td/td_heuristic_profiling.py
env:
CLICKHOUSE_ENDPOINT: ${{ secrets.CLICKHOUSE_HUD_USER_URL }}
CLICKHOUSE_USERNAME: ${{ secrets.CLICKHOUSE_HUD_USER_USERNAME }}
CLICKHOUSE_PASSWORD: ${{ secrets.CLICKHOUSE_HUD_USER_PASSWORD }}
- name: Push file to test file correlations to test-infra repository
if: github.event_name != 'pull_request'
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131
env:
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
with:
source_file: "file_test_rating.json"
destination_repo: "pytorch/test-infra"
destination_folder: "stats"
destination_branch: generated-stats
user_email: "test-infra@pytorch.org"
user_name: "Pytorch Test Infra"
commit_message: "Updating file to test file correlations"
- name: Push file to test class correlations to test-infra repository
if: github.event_name != 'pull_request'
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131
env:
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
with:
source_file: "file_test_class_rating.json"
destination_repo: "pytorch/test-infra"
destination_folder: "stats"
destination_branch: generated-stats
user_email: "test-infra@pytorch.org"
user_name: "Pytorch Test Infra"
commit_message: "Updating file to test class correlations"
- name: Push historical edited files heuristic to test-infra repository
if: github.event_name != 'pull_request'
uses: dmnemec/copy_file_to_another_repo_action@eebb594efdf52bc12e1b461988d7254322dac131
env:
API_TOKEN_GITHUB: ${{ secrets.GITHUB_TOKEN }}
with:
source_file: "td_heuristic_historical_edited_files.json"
destination_repo: "pytorch/test-infra"
destination_folder: "stats"
destination_branch: generated-stats
user_email: "test-infra@pytorch.org"
user_name: "Pytorch Test Infra"
commit_message: "Updating TD heuristic: historical edited files"
update-ec2-pricing:
runs-on: linux.large
steps:
- name: Checkout test-infra repository
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Install Dependencies
run: python3 -m pip install boto3==1.19.12 PyYAML==6.0
- name: Generate EC2 pricing data
run: |
python3 tools/torchci/test_insights/ec2_pricing.py
- name: Compress pricing file
run: |
gzip ec2_pricing.json
- name: Upload pricing file to S3
run: |
aws s3 cp ec2_pricing.json.gz s3://ossci-metrics/ec2_pricing.json.gz \
--content-encoding gzip \
--content-type application/json