pytorch/.github/scripts
zengk95 2acd2317b8 [mergebot] Create land time check options (#77943)
This adds land time checks before we try to merge. What this does is:
1. Merge changes into latest master, check out a new branch, push, and have a workflow that runs jobs from trunk (and maybe pull)
2. Wait for all checks in the landtime workflow to finish by using the GH API (graphql doesn't have this method from what I can see)
3. push the changes in

Test Plan:
Tested this in canary with a new workflow that passes and lint, tested what happens if i break the new workflow by exiting with 1, the normal flow, and some other flows.

Tested it breaking when land checks fail:
https://github.com/pytorch/pytorch-canary/pull/113#issuecomment-1165941716

Test that it works:
https://github.com/pytorch/pytorch-canary/pull/114#issuecomment-1165922791

Test that normal validations like PR is broken:
https://github.com/pytorch/pytorch-canary/pull/113#issuecomment-1165930037

Test that normal merge works:
https://github.com/pytorch/pytorch-canary/pull/113#issuecomment-1166751288

Test that force merge works:
https://github.com/pytorch/pytorch-canary/pull/113#issuecomment-1167507356
Pull Request resolved: https://github.com/pytorch/pytorch/pull/77943
Approved by: https://github.com/janeyx99
2022-06-27 22:28:12 +00:00
..
build_publish_nightly_docker.sh
convert_lintrunner_annotations_to_github.py [ci] use lintrunner in CI 2022-04-15 00:08:21 +00:00
ensure_actions_will_cancel.py
export_pytorch_labels.py
generate_binary_build_matrix.py Upgrade CI to ROCm 5.1 2022-04-28 00:02:07 +00:00
generate_ci_workflows.py [ci] remove ciflow/all (#78317) 2022-05-26 16:25:25 +00:00
generate_pytorch_version.py
get_workflow_job_id.py [ci] Fix bug in get_workflow_job_id.py 2022-04-08 21:09:38 +00:00
gitutils.py [GHF] Retry push unconditionally (#77426) 2022-05-13 17:09:01 +00:00
gql_mocks.json [mergebot] add additional checks (#79317) 2022-06-13 19:28:29 +00:00
install_nvidia_utils_linux.sh Cuda 11.6 Disable failing tests (#75420) 2022-04-07 22:43:15 +00:00
kill_active_ssh_sessions.ps1
lint_native_functions.py [lint] upgrade mypy to latest version 2022-05-03 20:51:34 +00:00
parse_ref.py
print_latest_commits.py finalized GHA for promoting to viable/strict (#79649) 2022-06-20 12:53:39 +00:00
process_commit.py
README.md
report_git_status.sh
run_torchbench.py Add userbenchmark support to TorchBench CI (#78794) 2022-06-03 21:07:36 +00:00
test_gitutils.py
test_print_latest_commits.py finalized GHA for promoting to viable/strict (#79649) 2022-06-20 12:53:39 +00:00
test_trymerge.py [mergebot] Create land time check options (#77943) 2022-06-27 22:28:12 +00:00
test_tryrebase.py rebase via comment - rebase to any branch (#78772) 2022-06-03 17:13:11 +00:00
trymerge.py [mergebot] Create land time check options (#77943) 2022-06-27 22:28:12 +00:00
tryrebase.py [GHF][BE] Comment on reverted commit (#79913) 2022-06-22 02:46:48 +00:00
update_commit_hashes.py automate hash updates - add new lint to appease lint (#79832) 2022-06-20 15:56:38 +00:00
wait_for_ssh_to_drain.ps1
wait_for_ssh_to_drain.sh

pytorch/.github

NOTE: This README contains information for the .github directory 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.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 acheive 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.yml have made their way into the default branch