From 3eb9fa5d58162930783c1656d4779312d7518084 Mon Sep 17 00:00:00 2001 From: Thanh Ha Date: Mon, 22 Jul 2024 13:26:44 +0000 Subject: [PATCH] Add support for using LF Canary runners (#131188) 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: https://github.com/pytorch/pytorch/pull/131188 Approved by: https://github.com/ZainRizvi --- .github/scripts/runner_determinator.py | 5 +++++ .github/workflows/_runner-determinator.yml | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/.github/scripts/runner_determinator.py b/.github/scripts/runner_determinator.py index b9878ada36b51..d2b6828811118 100644 --- a/.github/scripts/runner_determinator.py +++ b/.github/scripts/runner_determinator.py @@ -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" @@ -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) diff --git a/.github/workflows/_runner-determinator.yml b/.github/workflows/_runner-determinator.yml index 3da47fc8c0aa8..21c5a2b31c30e 100644 --- a/.github/workflows/_runner-determinator.yml +++ b/.github/workflows/_runner-determinator.yml @@ -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" @@ -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()