Skip to content

Commit

Permalink
Add support for using LF Canary runners (pytorch#131188)
Browse files Browse the repository at this point in the history
The script is updated such that if a canary build is detected and the label_type is LF runner it will run on an LF Canary runner.

Closes pytorch/ci-infra#245.

Pull Request resolved: pytorch#131188
Approved by: https://github.com/ZainRizvi
  • Loading branch information
zxiiro authored and pytorchmergebot committed Jul 22, 2024
1 parent 69e2590 commit 3eb9fa5
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .github/scripts/runner_determinator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

WORKFLOW_LABEL_META = "" # use meta runners
WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation
WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation

GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "")
GH_OUTPUT_KEY_LABEL_TYPE = "label-type"
Expand Down Expand Up @@ -203,6 +204,10 @@ def main() -> None:
)
label_type = WORKFLOW_LABEL_META

# For Canary builds use canary runners
if args.github_repo == "pytorch/pytorch-canary" and label_type == WORKFLOW_LABEL_LF:
label_type = WORKFLOW_LABEL_LF_CANARY

set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, label_type)


Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/_runner-determinator.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ jobs:
WORKFLOW_LABEL_META = "" # use meta runners
WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation
WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation
GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "")
GH_OUTPUT_KEY_LABEL_TYPE = "label-type"
Expand Down Expand Up @@ -262,8 +263,11 @@ jobs:
)
label_type = WORKFLOW_LABEL_META
set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, label_type)
# For Canary builds use canary runners
if args.github_repo == "pytorch/pytorch-canary" and label_type == WORKFLOW_LABEL_LF:
label_type = WORKFLOW_LABEL_LF_CANARY
set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, label_type)
if __name__ == "__main__":
main()
Expand Down

0 comments on commit 3eb9fa5

Please sign in to comment.