2025-12-04T08:49:15.7215681Z Current runner version: '2.329.0' 2025-12-04T08:49:15.7238313Z ##[group]Runner Image Provisioner 2025-12-04T08:49:15.7239100Z Hosted Compute Agent 2025-12-04T08:49:15.7239749Z Version: 20251124.448 2025-12-04T08:49:15.7240323Z Commit: fda5086b43ec66ade217e5fcd18146c879571177 2025-12-04T08:49:15.7241060Z Build Date: 2025-11-24T21:16:26Z 2025-12-04T08:49:15.7241668Z ##[endgroup] 2025-12-04T08:49:15.7242221Z ##[group]Operating System 2025-12-04T08:49:15.7242777Z Ubuntu 2025-12-04T08:49:15.7243261Z 24.04.3 2025-12-04T08:49:15.7243744Z LTS 2025-12-04T08:49:15.7244198Z ##[endgroup] 2025-12-04T08:49:15.7244732Z ##[group]Runner Image 2025-12-04T08:49:15.7245259Z Image: ubuntu-24.04 2025-12-04T08:49:15.7245762Z Version: 20251126.144.1 2025-12-04T08:49:15.7246712Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20251126.144/images/ubuntu/Ubuntu2404-Readme.md 2025-12-04T08:49:15.7248578Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20251126.144 2025-12-04T08:49:15.7249587Z ##[endgroup] 2025-12-04T08:49:15.7250577Z ##[group]GITHUB_TOKEN Permissions 2025-12-04T08:49:15.7252633Z Contents: read 2025-12-04T08:49:15.7253277Z Metadata: read 2025-12-04T08:49:15.7253791Z ##[endgroup] 2025-12-04T08:49:15.7255736Z Secret source: Actions 2025-12-04T08:49:15.7256505Z Prepare workflow directory 2025-12-04T08:49:15.7813862Z Prepare all required actions 2025-12-04T08:49:15.7868801Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (ffd9b0fb4355e97af82fc42cf185c3ffa0fc0a32) 2025-12-04T08:49:15.7873543Z ##[group] Inputs 2025-12-04T08:49:15.7874201Z check_experiments: 2025-12-04T08:49:15.7874850Z opt_out_experiments: 2025-12-04T08:49:15.7875462Z triggering_actor: pytorchmergebot 2025-12-04T08:49:15.7876063Z issue_owner: 2025-12-04T08:49:15.7876651Z curr_branch: main 2025-12-04T08:49:15.7877486Z curr_ref_type: branch 2025-12-04T08:49:15.7878159Z issue_number: 5132 2025-12-04T08:49:15.7878777Z ##[endgroup] 2025-12-04T08:49:15.7879481Z Complete job name: before-test / get-label-type / runner-determinator 2025-12-04T08:49:16.5179009Z ##[group]Run cat < runner_determinator.py 2025-12-04T08:49:16.5181546Z cat < runner_determinator.py 2025-12-04T08:49:16.5182240Z # flake8: noqa: G004 2025-12-04T08:49:16.5182827Z  2025-12-04T08:49:16.5183666Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T08:49:16.5184808Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T08:49:16.5185817Z # python .github/scripts/update_runner_determinator.py 2025-12-04T08:49:16.5186566Z  2025-12-04T08:49:16.5187479Z """ 2025-12-04T08:49:16.5188252Z This runner determinator is used to determine which set of runners to run a 2025-12-04T08:49:16.5189383Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T08:49:16.5190626Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T08:49:16.5191649Z of which runners should be used to run which job. 2025-12-04T08:49:16.5192434Z  2025-12-04T08:49:16.5193150Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T08:49:16.5194230Z separated by a line containing "---". If the line is not present, the 2025-12-04T08:49:16.5195351Z settings are considered to be empty with only the second part, the user 2025-12-04T08:49:16.5196265Z list, defined. 2025-12-04T08:49:16.5196803Z  2025-12-04T08:49:16.5197926Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T08:49:16.5199061Z used to define any settings that are needed to determine which runners to use. 2025-12-04T08:49:16.5200048Z It's fields are defined by the RolloutSettings class below. 2025-12-04T08:49:16.5200866Z  2025-12-04T08:49:16.5201860Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T08:49:16.5202935Z The user list is also a comma separated list of additional features or 2025-12-04T08:49:16.5203952Z experiments which the user could be opted in to. 2025-12-04T08:49:16.5204636Z  2025-12-04T08:49:16.5205175Z The user list has the following rules: 2025-12-04T08:49:16.5205824Z  2025-12-04T08:49:16.5206570Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T08:49:16.5207871Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T08:49:16.5208838Z - A "#" prefix opts the user out of all experiments 2025-12-04T08:49:16.5209557Z  2025-12-04T08:49:16.5210016Z Example config: 2025-12-04T08:49:16.5210704Z  # A list of experiments that can be opted into. 2025-12-04T08:49:16.5211572Z  # This defines the behavior they'll induce when opted into. 2025-12-04T08:49:16.5212368Z  # Expected syntax is: 2025-12-04T08:49:16.5213249Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T08:49:16.5214390Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T08:49:16.5215305Z  2025-12-04T08:49:16.5215740Z  experiments: 2025-12-04T08:49:16.5216397Z  lf: 2025-12-04T08:49:16.5217054Z  rollout_percent: 25 2025-12-04T08:49:16.5217644Z  all_branches: false 2025-12-04T08:49:16.5218335Z  default: true 2025-12-04T08:49:16.5218881Z  --- 2025-12-04T08:49:16.5219363Z  2025-12-04T08:49:16.5219906Z  # Opt-ins: 2025-12-04T08:49:16.5220700Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T08:49:16.5221930Z  # and specifying experiments to enable in a comma-separated list. 2025-12-04T08:49:16.5222969Z  # To always opt out of an experiment, prefix it with a "-". 2025-12-04T08:49:16.5223829Z  # Experiments should be from the above list. 2025-12-04T08:49:16.5224528Z  2025-12-04T08:49:16.5225101Z  @User1,-lf,split_build 2025-12-04T08:49:16.5225696Z  @User2,lf 2025-12-04T08:49:16.5226269Z  @User3,split_build 2025-12-04T08:49:16.5227036Z """ 2025-12-04T08:49:16.5227514Z  2025-12-04T08:49:16.5228045Z import json 2025-12-04T08:49:16.5301652Z import logging 2025-12-04T08:49:16.5302262Z import os 2025-12-04T08:49:16.5302743Z import random 2025-12-04T08:49:16.5303200Z import re 2025-12-04T08:49:16.5303635Z import sys 2025-12-04T08:49:16.5304132Z from argparse import ArgumentParser 2025-12-04T08:49:16.5304837Z from collections.abc import Iterable 2025-12-04T08:49:16.5305459Z from functools import cache 2025-12-04T08:49:16.5306036Z from logging import LogRecord 2025-12-04T08:49:16.5306639Z from typing import Any, NamedTuple 2025-12-04T08:49:16.5307406Z from urllib.request import Request, urlopen 2025-12-04T08:49:16.5308009Z  2025-12-04T08:49:16.5308396Z import yaml 2025-12-04T08:49:16.5308873Z from github import Auth, Github 2025-12-04T08:49:16.5309442Z from github.Issue import Issue 2025-12-04T08:49:16.5309978Z  2025-12-04T08:49:16.5310352Z  2025-12-04T08:49:16.5310820Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T08:49:16.5311612Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T08:49:16.5312592Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T08:49:16.5313356Z  2025-12-04T08:49:16.5314057Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T08:49:16.5314703Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T08:49:16.5315301Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T08:49:16.5315956Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T08:49:16.5316524Z  2025-12-04T08:49:16.5317214Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T08:49:16.5317770Z  2025-12-04T08:49:16.5318175Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T08:49:16.5318712Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T08:49:16.5319214Z  2025-12-04T08:49:16.5319585Z  2025-12-04T08:49:16.5320004Z class Experiment(NamedTuple): 2025-12-04T08:49:16.5320558Z  rollout_perc: float = ( 2025-12-04T08:49:16.5321302Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T08:49:16.5322036Z  ) 2025-12-04T08:49:16.5322468Z  all_branches: bool = ( 2025-12-04T08:49:16.5323209Z  False # If True, the experiment is also enabled on the exception branches 2025-12-04T08:49:16.5323938Z  ) 2025-12-04T08:49:16.5324367Z  default: bool = ( 2025-12-04T08:49:16.5325040Z  True # If True, the experiment is enabled by default for all queries 2025-12-04T08:49:16.5325741Z  ) 2025-12-04T08:49:16.5326137Z  2025-12-04T08:49:16.5326549Z  # Add more fields as needed 2025-12-04T08:49:16.5327200Z  2025-12-04T08:49:16.5327576Z  2025-12-04T08:49:16.5327986Z class Settings(NamedTuple): 2025-12-04T08:49:16.5328516Z  """ 2025-12-04T08:49:16.5329058Z  Settings for the experiments that can be opted into. 2025-12-04T08:49:16.5329698Z  """ 2025-12-04T08:49:16.5330110Z  2025-12-04T08:49:16.5330555Z  experiments: dict[str, Experiment] = {} 2025-12-04T08:49:16.5331127Z  2025-12-04T08:49:16.5331630Z  2025-12-04T08:49:16.5332098Z class ColorFormatter(logging.Formatter): 2025-12-04T08:49:16.5332816Z  """Color codes the log messages based on the log level""" 2025-12-04T08:49:16.5333461Z  2025-12-04T08:49:16.5333850Z  COLORS = { 2025-12-04T08:49:16.5334333Z  "WARNING": "\033[33m", # Yellow 2025-12-04T08:49:16.5334914Z  "ERROR": "\033[31m", # Red 2025-12-04T08:49:16.5335473Z  "CRITICAL": "\033[31m", # Red 2025-12-04T08:49:16.5336042Z  "INFO": "\033[0m", # Reset 2025-12-04T08:49:16.5336599Z  "DEBUG": "\033[0m", # Reset 2025-12-04T08:49:16.5337242Z  } 2025-12-04T08:49:16.5337641Z  2025-12-04T08:49:16.5338106Z  def format(self, record: LogRecord) -> str: 2025-12-04T08:49:16.5338940Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T08:49:16.5339804Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T08:49:16.5340450Z  return super().format(record) 2025-12-04T08:49:16.5340984Z  2025-12-04T08:49:16.5341353Z  2025-12-04T08:49:16.5341772Z handler = logging.StreamHandler() 2025-12-04T08:49:16.5342574Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T08:49:16.5343360Z  2025-12-04T08:49:16.5343856Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T08:49:16.5344514Z log.addHandler(handler) 2025-12-04T08:49:16.5345033Z log.setLevel(logging.INFO) 2025-12-04T08:49:16.5345541Z  2025-12-04T08:49:16.5345909Z  2025-12-04T08:49:16.5346406Z def set_github_output(key: str, value: str) -> None: 2025-12-04T08:49:16.5347140Z  """ 2025-12-04T08:49:16.5347735Z  Defines outputs of the github action that invokes this script 2025-12-04T08:49:16.5348611Z  """ 2025-12-04T08:49:16.5349043Z  if not GITHUB_OUTPUT: 2025-12-04T08:49:16.5350222Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-12-04T08:49:16.5351438Z  log.warning( 2025-12-04T08:49:16.5352412Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-12-04T08:49:16.5353402Z  ) 2025-12-04T08:49:16.5353904Z  print(f"::set-output name={key}::{value}") 2025-12-04T08:49:16.5354538Z  return 2025-12-04T08:49:16.5354972Z  2025-12-04T08:49:16.5355411Z  with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T08:49:16.5356059Z  log.info(f"Setting output: {key}='{value}'") 2025-12-04T08:49:16.5356701Z  f.write(f"{key}={value}\n") 2025-12-04T08:49:16.5357873Z  2025-12-04T08:49:16.5358262Z  2025-12-04T08:49:16.5358856Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T08:49:16.5359570Z  return frozenset( 2025-12-04T08:49:16.5360277Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T08:49:16.5361013Z  ) 2025-12-04T08:49:16.5361436Z  2025-12-04T08:49:16.5361825Z  2025-12-04T08:49:16.5362237Z def parse_args() -> Any: 2025-12-04T08:49:16.5362921Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T08:49:16.5363877Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T08:49:16.5364719Z  parser.add_argument( 2025-12-04T08:49:16.5365264Z  "--github-issue-repo", 2025-12-04T08:49:16.5365822Z  type=str, 2025-12-04T08:49:16.5366319Z  required=False, 2025-12-04T08:49:16.5367119Z  default="pytorch/test-infra", 2025-12-04T08:49:16.5367793Z  help="GitHub repo to get the issue", 2025-12-04T08:49:16.5368390Z  ) 2025-12-04T08:49:16.5368843Z  parser.add_argument( 2025-12-04T08:49:16.5369377Z  "--github-repo", 2025-12-04T08:49:16.5369902Z  type=str, 2025-12-04T08:49:16.5370397Z  required=True, 2025-12-04T08:49:16.5370977Z  help="GitHub repo where CI is running", 2025-12-04T08:49:16.5371566Z  ) 2025-12-04T08:49:16.5372011Z  parser.add_argument( 2025-12-04T08:49:16.5372732Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T08:49:16.5373470Z  ) 2025-12-04T08:49:16.5373909Z  parser.add_argument( 2025-12-04T08:49:16.5374644Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T08:49:16.5375410Z  ) 2025-12-04T08:49:16.5375847Z  parser.add_argument( 2025-12-04T08:49:16.5376599Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T08:49:16.5377474Z  ) 2025-12-04T08:49:16.5377913Z  parser.add_argument( 2025-12-04T08:49:16.5378693Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T08:49:16.5379466Z  ) 2025-12-04T08:49:16.5379923Z  parser.add_argument( 2025-12-04T08:49:16.5380461Z  "--github-ref-type", 2025-12-04T08:49:16.5381010Z  type=str, 2025-12-04T08:49:16.5381510Z  required=True, 2025-12-04T08:49:16.5382115Z  help="Current GitHub ref type, branch or tag", 2025-12-04T08:49:16.5382725Z  ) 2025-12-04T08:49:16.5383168Z  parser.add_argument( 2025-12-04T08:49:16.5383867Z  "--eligible-experiments", 2025-12-04T08:49:16.5384495Z  type=_str_comma_separated_to_set, 2025-12-04T08:49:16.5385088Z  required=False, 2025-12-04T08:49:16.5385604Z  default="", 2025-12-04T08:49:16.5386569Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T08:49:16.5387736Z  ) 2025-12-04T08:49:16.5388178Z  parser.add_argument( 2025-12-04T08:49:16.5388731Z  "--opt-out-experiments", 2025-12-04T08:49:16.5389347Z  type=_str_comma_separated_to_set, 2025-12-04T08:49:16.5389942Z  required=False, 2025-12-04T08:49:16.5390469Z  default="", 2025-12-04T08:49:16.5390961Z  help=( 2025-12-04T08:49:16.5391735Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T08:49:16.5392974Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T08:49:16.5393876Z  ), 2025-12-04T08:49:16.5394300Z  ) 2025-12-04T08:49:16.5394738Z  parser.add_argument( 2025-12-04T08:49:16.5395268Z  "--pr-number", 2025-12-04T08:49:16.5395778Z  type=str, 2025-12-04T08:49:16.5396268Z  required=False, 2025-12-04T08:49:16.5396791Z  default="", 2025-12-04T08:49:16.5397510Z  help="the optional PR number where this is run", 2025-12-04T08:49:16.5398133Z  ) 2025-12-04T08:49:16.5398538Z  2025-12-04T08:49:16.5398969Z  return parser.parse_args() 2025-12-04T08:49:16.5399499Z  2025-12-04T08:49:16.5399878Z  2025-12-04T08:49:16.5400548Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T08:49:16.5401533Z  auth = Auth.Token(github_token) 2025-12-04T08:49:16.5402161Z  return Github(auth=auth) 2025-12-04T08:49:16.5402682Z  2025-12-04T08:49:16.5403066Z  2025-12-04T08:49:16.5403799Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T08:49:16.5404678Z  repo = gh.get_repo(repo) 2025-12-04T08:49:16.5405291Z  return repo.get_issue(number=issue_num) 2025-12-04T08:49:16.5405876Z  2025-12-04T08:49:16.5406261Z  2025-12-04T08:49:16.5406682Z def get_potential_pr_author( 2025-12-04T08:49:16.5407554Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T08:49:16.5408300Z ) -> str: 2025-12-04T08:49:16.5408916Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T08:49:16.5409819Z  # Fetch the actual username from the original PR. The PR number is 2025-12-04T08:49:16.5410679Z  # embedded in the tag name: ciflow// 2025-12-04T08:49:16.5411320Z  2025-12-04T08:49:16.5411755Z  gh = get_gh_client(github_token) 2025-12-04T08:49:16.5412313Z  2025-12-04T08:49:16.5412836Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T08:49:16.5413544Z  split_tag = ref_name.split("/") 2025-12-04T08:49:16.5414112Z  if ( 2025-12-04T08:49:16.5414580Z  len(split_tag) == 3 2025-12-04T08:49:16.5415165Z  and split_tag[0] == "ciflow" 2025-12-04T08:49:16.5415762Z  and split_tag[2].isnumeric() 2025-12-04T08:49:16.5416331Z  ): 2025-12-04T08:49:16.5416809Z  pr_number = split_tag[2] 2025-12-04T08:49:16.5417470Z  try: 2025-12-04T08:49:16.5417994Z  repository = gh.get_repo(repo) 2025-12-04T08:49:16.5418841Z  pull = repository.get_pull(number=int(pr_number)) 2025-12-04T08:49:16.5419523Z  except Exception as e: 2025-12-04T08:49:16.5420137Z  raise Exception( # noqa: TRY002 2025-12-04T08:49:16.5420895Z  f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T08:49:16.5421618Z  ) from e 2025-12-04T08:49:16.5422277Z  return pull.user.login # type: ignore[no-any-return] 2025-12-04T08:49:16.5423070Z  # In all other cases, return the original input username 2025-12-04T08:49:16.5423733Z  return username 2025-12-04T08:49:16.5424217Z  2025-12-04T08:49:16.5424602Z  2025-12-04T08:49:16.5425099Z def is_exception_branch(branch: str) -> bool: 2025-12-04T08:49:16.5425693Z  """ 2025-12-04T08:49:16.5426447Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T08:49:16.5427412Z  """ 2025-12-04T08:49:16.5428052Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T08:49:16.5428787Z  2025-12-04T08:49:16.5429169Z  2025-12-04T08:49:16.5429620Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T08:49:16.5430191Z  try: 2025-12-04T08:49:16.5430664Z  data = yaml.safe_load(yaml_text) 2025-12-04T08:49:16.5431245Z  return data 2025-12-04T08:49:16.5431754Z  except yaml.YAMLError: 2025-12-04T08:49:16.5432343Z  log.exception("Error loading YAML") 2025-12-04T08:49:16.5432926Z  raise 2025-12-04T08:49:16.5433369Z  2025-12-04T08:49:16.5433759Z  2025-12-04T08:49:16.5434444Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T08:49:16.5435260Z  """ 2025-12-04T08:49:16.5436102Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T08:49:16.5437122Z  2025-12-04T08:49:16.5437736Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T08:49:16.5438594Z  and the text below is the list of opted in users. 2025-12-04T08:49:16.5439212Z  2025-12-04T08:49:16.5439855Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T08:49:16.5440613Z  """ 2025-12-04T08:49:16.5441145Z  rollout_state_parts = rollout_state.split("---") 2025-12-04T08:49:16.5441813Z  if len(rollout_state_parts) >= 2: 2025-12-04T08:49:16.5442522Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T08:49:16.5443181Z  else: 2025-12-04T08:49:16.5443640Z  return "", rollout_state 2025-12-04T08:49:16.5444179Z  2025-12-04T08:49:16.5444552Z  2025-12-04T08:49:16.5445272Z class UserOptins(dict[str, list[str]]): 2025-12-04T08:49:16.5445852Z  """ 2025-12-04T08:49:16.5446457Z  Dictionary of users with a list of features they have opted into 2025-12-04T08:49:16.5447268Z  """ 2025-12-04T08:49:16.5447673Z  2025-12-04T08:49:16.5448052Z  2025-12-04T08:49:16.5448643Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T08:49:16.5449379Z  """ 2025-12-04T08:49:16.5450187Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-12-04T08:49:16.5451090Z  2025-12-04T08:49:16.5451967Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-12-04T08:49:16.5453058Z  - Example line: "@User1,lf,split_build" 2025-12-04T08:49:16.5453969Z  - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T08:49:16.5454701Z  2025-12-04T08:49:16.5455076Z  2025-12-04T08:49:16.5455456Z  """ 2025-12-04T08:49:16.5455895Z  optins = UserOptins() 2025-12-04T08:49:16.5456484Z  for user in user_optin_text.split("\n"): 2025-12-04T08:49:16.5457229Z  user = user.strip("\r\n\t -") 2025-12-04T08:49:16.5457876Z  if not user or not user.startswith("@"): 2025-12-04T08:49:16.5458499Z  # Not a valid user. Skip 2025-12-04T08:49:16.5459056Z  continue 2025-12-04T08:49:16.5459527Z  2025-12-04T08:49:16.5459922Z  if user: 2025-12-04T08:49:16.5460455Z  usr_name = user.split(",")[0].strip("@") 2025-12-04T08:49:16.5461225Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T08:49:16.5461959Z  2025-12-04T08:49:16.5462361Z  return optins 2025-12-04T08:49:16.5462829Z  2025-12-04T08:49:16.5463208Z  2025-12-04T08:49:16.5463761Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T08:49:16.5464431Z  """ 2025-12-04T08:49:16.5464906Z  Check if the experiment name is valid. 2025-12-04T08:49:16.5465490Z  A valid name: 2025-12-04T08:49:16.5466234Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T08:49:16.5467346Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T08:49:16.5468132Z  - Cannot contain spaces 2025-12-04T08:49:16.5468663Z  """ 2025-12-04T08:49:16.5469068Z  2025-12-04T08:49:16.5469586Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T08:49:16.5470370Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T08:49:16.5471155Z  2025-12-04T08:49:16.5471552Z  if valid: 2025-12-04T08:49:16.5472010Z  return True 2025-12-04T08:49:16.5472472Z  2025-12-04T08:49:16.5472855Z  log.error( 2025-12-04T08:49:16.5474431Z  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-12-04T08:49:16.5476067Z  ) 2025-12-04T08:49:16.5476486Z  return False 2025-12-04T08:49:16.5477052Z  2025-12-04T08:49:16.5477437Z  2025-12-04T08:49:16.5478024Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T08:49:16.5478724Z  """ 2025-12-04T08:49:16.5479398Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T08:49:16.5480187Z  """ 2025-12-04T08:49:16.5480609Z  try: 2025-12-04T08:49:16.5481039Z  if settings_text: 2025-12-04T08:49:16.5481866Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-12-04T08:49:16.5482726Z  # for easy reading 2025-12-04T08:49:16.5483617Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T08:49:16.5484600Z  # the backtick character in shell commands. 2025-12-04T08:49:16.5485285Z  backtick = chr(96) # backtick character 2025-12-04T08:49:16.5486048Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T08:49:16.5486794Z  settings = load_yaml(settings_text) 2025-12-04T08:49:16.5487471Z  2025-12-04T08:49:16.5488137Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T08:49:16.5489074Z  experiments = {} 2025-12-04T08:49:16.5489593Z  2025-12-04T08:49:16.5490213Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T08:49:16.5491055Z  if not is_valid_experiment_name(exp_name): 2025-12-04T08:49:16.5492246Z  # 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-12-04T08:49:16.5493361Z  continue 2025-12-04T08:49:16.5493871Z  2025-12-04T08:49:16.5494299Z  valid_settings = {} 2025-12-04T08:49:16.5494895Z  for setting in exp_settings: 2025-12-04T08:49:16.5495533Z  if setting not in Experiment._fields: 2025-12-04T08:49:16.5496173Z  log.warning( 2025-12-04T08:49:16.5497083Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T08:49:16.5497856Z  ) 2025-12-04T08:49:16.5498361Z  else: 2025-12-04T08:49:16.5498968Z  valid_settings[setting] = exp_settings[setting] 2025-12-04T08:49:16.5499588Z  2025-12-04T08:49:16.5500121Z  experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T08:49:16.5500832Z  return Settings(experiments) 2025-12-04T08:49:16.5501386Z  2025-12-04T08:49:16.5501794Z  except Exception: 2025-12-04T08:49:16.5502371Z  log.exception("Failed to parse settings") 2025-12-04T08:49:16.5502972Z  2025-12-04T08:49:16.5503379Z  return Settings() 2025-12-04T08:49:16.5503862Z  2025-12-04T08:49:16.5504246Z  2025-12-04T08:49:16.5504872Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T08:49:16.5505511Z  """ 2025-12-04T08:49:16.5506032Z  Parse settings, if any, from the rollout state. 2025-12-04T08:49:16.5506639Z  2025-12-04T08:49:16.5507389Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T08:49:16.5508236Z  and the text below is the list of opted in users. 2025-12-04T08:49:16.5508850Z  2025-12-04T08:49:16.5509511Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T08:49:16.5510299Z  """ 2025-12-04T08:49:16.5510943Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T08:49:16.5511798Z  return parse_settings_from_text(settings_text) 2025-12-04T08:49:16.5512400Z  2025-12-04T08:49:16.5512776Z  2025-12-04T08:49:16.5513285Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T08:49:16.5513920Z  """ 2025-12-04T08:49:16.5514381Z  Parse users from the rollout state. 2025-12-04T08:49:16.5514945Z  2025-12-04T08:49:16.5515323Z  """ 2025-12-04T08:49:16.5515943Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T08:49:16.5516773Z  return parse_user_opt_in_from_text(users_text) 2025-12-04T08:49:16.5517488Z  2025-12-04T08:49:16.5517875Z  2025-12-04T08:49:16.5518561Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T08:49:16.5519392Z  """ 2025-12-04T08:49:16.5519888Z  Check if a user is opted into an experiment 2025-12-04T08:49:16.5520483Z  """ 2025-12-04T08:49:16.5521021Z  return experiment_name in user_optins.get(user, []) 2025-12-04T08:49:16.5521893Z  2025-12-04T08:49:16.5522274Z  2025-12-04T08:49:16.5522971Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T08:49:16.5523802Z  """ 2025-12-04T08:49:16.5524339Z  Check if a user explicitly opted out of an experiment 2025-12-04T08:49:16.5524980Z  """ 2025-12-04T08:49:16.5525841Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T08:49:16.5526637Z  experiment_optout = "-" + experiment_name 2025-12-04T08:49:16.5527492Z  if experiment_optout not in user_optins.get(user, []): 2025-12-04T08:49:16.5528165Z  return False 2025-12-04T08:49:16.5528647Z  2025-12-04T08:49:16.5529165Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T08:49:16.5529828Z  log.warning( 2025-12-04T08:49:16.5530751Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T08:49:16.5531713Z  ) 2025-12-04T08:49:16.5532297Z  2025-12-04T08:49:16.5532742Z  return True 2025-12-04T08:49:16.5533201Z  2025-12-04T08:49:16.5533579Z  2025-12-04T08:49:16.5533985Z def get_runner_prefix( 2025-12-04T08:49:16.5534504Z  rollout_state: str, 2025-12-04T08:49:16.5535061Z  workflow_requestors: Iterable[str], 2025-12-04T08:49:16.5535637Z  branch: str, 2025-12-04T08:49:16.5536231Z  eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T08:49:16.5537099Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T08:49:16.5537764Z  is_canary: bool = False, 2025-12-04T08:49:16.5538290Z ) -> str: 2025-12-04T08:49:16.5538803Z  settings = parse_settings(rollout_state) 2025-12-04T08:49:16.5539473Z  user_optins = parse_users(rollout_state) 2025-12-04T08:49:16.5540066Z  2025-12-04T08:49:16.5540624Z  fleet_prefix = "" 2025-12-04T08:49:16.5541137Z  prefixes = [] 2025-12-04T08:49:16.5541868Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T08:49:16.5542894Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T08:49:16.5543667Z  log.info( 2025-12-04T08:49:16.5544446Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T08:49:16.5545253Z  ) 2025-12-04T08:49:16.5545731Z  continue 2025-12-04T08:49:16.5546199Z  2025-12-04T08:49:16.5546624Z  if opt_out_experiments: 2025-12-04T08:49:16.5547357Z  if experiment_name in opt_out_experiments: 2025-12-04T08:49:16.5548092Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T08:49:16.5548758Z  log.info( 2025-12-04T08:49:16.5549785Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T08:49:16.5550830Z  ) 2025-12-04T08:49:16.5551315Z  continue 2025-12-04T08:49:16.5551839Z  2025-12-04T08:49:16.5552276Z  if eligible_experiments: 2025-12-04T08:49:16.5552932Z  if experiment_name not in eligible_experiments: 2025-12-04T08:49:16.5553648Z  exp_list = ", ".join(eligible_experiments) 2025-12-04T08:49:16.5554260Z  log.info( 2025-12-04T08:49:16.5555178Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T08:49:16.5556080Z  ) 2025-12-04T08:49:16.5556688Z  continue 2025-12-04T08:49:16.5557391Z  elif not experiment_settings.default: 2025-12-04T08:49:16.5557988Z  log.info( 2025-12-04T08:49:16.5558753Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T08:49:16.5559541Z  ) 2025-12-04T08:49:16.5559998Z  continue 2025-12-04T08:49:16.5560479Z  2025-12-04T08:49:16.5561002Z  # Is any workflow_requestor opted out to this experiment? 2025-12-04T08:49:16.5561687Z  opted_out_users = [ 2025-12-04T08:49:16.5562223Z  requestor 2025-12-04T08:49:16.5562786Z  for requestor in workflow_requestors 2025-12-04T08:49:16.5563538Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T08:49:16.5564234Z  ] 2025-12-04T08:49:16.5564648Z  2025-12-04T08:49:16.5565063Z  if opted_out_users: 2025-12-04T08:49:16.5565621Z  log.info( 2025-12-04T08:49:16.5566340Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T08:49:16.5567204Z  ) 2025-12-04T08:49:16.5567654Z  continue 2025-12-04T08:49:16.5568123Z  2025-12-04T08:49:16.5568638Z  # Is any workflow_requestor opted in to this experiment? 2025-12-04T08:49:16.5569309Z  opted_in_users = [ 2025-12-04T08:49:16.5569853Z  requestor 2025-12-04T08:49:16.5570399Z  for requestor in workflow_requestors 2025-12-04T08:49:16.5571149Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T08:49:16.5571836Z  ] 2025-12-04T08:49:16.5572258Z  2025-12-04T08:49:16.5572654Z  enabled = False 2025-12-04T08:49:16.5573179Z  if opted_in_users: 2025-12-04T08:49:16.5573825Z  log.info( 2025-12-04T08:49:16.5574539Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T08:49:16.5575283Z  ) 2025-12-04T08:49:16.5575738Z  enabled = True 2025-12-04T08:49:16.5576242Z  2025-12-04T08:49:16.5576700Z  elif experiment_settings.rollout_perc: 2025-12-04T08:49:16.5577774Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T08:49:16.5578795Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T08:49:16.5579510Z  log.info( 2025-12-04T08:49:16.5580480Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T08:49:16.5581456Z  ) 2025-12-04T08:49:16.5581957Z  enabled = True 2025-12-04T08:49:16.5582469Z  2025-12-04T08:49:16.5582867Z  if enabled: 2025-12-04T08:49:16.5583400Z  label = experiment_name 2025-12-04T08:49:16.5584034Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T08:49:16.5584942Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T08:49:16.5585883Z  # - If it's enabled, then we always list it's prefix first 2025-12-04T08:49:16.5586726Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T08:49:16.5587568Z  if is_canary: 2025-12-04T08:49:16.5588151Z  label += CANARY_FLEET_SUFFIX 2025-12-04T08:49:16.5588776Z  fleet_prefix = label 2025-12-04T08:49:16.5589322Z  else: 2025-12-04T08:49:16.5589973Z  prefixes.append(label) 2025-12-04T08:49:16.5590528Z  2025-12-04T08:49:16.5590937Z  if len(prefixes) > 1: 2025-12-04T08:49:16.5591458Z  log.error( 2025-12-04T08:49:16.5592587Z  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-12-04T08:49:16.5593771Z  ) 2025-12-04T08:49:16.5594228Z  prefixes = prefixes[:1] 2025-12-04T08:49:16.5594763Z  2025-12-04T08:49:16.5595175Z  # Fleet always comes first 2025-12-04T08:49:16.5595720Z  if fleet_prefix: 2025-12-04T08:49:16.5596254Z  prefixes.insert(0, fleet_prefix) 2025-12-04T08:49:16.5596813Z  2025-12-04T08:49:16.5597424Z  return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T08:49:16.5598056Z  2025-12-04T08:49:16.5598433Z  2025-12-04T08:49:16.5599140Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T08:49:16.5599972Z  """ 2025-12-04T08:49:16.5600628Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T08:49:16.5601388Z  2025-12-04T08:49:16.5602031Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T08:49:16.5602784Z  """ 2025-12-04T08:49:16.5603249Z  gh = get_gh_client(github_token) 2025-12-04T08:49:16.5603871Z  issue = get_issue(gh, repo, issue_num) 2025-12-04T08:49:16.5604594Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T08:49:16.5605254Z  2025-12-04T08:49:16.5605638Z  2025-12-04T08:49:16.5606306Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T08:49:16.5607359Z  for _ in range(num_retries): 2025-12-04T08:49:16.5607910Z  try: 2025-12-04T08:49:16.5608416Z  req = Request(url=url, headers=headers) 2025-12-04T08:49:16.5609161Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T08:49:16.5609876Z  return json.loads(content) 2025-12-04T08:49:16.5610472Z  except Exception as e: 2025-12-04T08:49:16.5611112Z  log.warning(f"Could not download {url}: {e}") 2025-12-04T08:49:16.5611716Z  2025-12-04T08:49:16.5612356Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T08:49:16.5613131Z  return {} 2025-12-04T08:49:16.5613581Z  2025-12-04T08:49:16.5613957Z  2025-12-04T08:49:16.5614347Z @cache 2025-12-04T08:49:16.5615077Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T08:49:16.5615899Z  """ 2025-12-04T08:49:16.5616363Z  Dynamically get PR information 2025-12-04T08:49:16.5617016Z  """ 2025-12-04T08:49:16.5617604Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T08:49:16.5618289Z  headers = { 2025-12-04T08:49:16.5618840Z  "Accept": "application/vnd.github.v3+json", 2025-12-04T08:49:16.5619519Z  "Authorization": f"token {github_token}", 2025-12-04T08:49:16.5620116Z  } 2025-12-04T08:49:16.5620623Z  json_response: dict[str, Any] = download_json( 2025-12-04T08:49:16.5621299Z  url=f"{github_api}/issues/{pr_number}", 2025-12-04T08:49:16.5621916Z  headers=headers, 2025-12-04T08:49:16.5622415Z  ) 2025-12-04T08:49:16.5622817Z  2025-12-04T08:49:16.5623232Z  if not json_response: 2025-12-04T08:49:16.5623905Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T08:49:16.5624732Z  return {} 2025-12-04T08:49:16.5625192Z  2025-12-04T08:49:16.5625611Z  return json_response 2025-12-04T08:49:16.5626292Z  2025-12-04T08:49:16.5626681Z  2025-12-04T08:49:16.5627430Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T08:49:16.5628227Z  """ 2025-12-04T08:49:16.5628834Z  Dynamically get the latest list of labels from the pull request 2025-12-04T08:49:16.5629550Z  """ 2025-12-04T08:49:16.5630113Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T08:49:16.5630786Z  return { 2025-12-04T08:49:16.5631448Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T08:49:16.5632199Z  } 2025-12-04T08:49:16.5632602Z  2025-12-04T08:49:16.5632993Z  2025-12-04T08:49:16.5633399Z def main() -> None: 2025-12-04T08:49:16.5633898Z  args = parse_args() 2025-12-04T08:49:16.5634390Z  2025-12-04T08:49:16.5634864Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T08:49:16.5635456Z  2025-12-04T08:49:16.5635884Z  # Check if the PR is opt-out 2025-12-04T08:49:16.5636437Z  if args.pr_number: 2025-12-04T08:49:16.5637295Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T08:49:16.5638114Z  if OPT_OUT_LABEL in labels: 2025-12-04T08:49:16.5638678Z  log.info( 2025-12-04T08:49:16.5639463Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T08:49:16.5640275Z  ) 2025-12-04T08:49:16.5640928Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T08:49:16.5641664Z  sys.exit() 2025-12-04T08:49:16.5642288Z  2025-12-04T08:49:16.5642682Z  try: 2025-12-04T08:49:16.5643206Z  rollout_state = get_rollout_state_from_issue( 2025-12-04T08:49:16.5643996Z  args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T08:49:16.5644691Z  ) 2025-12-04T08:49:16.5645110Z  2025-12-04T08:49:16.5645556Z  username = get_potential_pr_author( 2025-12-04T08:49:16.5646164Z  args.github_token, 2025-12-04T08:49:16.5646715Z  args.github_repo, 2025-12-04T08:49:16.5647376Z  args.github_actor, 2025-12-04T08:49:16.5647939Z  args.github_ref_type, 2025-12-04T08:49:16.5648518Z  args.github_branch, 2025-12-04T08:49:16.5649055Z  ) 2025-12-04T08:49:16.5649470Z  2025-12-04T08:49:16.5650018Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T08:49:16.5650674Z  2025-12-04T08:49:16.5651135Z  runner_label_prefix = get_runner_prefix( 2025-12-04T08:49:16.5651737Z  rollout_state, 2025-12-04T08:49:16.5652310Z  (args.github_issue_owner, username), 2025-12-04T08:49:16.5652914Z  args.github_branch, 2025-12-04T08:49:16.5653498Z  args.eligible_experiments, 2025-12-04T08:49:16.5654110Z  args.opt_out_experiments, 2025-12-04T08:49:16.5654706Z  is_canary, 2025-12-04T08:49:16.5655190Z  ) 2025-12-04T08:49:16.5655602Z  2025-12-04T08:49:16.5656015Z  except Exception as e: 2025-12-04T08:49:16.5656533Z  log.error( 2025-12-04T08:49:16.5657405Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T08:49:16.5658351Z  ) 2025-12-04T08:49:16.5658776Z  2025-12-04T08:49:16.5659359Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T08:49:16.5660068Z  2025-12-04T08:49:16.5660454Z  2025-12-04T08:49:16.5660861Z if __name__ == "__main__": 2025-12-04T08:49:16.5661380Z  main() 2025-12-04T08:49:16.5661798Z  2025-12-04T08:49:16.5662184Z EOF 2025-12-04T08:49:16.5662575Z  2025-12-04T08:49:16.5663001Z cat runner_determinator.py 2025-12-04T08:49:16.6449884Z shell: /usr/bin/bash -e {0} 2025-12-04T08:49:16.6450823Z env: 2025-12-04T08:49:16.6451610Z GITHUB_TOKEN: *** 2025-12-04T08:49:16.6452089Z ISSUE_NUMBER: 5132 2025-12-04T08:49:16.6452603Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T08:49:16.6453190Z ISSUE_OWNER: 2025-12-04T08:49:16.6453662Z CHECK_EXPERIMENTS: 2025-12-04T08:49:16.6454164Z OPT_OUT_EXPERIMENTS: 2025-12-04T08:49:16.6454660Z PR_NUMBER: 2025-12-04T08:49:16.6455126Z ##[endgroup] 2025-12-04T08:49:16.6659795Z # flake8: noqa: G004 2025-12-04T08:49:16.6660153Z 2025-12-04T08:49:16.6660594Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T08:49:16.6661570Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T08:49:16.6662415Z # python .github/scripts/update_runner_determinator.py 2025-12-04T08:49:16.6662862Z 2025-12-04T08:49:16.6663024Z """ 2025-12-04T08:49:16.6663618Z This runner determinator is used to determine which set of runners to run a 2025-12-04T08:49:16.6664506Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T08:49:16.6665403Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T08:49:16.6666224Z of which runners should be used to run which job. 2025-12-04T08:49:16.6666628Z 2025-12-04T08:49:16.6667275Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T08:49:16.6668403Z separated by a line containing "---". If the line is not present, the 2025-12-04T08:49:16.6669307Z settings are considered to be empty with only the second part, the user 2025-12-04T08:49:16.6670005Z list, defined. 2025-12-04T08:49:16.6670239Z 2025-12-04T08:49:16.6670601Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T08:49:16.6671524Z used to define any settings that are needed to determine which runners to use. 2025-12-04T08:49:16.6672340Z It's fields are defined by the RolloutSettings class below. 2025-12-04T08:49:16.6672776Z 2025-12-04T08:49:16.6673148Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T08:49:16.6674007Z The user list is also a comma separated list of additional features or 2025-12-04T08:49:16.6674740Z experiments which the user could be opted in to. 2025-12-04T08:49:16.6675143Z 2025-12-04T08:49:16.6675342Z The user list has the following rules: 2025-12-04T08:49:16.6675701Z 2025-12-04T08:49:16.6676018Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T08:49:16.6677081Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T08:49:16.6677883Z - A "#" prefix opts the user out of all experiments 2025-12-04T08:49:16.6678277Z 2025-12-04T08:49:16.6678452Z Example config: 2025-12-04T08:49:16.6678905Z # A list of experiments that can be opted into. 2025-12-04T08:49:16.6679581Z # This defines the behavior they'll induce when opted into. 2025-12-04T08:49:16.6680201Z # Expected syntax is: 2025-12-04T08:49:16.6680858Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T08:49:16.6681830Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T08:49:16.6682442Z 2025-12-04T08:49:16.6682616Z experiments: 2025-12-04T08:49:16.6683050Z lf: 2025-12-04T08:49:16.6683432Z rollout_percent: 25 2025-12-04T08:49:16.6684064Z all_branches: false 2025-12-04T08:49:16.6684520Z default: true 2025-12-04T08:49:16.6684937Z --- 2025-12-04T08:49:16.6685146Z 2025-12-04T08:49:16.6685311Z # Opt-ins: 2025-12-04T08:49:16.6685945Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T08:49:16.6686816Z # and specifying experiments to enable in a comma-separated list. 2025-12-04T08:49:16.6687853Z # To always opt out of an experiment, prefix it with a "-". 2025-12-04T08:49:16.6688518Z # Experiments should be from the above list. 2025-12-04T08:49:16.6688900Z 2025-12-04T08:49:16.6689083Z @User1,-lf,split_build 2025-12-04T08:49:16.6689533Z @User2,lf 2025-12-04T08:49:16.6689915Z @User3,split_build 2025-12-04T08:49:16.6690338Z """ 2025-12-04T08:49:16.6690532Z 2025-12-04T08:49:16.6690698Z import json 2025-12-04T08:49:16.6691074Z import logging 2025-12-04T08:49:16.6691471Z import os 2025-12-04T08:49:16.6691849Z import random 2025-12-04T08:49:16.6692247Z import re 2025-12-04T08:49:16.6692613Z import sys 2025-12-04T08:49:16.6693023Z from argparse import ArgumentParser 2025-12-04T08:49:16.6693557Z from collections.abc import Iterable 2025-12-04T08:49:16.6694078Z from functools import cache 2025-12-04T08:49:16.6694552Z from logging import LogRecord 2025-12-04T08:49:16.6695046Z from typing import Any, NamedTuple 2025-12-04T08:49:16.6695578Z from urllib.request import Request, urlopen 2025-12-04T08:49:16.6695953Z 2025-12-04T08:49:16.6696125Z import yaml 2025-12-04T08:49:16.6696515Z from github import Auth, Github 2025-12-04T08:49:16.6697273Z from github.Issue import Issue 2025-12-04T08:49:16.6697587Z 2025-12-04T08:49:16.6697594Z 2025-12-04T08:49:16.6697822Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T08:49:16.6698508Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T08:49:16.6699386Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T08:49:16.6699948Z 2025-12-04T08:49:16.6700184Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T08:49:16.6700906Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T08:49:16.6701431Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T08:49:16.6701992Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T08:49:16.6702347Z 2025-12-04T08:49:16.6702549Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T08:49:16.6702882Z 2025-12-04T08:49:16.6703068Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T08:49:16.6703536Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T08:49:16.6703820Z 2025-12-04T08:49:16.6703826Z 2025-12-04T08:49:16.6704014Z class Experiment(NamedTuple): 2025-12-04T08:49:16.6704510Z rollout_perc: float = ( 2025-12-04T08:49:16.6705140Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T08:49:16.6705818Z ) 2025-12-04T08:49:16.6706189Z all_branches: bool = ( 2025-12-04T08:49:16.6706807Z False # If True, the experiment is also enabled on the exception branches 2025-12-04T08:49:16.6707732Z ) 2025-12-04T08:49:16.6708102Z default: bool = ( 2025-12-04T08:49:16.6708676Z True # If True, the experiment is enabled by default for all queries 2025-12-04T08:49:16.6709318Z ) 2025-12-04T08:49:16.6709516Z 2025-12-04T08:49:16.6709698Z # Add more fields as needed 2025-12-04T08:49:16.6709999Z 2025-12-04T08:49:16.6710006Z 2025-12-04T08:49:16.6710202Z class Settings(NamedTuple): 2025-12-04T08:49:16.6710642Z """ 2025-12-04T08:49:16.6711104Z Settings for the experiments that can be opted into. 2025-12-04T08:49:16.6711672Z """ 2025-12-04T08:49:16.6711870Z 2025-12-04T08:49:16.6712082Z experiments: dict[str, Experiment] = {} 2025-12-04T08:49:16.6712443Z 2025-12-04T08:49:16.6712451Z 2025-12-04T08:49:16.6712662Z class ColorFormatter(logging.Formatter): 2025-12-04T08:49:16.6713291Z """Color codes the log messages based on the log level""" 2025-12-04T08:49:16.6713721Z 2025-12-04T08:49:16.6713889Z COLORS = { 2025-12-04T08:49:16.6714288Z "WARNING": "\033[33m", # Yellow 2025-12-04T08:49:16.6714951Z "ERROR": "\033[31m", # Red 2025-12-04T08:49:16.6715468Z "CRITICAL": "\033[31m", # Red 2025-12-04T08:49:16.6715976Z "INFO": "\033[0m", # Reset 2025-12-04T08:49:16.6716453Z "DEBUG": "\033[0m", # Reset 2025-12-04T08:49:16.6717139Z } 2025-12-04T08:49:16.6717356Z 2025-12-04T08:49:16.6717581Z def format(self, record: LogRecord) -> str: 2025-12-04T08:49:16.6718339Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T08:49:16.6719114Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T08:49:16.6719690Z return super().format(record) 2025-12-04T08:49:16.6720024Z 2025-12-04T08:49:16.6720032Z 2025-12-04T08:49:16.6720232Z handler = logging.StreamHandler() 2025-12-04T08:49:16.6720937Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T08:49:16.6721496Z 2025-12-04T08:49:16.6721741Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T08:49:16.6722335Z log.addHandler(handler) 2025-12-04T08:49:16.6722797Z log.setLevel(logging.INFO) 2025-12-04T08:49:16.6723082Z 2025-12-04T08:49:16.6723089Z 2025-12-04T08:49:16.6723347Z def set_github_output(key: str, value: str) -> None: 2025-12-04T08:49:16.6723903Z """ 2025-12-04T08:49:16.6724406Z Defines outputs of the github action that invokes this script 2025-12-04T08:49:16.6725036Z """ 2025-12-04T08:49:16.6725420Z if not GITHUB_OUTPUT: 2025-12-04T08:49:16.6726482Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-12-04T08:49:16.6727839Z log.warning( 2025-12-04T08:49:16.6728703Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-12-04T08:49:16.6729639Z ) 2025-12-04T08:49:16.6739666Z print(f"::set-output name={key}::{value}") 2025-12-04T08:49:16.6740292Z return 2025-12-04T08:49:16.6740560Z 2025-12-04T08:49:16.6740929Z with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T08:49:16.6741534Z log.info(f"Setting output: {key}='{value}'") 2025-12-04T08:49:16.6742130Z f.write(f"{key}={value}\n") 2025-12-04T08:49:16.6742460Z 2025-12-04T08:49:16.6742467Z 2025-12-04T08:49:16.6742777Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T08:49:16.6743405Z return frozenset( 2025-12-04T08:49:16.6744022Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T08:49:16.6744709Z ) 2025-12-04T08:49:16.6744911Z 2025-12-04T08:49:16.6744918Z 2025-12-04T08:49:16.6745102Z def parse_args() -> Any: 2025-12-04T08:49:16.6745669Z parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T08:49:16.6746544Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T08:49:16.6747499Z parser.add_argument( 2025-12-04T08:49:16.6747972Z "--github-issue-repo", 2025-12-04T08:49:16.6748449Z type=str, 2025-12-04T08:49:16.6748865Z required=False, 2025-12-04T08:49:16.6749336Z default="pytorch/test-infra", 2025-12-04T08:49:16.6749881Z help="GitHub repo to get the issue", 2025-12-04T08:49:16.6750402Z ) 2025-12-04T08:49:16.6750785Z parser.add_argument( 2025-12-04T08:49:16.6751262Z "--github-repo", 2025-12-04T08:49:16.6751695Z type=str, 2025-12-04T08:49:16.6752106Z required=True, 2025-12-04T08:49:16.6752573Z help="GitHub repo where CI is running", 2025-12-04T08:49:16.6753112Z ) 2025-12-04T08:49:16.6753501Z parser.add_argument( 2025-12-04T08:49:16.6754111Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T08:49:16.6754784Z ) 2025-12-04T08:49:16.6755158Z parser.add_argument( 2025-12-04T08:49:16.6755796Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T08:49:16.6756477Z ) 2025-12-04T08:49:16.6756970Z parser.add_argument( 2025-12-04T08:49:16.6757767Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T08:49:16.6758467Z ) 2025-12-04T08:49:16.6758855Z parser.add_argument( 2025-12-04T08:49:16.6759508Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T08:49:16.6760245Z ) 2025-12-04T08:49:16.6760633Z parser.add_argument( 2025-12-04T08:49:16.6761101Z "--github-ref-type", 2025-12-04T08:49:16.6761564Z type=str, 2025-12-04T08:49:16.6761977Z required=True, 2025-12-04T08:49:16.6762476Z help="Current GitHub ref type, branch or tag", 2025-12-04T08:49:16.6763042Z ) 2025-12-04T08:49:16.6763425Z parser.add_argument( 2025-12-04T08:49:16.6763907Z "--eligible-experiments", 2025-12-04T08:49:16.6764430Z type=_str_comma_separated_to_set, 2025-12-04T08:49:16.6764966Z required=False, 2025-12-04T08:49:16.6765405Z default="", 2025-12-04T08:49:16.6766274Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T08:49:16.6817146Z ) 2025-12-04T08:49:16.6817652Z parser.add_argument( 2025-12-04T08:49:16.6818201Z "--opt-out-experiments", 2025-12-04T08:49:16.6818722Z type=_str_comma_separated_to_set, 2025-12-04T08:49:16.6819253Z required=False, 2025-12-04T08:49:16.6819681Z default="", 2025-12-04T08:49:16.6820075Z help=( 2025-12-04T08:49:16.6820770Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T08:49:16.6821912Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T08:49:16.6822742Z ), 2025-12-04T08:49:16.6823094Z ) 2025-12-04T08:49:16.6823467Z parser.add_argument( 2025-12-04T08:49:16.6823904Z "--pr-number", 2025-12-04T08:49:16.6824319Z type=str, 2025-12-04T08:49:16.6824714Z required=False, 2025-12-04T08:49:16.6825161Z default="", 2025-12-04T08:49:16.6825806Z help="the optional PR number where this is run", 2025-12-04T08:49:16.6826377Z ) 2025-12-04T08:49:16.6826579Z 2025-12-04T08:49:16.6826776Z return parser.parse_args() 2025-12-04T08:49:16.6827210Z 2025-12-04T08:49:16.6827217Z 2025-12-04T08:49:16.6827625Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T08:49:16.6828391Z auth = Auth.Token(github_token) 2025-12-04T08:49:16.6828895Z return Github(auth=auth) 2025-12-04T08:49:16.6829194Z 2025-12-04T08:49:16.6829201Z 2025-12-04T08:49:16.6829660Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T08:49:16.6830460Z repo = gh.get_repo(repo) 2025-12-04T08:49:16.6830951Z return repo.get_issue(number=issue_num) 2025-12-04T08:49:16.6831316Z 2025-12-04T08:49:16.6831323Z 2025-12-04T08:49:16.6831509Z def get_potential_pr_author( 2025-12-04T08:49:16.6832168Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T08:49:16.6832845Z ) -> str: 2025-12-04T08:49:16.6833368Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T08:49:16.6834164Z # Fetch the actual username from the original PR. The PR number is 2025-12-04T08:49:16.6834909Z # embedded in the tag name: ciflow// 2025-12-04T08:49:16.6835319Z 2025-12-04T08:49:16.6835512Z gh = get_gh_client(github_token) 2025-12-04T08:49:16.6835853Z 2025-12-04T08:49:16.6836126Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T08:49:16.6836749Z split_tag = ref_name.split("/") 2025-12-04T08:49:16.6837390Z if ( 2025-12-04T08:49:16.6837776Z len(split_tag) == 3 2025-12-04T08:49:16.6838258Z and split_tag[0] == "ciflow" 2025-12-04T08:49:16.6838789Z and split_tag[2].isnumeric() 2025-12-04T08:49:16.6839280Z ): 2025-12-04T08:49:16.6839673Z pr_number = split_tag[2] 2025-12-04T08:49:16.6840301Z try: 2025-12-04T08:49:16.6840746Z repository = gh.get_repo(repo) 2025-12-04T08:49:16.6841361Z pull = repository.get_pull(number=int(pr_number)) 2025-12-04T08:49:16.6841961Z except Exception as e: 2025-12-04T08:49:16.6842479Z raise Exception( # noqa: TRY002 2025-12-04T08:49:16.6843151Z f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T08:49:16.6843784Z ) from e 2025-12-04T08:49:16.6844320Z return pull.user.login # type: ignore[no-any-return] 2025-12-04T08:49:16.6845017Z # In all other cases, return the original input username 2025-12-04T08:49:16.6845601Z return username 2025-12-04T08:49:16.6845850Z 2025-12-04T08:49:16.6845856Z 2025-12-04T08:49:16.6846082Z def is_exception_branch(branch: str) -> bool: 2025-12-04T08:49:16.6846607Z """ 2025-12-04T08:49:16.6847408Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T08:49:16.6848201Z """ 2025-12-04T08:49:16.6848749Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T08:49:16.6849265Z 2025-12-04T08:49:16.6849272Z 2025-12-04T08:49:16.6849470Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T08:49:16.6849965Z try: 2025-12-04T08:49:16.6850354Z data = yaml.safe_load(yaml_text) 2025-12-04T08:49:16.6850859Z return data 2025-12-04T08:49:16.6851287Z except yaml.YAMLError: 2025-12-04T08:49:16.6851761Z log.exception("Error loading YAML") 2025-12-04T08:49:16.6852273Z raise 2025-12-04T08:49:16.6852492Z 2025-12-04T08:49:16.6852498Z 2025-12-04T08:49:16.6852926Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T08:49:16.6853655Z """ 2025-12-04T08:49:16.6854283Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T08:49:16.6854879Z 2025-12-04T08:49:16.6855363Z If the issue body contains "---" then the text above that is the settings 2025-12-04T08:49:16.6856129Z and the text below is the list of opted in users. 2025-12-04T08:49:16.6856530Z 2025-12-04T08:49:16.6857070Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T08:49:16.6857786Z """ 2025-12-04T08:49:16.6858234Z rollout_state_parts = rollout_state.split("---") 2025-12-04T08:49:16.6858849Z if len(rollout_state_parts) >= 2: 2025-12-04T08:49:16.6859461Z return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T08:49:16.6860042Z else: 2025-12-04T08:49:16.6860429Z return "", rollout_state 2025-12-04T08:49:16.6861156Z 2025-12-04T08:49:16.6861163Z 2025-12-04T08:49:16.6861389Z class UserOptins(dict[str, list[str]]): 2025-12-04T08:49:16.6861910Z """ 2025-12-04T08:49:16.6862431Z Dictionary of users with a list of features they have opted into 2025-12-04T08:49:16.6863074Z """ 2025-12-04T08:49:16.6863289Z 2025-12-04T08:49:16.6863297Z 2025-12-04T08:49:16.6863651Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T08:49:16.6864296Z """ 2025-12-04T08:49:16.6865011Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-12-04T08:49:16.6865693Z 2025-12-04T08:49:16.6866316Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-12-04T08:49:16.6867423Z - Example line: "@User1,lf,split_build" 2025-12-04T08:49:16.6868120Z - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T08:49:16.6868602Z 2025-12-04T08:49:16.6868609Z 2025-12-04T08:49:16.6868770Z """ 2025-12-04T08:49:16.6869152Z optins = UserOptins() 2025-12-04T08:49:16.6869638Z for user in user_optin_text.split("\n"): 2025-12-04T08:49:16.6870199Z user = user.strip("\r\n\t -") 2025-12-04T08:49:16.6870747Z if not user or not user.startswith("@"): 2025-12-04T08:49:16.6871529Z # Not a valid user. Skip 2025-12-04T08:49:16.6872021Z continue 2025-12-04T08:49:16.6872267Z 2025-12-04T08:49:16.6872428Z if user: 2025-12-04T08:49:16.6872872Z usr_name = user.split(",")[0].strip("@") 2025-12-04T08:49:16.6873557Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T08:49:16.6874055Z 2025-12-04T08:49:16.6874224Z return optins 2025-12-04T08:49:16.6874464Z 2025-12-04T08:49:16.6874471Z 2025-12-04T08:49:16.6874764Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T08:49:16.6875358Z """ 2025-12-04T08:49:16.6875758Z Check if the experiment name is valid. 2025-12-04T08:49:16.6876269Z A valid name: 2025-12-04T08:49:16.6877024Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T08:49:16.6877990Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T08:49:16.6878728Z - Cannot contain spaces 2025-12-04T08:49:16.6879190Z """ 2025-12-04T08:49:16.6879398Z 2025-12-04T08:49:16.6879665Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T08:49:16.6880374Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T08:49:16.6880822Z 2025-12-04T08:49:16.6880984Z if valid: 2025-12-04T08:49:16.6881368Z return True 2025-12-04T08:49:16.6881610Z 2025-12-04T08:49:16.6881776Z log.error( 2025-12-04T08:49:16.6883262Z 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-12-04T08:49:16.6884866Z ) 2025-12-04T08:49:16.6885221Z return False 2025-12-04T08:49:16.6885460Z 2025-12-04T08:49:16.6885467Z 2025-12-04T08:49:16.6885769Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T08:49:16.6886393Z """ 2025-12-04T08:49:16.6887263Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T08:49:16.6888031Z """ 2025-12-04T08:49:16.6888387Z try: 2025-12-04T08:49:16.6888766Z if settings_text: 2025-12-04T08:49:16.6889493Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-12-04T08:49:16.6890288Z # for easy reading 2025-12-04T08:49:16.6891083Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T08:49:16.6891965Z # the backtick character in shell commands. 2025-12-04T08:49:16.6892570Z backtick = chr(96) # backtick character 2025-12-04T08:49:16.6893234Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T08:49:16.6893906Z settings = load_yaml(settings_text) 2025-12-04T08:49:16.6894280Z 2025-12-04T08:49:16.6894694Z # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T08:49:16.6895463Z experiments = {} 2025-12-04T08:49:16.6895765Z 2025-12-04T08:49:16.6896152Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T08:49:16.6897069Z if not is_valid_experiment_name(exp_name): 2025-12-04T08:49:16.6898192Z # 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-12-04T08:49:16.6899237Z continue 2025-12-04T08:49:16.6899524Z 2025-12-04T08:49:16.6899794Z valid_settings = {} 2025-12-04T08:49:16.6900539Z for setting in exp_settings: 2025-12-04T08:49:16.6901498Z if setting not in Experiment._fields: 2025-12-04T08:49:16.6902059Z log.warning( 2025-12-04T08:49:16.6902777Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T08:49:16.6903674Z ) 2025-12-04T08:49:16.6904104Z else: 2025-12-04T08:49:16.6904628Z valid_settings[setting] = exp_settings[setting] 2025-12-04T08:49:16.6905052Z 2025-12-04T08:49:16.6905329Z experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T08:49:16.6905964Z return Settings(experiments) 2025-12-04T08:49:16.6906347Z 2025-12-04T08:49:16.6906532Z except Exception: 2025-12-04T08:49:16.6907143Z log.exception("Failed to parse settings") 2025-12-04T08:49:16.6907535Z 2025-12-04T08:49:16.6907719Z return Settings() 2025-12-04T08:49:16.6907977Z 2025-12-04T08:49:16.6907983Z 2025-12-04T08:49:16.6908230Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T08:49:16.6908809Z """ 2025-12-04T08:49:16.6909254Z Parse settings, if any, from the rollout state. 2025-12-04T08:49:16.6909667Z 2025-12-04T08:49:16.6910019Z If the issue body contains "---" then the text above that is the settings 2025-12-04T08:49:16.6910789Z and the text below is the list of opted in users. 2025-12-04T08:49:16.6911205Z 2025-12-04T08:49:16.6911612Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T08:49:16.6912373Z """ 2025-12-04T08:49:16.6912934Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T08:49:16.6913806Z return parse_settings_from_text(settings_text) 2025-12-04T08:49:16.6914208Z 2025-12-04T08:49:16.6914215Z 2025-12-04T08:49:16.6914647Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T08:49:16.6915250Z """ 2025-12-04T08:49:16.6915645Z Parse users from the rollout state. 2025-12-04T08:49:16.6916002Z 2025-12-04T08:49:16.6916161Z """ 2025-12-04T08:49:16.6916703Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T08:49:16.6918010Z return parse_user_opt_in_from_text(users_text) 2025-12-04T08:49:16.6918433Z 2025-12-04T08:49:16.6918446Z 2025-12-04T08:49:16.6919010Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T08:49:16.6919765Z """ 2025-12-04T08:49:16.6920184Z Check if a user is opted into an experiment 2025-12-04T08:49:16.6920717Z """ 2025-12-04T08:49:16.6921175Z return experiment_name in user_optins.get(user, []) 2025-12-04T08:49:16.6921590Z 2025-12-04T08:49:16.6921596Z 2025-12-04T08:49:16.6922019Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T08:49:16.6922759Z """ 2025-12-04T08:49:16.6923218Z Check if a user explicitly opted out of an experiment 2025-12-04T08:49:16.6923795Z """ 2025-12-04T08:49:16.6924297Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T08:49:16.6924974Z experiment_optout = "-" + experiment_name 2025-12-04T08:49:16.6926013Z if experiment_optout not in user_optins.get(user, []): 2025-12-04T08:49:16.6926785Z return False 2025-12-04T08:49:16.6927202Z 2025-12-04T08:49:16.6927492Z if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T08:49:16.6928113Z log.warning( 2025-12-04T08:49:16.6928945Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T08:49:16.6929837Z ) 2025-12-04T08:49:16.6930049Z 2025-12-04T08:49:16.6930215Z return True 2025-12-04T08:49:16.6930455Z 2025-12-04T08:49:16.6930461Z 2025-12-04T08:49:16.6930640Z def get_runner_prefix( 2025-12-04T08:49:16.6931084Z rollout_state: str, 2025-12-04T08:49:16.6931554Z workflow_requestors: Iterable[str], 2025-12-04T08:49:16.6932078Z branch: str, 2025-12-04T08:49:16.6932566Z eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T08:49:16.6933249Z opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T08:49:16.6934064Z is_canary: bool = False, 2025-12-04T08:49:16.6934703Z ) -> str: 2025-12-04T08:49:16.6935318Z settings = parse_settings(rollout_state) 2025-12-04T08:49:16.6935920Z user_optins = parse_users(rollout_state) 2025-12-04T08:49:16.6936298Z 2025-12-04T08:49:16.6936479Z fleet_prefix = "" 2025-12-04T08:49:16.6937054Z prefixes = [] 2025-12-04T08:49:16.6937711Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T08:49:16.6938661Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T08:49:16.6939389Z log.info( 2025-12-04T08:49:16.6940078Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T08:49:16.6940841Z ) 2025-12-04T08:49:16.6941239Z continue 2025-12-04T08:49:16.6941493Z 2025-12-04T08:49:16.6941686Z if opt_out_experiments: 2025-12-04T08:49:16.6942253Z if experiment_name in opt_out_experiments: 2025-12-04T08:49:16.6942919Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T08:49:16.6943521Z log.info( 2025-12-04T08:49:16.6944462Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T08:49:16.6945434Z ) 2025-12-04T08:49:16.6945843Z continue 2025-12-04T08:49:16.6946114Z 2025-12-04T08:49:16.6946313Z if eligible_experiments: 2025-12-04T08:49:16.6947053Z if experiment_name not in eligible_experiments: 2025-12-04T08:49:16.6947711Z exp_list = ", ".join(eligible_experiments) 2025-12-04T08:49:16.6948281Z log.info( 2025-12-04T08:49:16.6949073Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T08:49:16.6949903Z ) 2025-12-04T08:49:16.6950313Z continue 2025-12-04T08:49:16.6950788Z elif not experiment_settings.default: 2025-12-04T08:49:16.6951332Z log.info( 2025-12-04T08:49:16.6952170Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T08:49:16.6952920Z ) 2025-12-04T08:49:16.6953305Z continue 2025-12-04T08:49:16.6953558Z 2025-12-04T08:49:16.6953838Z # Is any workflow_requestor opted out to this experiment? 2025-12-04T08:49:16.6954467Z opted_out_users = [ 2025-12-04T08:49:16.6954923Z requestor 2025-12-04T08:49:16.6955384Z for requestor in workflow_requestors 2025-12-04T08:49:16.6956062Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T08:49:16.6956722Z ] 2025-12-04T08:49:16.6957084Z 2025-12-04T08:49:16.6957273Z if opted_out_users: 2025-12-04T08:49:16.6957739Z log.info( 2025-12-04T08:49:16.6958401Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T08:49:16.6959109Z ) 2025-12-04T08:49:16.6959496Z continue 2025-12-04T08:49:16.6959753Z 2025-12-04T08:49:16.6960035Z # Is any workflow_requestor opted in to this experiment? 2025-12-04T08:49:16.6960680Z opted_in_users = [ 2025-12-04T08:49:16.6961134Z requestor 2025-12-04T08:49:16.6961594Z for requestor in workflow_requestors 2025-12-04T08:49:16.6962259Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T08:49:16.6962877Z ] 2025-12-04T08:49:16.6963085Z 2025-12-04T08:49:16.6963265Z enabled = False 2025-12-04T08:49:16.6963705Z if opted_in_users: 2025-12-04T08:49:16.6964152Z log.info( 2025-12-04T08:49:16.6964754Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T08:49:16.6965446Z ) 2025-12-04T08:49:16.6965842Z enabled = True 2025-12-04T08:49:16.6966130Z 2025-12-04T08:49:16.6966369Z elif experiment_settings.rollout_perc: 2025-12-04T08:49:16.6967385Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T08:49:16.6968899Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T08:49:16.6969579Z log.info( 2025-12-04T08:49:16.6970453Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T08:49:16.6971387Z ) 2025-12-04T08:49:16.6971805Z enabled = True 2025-12-04T08:49:16.6972109Z 2025-12-04T08:49:16.6972279Z if enabled: 2025-12-04T08:49:16.6972738Z label = experiment_name 2025-12-04T08:49:16.6973307Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T08:49:16.6974146Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T08:49:16.6975041Z # - If it's enabled, then we always list it's prefix first 2025-12-04T08:49:16.6975825Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T08:49:16.6976509Z if is_canary: 2025-12-04T08:49:16.6977146Z label += CANARY_FLEET_SUFFIX 2025-12-04T08:49:16.6977711Z fleet_prefix = label 2025-12-04T08:49:16.6978210Z else: 2025-12-04T08:49:16.6978649Z prefixes.append(label) 2025-12-04T08:49:16.6978997Z 2025-12-04T08:49:16.6979180Z if len(prefixes) > 1: 2025-12-04T08:49:16.6979627Z log.error( 2025-12-04T08:49:16.6980658Z 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-12-04T08:49:16.6981780Z ) 2025-12-04T08:49:16.6982182Z prefixes = prefixes[:1] 2025-12-04T08:49:16.6982516Z 2025-12-04T08:49:16.6982707Z # Fleet always comes first 2025-12-04T08:49:16.6983217Z if fleet_prefix: 2025-12-04T08:49:16.6983689Z prefixes.insert(0, fleet_prefix) 2025-12-04T08:49:16.6984069Z 2025-12-04T08:49:16.6984457Z return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T08:49:16.6984882Z 2025-12-04T08:49:16.6984889Z 2025-12-04T08:49:16.6985332Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T08:49:16.6986125Z """ 2025-12-04T08:49:16.6986724Z Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T08:49:16.6987450Z 2025-12-04T08:49:16.6987842Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T08:49:16.6988561Z """ 2025-12-04T08:49:16.6989052Z gh = get_gh_client(github_token) 2025-12-04T08:49:16.6989612Z issue = get_issue(gh, repo, issue_num) 2025-12-04T08:49:16.6990276Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T08:49:16.6990730Z 2025-12-04T08:49:16.6990737Z 2025-12-04T08:49:16.6991134Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T08:49:16.6991911Z for _ in range(num_retries): 2025-12-04T08:49:16.6992391Z try: 2025-12-04T08:49:16.6992825Z req = Request(url=url, headers=headers) 2025-12-04T08:49:16.6993490Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T08:49:16.6994157Z return json.loads(content) 2025-12-04T08:49:16.6994687Z except Exception as e: 2025-12-04T08:49:16.6995236Z log.warning(f"Could not download {url}: {e}") 2025-12-04T08:49:16.6995662Z 2025-12-04T08:49:16.6996045Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T08:49:16.6996757Z return {} 2025-12-04T08:49:16.6997130Z 2025-12-04T08:49:16.6997136Z 2025-12-04T08:49:16.6997309Z @cache 2025-12-04T08:49:16.6997934Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T08:49:16.6998696Z """ 2025-12-04T08:49:16.6999097Z Dynamically get PR information 2025-12-04T08:49:16.6999750Z """ 2025-12-04T08:49:16.7000259Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T08:49:16.7000894Z headers = { 2025-12-04T08:49:16.7001355Z "Accept": "application/vnd.github.v3+json", 2025-12-04T08:49:16.7001963Z "Authorization": f"token {github_token}", 2025-12-04T08:49:16.7002505Z } 2025-12-04T08:49:16.7002937Z json_response: dict[str, Any] = download_json( 2025-12-04T08:49:16.7003566Z url=f"{github_api}/issues/{pr_number}", 2025-12-04T08:49:16.7004117Z headers=headers, 2025-12-04T08:49:16.7004556Z ) 2025-12-04T08:49:16.7004761Z 2025-12-04T08:49:16.7004946Z if not json_response: 2025-12-04T08:49:16.7005549Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T08:49:16.7006180Z return {} 2025-12-04T08:49:16.7006420Z 2025-12-04T08:49:16.7006602Z return json_response 2025-12-04T08:49:16.7007001Z 2025-12-04T08:49:16.7007007Z 2025-12-04T08:49:16.7007422Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T08:49:16.7008162Z """ 2025-12-04T08:49:16.7008701Z Dynamically get the latest list of labels from the pull request 2025-12-04T08:49:16.7009355Z """ 2025-12-04T08:49:16.7009859Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T08:49:16.7010483Z return { 2025-12-04T08:49:16.7011070Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T08:49:16.7011784Z } 2025-12-04T08:49:16.7011993Z 2025-12-04T08:49:16.7011999Z 2025-12-04T08:49:16.7012175Z def main() -> None: 2025-12-04T08:49:16.7012603Z args = parse_args() 2025-12-04T08:49:16.7012871Z 2025-12-04T08:49:16.7013100Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T08:49:16.7013492Z 2025-12-04T08:49:16.7013685Z # Check if the PR is opt-out 2025-12-04T08:49:16.7014181Z if args.pr_number: 2025-12-04T08:49:16.7014836Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T08:49:16.7015725Z if OPT_OUT_LABEL in labels: 2025-12-04T08:49:16.7016232Z log.info( 2025-12-04T08:49:16.7017064Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T08:49:16.7017874Z ) 2025-12-04T08:49:16.7018447Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T08:49:16.7019122Z sys.exit() 2025-12-04T08:49:16.7019394Z 2025-12-04T08:49:16.7019560Z try: 2025-12-04T08:49:16.7020011Z rollout_state = get_rollout_state_from_issue( 2025-12-04T08:49:16.7020714Z args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T08:49:16.7021354Z ) 2025-12-04T08:49:16.7021568Z 2025-12-04T08:49:16.7021779Z username = get_potential_pr_author( 2025-12-04T08:49:16.7022347Z args.github_token, 2025-12-04T08:49:16.7022826Z args.github_repo, 2025-12-04T08:49:16.7023310Z args.github_actor, 2025-12-04T08:49:16.7023804Z args.github_ref_type, 2025-12-04T08:49:16.7024311Z args.github_branch, 2025-12-04T08:49:16.7024776Z ) 2025-12-04T08:49:16.7024992Z 2025-12-04T08:49:16.7025278Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T08:49:16.7025733Z 2025-12-04T08:49:16.7025957Z runner_label_prefix = get_runner_prefix( 2025-12-04T08:49:16.7026519Z rollout_state, 2025-12-04T08:49:16.7027164Z (args.github_issue_owner, username), 2025-12-04T08:49:16.7027720Z args.github_branch, 2025-12-04T08:49:16.7028227Z args.eligible_experiments, 2025-12-04T08:49:16.7028766Z args.opt_out_experiments, 2025-12-04T08:49:16.7029280Z is_canary, 2025-12-04T08:49:16.7029704Z ) 2025-12-04T08:49:16.7029916Z 2025-12-04T08:49:16.7030107Z except Exception as e: 2025-12-04T08:49:16.7030566Z log.error( 2025-12-04T08:49:16.7031237Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T08:49:16.7032181Z ) 2025-12-04T08:49:16.7032394Z 2025-12-04T08:49:16.7032722Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T08:49:16.7033229Z 2025-12-04T08:49:16.7033236Z 2025-12-04T08:49:16.7033421Z if __name__ == "__main__": 2025-12-04T08:49:16.7033862Z main() 2025-12-04T08:49:16.7034080Z 2025-12-04T08:49:16.7122000Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T08:49:16.7122890Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T08:49:16.7155764Z shell: /usr/bin/bash -e {0} 2025-12-04T08:49:16.7156254Z env: 2025-12-04T08:49:16.7156968Z GITHUB_TOKEN: *** 2025-12-04T08:49:16.7157418Z ISSUE_NUMBER: 5132 2025-12-04T08:49:16.7157885Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T08:49:16.7158388Z ISSUE_OWNER: 2025-12-04T08:49:16.7158798Z CHECK_EXPERIMENTS: 2025-12-04T08:49:16.7159254Z OPT_OUT_EXPERIMENTS: 2025-12-04T08:49:16.7159701Z PR_NUMBER: 2025-12-04T08:49:16.7160106Z ##[endgroup] 2025-12-04T08:49:17.6887754Z Defaulting to user installation because normal site-packages is not writeable 2025-12-04T08:49:18.2923189Z Collecting urllib3==1.26.18 2025-12-04T08:49:18.3321711Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-12-04T08:49:18.3524095Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 4.3 MB/s eta 0:00:00 2025-12-04T08:49:18.3742655Z Collecting PyGithub==2.3.0 2025-12-04T08:49:18.3774684Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-12-04T08:49:18.4218861Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-12-04T08:49:18.4252364Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl.metadata (9.8 kB) 2025-12-04T08:49:18.4296318Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-12-04T08:49:18.4312770Z 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-12-04T08:49:18.4327131Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-12-04T08:49:18.4585935Z Collecting Deprecated (from PyGithub==2.3.0) 2025-12-04T08:49:18.4615413Z Downloading deprecated-1.3.1-py2.py3-none-any.whl.metadata (5.9 kB) 2025-12-04T08:49:18.4837698Z 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-12-04T08:49:18.6021692Z Collecting cffi>=2.0.0 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T08:49:18.6057194Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.6 kB) 2025-12-04T08:49:18.7635284Z Collecting wrapt<3,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-12-04T08:49:18.7679299Z Downloading wrapt-2.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (9.0 kB) 2025-12-04T08:49:18.7873755Z Collecting pycparser (from cffi>=2.0.0->pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T08:49:18.7908331Z Downloading pycparser-2.23-py3-none-any.whl.metadata (993 bytes) 2025-12-04T08:49:18.8144895Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-12-04T08:49:18.8222780Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 29.6 MB/s eta 0:00:00 2025-12-04T08:49:18.8268709Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-12-04T08:49:18.8324188Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 88.0 MB/s eta 0:00:00 2025-12-04T08:49:18.8356789Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl (1.4 MB) 2025-12-04T08:49:18.8471266Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 142.2 MB/s eta 0:00:00 2025-12-04T08:49:18.8502632Z Downloading deprecated-1.3.1-py2.py3-none-any.whl (11 kB) 2025-12-04T08:49:18.8592717Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (219 kB) 2025-12-04T08:49:18.8643263Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 219.6/219.6 kB 60.1 MB/s eta 0:00:00 2025-12-04T08:49:18.8674972Z Downloading wrapt-2.0.1-cp312-cp312-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (121 kB) 2025-12-04T08:49:18.8721824Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.5/121.5 kB 40.9 MB/s eta 0:00:00 2025-12-04T08:49:18.8758493Z Downloading pycparser-2.23-py3-none-any.whl (118 kB) 2025-12-04T08:49:18.8800652Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.1/118.1 kB 40.9 MB/s eta 0:00:00 2025-12-04T08:49:19.1706203Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-12-04T08:49:19.7060985Z Successfully installed Deprecated-1.3.1 PyGithub-2.3.0 cffi-2.0.0 pycparser-2.23 pynacl-1.6.1 urllib3-1.26.18 wrapt-2.0.1 2025-12-04T08:49:19.7933318Z ##[group]Run curr_branch="main" 2025-12-04T08:49:19.7933623Z curr_branch="main" 2025-12-04T08:49:19.7933841Z curr_ref_type="branch" 2025-12-04T08:49:19.7934095Z echo "Current branch is '$curr_branch'" 2025-12-04T08:49:19.7934368Z  2025-12-04T08:49:19.7934559Z python3 runner_determinator.py \ 2025-12-04T08:49:19.7934845Z  --github-token "$GITHUB_TOKEN" \ 2025-12-04T08:49:19.7935118Z  --github-issue "$ISSUE_NUMBER" \ 2025-12-04T08:49:19.7935377Z  --github-branch "$curr_branch" \ 2025-12-04T08:49:19.7935634Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-12-04T08:49:19.7935943Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-12-04T08:49:19.7936219Z  --github-ref-type "$curr_ref_type" \ 2025-12-04T08:49:19.7936493Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-12-04T08:49:19.7936790Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-12-04T08:49:19.7937642Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-12-04T08:49:19.7937937Z  --pr-number "${PR_NUMBER}" 2025-12-04T08:49:19.7971869Z shell: /usr/bin/bash -e {0} 2025-12-04T08:49:19.7972093Z env: 2025-12-04T08:49:19.7972587Z GITHUB_TOKEN: *** 2025-12-04T08:49:19.7972778Z ISSUE_NUMBER: 5132 2025-12-04T08:49:19.7972993Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T08:49:19.7973232Z ISSUE_OWNER: 2025-12-04T08:49:19.7973416Z CHECK_EXPERIMENTS: 2025-12-04T08:49:19.7973602Z OPT_OUT_EXPERIMENTS: 2025-12-04T08:49:19.7973786Z PR_NUMBER: 2025-12-04T08:49:19.7973951Z ##[endgroup] 2025-12-04T08:49:19.8025203Z Current branch is 'main' 2025-12-04T08:49:21.5842184Z INFO : Branch main is an exception branch. Not enabling experiment ephemeral. 2025-12-04T08:49:21.5843663Z INFO : Branch main is an exception branch. Not enabling experiment wincanary. 2025-12-04T08:49:21.5844905Z INFO : Branch main is an exception branch. Not enabling experiment wincanarylf. 2025-12-04T08:49:21.5845819Z INFO : Setting output: label-type='' 2025-12-04T08:49:21.6171561Z Evaluate and set job outputs 2025-12-04T08:49:21.6178425Z Cleaning up orphan processes