Fixes https://github.com/pytorch/pytorch/issues/88098 This is a mirror of the same PR (https://github.com/Goldspear/pytorch/pull/3) that has been reviewed in my fork (due to it's a stacked PR). ============== ## Context This the 3rd of the 3 PRs to address the issue 88098. ## What Changed 1. check_labels.py no longer fails, but only leaving a comment 2. trymerge.py now would fail if no required labels provided ## Tests * dummy-repo trymerge run [fails without required label](https://github.com/Goldspear/pytorch-dummy/actions/runs/4162819216) and resulted in [a label error comment](https://github.com/Goldspear/pytorch-dummy/pull/3#issuecomment-1427756769) * the above pr was [correctly merged](https://github.com/Goldspear/pytorch-dummy/pull/3) after label is added. ## Note to Reviewers 1st PR: https://github.com/pytorch/pytorch/pull/94179 2nd PR: https://github.com/pytorch/pytorch/pull/94899 3rd PR: this one Pull Request resolved: https://github.com/pytorch/pytorch/pull/94707 Approved by: https://github.com/ZainRizvi |
||
|---|---|---|
| .. | ||
| build_triton_wheel.py | ||
| check_labels.py | ||
| collect_ciflow_labels.py | ||
| comment_on_pr.py | ||
| convert_lintrunner_annotations_to_github.py | ||
| ensure_actions_will_cancel.py | ||
| export_pytorch_labels.py | ||
| fetch_latest_green_commit.py | ||
| filter_test_configs.py | ||
| generate_binary_build_matrix.py | ||
| generate_ci_workflows.py | ||
| generate_pytorch_version.py | ||
| get_workflow_job_id.py | ||
| github_utils.py | ||
| gitutils.py | ||
| gql_mocks.json | ||
| kill_active_ssh_sessions.ps1 | ||
| label_utils.py | ||
| lint_native_functions.py | ||
| parse_ref.py | ||
| pr-sanity-check.sh | ||
| README.md | ||
| report_git_status.sh | ||
| rockset_mocks.json | ||
| run_torchbench.py | ||
| test_check_labels.py | ||
| test_fetch_latest_green_commit.py | ||
| test_filter_test_configs.py | ||
| test_gitutils.py | ||
| test_label_utils.py | ||
| test_trymerge.py | ||
| test_tryrebase.py | ||
| trymerge.py | ||
| trymerge_explainer.py | ||
| tryrebase.py | ||
| update_commit_hashes.py | ||
| wait_for_ssh_to_drain.ps1 | ||
pytorch/.github
NOTE: This README contains information for the
.githubdirectory but cannot be located there because it will overwrite the repo README.
This directory contains workflows and scripts to support our CI infrastructure that runs on GitHub Actions.
Workflows
- Pull CI (
pull.yml) is run on PRs and on master. - Trunk CI (
trunk.yml) is run on trunk to validate incoming commits. Trunk jobs are usually more expensive to run so we do not run them on PRs unless specified. - Scheduled CI (
periodic.yml) is a subset of trunk CI that is run every few hours on master. - Binary CI is run to package binaries for distribution for all platforms.
Templates
Templates written in Jinja are located in the .github/templates directory
and used to generate workflow files for binary jobs found in the .github/workflows/ directory. These are also a
couple of utility templates used to discern common utilities that can be used amongst different templates.
(Re)Generating workflow files
You will need jinja2 in order to regenerate the workflow files which can be installed using:
pip install -r .github/requirements/regenerate-requirements.txt
Workflows can be generated / regenerated using the following command:
.github/regenerate.sh
Adding a new generated binary workflow
New generated binary workflows can be added in the .github/scripts/generate_ci_workflows.py script. You can reference
examples from that script in order to add the workflow to the stream that is relevant to what you particularly
care about.
Different parameters can be used to achieve different goals, i.e. running jobs on a cron, running only on trunk, etc.
ciflow (trunk)
The label ciflow/trunk can be used to run trunk only workflows. This is especially useful if trying to re-land a PR that was
reverted for failing a non-default workflow.
Infra
Currently most of our self hosted runners are hosted on AWS, for a comprehensive list of available runner types you
can reference .github/scale-config.yml.
Exceptions to AWS for self hosted:
- ROCM runners
Adding new runner types
New runner types can be added by committing changes to .github/scale-config.yml. Example: https://github.com/pytorch/pytorch/pull/70474
NOTE: New runner types can only be used once the changes to
.github/scale-config.ymlhave made their way into the default branch
Testing pytorch/builder changes
In order to test changes to the builder scripts:
- Specify your builder PR's branch and repo as
builder_repoandbuilder_branchin.github/templates/common.yml.j2. - Regenerate workflow files with
.github/regenerate.sh(see above). - Submit fake PR to PyTorch. If changing binaries build, add an appropriate label like
ciflow/binariesto trigger the builds.