2025-09-07T07:02:10.4114657Z Current runner version: '2.328.0' 2025-09-07T07:02:10.4138256Z ##[group]Runner Image Provisioner 2025-09-07T07:02:10.4139056Z Hosted Compute Agent 2025-09-07T07:02:10.4139546Z Version: 20250829.383 2025-09-07T07:02:10.4140344Z Commit: 27cb235aab5b0e52e153a26cd86b4742e89dac5d 2025-09-07T07:02:10.4141010Z Build Date: 2025-08-29T13:48:48Z 2025-09-07T07:02:10.4141583Z ##[endgroup] 2025-09-07T07:02:10.4142145Z ##[group]Operating System 2025-09-07T07:02:10.4142701Z Ubuntu 2025-09-07T07:02:10.4143130Z 24.04.3 2025-09-07T07:02:10.4143676Z LTS 2025-09-07T07:02:10.4144123Z ##[endgroup] 2025-09-07T07:02:10.4144566Z ##[group]Runner Image 2025-09-07T07:02:10.4145278Z Image: ubuntu-24.04 2025-09-07T07:02:10.4145812Z Version: 20250831.1.0 2025-09-07T07:02:10.4146787Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250831.1/images/ubuntu/Ubuntu2404-Readme.md 2025-09-07T07:02:10.4148323Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250831.1 2025-09-07T07:02:10.4149269Z ##[endgroup] 2025-09-07T07:02:10.4150293Z ##[group]GITHUB_TOKEN Permissions 2025-09-07T07:02:10.4152335Z Contents: read 2025-09-07T07:02:10.4152950Z Metadata: read 2025-09-07T07:02:10.4153469Z ##[endgroup] 2025-09-07T07:02:10.4155694Z Secret source: Actions 2025-09-07T07:02:10.4156341Z Prepare workflow directory 2025-09-07T07:02:10.4666647Z Prepare all required actions 2025-09-07T07:02:10.4720810Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (93fb23d6fae7c4e82c4239a1033e522088742634) 2025-09-07T07:02:10.4725823Z ##[group] Inputs 2025-09-07T07:02:10.4726389Z check_experiments: 2025-09-07T07:02:10.4727019Z opt_out_experiments: lf 2025-09-07T07:02:10.4727631Z triggering_actor: pytorchmergebot 2025-09-07T07:02:10.4728191Z issue_owner: 2025-09-07T07:02:10.4728724Z curr_branch: main 2025-09-07T07:02:10.4729254Z curr_ref_type: branch 2025-09-07T07:02:10.4729887Z issue_number: 5132 2025-09-07T07:02:10.4730343Z ##[endgroup] 2025-09-07T07:02:10.4731083Z Complete job name: get-default-label-prefix / runner-determinator 2025-09-07T07:02:11.1623303Z ##[group]Run cat < runner_determinator.py 2025-09-07T07:02:11.1625965Z cat < runner_determinator.py 2025-09-07T07:02:11.1626676Z # flake8: noqa: G004 2025-09-07T07:02:11.1627696Z  2025-09-07T07:02:11.1628468Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-09-07T07:02:11.1629561Z # must be kept in sync. You can do it easily by running the following command: 2025-09-07T07:02:11.1630737Z # python .github/scripts/update_runner_determinator.py 2025-09-07T07:02:11.1631509Z  2025-09-07T07:02:11.1631971Z """ 2025-09-07T07:02:11.1632761Z This runner determinator is used to determine which set of runners to run a 2025-09-07T07:02:11.1633843Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-09-07T07:02:11.1635099Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-09-07T07:02:11.1636253Z of which runners should be used to run which job. 2025-09-07T07:02:11.1636969Z  2025-09-07T07:02:11.1637755Z The configuration has two parts, the settings and a list of opted-in users, 2025-09-07T07:02:11.1638873Z separated by a line containing "---". If the line is not present, the 2025-09-07T07:02:11.1639899Z settings are considered to be empty with only the second part, the user 2025-09-07T07:02:11.1640824Z list, defined. 2025-09-07T07:02:11.1641352Z  2025-09-07T07:02:11.1642062Z The first part is a YAML block that defines the rollout settings. This can be 2025-09-07T07:02:11.1643125Z used to define any settings that are needed to determine which runners to use. 2025-09-07T07:02:11.1644219Z It's fields are defined by the RolloutSettings class below. 2025-09-07T07:02:11.1644968Z  2025-09-07T07:02:11.1646215Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-09-07T07:02:11.1647452Z The user list is also a comma separated list of additional features or 2025-09-07T07:02:11.1648349Z experiments which the user could be opted in to. 2025-09-07T07:02:11.1649043Z  2025-09-07T07:02:11.1649639Z The user list has the following rules: 2025-09-07T07:02:11.1650260Z  2025-09-07T07:02:11.1650979Z - Users are GitHub usernames, which must start with the @ prefix 2025-09-07T07:02:11.1652048Z - Each user is also a comma-separated list of features/experiments to enable 2025-09-07T07:02:11.1652991Z - A "#" prefix opts the user out of all experiments 2025-09-07T07:02:11.1653639Z  2025-09-07T07:02:11.1654177Z Example config: 2025-09-07T07:02:11.1654858Z  # A list of experiments that can be opted into. 2025-09-07T07:02:11.1655860Z  # This defines the behavior they'll induce when opted into. 2025-09-07T07:02:11.1656733Z  # Expected syntax is: 2025-09-07T07:02:11.1657523Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-09-07T07:02:11.1658665Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-09-07T07:02:11.1659613Z  2025-09-07T07:02:11.1660067Z  experiments: 2025-09-07T07:02:11.1660643Z  lf: 2025-09-07T07:02:11.1661173Z  rollout_percent: 25 2025-09-07T07:02:11.1661824Z  all_branches: false 2025-09-07T07:02:11.1662398Z  default: true 2025-09-07T07:02:11.1663005Z  --- 2025-09-07T07:02:11.1663545Z  2025-09-07T07:02:11.1663987Z  # Opt-ins: 2025-09-07T07:02:11.1664838Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-09-07T07:02:11.1666260Z  # and specifying experiments to enable in a comma-separated list. 2025-09-07T07:02:11.1667260Z  # To always opt out of an experiment, prefix it with a "-". 2025-09-07T07:02:11.1668154Z  # Experiments should be from the above list. 2025-09-07T07:02:11.1668871Z  2025-09-07T07:02:11.1669390Z  @User1,-lf,split_build 2025-09-07T07:02:11.1669961Z  @User2,lf 2025-09-07T07:02:11.1670594Z  @User3,split_build 2025-09-07T07:02:11.1671153Z """ 2025-09-07T07:02:11.1671630Z  2025-09-07T07:02:11.1672185Z import json 2025-09-07T07:02:11.1672727Z import logging 2025-09-07T07:02:11.1673253Z import os 2025-09-07T07:02:11.1754529Z import random 2025-09-07T07:02:11.1755027Z import re 2025-09-07T07:02:11.1755629Z import sys 2025-09-07T07:02:11.1756120Z from argparse import ArgumentParser 2025-09-07T07:02:11.1756799Z from collections.abc import Iterable 2025-09-07T07:02:11.1757412Z from functools import cache 2025-09-07T07:02:11.1757958Z from logging import LogRecord 2025-09-07T07:02:11.1758534Z from typing import Any, NamedTuple 2025-09-07T07:02:11.1759186Z from urllib.request import Request, urlopen 2025-09-07T07:02:11.1759802Z  2025-09-07T07:02:11.1760184Z import yaml 2025-09-07T07:02:11.1760655Z from github import Auth, Github 2025-09-07T07:02:11.1761216Z from github.Issue import Issue 2025-09-07T07:02:11.1761733Z  2025-09-07T07:02:11.1762105Z  2025-09-07T07:02:11.1762580Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-09-07T07:02:11.1763359Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-09-07T07:02:11.1764334Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-09-07T07:02:11.1765134Z  2025-09-07T07:02:11.1766012Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-09-07T07:02:11.1766656Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-09-07T07:02:11.1767253Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-09-07T07:02:11.1767916Z OPT_OUT_LABEL = "no-runner-experiments" 2025-09-07T07:02:11.1768483Z  2025-09-07T07:02:11.1768912Z SETTING_EXPERIMENTS = "experiments" 2025-09-07T07:02:11.1769456Z  2025-09-07T07:02:11.1769855Z LF_FLEET_EXPERIMENT = "lf" 2025-09-07T07:02:11.1770387Z CANARY_FLEET_SUFFIX = ".c" 2025-09-07T07:02:11.1770881Z  2025-09-07T07:02:11.1771249Z  2025-09-07T07:02:11.1771663Z class Experiment(NamedTuple): 2025-09-07T07:02:11.1772221Z  rollout_perc: float = ( 2025-09-07T07:02:11.1772970Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-09-07T07:02:11.1773699Z  ) 2025-09-07T07:02:11.1774123Z  all_branches: bool = ( 2025-09-07T07:02:11.1774860Z  False # If True, the experiment is also enabled on the exception branches 2025-09-07T07:02:11.1775750Z  ) 2025-09-07T07:02:11.1776174Z  default: bool = ( 2025-09-07T07:02:11.1776853Z  True # If True, the experiment is enabled by default for all queries 2025-09-07T07:02:11.1777541Z  ) 2025-09-07T07:02:11.1777936Z  2025-09-07T07:02:11.1778337Z  # Add more fields as needed 2025-09-07T07:02:11.1778845Z  2025-09-07T07:02:11.1779213Z  2025-09-07T07:02:11.1779617Z class Settings(NamedTuple): 2025-09-07T07:02:11.1780141Z  """ 2025-09-07T07:02:11.1780676Z  Settings for the experiments that can be opted into. 2025-09-07T07:02:11.1781318Z  """ 2025-09-07T07:02:11.1781716Z  2025-09-07T07:02:11.1782166Z  experiments: dict[str, Experiment] = {} 2025-09-07T07:02:11.1782741Z  2025-09-07T07:02:11.1783244Z  2025-09-07T07:02:11.1783713Z class ColorFormatter(logging.Formatter): 2025-09-07T07:02:11.1784424Z  """Color codes the log messages based on the log level""" 2025-09-07T07:02:11.1785072Z  2025-09-07T07:02:11.1785573Z  COLORS = { 2025-09-07T07:02:11.1786073Z  "WARNING": "\033[33m", # Yellow 2025-09-07T07:02:11.1786644Z  "ERROR": "\033[31m", # Red 2025-09-07T07:02:11.1787211Z  "CRITICAL": "\033[31m", # Red 2025-09-07T07:02:11.1787767Z  "INFO": "\033[0m", # Reset 2025-09-07T07:02:11.1788316Z  "DEBUG": "\033[0m", # Reset 2025-09-07T07:02:11.1788844Z  } 2025-09-07T07:02:11.1789225Z  2025-09-07T07:02:11.1789683Z  def format(self, record: LogRecord) -> str: 2025-09-07T07:02:11.1790507Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-09-07T07:02:11.1791362Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-09-07T07:02:11.1792006Z  return super().format(record) 2025-09-07T07:02:11.1792543Z  2025-09-07T07:02:11.1792912Z  2025-09-07T07:02:11.1793332Z handler = logging.StreamHandler() 2025-09-07T07:02:11.1794149Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-09-07T07:02:11.1794917Z  2025-09-07T07:02:11.1795543Z log = logging.getLogger(os.path.basename(__file__)) 2025-09-07T07:02:11.1796214Z log.addHandler(handler) 2025-09-07T07:02:11.1796749Z log.setLevel(logging.INFO) 2025-09-07T07:02:11.1797255Z  2025-09-07T07:02:11.1797618Z  2025-09-07T07:02:11.1798130Z def set_github_output(key: str, value: str) -> None: 2025-09-07T07:02:11.1798768Z  """ 2025-09-07T07:02:11.1799353Z  Defines outputs of the github action that invokes this script 2025-09-07T07:02:11.1800184Z  """ 2025-09-07T07:02:11.1800617Z  if not GITHUB_OUTPUT: 2025-09-07T07:02:11.1801783Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-09-07T07:02:11.1802985Z  log.warning( 2025-09-07T07:02:11.1803951Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-09-07T07:02:11.1804928Z  ) 2025-09-07T07:02:11.1805542Z  print(f"::set-output name={key}::{value}") 2025-09-07T07:02:11.1806152Z  return 2025-09-07T07:02:11.1806590Z  2025-09-07T07:02:11.1807023Z  with open(GITHUB_OUTPUT, "a") as f: 2025-09-07T07:02:11.1807659Z  log.info(f"Setting output: {key}='{value}'") 2025-09-07T07:02:11.1808292Z  f.write(f"{key}={value}\n") 2025-09-07T07:02:11.1808832Z  2025-09-07T07:02:11.1809204Z  2025-09-07T07:02:11.1809762Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-09-07T07:02:11.1810478Z  return frozenset( 2025-09-07T07:02:11.1811190Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-09-07T07:02:11.1811921Z  ) 2025-09-07T07:02:11.1812337Z  2025-09-07T07:02:11.1812710Z  2025-09-07T07:02:11.1813115Z def parse_args() -> Any: 2025-09-07T07:02:11.1813776Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-09-07T07:02:11.1814741Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-09-07T07:02:11.1815716Z  parser.add_argument( 2025-09-07T07:02:11.1816292Z  "--github-issue-repo", 2025-09-07T07:02:11.1816836Z  type=str, 2025-09-07T07:02:11.1817329Z  required=False, 2025-09-07T07:02:11.1818001Z  default="pytorch/test-infra", 2025-09-07T07:02:11.1818636Z  help="GitHub repo to get the issue", 2025-09-07T07:02:11.1819209Z  ) 2025-09-07T07:02:11.1819635Z  parser.add_argument( 2025-09-07T07:02:11.1820160Z  "--github-repo", 2025-09-07T07:02:11.1820672Z  type=str, 2025-09-07T07:02:11.1821146Z  required=True, 2025-09-07T07:02:11.1821704Z  help="GitHub repo where CI is running", 2025-09-07T07:02:11.1822278Z  ) 2025-09-07T07:02:11.1822708Z  parser.add_argument( 2025-09-07T07:02:11.1823414Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-09-07T07:02:11.1824129Z  ) 2025-09-07T07:02:11.1824555Z  parser.add_argument( 2025-09-07T07:02:11.1825557Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-09-07T07:02:11.1826342Z  ) 2025-09-07T07:02:11.1826762Z  parser.add_argument( 2025-09-07T07:02:11.1827501Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-09-07T07:02:11.1828249Z  ) 2025-09-07T07:02:11.1828666Z  parser.add_argument( 2025-09-07T07:02:11.1829424Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-09-07T07:02:11.1830191Z  ) 2025-09-07T07:02:11.1830632Z  parser.add_argument( 2025-09-07T07:02:11.1831161Z  "--github-ref-type", 2025-09-07T07:02:11.1831692Z  type=str, 2025-09-07T07:02:11.1832181Z  required=True, 2025-09-07T07:02:11.1832781Z  help="Current GitHub ref type, branch or tag", 2025-09-07T07:02:11.1833388Z  ) 2025-09-07T07:02:11.1833807Z  parser.add_argument( 2025-09-07T07:02:11.1834502Z  "--eligible-experiments", 2025-09-07T07:02:11.1835116Z  type=_str_comma_separated_to_set, 2025-09-07T07:02:11.1835852Z  required=False, 2025-09-07T07:02:11.1836387Z  default="", 2025-09-07T07:02:11.1837331Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-09-07T07:02:11.1838316Z  ) 2025-09-07T07:02:11.1838736Z  parser.add_argument( 2025-09-07T07:02:11.1839267Z  "--opt-out-experiments", 2025-09-07T07:02:11.1839854Z  type=_str_comma_separated_to_set, 2025-09-07T07:02:11.1840424Z  required=False, 2025-09-07T07:02:11.1840925Z  default="", 2025-09-07T07:02:11.1841392Z  help=( 2025-09-07T07:02:11.1842163Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-09-07T07:02:11.1843379Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-09-07T07:02:11.1844270Z  ), 2025-09-07T07:02:11.1844690Z  ) 2025-09-07T07:02:11.1845110Z  parser.add_argument( 2025-09-07T07:02:11.1845730Z  "--pr-number", 2025-09-07T07:02:11.1846231Z  type=str, 2025-09-07T07:02:11.1846706Z  required=False, 2025-09-07T07:02:11.1847200Z  default="", 2025-09-07T07:02:11.1847769Z  help="the optional PR number where this is run", 2025-09-07T07:02:11.1848378Z  ) 2025-09-07T07:02:11.1848771Z  2025-09-07T07:02:11.1849187Z  return parser.parse_args() 2025-09-07T07:02:11.1849704Z  2025-09-07T07:02:11.1850074Z  2025-09-07T07:02:11.1850723Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-09-07T07:02:11.1851688Z  auth = Auth.Token(github_token) 2025-09-07T07:02:11.1852301Z  return Github(auth=auth) 2025-09-07T07:02:11.1852812Z  2025-09-07T07:02:11.1853177Z  2025-09-07T07:02:11.1853895Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-09-07T07:02:11.1854762Z  repo = gh.get_repo(repo) 2025-09-07T07:02:11.1855496Z  return repo.get_issue(number=issue_num) 2025-09-07T07:02:11.1856078Z  2025-09-07T07:02:11.1856457Z  2025-09-07T07:02:11.1856862Z def get_potential_pr_author( 2025-09-07T07:02:11.1857603Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-09-07T07:02:11.1858340Z ) -> str: 2025-09-07T07:02:11.1858941Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-09-07T07:02:11.1859837Z  # Fetch the actual username from the original PR. The PR number is 2025-09-07T07:02:11.1860681Z  # embedded in the tag name: ciflow// 2025-09-07T07:02:11.1861304Z  2025-09-07T07:02:11.1861731Z  gh = get_gh_client(github_token) 2025-09-07T07:02:11.1862275Z  2025-09-07T07:02:11.1862792Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-09-07T07:02:11.1863489Z  split_tag = ref_name.split("/") 2025-09-07T07:02:11.1864040Z  if ( 2025-09-07T07:02:11.1864523Z  len(split_tag) == 3 2025-09-07T07:02:11.1865087Z  and split_tag[0] == "ciflow" 2025-09-07T07:02:11.1865797Z  and split_tag[2].isnumeric() 2025-09-07T07:02:11.1866371Z  ): 2025-09-07T07:02:11.1866835Z  pr_number = split_tag[2] 2025-09-07T07:02:11.1867381Z  try: 2025-09-07T07:02:11.1867890Z  repository = gh.get_repo(repo) 2025-09-07T07:02:11.1868722Z  pull = repository.get_pull(number=int(pr_number)) 2025-09-07T07:02:11.1869393Z  except Exception as e: 2025-09-07T07:02:11.1869999Z  raise Exception( # noqa: TRY002 2025-09-07T07:02:11.1870741Z  f"issue with pull request {pr_number} from repo {repository}" 2025-09-07T07:02:11.1871447Z  ) from e 2025-09-07T07:02:11.1872086Z  return pull.user.login # type: ignore[no-any-return] 2025-09-07T07:02:11.1872864Z  # In all other cases, return the original input username 2025-09-07T07:02:11.1873525Z  return username 2025-09-07T07:02:11.1873991Z  2025-09-07T07:02:11.1874365Z  2025-09-07T07:02:11.1874826Z def is_exception_branch(branch: str) -> bool: 2025-09-07T07:02:11.1875548Z  """ 2025-09-07T07:02:11.1876284Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-09-07T07:02:11.1877131Z  """ 2025-09-07T07:02:11.1877762Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-09-07T07:02:11.1878488Z  2025-09-07T07:02:11.1878867Z  2025-09-07T07:02:11.1879297Z def load_yaml(yaml_text: str) -> Any: 2025-09-07T07:02:11.1879857Z  try: 2025-09-07T07:02:11.1880315Z  data = yaml.safe_load(yaml_text) 2025-09-07T07:02:11.1880880Z  return data 2025-09-07T07:02:11.1881387Z  except yaml.YAMLError: 2025-09-07T07:02:11.1881960Z  log.exception("Error loading YAML") 2025-09-07T07:02:11.1882528Z  raise 2025-09-07T07:02:11.1882961Z  2025-09-07T07:02:11.1883327Z  2025-09-07T07:02:11.1883998Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-09-07T07:02:11.1884804Z  """ 2025-09-07T07:02:11.1885729Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-09-07T07:02:11.1886546Z  2025-09-07T07:02:11.1887139Z  If the issue body contains "---" then the text above that is the settings 2025-09-07T07:02:11.1887995Z  and the text below is the list of opted in users. 2025-09-07T07:02:11.1888608Z  2025-09-07T07:02:11.1889231Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-09-07T07:02:11.1889990Z  """ 2025-09-07T07:02:11.1890509Z  rollout_state_parts = rollout_state.split("---") 2025-09-07T07:02:11.1891173Z  if len(rollout_state_parts) >= 2: 2025-09-07T07:02:11.1891867Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-09-07T07:02:11.1892510Z  else: 2025-09-07T07:02:11.1892949Z  return "", rollout_state 2025-09-07T07:02:11.1893465Z  2025-09-07T07:02:11.1893831Z  2025-09-07T07:02:11.1894502Z class UserOptins(dict[str, list[str]]): 2025-09-07T07:02:11.1895067Z  """ 2025-09-07T07:02:11.1895805Z  Dictionary of users with a list of features they have opted into 2025-09-07T07:02:11.1896498Z  """ 2025-09-07T07:02:11.1896887Z  2025-09-07T07:02:11.1897247Z  2025-09-07T07:02:11.1897830Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-09-07T07:02:11.1898536Z  """ 2025-09-07T07:02:11.1899338Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-09-07T07:02:11.1900229Z  2025-09-07T07:02:11.1901090Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-09-07T07:02:11.1902170Z  - Example line: "@User1,lf,split_build" 2025-09-07T07:02:11.1903073Z  - A "#" prefix indicates the user is opted out of all experiments 2025-09-07T07:02:11.1903760Z  2025-09-07T07:02:11.1904121Z  2025-09-07T07:02:11.1904476Z  """ 2025-09-07T07:02:11.1904899Z  optins = UserOptins() 2025-09-07T07:02:11.1906037Z  for user in user_optin_text.split("\n"): 2025-09-07T07:02:11.1906659Z  user = user.strip("\r\n\t -") 2025-09-07T07:02:11.1907281Z  if not user or not user.startswith("@"): 2025-09-07T07:02:11.1907894Z  # Not a valid user. Skip 2025-09-07T07:02:11.1908432Z  continue 2025-09-07T07:02:11.1908889Z  2025-09-07T07:02:11.1909266Z  if user: 2025-09-07T07:02:11.1909782Z  usr_name = user.split(",")[0].strip("@") 2025-09-07T07:02:11.1910544Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-09-07T07:02:11.1911269Z  2025-09-07T07:02:11.1911659Z  return optins 2025-09-07T07:02:11.1912105Z  2025-09-07T07:02:11.1912466Z  2025-09-07T07:02:11.1913002Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-09-07T07:02:11.1913669Z  """ 2025-09-07T07:02:11.1914122Z  Check if the experiment name is valid. 2025-09-07T07:02:11.1914690Z  A valid name: 2025-09-07T07:02:11.1915555Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-09-07T07:02:11.1916571Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-09-07T07:02:11.1917340Z  - Cannot contain spaces 2025-09-07T07:02:11.1917857Z  """ 2025-09-07T07:02:11.1918245Z  2025-09-07T07:02:11.1918746Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-09-07T07:02:11.1919552Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-09-07T07:02:11.1920331Z  2025-09-07T07:02:11.1920704Z  if valid: 2025-09-07T07:02:11.1921154Z  return True 2025-09-07T07:02:11.1921610Z  2025-09-07T07:02:11.1921977Z  log.error( 2025-09-07T07:02:11.1923515Z  f"Invalid experiment name: {experiment_name}. Experiment names should only contain alphanumeric characters, '_', and '-'. They cannot contain spaces, and the special characters '_' and '-' cannot be the first or last characters." 2025-09-07T07:02:11.1925133Z  ) 2025-09-07T07:02:11.1925641Z  return False 2025-09-07T07:02:11.1926080Z  2025-09-07T07:02:11.1926435Z  2025-09-07T07:02:11.1926990Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-09-07T07:02:11.1927671Z  """ 2025-09-07T07:02:11.1928329Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-09-07T07:02:11.1929088Z  """ 2025-09-07T07:02:11.1929488Z  try: 2025-09-07T07:02:11.1929908Z  if settings_text: 2025-09-07T07:02:11.1930723Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-09-07T07:02:11.1931562Z  # for easy reading 2025-09-07T07:02:11.1932453Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-09-07T07:02:11.1933412Z  # the backtick character in shell commands. 2025-09-07T07:02:11.1934079Z  backtick = chr(96) # backtick character 2025-09-07T07:02:11.1934824Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-09-07T07:02:11.1935672Z  settings = load_yaml(settings_text) 2025-09-07T07:02:11.1936230Z  2025-09-07T07:02:11.1936875Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-09-07T07:02:11.1937804Z  experiments = {} 2025-09-07T07:02:11.1938304Z  2025-09-07T07:02:11.1938911Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-09-07T07:02:11.1939742Z  if not is_valid_experiment_name(exp_name): 2025-09-07T07:02:11.1940926Z  # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2025-09-07T07:02:11.1942025Z  continue 2025-09-07T07:02:11.1942515Z  2025-09-07T07:02:11.1942916Z  valid_settings = {} 2025-09-07T07:02:11.1943503Z  for setting in exp_settings: 2025-09-07T07:02:11.1944120Z  if setting not in Experiment._fields: 2025-09-07T07:02:11.1944730Z  log.warning( 2025-09-07T07:02:11.1945628Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-09-07T07:02:11.1946392Z  ) 2025-09-07T07:02:11.1946880Z  else: 2025-09-07T07:02:11.1947468Z  valid_settings[setting] = exp_settings[setting] 2025-09-07T07:02:11.1948078Z  2025-09-07T07:02:11.1948583Z  experiments[exp_name] = Experiment(**valid_settings) 2025-09-07T07:02:11.1949279Z  return Settings(experiments) 2025-09-07T07:02:11.1949820Z  2025-09-07T07:02:11.1950206Z  except Exception: 2025-09-07T07:02:11.1950766Z  log.exception("Failed to parse settings") 2025-09-07T07:02:11.1951335Z  2025-09-07T07:02:11.1951718Z  return Settings() 2025-09-07T07:02:11.1952174Z  2025-09-07T07:02:11.1952537Z  2025-09-07T07:02:11.1953139Z def parse_settings(rollout_state: str) -> Settings: 2025-09-07T07:02:11.1953769Z  """ 2025-09-07T07:02:11.1954274Z  Parse settings, if any, from the rollout state. 2025-09-07T07:02:11.1954868Z  2025-09-07T07:02:11.1955550Z  If the issue body contains "---" then the text above that is the settings 2025-09-07T07:02:11.1956376Z  and the text below is the list of opted in users. 2025-09-07T07:02:11.1956979Z  2025-09-07T07:02:11.1957617Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-09-07T07:02:11.1958383Z  """ 2025-09-07T07:02:11.1959003Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-09-07T07:02:11.1959834Z  return parse_settings_from_text(settings_text) 2025-09-07T07:02:11.1960418Z  2025-09-07T07:02:11.1960776Z  2025-09-07T07:02:11.1961269Z def parse_users(rollout_state: str) -> UserOptins: 2025-09-07T07:02:11.1961882Z  """ 2025-09-07T07:02:11.1962340Z  Parse users from the rollout state. 2025-09-07T07:02:11.1962889Z  2025-09-07T07:02:11.1963250Z  """ 2025-09-07T07:02:11.1963854Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-09-07T07:02:11.1964695Z  return parse_user_opt_in_from_text(users_text) 2025-09-07T07:02:11.1965398Z  2025-09-07T07:02:11.1965765Z  2025-09-07T07:02:11.1966433Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-09-07T07:02:11.1967229Z  """ 2025-09-07T07:02:11.1967717Z  Check if a user is opted into an experiment 2025-09-07T07:02:11.1968299Z  """ 2025-09-07T07:02:11.1968820Z  return experiment_name in user_optins.get(user, []) 2025-09-07T07:02:11.1969441Z  2025-09-07T07:02:11.1969980Z  2025-09-07T07:02:11.1970668Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-09-07T07:02:11.1971466Z  """ 2025-09-07T07:02:11.1971997Z  Check if a user explicitly opted out of an experiment 2025-09-07T07:02:11.1972624Z  """ 2025-09-07T07:02:11.1973205Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-09-07T07:02:11.1973964Z  experiment_optout = "-" + experiment_name 2025-09-07T07:02:11.1974668Z  if experiment_optout not in user_optins.get(user, []): 2025-09-07T07:02:11.1975426Z  return False 2025-09-07T07:02:11.1975882Z  2025-09-07T07:02:11.1976389Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-09-07T07:02:11.1977041Z  log.warning( 2025-09-07T07:02:11.1977953Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-09-07T07:02:11.1978880Z  ) 2025-09-07T07:02:11.1979275Z  2025-09-07T07:02:11.1979656Z  return True 2025-09-07T07:02:11.1980088Z  2025-09-07T07:02:11.1980453Z  2025-09-07T07:02:11.1980838Z def get_runner_prefix( 2025-09-07T07:02:11.1981343Z  rollout_state: str, 2025-09-07T07:02:11.1981881Z  workflow_requestors: Iterable[str], 2025-09-07T07:02:11.1982445Z  branch: str, 2025-09-07T07:02:11.1983019Z  eligible_experiments: frozenset[str] = frozenset(), 2025-09-07T07:02:11.1983764Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-09-07T07:02:11.1984400Z  is_canary: bool = False, 2025-09-07T07:02:11.1984905Z ) -> str: 2025-09-07T07:02:11.1985502Z  settings = parse_settings(rollout_state) 2025-09-07T07:02:11.1986145Z  user_optins = parse_users(rollout_state) 2025-09-07T07:02:11.1986712Z  2025-09-07T07:02:11.1987225Z  fleet_prefix = "" 2025-09-07T07:02:11.1987726Z  prefixes = [] 2025-09-07T07:02:11.1988453Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-09-07T07:02:11.1989471Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-09-07T07:02:11.1990239Z  log.info( 2025-09-07T07:02:11.1991008Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-09-07T07:02:11.1991801Z  ) 2025-09-07T07:02:11.1992255Z  continue 2025-09-07T07:02:11.1992716Z  2025-09-07T07:02:11.1993122Z  if opt_out_experiments: 2025-09-07T07:02:11.1993739Z  if experiment_name in opt_out_experiments: 2025-09-07T07:02:11.1994464Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-09-07T07:02:11.1995117Z  log.info( 2025-09-07T07:02:11.1996238Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-09-07T07:02:11.1997265Z  ) 2025-09-07T07:02:11.1997767Z  continue 2025-09-07T07:02:11.1998250Z  2025-09-07T07:02:11.1998663Z  if eligible_experiments: 2025-09-07T07:02:11.1999305Z  if experiment_name not in eligible_experiments: 2025-09-07T07:02:11.2000004Z  exp_list = ", ".join(eligible_experiments) 2025-09-07T07:02:11.2000606Z  log.info( 2025-09-07T07:02:11.2001473Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-09-07T07:02:11.2002355Z  ) 2025-09-07T07:02:11.2002962Z  continue 2025-09-07T07:02:11.2003524Z  elif not experiment_settings.default: 2025-09-07T07:02:11.2004109Z  log.info( 2025-09-07T07:02:11.2004860Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-09-07T07:02:11.2005750Z  ) 2025-09-07T07:02:11.2006192Z  continue 2025-09-07T07:02:11.2006642Z  2025-09-07T07:02:11.2007163Z  # Is any workflow_requestor opted out to this experiment? 2025-09-07T07:02:11.2007826Z  opted_out_users = [ 2025-09-07T07:02:11.2008347Z  requestor 2025-09-07T07:02:11.2008884Z  for requestor in workflow_requestors 2025-09-07T07:02:11.2009628Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-09-07T07:02:11.2010314Z  ] 2025-09-07T07:02:11.2010717Z  2025-09-07T07:02:11.2011120Z  if opted_out_users: 2025-09-07T07:02:11.2011646Z  log.info( 2025-09-07T07:02:11.2012381Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-09-07T07:02:11.2013141Z  ) 2025-09-07T07:02:11.2013588Z  continue 2025-09-07T07:02:11.2014043Z  2025-09-07T07:02:11.2014548Z  # Is any workflow_requestor opted in to this experiment? 2025-09-07T07:02:11.2015308Z  opted_in_users = [ 2025-09-07T07:02:11.2015832Z  requestor 2025-09-07T07:02:11.2016376Z  for requestor in workflow_requestors 2025-09-07T07:02:11.2017116Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-09-07T07:02:11.2017794Z  ] 2025-09-07T07:02:11.2018199Z  2025-09-07T07:02:11.2018583Z  enabled = False 2025-09-07T07:02:11.2019095Z  if opted_in_users: 2025-09-07T07:02:11.2019732Z  log.info( 2025-09-07T07:02:11.2020451Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-09-07T07:02:11.2021181Z  ) 2025-09-07T07:02:11.2021636Z  enabled = True 2025-09-07T07:02:11.2022129Z  2025-09-07T07:02:11.2022575Z  elif experiment_settings.rollout_perc: 2025-09-07T07:02:11.2023478Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-09-07T07:02:11.2024496Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-09-07T07:02:11.2025300Z  log.info( 2025-09-07T07:02:11.2026261Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-09-07T07:02:11.2027229Z  ) 2025-09-07T07:02:11.2027718Z  enabled = True 2025-09-07T07:02:11.2028223Z  2025-09-07T07:02:11.2028611Z  if enabled: 2025-09-07T07:02:11.2029150Z  label = experiment_name 2025-09-07T07:02:11.2029774Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-09-07T07:02:11.2030675Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-09-07T07:02:11.2031623Z  # - If it's enabled, then we always list it's prefix first 2025-09-07T07:02:11.2032462Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-09-07T07:02:11.2033181Z  if is_canary: 2025-09-07T07:02:11.2033746Z  label += CANARY_FLEET_SUFFIX 2025-09-07T07:02:11.2034342Z  fleet_prefix = label 2025-09-07T07:02:11.2034894Z  else: 2025-09-07T07:02:11.2035653Z  prefixes.append(label) 2025-09-07T07:02:11.2036197Z  2025-09-07T07:02:11.2036589Z  if len(prefixes) > 1: 2025-09-07T07:02:11.2037104Z  log.error( 2025-09-07T07:02:11.2038241Z  f"Only a fleet and one other experiment can be enabled for a job at any time. Enabling {prefixes[0]} and ignoring the rest, which are {', '.join(prefixes[1:])}" 2025-09-07T07:02:11.2039409Z  ) 2025-09-07T07:02:11.2039853Z  prefixes = prefixes[:1] 2025-09-07T07:02:11.2040367Z  2025-09-07T07:02:11.2040767Z  # Fleet always comes first 2025-09-07T07:02:11.2041305Z  if fleet_prefix: 2025-09-07T07:02:11.2041823Z  prefixes.insert(0, fleet_prefix) 2025-09-07T07:02:11.2042378Z  2025-09-07T07:02:11.2042871Z  return ".".join(prefixes) + "." if prefixes else "" 2025-09-07T07:02:11.2043486Z  2025-09-07T07:02:11.2043851Z  2025-09-07T07:02:11.2044550Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-09-07T07:02:11.2045469Z  """ 2025-09-07T07:02:11.2046119Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-09-07T07:02:11.2046884Z  2025-09-07T07:02:11.2047501Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-09-07T07:02:11.2048260Z  """ 2025-09-07T07:02:11.2048700Z  gh = get_gh_client(github_token) 2025-09-07T07:02:11.2049318Z  issue = get_issue(gh, repo, issue_num) 2025-09-07T07:02:11.2050032Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-09-07T07:02:11.2050666Z  2025-09-07T07:02:11.2051035Z  2025-09-07T07:02:11.2051678Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-09-07T07:02:11.2052632Z  for _ in range(num_retries): 2025-09-07T07:02:11.2053169Z  try: 2025-09-07T07:02:11.2053667Z  req = Request(url=url, headers=headers) 2025-09-07T07:02:11.2054398Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-09-07T07:02:11.2055095Z  return json.loads(content) 2025-09-07T07:02:11.2055784Z  except Exception as e: 2025-09-07T07:02:11.2056404Z  log.warning(f"Could not download {url}: {e}") 2025-09-07T07:02:11.2057002Z  2025-09-07T07:02:11.2057621Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-09-07T07:02:11.2058389Z  return {} 2025-09-07T07:02:11.2058816Z  2025-09-07T07:02:11.2059180Z  2025-09-07T07:02:11.2059551Z @cache 2025-09-07T07:02:11.2060249Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-09-07T07:02:11.2061064Z  """ 2025-09-07T07:02:11.2061509Z  Dynamically get PR information 2025-09-07T07:02:11.2062054Z  """ 2025-09-07T07:02:11.2062624Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-09-07T07:02:11.2063315Z  headers = { 2025-09-07T07:02:11.2063855Z  "Accept": "application/vnd.github.v3+json", 2025-09-07T07:02:11.2064553Z  "Authorization": f"token {github_token}", 2025-09-07T07:02:11.2065136Z  } 2025-09-07T07:02:11.2065722Z  json_response: dict[str, Any] = download_json( 2025-09-07T07:02:11.2066395Z  url=f"{github_api}/issues/{pr_number}", 2025-09-07T07:02:11.2066980Z  headers=headers, 2025-09-07T07:02:11.2067471Z  ) 2025-09-07T07:02:11.2067857Z  2025-09-07T07:02:11.2068245Z  if not json_response: 2025-09-07T07:02:11.2068901Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-09-07T07:02:11.2069720Z  return {} 2025-09-07T07:02:11.2070177Z  2025-09-07T07:02:11.2070569Z  return json_response 2025-09-07T07:02:11.2071060Z  2025-09-07T07:02:11.2071419Z  2025-09-07T07:02:11.2072059Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-09-07T07:02:11.2072832Z  """ 2025-09-07T07:02:11.2073423Z  Dynamically get the latest list of labels from the pull request 2025-09-07T07:02:11.2074120Z  """ 2025-09-07T07:02:11.2074666Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-09-07T07:02:11.2075431Z  return { 2025-09-07T07:02:11.2076081Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-09-07T07:02:11.2076814Z  } 2025-09-07T07:02:11.2077200Z  2025-09-07T07:02:11.2077567Z  2025-09-07T07:02:11.2077951Z def main() -> None: 2025-09-07T07:02:11.2078431Z  args = parse_args() 2025-09-07T07:02:11.2078920Z  2025-09-07T07:02:11.2079377Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-09-07T07:02:11.2079965Z  2025-09-07T07:02:11.2080363Z  # Check if the PR is opt-out 2025-09-07T07:02:11.2080911Z  if args.pr_number: 2025-09-07T07:02:11.2081665Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-09-07T07:02:11.2082472Z  if OPT_OUT_LABEL in labels: 2025-09-07T07:02:11.2083028Z  log.info( 2025-09-07T07:02:11.2083808Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-09-07T07:02:11.2084629Z  ) 2025-09-07T07:02:11.2085358Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-09-07T07:02:11.2086103Z  sys.exit() 2025-09-07T07:02:11.2086693Z  2025-09-07T07:02:11.2087070Z  try: 2025-09-07T07:02:11.2087578Z  rollout_state = get_rollout_state_from_issue( 2025-09-07T07:02:11.2088358Z  args.github_token, args.github_issue_repo, args.github_issue 2025-09-07T07:02:11.2089049Z  ) 2025-09-07T07:02:11.2089456Z  2025-09-07T07:02:11.2089892Z  username = get_potential_pr_author( 2025-09-07T07:02:11.2090482Z  args.github_token, 2025-09-07T07:02:11.2091062Z  args.github_repo, 2025-09-07T07:02:11.2091608Z  args.github_actor, 2025-09-07T07:02:11.2092158Z  args.github_ref_type, 2025-09-07T07:02:11.2092732Z  args.github_branch, 2025-09-07T07:02:11.2093251Z  ) 2025-09-07T07:02:11.2093658Z  2025-09-07T07:02:11.2094179Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-09-07T07:02:11.2094841Z  2025-09-07T07:02:11.2095399Z  runner_label_prefix = get_runner_prefix( 2025-09-07T07:02:11.2095998Z  rollout_state, 2025-09-07T07:02:11.2096567Z  (args.github_issue_owner, username), 2025-09-07T07:02:11.2097158Z  args.github_branch, 2025-09-07T07:02:11.2097729Z  args.eligible_experiments, 2025-09-07T07:02:11.2098321Z  args.opt_out_experiments, 2025-09-07T07:02:11.2098880Z  is_canary, 2025-09-07T07:02:11.2099358Z  ) 2025-09-07T07:02:11.2099772Z  2025-09-07T07:02:11.2100174Z  except Exception as e: 2025-09-07T07:02:11.2100689Z  log.error( 2025-09-07T07:02:11.2101460Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-09-07T07:02:11.2102257Z  ) 2025-09-07T07:02:11.2102806Z  2025-09-07T07:02:11.2103381Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-09-07T07:02:11.2104080Z  2025-09-07T07:02:11.2104446Z  2025-09-07T07:02:11.2104833Z if __name__ == "__main__": 2025-09-07T07:02:11.2105438Z  main() 2025-09-07T07:02:11.2105847Z  2025-09-07T07:02:11.2106214Z EOF 2025-09-07T07:02:11.2106589Z  2025-09-07T07:02:11.2106998Z cat runner_determinator.py 2025-09-07T07:02:11.3601857Z shell: /usr/bin/bash -e {0} 2025-09-07T07:02:11.3602698Z env: 2025-09-07T07:02:11.3603401Z GITHUB_TOKEN: *** 2025-09-07T07:02:11.3603833Z ISSUE_NUMBER: 5132 2025-09-07T07:02:11.3604289Z TRIGGERING_ACTOR: pytorchmergebot 2025-09-07T07:02:11.3604799Z ISSUE_OWNER: 2025-09-07T07:02:11.3605461Z CHECK_EXPERIMENTS: 2025-09-07T07:02:11.3605922Z OPT_OUT_EXPERIMENTS: lf 2025-09-07T07:02:11.3606374Z PR_NUMBER: 2025-09-07T07:02:11.3606777Z ##[endgroup] 2025-09-07T07:02:11.3821102Z # flake8: noqa: G004 2025-09-07T07:02:11.3821447Z 2025-09-07T07:02:11.3821886Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-09-07T07:02:11.3822845Z # must be kept in sync. You can do it easily by running the following command: 2025-09-07T07:02:11.3823645Z # python .github/scripts/update_runner_determinator.py 2025-09-07T07:02:11.3824092Z 2025-09-07T07:02:11.3824245Z """ 2025-09-07T07:02:11.3824857Z This runner determinator is used to determine which set of runners to run a 2025-09-07T07:02:11.3826130Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-09-07T07:02:11.3827036Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-09-07T07:02:11.3827840Z of which runners should be used to run which job. 2025-09-07T07:02:11.3828236Z 2025-09-07T07:02:11.3828607Z The configuration has two parts, the settings and a list of opted-in users, 2025-09-07T07:02:11.3829695Z separated by a line containing "---". If the line is not present, the 2025-09-07T07:02:11.3830598Z settings are considered to be empty with only the second part, the user 2025-09-07T07:02:11.3831291Z list, defined. 2025-09-07T07:02:11.3831516Z 2025-09-07T07:02:11.3831876Z The first part is a YAML block that defines the rollout settings. This can be 2025-09-07T07:02:11.3832803Z used to define any settings that are needed to determine which runners to use. 2025-09-07T07:02:11.3833623Z It's fields are defined by the RolloutSettings class below. 2025-09-07T07:02:11.3834063Z 2025-09-07T07:02:11.3834435Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-09-07T07:02:11.3835496Z The user list is also a comma separated list of additional features or 2025-09-07T07:02:11.3836232Z experiments which the user could be opted in to. 2025-09-07T07:02:11.3836630Z 2025-09-07T07:02:11.3836835Z The user list has the following rules: 2025-09-07T07:02:11.3837172Z 2025-09-07T07:02:11.3837489Z - Users are GitHub usernames, which must start with the @ prefix 2025-09-07T07:02:11.3838380Z - Each user is also a comma-separated list of features/experiments to enable 2025-09-07T07:02:11.3839130Z - A "#" prefix opts the user out of all experiments 2025-09-07T07:02:11.3839523Z 2025-09-07T07:02:11.3839693Z Example config: 2025-09-07T07:02:11.3840132Z # A list of experiments that can be opted into. 2025-09-07T07:02:11.3840778Z # This defines the behavior they'll induce when opted into. 2025-09-07T07:02:11.3841395Z # Expected syntax is: 2025-09-07T07:02:11.3842021Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-09-07T07:02:11.3843003Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-09-07T07:02:11.3843612Z 2025-09-07T07:02:11.3843782Z experiments: 2025-09-07T07:02:11.3844165Z lf: 2025-09-07T07:02:11.3844554Z rollout_percent: 25 2025-09-07T07:02:11.3845416Z all_branches: false 2025-09-07T07:02:11.3845894Z default: true 2025-09-07T07:02:11.3846326Z --- 2025-09-07T07:02:11.3846571Z 2025-09-07T07:02:11.3846740Z # Opt-ins: 2025-09-07T07:02:11.3847565Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-09-07T07:02:11.3848440Z # and specifying experiments to enable in a comma-separated list. 2025-09-07T07:02:11.3849204Z # To always opt out of an experiment, prefix it with a "-". 2025-09-07T07:02:11.3849865Z # Experiments should be from the above list. 2025-09-07T07:02:11.3850248Z 2025-09-07T07:02:11.3850427Z @User1,-lf,split_build 2025-09-07T07:02:11.3850877Z @User2,lf 2025-09-07T07:02:11.3851248Z @User3,split_build 2025-09-07T07:02:11.3851659Z """ 2025-09-07T07:02:11.3851851Z 2025-09-07T07:02:11.3852016Z import json 2025-09-07T07:02:11.3852395Z import logging 2025-09-07T07:02:11.3852785Z import os 2025-09-07T07:02:11.3853145Z import random 2025-09-07T07:02:11.3853518Z import re 2025-09-07T07:02:11.3853881Z import sys 2025-09-07T07:02:11.3854285Z from argparse import ArgumentParser 2025-09-07T07:02:11.3854806Z from collections.abc import Iterable 2025-09-07T07:02:11.3855582Z from functools import cache 2025-09-07T07:02:11.3856060Z from logging import LogRecord 2025-09-07T07:02:11.3856556Z from typing import Any, NamedTuple 2025-09-07T07:02:11.3857087Z from urllib.request import Request, urlopen 2025-09-07T07:02:11.3857482Z 2025-09-07T07:02:11.3857642Z import yaml 2025-09-07T07:02:11.3858032Z from github import Auth, Github 2025-09-07T07:02:11.3858508Z from github.Issue import Issue 2025-09-07T07:02:11.3858810Z 2025-09-07T07:02:11.3858817Z 2025-09-07T07:02:11.3859041Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-09-07T07:02:11.3859740Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-09-07T07:02:11.3860609Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-09-07T07:02:11.3861159Z 2025-09-07T07:02:11.3861388Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-09-07T07:02:11.3862111Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-09-07T07:02:11.3862642Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-09-07T07:02:11.3863183Z OPT_OUT_LABEL = "no-runner-experiments" 2025-09-07T07:02:11.3863530Z 2025-09-07T07:02:11.3863725Z SETTING_EXPERIMENTS = "experiments" 2025-09-07T07:02:11.3864130Z 2025-09-07T07:02:11.3864315Z LF_FLEET_EXPERIMENT = "lf" 2025-09-07T07:02:11.3864775Z CANARY_FLEET_SUFFIX = ".c" 2025-09-07T07:02:11.3865051Z 2025-09-07T07:02:11.3865057Z 2025-09-07T07:02:11.3865434Z class Experiment(NamedTuple): 2025-09-07T07:02:11.3865931Z rollout_perc: float = ( 2025-09-07T07:02:11.3866565Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-09-07T07:02:11.3867231Z ) 2025-09-07T07:02:11.3867598Z all_branches: bool = ( 2025-09-07T07:02:11.3868214Z False # If True, the experiment is also enabled on the exception branches 2025-09-07T07:02:11.3868889Z ) 2025-09-07T07:02:11.3869240Z default: bool = ( 2025-09-07T07:02:11.3869825Z True # If True, the experiment is enabled by default for all queries 2025-09-07T07:02:11.3870460Z ) 2025-09-07T07:02:11.3870657Z 2025-09-07T07:02:11.3870833Z # Add more fields as needed 2025-09-07T07:02:11.3871135Z 2025-09-07T07:02:11.3871141Z 2025-09-07T07:02:11.3871328Z class Settings(NamedTuple): 2025-09-07T07:02:11.3871761Z """ 2025-09-07T07:02:11.3872209Z Settings for the experiments that can be opted into. 2025-09-07T07:02:11.3872781Z """ 2025-09-07T07:02:11.3872981Z 2025-09-07T07:02:11.3873185Z experiments: dict[str, Experiment] = {} 2025-09-07T07:02:11.3873543Z 2025-09-07T07:02:11.3873551Z 2025-09-07T07:02:11.3873753Z class ColorFormatter(logging.Formatter): 2025-09-07T07:02:11.3874369Z """Color codes the log messages based on the log level""" 2025-09-07T07:02:11.3874822Z 2025-09-07T07:02:11.3874988Z COLORS = { 2025-09-07T07:02:11.3875711Z "WARNING": "\033[33m", # Yellow 2025-09-07T07:02:11.3876423Z "ERROR": "\033[31m", # Red 2025-09-07T07:02:11.3876910Z "CRITICAL": "\033[31m", # Red 2025-09-07T07:02:11.3877403Z "INFO": "\033[0m", # Reset 2025-09-07T07:02:11.3877874Z "DEBUG": "\033[0m", # Reset 2025-09-07T07:02:11.3878332Z } 2025-09-07T07:02:11.3878526Z 2025-09-07T07:02:11.3878739Z def format(self, record: LogRecord) -> str: 2025-09-07T07:02:11.3879480Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-09-07T07:02:11.3880244Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-09-07T07:02:11.3880812Z return super().format(record) 2025-09-07T07:02:11.3881140Z 2025-09-07T07:02:11.3881152Z 2025-09-07T07:02:11.3881343Z handler = logging.StreamHandler() 2025-09-07T07:02:11.3882034Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-09-07T07:02:11.3882585Z 2025-09-07T07:02:11.3882824Z log = logging.getLogger(os.path.basename(__file__)) 2025-09-07T07:02:11.3883396Z log.addHandler(handler) 2025-09-07T07:02:11.3883835Z log.setLevel(logging.INFO) 2025-09-07T07:02:11.3884118Z 2025-09-07T07:02:11.3884124Z 2025-09-07T07:02:11.3884376Z def set_github_output(key: str, value: str) -> None: 2025-09-07T07:02:11.3884936Z """ 2025-09-07T07:02:11.3885646Z Defines outputs of the github action that invokes this script 2025-09-07T07:02:11.3886304Z """ 2025-09-07T07:02:11.3886674Z if not GITHUB_OUTPUT: 2025-09-07T07:02:11.3887733Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-09-07T07:02:11.3888877Z log.warning( 2025-09-07T07:02:11.3889746Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-09-07T07:02:11.3890666Z ) 2025-09-07T07:02:11.3901830Z print(f"::set-output name={key}::{value}") 2025-09-07T07:02:11.3902448Z return 2025-09-07T07:02:11.3902692Z 2025-09-07T07:02:11.3903092Z with open(GITHUB_OUTPUT, "a") as f: 2025-09-07T07:02:11.3903685Z log.info(f"Setting output: {key}='{value}'") 2025-09-07T07:02:11.3904259Z f.write(f"{key}={value}\n") 2025-09-07T07:02:11.3904584Z 2025-09-07T07:02:11.3904592Z 2025-09-07T07:02:11.3904907Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-09-07T07:02:11.3905844Z return frozenset( 2025-09-07T07:02:11.3906476Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-09-07T07:02:11.3907167Z ) 2025-09-07T07:02:11.3907366Z 2025-09-07T07:02:11.3907373Z 2025-09-07T07:02:11.3907550Z def parse_args() -> Any: 2025-09-07T07:02:11.3908104Z parser = ArgumentParser("Get dynamic rollout settings") 2025-09-07T07:02:11.3908980Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-09-07T07:02:11.3909755Z parser.add_argument( 2025-09-07T07:02:11.3910207Z "--github-issue-repo", 2025-09-07T07:02:11.3910677Z type=str, 2025-09-07T07:02:11.3911073Z required=False, 2025-09-07T07:02:11.3911518Z default="pytorch/test-infra", 2025-09-07T07:02:11.3912046Z help="GitHub repo to get the issue", 2025-09-07T07:02:11.3912552Z ) 2025-09-07T07:02:11.3912906Z parser.add_argument( 2025-09-07T07:02:11.3913341Z "--github-repo", 2025-09-07T07:02:11.3913747Z type=str, 2025-09-07T07:02:11.3914134Z required=True, 2025-09-07T07:02:11.3914586Z help="GitHub repo where CI is running", 2025-09-07T07:02:11.3915093Z ) 2025-09-07T07:02:11.3915650Z parser.add_argument( 2025-09-07T07:02:11.3916261Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-09-07T07:02:11.3916919Z ) 2025-09-07T07:02:11.3917272Z parser.add_argument( 2025-09-07T07:02:11.3917898Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-09-07T07:02:11.3918565Z ) 2025-09-07T07:02:11.3918921Z parser.add_argument( 2025-09-07T07:02:11.3919708Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-09-07T07:02:11.3920395Z ) 2025-09-07T07:02:11.3920751Z parser.add_argument( 2025-09-07T07:02:11.3921394Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-09-07T07:02:11.3922100Z ) 2025-09-07T07:02:11.3922449Z parser.add_argument( 2025-09-07T07:02:11.3922888Z "--github-ref-type", 2025-09-07T07:02:11.3923327Z type=str, 2025-09-07T07:02:11.3923715Z required=True, 2025-09-07T07:02:11.3924182Z help="Current GitHub ref type, branch or tag", 2025-09-07T07:02:11.3924724Z ) 2025-09-07T07:02:11.3925077Z parser.add_argument( 2025-09-07T07:02:11.3925786Z "--eligible-experiments", 2025-09-07T07:02:11.3926302Z type=_str_comma_separated_to_set, 2025-09-07T07:02:11.3979528Z required=False, 2025-09-07T07:02:11.3980010Z default="", 2025-09-07T07:02:11.3980878Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-09-07T07:02:11.3981805Z ) 2025-09-07T07:02:11.3982169Z parser.add_argument( 2025-09-07T07:02:11.3982626Z "--opt-out-experiments", 2025-09-07T07:02:11.3983121Z type=_str_comma_separated_to_set, 2025-09-07T07:02:11.3983630Z required=False, 2025-09-07T07:02:11.3984034Z default="", 2025-09-07T07:02:11.3984422Z help=( 2025-09-07T07:02:11.3985075Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-09-07T07:02:11.3986483Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-09-07T07:02:11.3987322Z ), 2025-09-07T07:02:11.3987662Z ) 2025-09-07T07:02:11.3988025Z parser.add_argument( 2025-09-07T07:02:11.3988452Z "--pr-number", 2025-09-07T07:02:11.3988855Z type=str, 2025-09-07T07:02:11.3989236Z required=False, 2025-09-07T07:02:11.3989655Z default="", 2025-09-07T07:02:11.3990292Z help="the optional PR number where this is run", 2025-09-07T07:02:11.3990875Z ) 2025-09-07T07:02:11.3991072Z 2025-09-07T07:02:11.3991264Z return parser.parse_args() 2025-09-07T07:02:11.3991567Z 2025-09-07T07:02:11.3991573Z 2025-09-07T07:02:11.3991975Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-09-07T07:02:11.3992718Z auth = Auth.Token(github_token) 2025-09-07T07:02:11.3993215Z return Github(auth=auth) 2025-09-07T07:02:11.3993512Z 2025-09-07T07:02:11.3993518Z 2025-09-07T07:02:11.3993961Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-09-07T07:02:11.3994759Z repo = gh.get_repo(repo) 2025-09-07T07:02:11.3995442Z return repo.get_issue(number=issue_num) 2025-09-07T07:02:11.3995823Z 2025-09-07T07:02:11.3995830Z 2025-09-07T07:02:11.3996021Z def get_potential_pr_author( 2025-09-07T07:02:11.3996655Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-09-07T07:02:11.3997328Z ) -> str: 2025-09-07T07:02:11.3997829Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-09-07T07:02:11.3998622Z # Fetch the actual username from the original PR. The PR number is 2025-09-07T07:02:11.3999349Z # embedded in the tag name: ciflow// 2025-09-07T07:02:11.3999758Z 2025-09-07T07:02:11.3999942Z gh = get_gh_client(github_token) 2025-09-07T07:02:11.4000276Z 2025-09-07T07:02:11.4000545Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-09-07T07:02:11.4001147Z split_tag = ref_name.split("/") 2025-09-07T07:02:11.4001642Z if ( 2025-09-07T07:02:11.4002025Z len(split_tag) == 3 2025-09-07T07:02:11.4002500Z and split_tag[0] == "ciflow" 2025-09-07T07:02:11.4003010Z and split_tag[2].isnumeric() 2025-09-07T07:02:11.4003493Z ): 2025-09-07T07:02:11.4003874Z pr_number = split_tag[2] 2025-09-07T07:02:11.4004497Z try: 2025-09-07T07:02:11.4004918Z repository = gh.get_repo(repo) 2025-09-07T07:02:11.4005708Z pull = repository.get_pull(number=int(pr_number)) 2025-09-07T07:02:11.4006309Z except Exception as e: 2025-09-07T07:02:11.4006809Z raise Exception( # noqa: TRY002 2025-09-07T07:02:11.4007467Z f"issue with pull request {pr_number} from repo {repository}" 2025-09-07T07:02:11.4008091Z ) from e 2025-09-07T07:02:11.4008614Z return pull.user.login # type: ignore[no-any-return] 2025-09-07T07:02:11.4009295Z # In all other cases, return the original input username 2025-09-07T07:02:11.4009866Z return username 2025-09-07T07:02:11.4010099Z 2025-09-07T07:02:11.4010105Z 2025-09-07T07:02:11.4010331Z def is_exception_branch(branch: str) -> bool: 2025-09-07T07:02:11.4010852Z """ 2025-09-07T07:02:11.4011491Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-09-07T07:02:11.4012255Z """ 2025-09-07T07:02:11.4012789Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-09-07T07:02:11.4013303Z 2025-09-07T07:02:11.4013311Z 2025-09-07T07:02:11.4013504Z def load_yaml(yaml_text: str) -> Any: 2025-09-07T07:02:11.4013981Z try: 2025-09-07T07:02:11.4014361Z data = yaml.safe_load(yaml_text) 2025-09-07T07:02:11.4014855Z return data 2025-09-07T07:02:11.4015425Z except yaml.YAMLError: 2025-09-07T07:02:11.4015912Z log.exception("Error loading YAML") 2025-09-07T07:02:11.4016422Z raise 2025-09-07T07:02:11.4016638Z 2025-09-07T07:02:11.4016644Z 2025-09-07T07:02:11.4017051Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-09-07T07:02:11.4017776Z """ 2025-09-07T07:02:11.4018390Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-09-07T07:02:11.4018985Z 2025-09-07T07:02:11.4019465Z If the issue body contains "---" then the text above that is the settings 2025-09-07T07:02:11.4020221Z and the text below is the list of opted in users. 2025-09-07T07:02:11.4020618Z 2025-09-07T07:02:11.4020980Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-09-07T07:02:11.4021685Z """ 2025-09-07T07:02:11.4022120Z rollout_state_parts = rollout_state.split("---") 2025-09-07T07:02:11.4022699Z if len(rollout_state_parts) >= 2: 2025-09-07T07:02:11.4023294Z return rollout_state_parts[0], rollout_state_parts[1] 2025-09-07T07:02:11.4023868Z else: 2025-09-07T07:02:11.4024241Z return "", rollout_state 2025-09-07T07:02:11.4024540Z 2025-09-07T07:02:11.4024547Z 2025-09-07T07:02:11.4024738Z class UserOptins(dict[str, list[str]]): 2025-09-07T07:02:11.4025459Z """ 2025-09-07T07:02:11.4026060Z Dictionary of users with a list of features they have opted into 2025-09-07T07:02:11.4026700Z """ 2025-09-07T07:02:11.4026906Z 2025-09-07T07:02:11.4026914Z 2025-09-07T07:02:11.4027254Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-09-07T07:02:11.4027895Z """ 2025-09-07T07:02:11.4028594Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-09-07T07:02:11.4029269Z 2025-09-07T07:02:11.4029878Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-09-07T07:02:11.4030851Z - Example line: "@User1,lf,split_build" 2025-09-07T07:02:11.4031521Z - A "#" prefix indicates the user is opted out of all experiments 2025-09-07T07:02:11.4031995Z 2025-09-07T07:02:11.4032001Z 2025-09-07T07:02:11.4032150Z """ 2025-09-07T07:02:11.4032516Z optins = UserOptins() 2025-09-07T07:02:11.4032988Z for user in user_optin_text.split("\n"): 2025-09-07T07:02:11.4033527Z user = user.strip("\r\n\t -") 2025-09-07T07:02:11.4034060Z if not user or not user.startswith("@"): 2025-09-07T07:02:11.4034768Z # Not a valid user. Skip 2025-09-07T07:02:11.4035372Z continue 2025-09-07T07:02:11.4035624Z 2025-09-07T07:02:11.4035782Z if user: 2025-09-07T07:02:11.4036210Z usr_name = user.split(",")[0].strip("@") 2025-09-07T07:02:11.4036914Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-09-07T07:02:11.4037414Z 2025-09-07T07:02:11.4037583Z return optins 2025-09-07T07:02:11.4037814Z 2025-09-07T07:02:11.4037820Z 2025-09-07T07:02:11.4038106Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-09-07T07:02:11.4038699Z """ 2025-09-07T07:02:11.4039082Z Check if the experiment name is valid. 2025-09-07T07:02:11.4039596Z A valid name: 2025-09-07T07:02:11.4040217Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-09-07T07:02:11.4041136Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-09-07T07:02:11.4041851Z - Cannot contain spaces 2025-09-07T07:02:11.4042294Z """ 2025-09-07T07:02:11.4042493Z 2025-09-07T07:02:11.4042747Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-09-07T07:02:11.4043425Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-09-07T07:02:11.4043863Z 2025-09-07T07:02:11.4044018Z if valid: 2025-09-07T07:02:11.4044383Z return True 2025-09-07T07:02:11.4044613Z 2025-09-07T07:02:11.4044769Z log.error( 2025-09-07T07:02:11.4046305Z f"Invalid experiment name: {experiment_name}. Experiment names should only contain alphanumeric characters, '_', and '-'. They cannot contain spaces, and the special characters '_' and '-' cannot be the first or last characters." 2025-09-07T07:02:11.4047830Z ) 2025-09-07T07:02:11.4048179Z return False 2025-09-07T07:02:11.4048406Z 2025-09-07T07:02:11.4048412Z 2025-09-07T07:02:11.4048724Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-09-07T07:02:11.4049328Z """ 2025-09-07T07:02:11.4050035Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-09-07T07:02:11.4050752Z """ 2025-09-07T07:02:11.4051101Z try: 2025-09-07T07:02:11.4051461Z if settings_text: 2025-09-07T07:02:11.4052172Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-09-07T07:02:11.4052946Z # for easy reading 2025-09-07T07:02:11.4053730Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-09-07T07:02:11.4054628Z # the backtick character in shell commands. 2025-09-07T07:02:11.4055333Z backtick = chr(96) # backtick character 2025-09-07T07:02:11.4056009Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-09-07T07:02:11.4056668Z settings = load_yaml(settings_text) 2025-09-07T07:02:11.4057035Z 2025-09-07T07:02:11.4057444Z # For now we just load experiments. We can expand this if/when we add more settings 2025-09-07T07:02:11.4058181Z experiments = {} 2025-09-07T07:02:11.4058482Z 2025-09-07T07:02:11.4058854Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-09-07T07:02:11.4059594Z if not is_valid_experiment_name(exp_name): 2025-09-07T07:02:11.4060692Z # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2025-09-07T07:02:11.4061739Z continue 2025-09-07T07:02:11.4062020Z 2025-09-07T07:02:11.4062193Z valid_settings = {} 2025-09-07T07:02:11.4062705Z for setting in exp_settings: 2025-09-07T07:02:11.4063254Z if setting not in Experiment._fields: 2025-09-07T07:02:11.4063797Z log.warning( 2025-09-07T07:02:11.4064487Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-09-07T07:02:11.4065808Z ) 2025-09-07T07:02:11.4066239Z else: 2025-09-07T07:02:11.4066752Z valid_settings[setting] = exp_settings[setting] 2025-09-07T07:02:11.4067180Z 2025-09-07T07:02:11.4067443Z experiments[exp_name] = Experiment(**valid_settings) 2025-09-07T07:02:11.4068069Z return Settings(experiments) 2025-09-07T07:02:11.4068427Z 2025-09-07T07:02:11.4068593Z except Exception: 2025-09-07T07:02:11.4069058Z log.exception("Failed to parse settings") 2025-09-07T07:02:11.4069448Z 2025-09-07T07:02:11.4069615Z return Settings() 2025-09-07T07:02:11.4069867Z 2025-09-07T07:02:11.4069874Z 2025-09-07T07:02:11.4070119Z def parse_settings(rollout_state: str) -> Settings: 2025-09-07T07:02:11.4070671Z """ 2025-09-07T07:02:11.4071093Z Parse settings, if any, from the rollout state. 2025-09-07T07:02:11.4071486Z 2025-09-07T07:02:11.4071833Z If the issue body contains "---" then the text above that is the settings 2025-09-07T07:02:11.4072592Z and the text below is the list of opted in users. 2025-09-07T07:02:11.4072992Z 2025-09-07T07:02:11.4073403Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-09-07T07:02:11.4074120Z """ 2025-09-07T07:02:11.4074661Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-09-07T07:02:11.4075510Z return parse_settings_from_text(settings_text) 2025-09-07T07:02:11.4075912Z 2025-09-07T07:02:11.4075918Z 2025-09-07T07:02:11.4076154Z def parse_users(rollout_state: str) -> UserOptins: 2025-09-07T07:02:11.4076703Z """ 2025-09-07T07:02:11.4077086Z Parse users from the rollout state. 2025-09-07T07:02:11.4077437Z 2025-09-07T07:02:11.4077600Z """ 2025-09-07T07:02:11.4078121Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-09-07T07:02:11.4078849Z return parse_user_opt_in_from_text(users_text) 2025-09-07T07:02:11.4079251Z 2025-09-07T07:02:11.4079258Z 2025-09-07T07:02:11.4079808Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-09-07T07:02:11.4080569Z """ 2025-09-07T07:02:11.4080972Z Check if a user is opted into an experiment 2025-09-07T07:02:11.4081501Z """ 2025-09-07T07:02:11.4081952Z return experiment_name in user_optins.get(user, []) 2025-09-07T07:02:11.4082373Z 2025-09-07T07:02:11.4082379Z 2025-09-07T07:02:11.4082794Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-09-07T07:02:11.4083529Z """ 2025-09-07T07:02:11.4083968Z Check if a user explicitly opted out of an experiment 2025-09-07T07:02:11.4084534Z """ 2025-09-07T07:02:11.4085025Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-09-07T07:02:11.4085818Z experiment_optout = "-" + experiment_name 2025-09-07T07:02:11.4086486Z if experiment_optout not in user_optins.get(user, []): 2025-09-07T07:02:11.4087070Z return False 2025-09-07T07:02:11.4087327Z 2025-09-07T07:02:11.4087597Z if is_user_opted_in(user, user_optins, experiment_name): 2025-09-07T07:02:11.4088178Z log.warning( 2025-09-07T07:02:11.4088964Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-09-07T07:02:11.4089822Z ) 2025-09-07T07:02:11.4090026Z 2025-09-07T07:02:11.4090184Z return True 2025-09-07T07:02:11.4090411Z 2025-09-07T07:02:11.4090417Z 2025-09-07T07:02:11.4090594Z def get_runner_prefix( 2025-09-07T07:02:11.4091010Z rollout_state: str, 2025-09-07T07:02:11.4091462Z workflow_requestors: Iterable[str], 2025-09-07T07:02:11.4091966Z branch: str, 2025-09-07T07:02:11.4092441Z eligible_experiments: frozenset[str] = frozenset(), 2025-09-07T07:02:11.4093082Z opt_out_experiments: frozenset[str] = frozenset(), 2025-09-07T07:02:11.4093659Z is_canary: bool = False, 2025-09-07T07:02:11.4094105Z ) -> str: 2025-09-07T07:02:11.4094648Z settings = parse_settings(rollout_state) 2025-09-07T07:02:11.4095326Z user_optins = parse_users(rollout_state) 2025-09-07T07:02:11.4095703Z 2025-09-07T07:02:11.4095879Z fleet_prefix = "" 2025-09-07T07:02:11.4096297Z prefixes = [] 2025-09-07T07:02:11.4096918Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-09-07T07:02:11.4097845Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-09-07T07:02:11.4098538Z log.info( 2025-09-07T07:02:11.4099205Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-09-07T07:02:11.4099952Z ) 2025-09-07T07:02:11.4100317Z continue 2025-09-07T07:02:11.4100558Z 2025-09-07T07:02:11.4100746Z if opt_out_experiments: 2025-09-07T07:02:11.4101272Z if experiment_name in opt_out_experiments: 2025-09-07T07:02:11.4101906Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-09-07T07:02:11.4102489Z log.info( 2025-09-07T07:02:11.4103405Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-09-07T07:02:11.4104378Z ) 2025-09-07T07:02:11.4104764Z continue 2025-09-07T07:02:11.4105025Z 2025-09-07T07:02:11.4105315Z if eligible_experiments: 2025-09-07T07:02:11.4105892Z if experiment_name not in eligible_experiments: 2025-09-07T07:02:11.4106518Z exp_list = ", ".join(eligible_experiments) 2025-09-07T07:02:11.4107066Z log.info( 2025-09-07T07:02:11.4107833Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-09-07T07:02:11.4108664Z ) 2025-09-07T07:02:11.4109037Z continue 2025-09-07T07:02:11.4109496Z elif not experiment_settings.default: 2025-09-07T07:02:11.4110012Z log.info( 2025-09-07T07:02:11.4110843Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-09-07T07:02:11.4111589Z ) 2025-09-07T07:02:11.4111957Z continue 2025-09-07T07:02:11.4112197Z 2025-09-07T07:02:11.4112464Z # Is any workflow_requestor opted out to this experiment? 2025-09-07T07:02:11.4113084Z opted_out_users = [ 2025-09-07T07:02:11.4113532Z requestor 2025-09-07T07:02:11.4113977Z for requestor in workflow_requestors 2025-09-07T07:02:11.4114641Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-09-07T07:02:11.4115362Z ] 2025-09-07T07:02:11.4115566Z 2025-09-07T07:02:11.4115738Z if opted_out_users: 2025-09-07T07:02:11.4116174Z log.info( 2025-09-07T07:02:11.4116780Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-09-07T07:02:11.4117464Z ) 2025-09-07T07:02:11.4117824Z continue 2025-09-07T07:02:11.4118071Z 2025-09-07T07:02:11.4118335Z # Is any workflow_requestor opted in to this experiment? 2025-09-07T07:02:11.4118933Z opted_in_users = [ 2025-09-07T07:02:11.4119363Z requestor 2025-09-07T07:02:11.4119795Z for requestor in workflow_requestors 2025-09-07T07:02:11.4120443Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-09-07T07:02:11.4121044Z ] 2025-09-07T07:02:11.4121243Z 2025-09-07T07:02:11.4121411Z enabled = False 2025-09-07T07:02:11.4121826Z if opted_in_users: 2025-09-07T07:02:11.4122259Z log.info( 2025-09-07T07:02:11.4122851Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-09-07T07:02:11.4123525Z ) 2025-09-07T07:02:11.4123906Z enabled = True 2025-09-07T07:02:11.4124174Z 2025-09-07T07:02:11.4124382Z elif experiment_settings.rollout_perc: 2025-09-07T07:02:11.4125304Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-09-07T07:02:11.4126384Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-09-07T07:02:11.4127032Z log.info( 2025-09-07T07:02:11.4127896Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-09-07T07:02:11.4128818Z ) 2025-09-07T07:02:11.4129215Z enabled = True 2025-09-07T07:02:11.4129513Z 2025-09-07T07:02:11.4129675Z if enabled: 2025-09-07T07:02:11.4130092Z label = experiment_name 2025-09-07T07:02:11.4130633Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-09-07T07:02:11.4131454Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-09-07T07:02:11.4132332Z # - If it's enabled, then we always list it's prefix first 2025-09-07T07:02:11.4133080Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-09-07T07:02:11.4133740Z if is_canary: 2025-09-07T07:02:11.4134218Z label += CANARY_FLEET_SUFFIX 2025-09-07T07:02:11.4134763Z fleet_prefix = label 2025-09-07T07:02:11.4135338Z else: 2025-09-07T07:02:11.4135760Z prefixes.append(label) 2025-09-07T07:02:11.4136124Z 2025-09-07T07:02:11.4136300Z if len(prefixes) > 1: 2025-09-07T07:02:11.4136749Z log.error( 2025-09-07T07:02:11.4137779Z f"Only a fleet and one other experiment can be enabled for a job at any time. Enabling {prefixes[0]} and ignoring the rest, which are {', '.join(prefixes[1:])}" 2025-09-07T07:02:11.4138893Z ) 2025-09-07T07:02:11.4139272Z prefixes = prefixes[:1] 2025-09-07T07:02:11.4139578Z 2025-09-07T07:02:11.4139760Z # Fleet always comes first 2025-09-07T07:02:11.4140214Z if fleet_prefix: 2025-09-07T07:02:11.4140647Z prefixes.insert(0, fleet_prefix) 2025-09-07T07:02:11.4141009Z 2025-09-07T07:02:11.4141365Z return ".".join(prefixes) + "." if prefixes else "" 2025-09-07T07:02:11.4141781Z 2025-09-07T07:02:11.4141788Z 2025-09-07T07:02:11.4142230Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-09-07T07:02:11.4142994Z """ 2025-09-07T07:02:11.4143565Z Gets the first comment of the issue, which contains the desired rollout state. 2025-09-07T07:02:11.4144126Z 2025-09-07T07:02:11.4144502Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-09-07T07:02:11.4145301Z """ 2025-09-07T07:02:11.4145676Z gh = get_gh_client(github_token) 2025-09-07T07:02:11.4146211Z issue = get_issue(gh, repo, issue_num) 2025-09-07T07:02:11.4146834Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-09-07T07:02:11.4147280Z 2025-09-07T07:02:11.4147287Z 2025-09-07T07:02:11.4147681Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-09-07T07:02:11.4148442Z for _ in range(num_retries): 2025-09-07T07:02:11.4148900Z try: 2025-09-07T07:02:11.4149312Z req = Request(url=url, headers=headers) 2025-09-07T07:02:11.4149962Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-09-07T07:02:11.4150588Z return json.loads(content) 2025-09-07T07:02:11.4151099Z except Exception as e: 2025-09-07T07:02:11.4151618Z log.warning(f"Could not download {url}: {e}") 2025-09-07T07:02:11.4152012Z 2025-09-07T07:02:11.4152388Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-09-07T07:02:11.4153086Z return {} 2025-09-07T07:02:11.4153302Z 2025-09-07T07:02:11.4153308Z 2025-09-07T07:02:11.4153457Z @cache 2025-09-07T07:02:11.4154061Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-09-07T07:02:11.4154811Z """ 2025-09-07T07:02:11.4155292Z Dynamically get PR information 2025-09-07T07:02:11.4155774Z """ 2025-09-07T07:02:11.4156395Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-09-07T07:02:11.4157010Z headers = { 2025-09-07T07:02:11.4157454Z "Accept": "application/vnd.github.v3+json", 2025-09-07T07:02:11.4158041Z "Authorization": f"token {github_token}", 2025-09-07T07:02:11.4158562Z } 2025-09-07T07:02:11.4158973Z json_response: dict[str, Any] = download_json( 2025-09-07T07:02:11.4159570Z url=f"{github_api}/issues/{pr_number}", 2025-09-07T07:02:11.4160112Z headers=headers, 2025-09-07T07:02:11.4160521Z ) 2025-09-07T07:02:11.4160712Z 2025-09-07T07:02:11.4160895Z if not json_response: 2025-09-07T07:02:11.4161447Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-09-07T07:02:11.4162056Z return {} 2025-09-07T07:02:11.4162285Z 2025-09-07T07:02:11.4162457Z return json_response 2025-09-07T07:02:11.4162733Z 2025-09-07T07:02:11.4162740Z 2025-09-07T07:02:11.4163135Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-09-07T07:02:11.4163857Z """ 2025-09-07T07:02:11.4164364Z Dynamically get the latest list of labels from the pull request 2025-09-07T07:02:11.4165006Z """ 2025-09-07T07:02:11.4165606Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-09-07T07:02:11.4166210Z return { 2025-09-07T07:02:11.4166781Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-09-07T07:02:11.4167466Z } 2025-09-07T07:02:11.4167659Z 2025-09-07T07:02:11.4167665Z 2025-09-07T07:02:11.4167831Z def main() -> None: 2025-09-07T07:02:11.4168236Z args = parse_args() 2025-09-07T07:02:11.4168499Z 2025-09-07T07:02:11.4168718Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-09-07T07:02:11.4169098Z 2025-09-07T07:02:11.4169279Z # Check if the PR is opt-out 2025-09-07T07:02:11.4169756Z if args.pr_number: 2025-09-07T07:02:11.4170399Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-09-07T07:02:11.4171264Z if OPT_OUT_LABEL in labels: 2025-09-07T07:02:11.4171757Z log.info( 2025-09-07T07:02:11.4172434Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-09-07T07:02:11.4173189Z ) 2025-09-07T07:02:11.4173727Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-09-07T07:02:11.4174390Z sys.exit() 2025-09-07T07:02:11.4174640Z 2025-09-07T07:02:11.4174796Z try: 2025-09-07T07:02:11.4175318Z rollout_state = get_rollout_state_from_issue( 2025-09-07T07:02:11.4176015Z args.github_token, args.github_issue_repo, args.github_issue 2025-09-07T07:02:11.4176641Z ) 2025-09-07T07:02:11.4176838Z 2025-09-07T07:02:11.4177041Z username = get_potential_pr_author( 2025-09-07T07:02:11.4177577Z args.github_token, 2025-09-07T07:02:11.4178041Z args.github_repo, 2025-09-07T07:02:11.4178503Z args.github_actor, 2025-09-07T07:02:11.4178979Z args.github_ref_type, 2025-09-07T07:02:11.4179462Z args.github_branch, 2025-09-07T07:02:11.4179901Z ) 2025-09-07T07:02:11.4180097Z 2025-09-07T07:02:11.4180371Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-09-07T07:02:11.4180825Z 2025-09-07T07:02:11.4181031Z runner_label_prefix = get_runner_prefix( 2025-09-07T07:02:11.4181572Z rollout_state, 2025-09-07T07:02:11.4182037Z (args.github_issue_owner, username), 2025-09-07T07:02:11.4182573Z args.github_branch, 2025-09-07T07:02:11.4183052Z args.eligible_experiments, 2025-09-07T07:02:11.4183581Z args.opt_out_experiments, 2025-09-07T07:02:11.4184067Z is_canary, 2025-09-07T07:02:11.4184466Z ) 2025-09-07T07:02:11.4184666Z 2025-09-07T07:02:11.4184842Z except Exception as e: 2025-09-07T07:02:11.4185380Z log.error( 2025-09-07T07:02:11.4186065Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-09-07T07:02:11.4186973Z ) 2025-09-07T07:02:11.4187179Z 2025-09-07T07:02:11.4187507Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-09-07T07:02:11.4188001Z 2025-09-07T07:02:11.4188007Z 2025-09-07T07:02:11.4188177Z if __name__ == "__main__": 2025-09-07T07:02:11.4188602Z main() 2025-09-07T07:02:11.4188800Z 2025-09-07T07:02:11.4276616Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-09-07T07:02:11.4277487Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-09-07T07:02:11.4306965Z shell: /usr/bin/bash -e {0} 2025-09-07T07:02:11.4307440Z env: 2025-09-07T07:02:11.4308023Z GITHUB_TOKEN: *** 2025-09-07T07:02:11.4308451Z ISSUE_NUMBER: 5132 2025-09-07T07:02:11.4308880Z TRIGGERING_ACTOR: pytorchmergebot 2025-09-07T07:02:11.4309375Z ISSUE_OWNER: 2025-09-07T07:02:11.4309759Z CHECK_EXPERIMENTS: 2025-09-07T07:02:11.4310185Z OPT_OUT_EXPERIMENTS: lf 2025-09-07T07:02:11.4310625Z PR_NUMBER: 2025-09-07T07:02:11.4310991Z ##[endgroup] 2025-09-07T07:02:18.3708828Z Defaulting to user installation because normal site-packages is not writeable 2025-09-07T07:02:20.8015074Z Collecting urllib3==1.26.18 2025-09-07T07:02:20.8686346Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-09-07T07:02:20.8910144Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 3.4 MB/s eta 0:00:00 2025-09-07T07:02:20.9219475Z Collecting PyGithub==2.3.0 2025-09-07T07:02:20.9334594Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-09-07T07:02:20.9840268Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-09-07T07:02:20.9941782Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB) 2025-09-07T07:02:20.9985862Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-09-07T07:02:20.9997646Z Requirement already satisfied: pyjwt>=2.4.0 in /usr/lib/python3/dist-packages (from pyjwt[crypto]>=2.4.0->PyGithub==2.3.0) (2.7.0) 2025-09-07T07:02:21.0016124Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-09-07T07:02:21.0322911Z Collecting Deprecated (from PyGithub==2.3.0) 2025-09-07T07:02:21.0423231Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB) 2025-09-07T07:02:21.0651226Z Requirement already satisfied: cryptography>=3.4.0 in /usr/lib/python3/dist-packages (from pyjwt[crypto]>=2.4.0->PyGithub==2.3.0) (41.0.7) 2025-09-07T07:02:21.1945887Z Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-09-07T07:02:21.2047643Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) 2025-09-07T07:02:21.3318938Z Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-09-07T07:02:21.3422600Z Downloading wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.4 kB) 2025-09-07T07:02:21.3662913Z Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub==2.3.0) 2025-09-07T07:02:21.3766474Z Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes) 2025-09-07T07:02:21.4062381Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-09-07T07:02:21.4199788Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 11.4 MB/s eta 0:00:00 2025-09-07T07:02:21.4316252Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-09-07T07:02:21.4442758Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 31.9 MB/s eta 0:00:00 2025-09-07T07:02:21.4559145Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2025-09-07T07:02:21.4696009Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 70.5 MB/s eta 0:00:00 2025-09-07T07:02:21.4799658Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB) 2025-09-07T07:02:21.4921445Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) 2025-09-07T07:02:21.4989864Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 93.9 MB/s eta 0:00:00 2025-09-07T07:02:21.5098021Z Downloading wrapt-1.17.3-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (88 kB) 2025-09-07T07:02:21.5141867Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 88.0/88.0 kB 28.3 MB/s eta 0:00:00 2025-09-07T07:02:21.5239771Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2025-09-07T07:02:21.5280535Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 42.6 MB/s eta 0:00:00 2025-09-07T07:02:21.9924633Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-09-07T07:02:22.5171755Z Successfully installed Deprecated-1.2.18 PyGithub-2.3.0 cffi-1.17.1 pycparser-2.22 pynacl-1.5.0 urllib3-1.26.18 wrapt-1.17.3 2025-09-07T07:02:22.5958055Z ##[group]Run curr_branch="main" 2025-09-07T07:02:22.5958347Z curr_branch="main" 2025-09-07T07:02:22.5958562Z curr_ref_type="branch" 2025-09-07T07:02:22.5958835Z echo "Current branch is '$curr_branch'" 2025-09-07T07:02:22.5959082Z  2025-09-07T07:02:22.5959268Z python3 runner_determinator.py \ 2025-09-07T07:02:22.5959543Z  --github-token "$GITHUB_TOKEN" \ 2025-09-07T07:02:22.5959815Z  --github-issue "$ISSUE_NUMBER" \ 2025-09-07T07:02:22.5960067Z  --github-branch "$curr_branch" \ 2025-09-07T07:02:22.5960320Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-09-07T07:02:22.5960631Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-09-07T07:02:22.5960904Z  --github-ref-type "$curr_ref_type" \ 2025-09-07T07:02:22.5961171Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-09-07T07:02:22.5961462Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-09-07T07:02:22.5961826Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-09-07T07:02:22.5962106Z  --pr-number "${PR_NUMBER}" 2025-09-07T07:02:22.5993257Z shell: /usr/bin/bash -e {0} 2025-09-07T07:02:22.5993476Z env: 2025-09-07T07:02:22.5993969Z GITHUB_TOKEN: *** 2025-09-07T07:02:22.5994159Z ISSUE_NUMBER: 5132 2025-09-07T07:02:22.5994354Z TRIGGERING_ACTOR: pytorchmergebot 2025-09-07T07:02:22.5994580Z ISSUE_OWNER: 2025-09-07T07:02:22.5994750Z CHECK_EXPERIMENTS: 2025-09-07T07:02:22.5994942Z OPT_OUT_EXPERIMENTS: lf 2025-09-07T07:02:22.5995130Z PR_NUMBER: 2025-09-07T07:02:22.5995586Z ##[endgroup] 2025-09-07T07:02:22.6043568Z Current branch is 'main' 2025-09-07T07:02:24.9288605Z INFO : Skipping experiment 'lf', as this workflow has opted-out (opted out experiments are: lf) 2025-09-07T07:02:24.9289612Z INFO : Branch main is an exception branch. Not enabling experiment ephemeral. 2025-09-07T07:02:24.9290585Z INFO : Branch main is an exception branch. Not enabling experiment wincanary. 2025-09-07T07:02:24.9291541Z INFO : Branch main is an exception branch. Not enabling experiment wincanarylf. 2025-09-07T07:02:24.9292300Z INFO : Setting output: label-type='' 2025-09-07T07:02:24.9595036Z Evaluate and set job outputs 2025-09-07T07:02:24.9602366Z Cleaning up orphan processes