2025-12-04T07:56:46.5075881Z Current runner version: '2.329.0' 2025-12-04T07:56:46.5098627Z ##[group]Runner Image Provisioner 2025-12-04T07:56:46.5099444Z Hosted Compute Agent 2025-12-04T07:56:46.5100032Z Version: 20251124.448 2025-12-04T07:56:46.5100676Z Commit: fda5086b43ec66ade217e5fcd18146c879571177 2025-12-04T07:56:46.5101335Z Build Date: 2025-11-24T21:16:26Z 2025-12-04T07:56:46.5101982Z ##[endgroup] 2025-12-04T07:56:46.5102578Z ##[group]Operating System 2025-12-04T07:56:46.5103110Z Ubuntu 2025-12-04T07:56:46.5103640Z 24.04.3 2025-12-04T07:56:46.5104090Z LTS 2025-12-04T07:56:46.5104547Z ##[endgroup] 2025-12-04T07:56:46.5104982Z ##[group]Runner Image 2025-12-04T07:56:46.5105623Z Image: ubuntu-24.04 2025-12-04T07:56:46.5106099Z Version: 20251126.144.1 2025-12-04T07:56:46.5107110Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20251126.144/images/ubuntu/Ubuntu2404-Readme.md 2025-12-04T07:56:46.5108993Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20251126.144 2025-12-04T07:56:46.5110020Z ##[endgroup] 2025-12-04T07:56:46.5111045Z ##[group]GITHUB_TOKEN Permissions 2025-12-04T07:56:46.5113019Z Contents: read 2025-12-04T07:56:46.5113668Z Metadata: read 2025-12-04T07:56:46.5114170Z ##[endgroup] 2025-12-04T07:56:46.5116060Z Secret source: Actions 2025-12-04T07:56:46.5117475Z Prepare workflow directory 2025-12-04T07:56:46.5773797Z Prepare all required actions 2025-12-04T07:56:46.5832073Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (ffd9b0fb4355e97af82fc42cf185c3ffa0fc0a32) 2025-12-04T07:56:46.5837550Z ##[group] Inputs 2025-12-04T07:56:46.5838142Z check_experiments: 2025-12-04T07:56:46.5838805Z opt_out_experiments: 2025-12-04T07:56:46.5839359Z triggering_actor: pytorchmergebot 2025-12-04T07:56:46.5839973Z issue_owner: 2025-12-04T07:56:46.5840485Z curr_branch: main 2025-12-04T07:56:46.5841064Z curr_ref_type: branch 2025-12-04T07:56:46.5841709Z issue_number: 5132 2025-12-04T07:56:46.5842292Z ##[endgroup] 2025-12-04T07:56:46.5843008Z Complete job name: before-test / get-label-type / runner-determinator 2025-12-04T07:56:47.2219166Z ##[group]Run cat < runner_determinator.py 2025-12-04T07:56:47.2221631Z cat < runner_determinator.py 2025-12-04T07:56:47.2222277Z # flake8: noqa: G004 2025-12-04T07:56:47.2222870Z  2025-12-04T07:56:47.2223605Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T07:56:47.2224666Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T07:56:47.2225652Z # python .github/scripts/update_runner_determinator.py 2025-12-04T07:56:47.2226346Z  2025-12-04T07:56:47.2226795Z """ 2025-12-04T07:56:47.2227618Z This runner determinator is used to determine which set of runners to run a 2025-12-04T07:56:47.2228736Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T07:56:47.2229881Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T07:56:47.2230929Z of which runners should be used to run which job. 2025-12-04T07:56:47.2231564Z  2025-12-04T07:56:47.2232254Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T07:56:47.2233337Z separated by a line containing "---". If the line is not present, the 2025-12-04T07:56:47.2234304Z settings are considered to be empty with only the second part, the user 2025-12-04T07:56:47.2235144Z list, defined. 2025-12-04T07:56:47.2235656Z  2025-12-04T07:56:47.2236337Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T07:56:47.2237492Z used to define any settings that are needed to determine which runners to use. 2025-12-04T07:56:47.2238480Z It's fields are defined by the RolloutSettings class below. 2025-12-04T07:56:47.2239207Z  2025-12-04T07:56:47.2240133Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T07:56:47.2241183Z The user list is also a comma separated list of additional features or 2025-12-04T07:56:47.2242077Z experiments which the user could be opted in to. 2025-12-04T07:56:47.2242707Z  2025-12-04T07:56:47.2243241Z The user list has the following rules: 2025-12-04T07:56:47.2243831Z  2025-12-04T07:56:47.2244485Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T07:56:47.2245488Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T07:56:47.2246363Z - A "#" prefix opts the user out of all experiments 2025-12-04T07:56:47.2247016Z  2025-12-04T07:56:47.2247659Z Example config: 2025-12-04T07:56:47.2248549Z  # A list of experiments that can be opted into. 2025-12-04T07:56:47.2249340Z  # This defines the behavior they'll induce when opted into. 2025-12-04T07:56:47.2250082Z  # Expected syntax is: 2025-12-04T07:56:47.2250962Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T07:56:47.2252026Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T07:56:47.2252837Z  2025-12-04T07:56:47.2338431Z  experiments: 2025-12-04T07:56:47.2338915Z  lf: 2025-12-04T07:56:47.2339339Z  rollout_percent: 25 2025-12-04T07:56:47.2339882Z  all_branches: false 2025-12-04T07:56:47.2340412Z  default: true 2025-12-04T07:56:47.2340855Z  --- 2025-12-04T07:56:47.2341237Z  2025-12-04T07:56:47.2341615Z  # Opt-ins: 2025-12-04T07:56:47.2342283Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T07:56:47.2343450Z  # and specifying experiments to enable in a comma-separated list. 2025-12-04T07:56:47.2344286Z  # To always opt out of an experiment, prefix it with a "-". 2025-12-04T07:56:47.2344995Z  # Experiments should be from the above list. 2025-12-04T07:56:47.2345548Z  2025-12-04T07:56:47.2345947Z  @User1,-lf,split_build 2025-12-04T07:56:47.2346447Z  @User2,lf 2025-12-04T07:56:47.2346893Z  @User3,split_build 2025-12-04T07:56:47.2347497Z """ 2025-12-04T07:56:47.2347870Z  2025-12-04T07:56:47.2348247Z import json 2025-12-04T07:56:47.2348679Z import logging 2025-12-04T07:56:47.2349112Z import os 2025-12-04T07:56:47.2349513Z import random 2025-12-04T07:56:47.2349934Z import re 2025-12-04T07:56:47.2350325Z import sys 2025-12-04T07:56:47.2350787Z from argparse import ArgumentParser 2025-12-04T07:56:47.2351439Z from collections.abc import Iterable 2025-12-04T07:56:47.2352005Z from functools import cache 2025-12-04T07:56:47.2352528Z from logging import LogRecord 2025-12-04T07:56:47.2353071Z from typing import Any, NamedTuple 2025-12-04T07:56:47.2353678Z from urllib.request import Request, urlopen 2025-12-04T07:56:47.2354237Z  2025-12-04T07:56:47.2354594Z import yaml 2025-12-04T07:56:47.2355036Z from github import Auth, Github 2025-12-04T07:56:47.2355570Z from github.Issue import Issue 2025-12-04T07:56:47.2356076Z  2025-12-04T07:56:47.2356423Z  2025-12-04T07:56:47.2356874Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T07:56:47.2357735Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T07:56:47.2358637Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T07:56:47.2359347Z  2025-12-04T07:56:47.2359982Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T07:56:47.2360595Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T07:56:47.2361181Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T07:56:47.2361800Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T07:56:47.2362341Z  2025-12-04T07:56:47.2362759Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T07:56:47.2363279Z  2025-12-04T07:56:47.2363668Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T07:56:47.2364187Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T07:56:47.2364660Z  2025-12-04T07:56:47.2365008Z  2025-12-04T07:56:47.2365387Z class Experiment(NamedTuple): 2025-12-04T07:56:47.2365922Z  rollout_perc: float = ( 2025-12-04T07:56:47.2366628Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T07:56:47.2367744Z  ) 2025-12-04T07:56:47.2368265Z  all_branches: bool = ( 2025-12-04T07:56:47.2368996Z  False # If True, the experiment is also enabled on the exception branches 2025-12-04T07:56:47.2369695Z  ) 2025-12-04T07:56:47.2370102Z  default: bool = ( 2025-12-04T07:56:47.2370752Z  True # If True, the experiment is enabled by default for all queries 2025-12-04T07:56:47.2371409Z  ) 2025-12-04T07:56:47.2371778Z  2025-12-04T07:56:47.2372176Z  # Add more fields as needed 2025-12-04T07:56:47.2372659Z  2025-12-04T07:56:47.2373012Z  2025-12-04T07:56:47.2373392Z class Settings(NamedTuple): 2025-12-04T07:56:47.2373880Z  """ 2025-12-04T07:56:47.2374387Z  Settings for the experiments that can be opted into. 2025-12-04T07:56:47.2374982Z  """ 2025-12-04T07:56:47.2375345Z  2025-12-04T07:56:47.2375772Z  experiments: dict[str, Experiment] = {} 2025-12-04T07:56:47.2376311Z  2025-12-04T07:56:47.2376865Z  2025-12-04T07:56:47.2377447Z class ColorFormatter(logging.Formatter): 2025-12-04T07:56:47.2378139Z  """Color codes the log messages based on the log level""" 2025-12-04T07:56:47.2378748Z  2025-12-04T07:56:47.2379103Z  COLORS = { 2025-12-04T07:56:47.2379561Z  "WARNING": "\033[33m", # Yellow 2025-12-04T07:56:47.2380097Z  "ERROR": "\033[31m", # Red 2025-12-04T07:56:47.2380634Z  "CRITICAL": "\033[31m", # Red 2025-12-04T07:56:47.2381175Z  "INFO": "\033[0m", # Reset 2025-12-04T07:56:47.2381691Z  "DEBUG": "\033[0m", # Reset 2025-12-04T07:56:47.2382188Z  } 2025-12-04T07:56:47.2382553Z  2025-12-04T07:56:47.2382998Z  def format(self, record: LogRecord) -> str: 2025-12-04T07:56:47.2383771Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T07:56:47.2384583Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T07:56:47.2385196Z  return super().format(record) 2025-12-04T07:56:47.2385702Z  2025-12-04T07:56:47.2386048Z  2025-12-04T07:56:47.2386446Z handler = logging.StreamHandler() 2025-12-04T07:56:47.2387222Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T07:56:47.2388042Z  2025-12-04T07:56:47.2388534Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T07:56:47.2389141Z log.addHandler(handler) 2025-12-04T07:56:47.2389644Z log.setLevel(logging.INFO) 2025-12-04T07:56:47.2390117Z  2025-12-04T07:56:47.2390460Z  2025-12-04T07:56:47.2390941Z def set_github_output(key: str, value: str) -> None: 2025-12-04T07:56:47.2391521Z  """ 2025-12-04T07:56:47.2392087Z  Defines outputs of the github action that invokes this script 2025-12-04T07:56:47.2392889Z  """ 2025-12-04T07:56:47.2393291Z  if not GITHUB_OUTPUT: 2025-12-04T07:56:47.2394422Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-12-04T07:56:47.2395525Z  log.warning( 2025-12-04T07:56:47.2396423Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-12-04T07:56:47.2397459Z  ) 2025-12-04T07:56:47.2397947Z  print(f"::set-output name={key}::{value}") 2025-12-04T07:56:47.2398513Z  return 2025-12-04T07:56:47.2398939Z  2025-12-04T07:56:47.2399351Z  with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T07:56:47.2399960Z  log.info(f"Setting output: {key}='{value}'") 2025-12-04T07:56:47.2400559Z  f.write(f"{key}={value}\n") 2025-12-04T07:56:47.2401060Z  2025-12-04T07:56:47.2401418Z  2025-12-04T07:56:47.2401938Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T07:56:47.2402618Z  return frozenset( 2025-12-04T07:56:47.2403278Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T07:56:47.2403955Z  ) 2025-12-04T07:56:47.2404332Z  2025-12-04T07:56:47.2404678Z  2025-12-04T07:56:47.2405055Z def parse_args() -> Any: 2025-12-04T07:56:47.2405672Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T07:56:47.2406566Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T07:56:47.2407593Z  parser.add_argument( 2025-12-04T07:56:47.2408154Z  "--github-issue-repo", 2025-12-04T07:56:47.2408824Z  type=str, 2025-12-04T07:56:47.2409424Z  required=False, 2025-12-04T07:56:47.2410298Z  default="pytorch/test-infra", 2025-12-04T07:56:47.2411241Z  help="GitHub repo to get the issue", 2025-12-04T07:56:47.2412094Z  ) 2025-12-04T07:56:47.2412564Z  parser.add_argument( 2025-12-04T07:56:47.2413212Z  "--github-repo", 2025-12-04T07:56:47.2413685Z  type=str, 2025-12-04T07:56:47.2414142Z  required=True, 2025-12-04T07:56:47.2414683Z  help="GitHub repo where CI is running", 2025-12-04T07:56:47.2415220Z  ) 2025-12-04T07:56:47.2415624Z  parser.add_argument( 2025-12-04T07:56:47.2416286Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T07:56:47.2416952Z  ) 2025-12-04T07:56:47.2417616Z  parser.add_argument( 2025-12-04T07:56:47.2418330Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T07:56:47.2419036Z  ) 2025-12-04T07:56:47.2419433Z  parser.add_argument( 2025-12-04T07:56:47.2420133Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T07:56:47.2420822Z  ) 2025-12-04T07:56:47.2421230Z  parser.add_argument( 2025-12-04T07:56:47.2421946Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T07:56:47.2422671Z  ) 2025-12-04T07:56:47.2423073Z  parser.add_argument( 2025-12-04T07:56:47.2423564Z  "--github-ref-type", 2025-12-04T07:56:47.2424058Z  type=str, 2025-12-04T07:56:47.2424505Z  required=True, 2025-12-04T07:56:47.2425060Z  help="Current GitHub ref type, branch or tag", 2025-12-04T07:56:47.2425631Z  ) 2025-12-04T07:56:47.2426028Z  parser.add_argument( 2025-12-04T07:56:47.2426697Z  "--eligible-experiments", 2025-12-04T07:56:47.2427376Z  type=_str_comma_separated_to_set, 2025-12-04T07:56:47.2427931Z  required=False, 2025-12-04T07:56:47.2428406Z  default="", 2025-12-04T07:56:47.2429297Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T07:56:47.2430222Z  ) 2025-12-04T07:56:47.2430616Z  parser.add_argument( 2025-12-04T07:56:47.2431123Z  "--opt-out-experiments", 2025-12-04T07:56:47.2431678Z  type=_str_comma_separated_to_set, 2025-12-04T07:56:47.2432215Z  required=False, 2025-12-04T07:56:47.2432685Z  default="", 2025-12-04T07:56:47.2433128Z  help=( 2025-12-04T07:56:47.2433844Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T07:56:47.2434985Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T07:56:47.2435819Z  ), 2025-12-04T07:56:47.2436210Z  ) 2025-12-04T07:56:47.2436605Z  parser.add_argument( 2025-12-04T07:56:47.2437098Z  "--pr-number", 2025-12-04T07:56:47.2437657Z  type=str, 2025-12-04T07:56:47.2438110Z  required=False, 2025-12-04T07:56:47.2438580Z  default="", 2025-12-04T07:56:47.2439114Z  help="the optional PR number where this is run", 2025-12-04T07:56:47.2439678Z  ) 2025-12-04T07:56:47.2440048Z  2025-12-04T07:56:47.2440447Z  return parser.parse_args() 2025-12-04T07:56:47.2440932Z  2025-12-04T07:56:47.2441277Z  2025-12-04T07:56:47.2441888Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.2442802Z  auth = Auth.Token(github_token) 2025-12-04T07:56:47.2443341Z  return Github(auth=auth) 2025-12-04T07:56:47.2443823Z  2025-12-04T07:56:47.2444163Z  2025-12-04T07:56:47.2444823Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.2445632Z  repo = gh.get_repo(repo) 2025-12-04T07:56:47.2446184Z  return repo.get_issue(number=issue_num) 2025-12-04T07:56:47.2446719Z  2025-12-04T07:56:47.2447061Z  2025-12-04T07:56:47.2447730Z def get_potential_pr_author( 2025-12-04T07:56:47.2448435Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T07:56:47.2449120Z ) -> str: 2025-12-04T07:56:47.2449684Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T07:56:47.2450518Z  # Fetch the actual username from the original PR. The PR number is 2025-12-04T07:56:47.2451314Z  # embedded in the tag name: ciflow// 2025-12-04T07:56:47.2451893Z  2025-12-04T07:56:47.2452299Z  gh = get_gh_client(github_token) 2025-12-04T07:56:47.2452810Z  2025-12-04T07:56:47.2453291Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T07:56:47.2453948Z  split_tag = ref_name.split("/") 2025-12-04T07:56:47.2454470Z  if ( 2025-12-04T07:56:47.2454905Z  len(split_tag) == 3 2025-12-04T07:56:47.2455433Z  and split_tag[0] == "ciflow" 2025-12-04T07:56:47.2455997Z  and split_tag[2].isnumeric() 2025-12-04T07:56:47.2456512Z  ): 2025-12-04T07:56:47.2456948Z  pr_number = split_tag[2] 2025-12-04T07:56:47.2457572Z  try: 2025-12-04T07:56:47.2458052Z  repository = gh.get_repo(repo) 2025-12-04T07:56:47.2458858Z  pull = repository.get_pull(number=int(pr_number)) 2025-12-04T07:56:47.2459484Z  except Exception as e: 2025-12-04T07:56:47.2460049Z  raise Exception( # noqa: TRY002 2025-12-04T07:56:47.2460743Z  f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T07:56:47.2461408Z  ) from e 2025-12-04T07:56:47.2462011Z  return pull.user.login # type: ignore[no-any-return] 2025-12-04T07:56:47.2462733Z  # In all other cases, return the original input username 2025-12-04T07:56:47.2463349Z  return username 2025-12-04T07:56:47.2463776Z  2025-12-04T07:56:47.2464124Z  2025-12-04T07:56:47.2464561Z def is_exception_branch(branch: str) -> bool: 2025-12-04T07:56:47.2465116Z  """ 2025-12-04T07:56:47.2465802Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T07:56:47.2466572Z  """ 2025-12-04T07:56:47.2467157Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T07:56:47.2467927Z  2025-12-04T07:56:47.2468274Z  2025-12-04T07:56:47.2468673Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T07:56:47.2469198Z  try: 2025-12-04T07:56:47.2469631Z  data = yaml.safe_load(yaml_text) 2025-12-04T07:56:47.2470152Z  return data 2025-12-04T07:56:47.2470616Z  except yaml.YAMLError: 2025-12-04T07:56:47.2471156Z  log.exception("Error loading YAML") 2025-12-04T07:56:47.2471690Z  raise 2025-12-04T07:56:47.2472091Z  2025-12-04T07:56:47.2472433Z  2025-12-04T07:56:47.2473051Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T07:56:47.2473810Z  """ 2025-12-04T07:56:47.2474593Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T07:56:47.2475344Z  2025-12-04T07:56:47.2475899Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.2476691Z  and the text below is the list of opted in users. 2025-12-04T07:56:47.2477360Z  2025-12-04T07:56:47.2477941Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T07:56:47.2478643Z  """ 2025-12-04T07:56:47.2479125Z  rollout_state_parts = rollout_state.split("---") 2025-12-04T07:56:47.2479742Z  if len(rollout_state_parts) >= 2: 2025-12-04T07:56:47.2480385Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T07:56:47.2480979Z  else: 2025-12-04T07:56:47.2481465Z  return "", rollout_state 2025-12-04T07:56:47.2482012Z  2025-12-04T07:56:47.2482356Z  2025-12-04T07:56:47.2482770Z class UserOptins(dict[str, list[str]]): 2025-12-04T07:56:47.2483291Z  """ 2025-12-04T07:56:47.2483848Z  Dictionary of users with a list of features they have opted into 2025-12-04T07:56:47.2484488Z  """ 2025-12-04T07:56:47.2484853Z  2025-12-04T07:56:47.2485192Z  2025-12-04T07:56:47.2485737Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T07:56:47.2486392Z  """ 2025-12-04T07:56:47.2487132Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-12-04T07:56:47.2488262Z  2025-12-04T07:56:47.2489072Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-12-04T07:56:47.2490067Z  - Example line: "@User1,lf,split_build" 2025-12-04T07:56:47.2490928Z  - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T07:56:47.2491569Z  2025-12-04T07:56:47.2491905Z  2025-12-04T07:56:47.2492245Z  """ 2025-12-04T07:56:47.2492646Z  optins = UserOptins() 2025-12-04T07:56:47.2493183Z  for user in user_optin_text.split("\n"): 2025-12-04T07:56:47.2493765Z  user = user.strip("\r\n\t -") 2025-12-04T07:56:47.2494383Z  if not user or not user.startswith("@"): 2025-12-04T07:56:47.2494961Z  # Not a valid user. Skip 2025-12-04T07:56:47.2495464Z  continue 2025-12-04T07:56:47.2495891Z  2025-12-04T07:56:47.2496241Z  if user: 2025-12-04T07:56:47.2496758Z  usr_name = user.split(",")[0].strip("@") 2025-12-04T07:56:47.2497851Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T07:56:47.2498494Z  2025-12-04T07:56:47.2498864Z  return optins 2025-12-04T07:56:47.2499279Z  2025-12-04T07:56:47.2499618Z  2025-12-04T07:56:47.2500124Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T07:56:47.2500746Z  """ 2025-12-04T07:56:47.2501183Z  Check if the experiment name is valid. 2025-12-04T07:56:47.2501718Z  A valid name: 2025-12-04T07:56:47.2502412Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T07:56:47.2503350Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T07:56:47.2504068Z  - Cannot contain spaces 2025-12-04T07:56:47.2504549Z  """ 2025-12-04T07:56:47.2504910Z  2025-12-04T07:56:47.2505384Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T07:56:47.2506109Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T07:56:47.2506830Z  2025-12-04T07:56:47.2507183Z  if valid: 2025-12-04T07:56:47.2508184Z  return True 2025-12-04T07:56:47.2508634Z  2025-12-04T07:56:47.2508990Z  log.error( 2025-12-04T07:56:47.2510432Z  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-04T07:56:47.2511922Z  ) 2025-12-04T07:56:47.2512299Z  return False 2025-12-04T07:56:47.2512703Z  2025-12-04T07:56:47.2513045Z  2025-12-04T07:56:47.2513568Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T07:56:47.2514209Z  """ 2025-12-04T07:56:47.2514828Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T07:56:47.2515544Z  """ 2025-12-04T07:56:47.2515919Z  try: 2025-12-04T07:56:47.2516319Z  if settings_text: 2025-12-04T07:56:47.2517071Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-12-04T07:56:47.2518084Z  # for easy reading 2025-12-04T07:56:47.2518913Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T07:56:47.2519799Z  # the backtick character in shell commands. 2025-12-04T07:56:47.2520422Z  backtick = chr(96) # backtick character 2025-12-04T07:56:47.2521106Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T07:56:47.2521778Z  settings = load_yaml(settings_text) 2025-12-04T07:56:47.2522291Z  2025-12-04T07:56:47.2522888Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T07:56:47.2523837Z  experiments = {} 2025-12-04T07:56:47.2524302Z  2025-12-04T07:56:47.2524858Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T07:56:47.2525622Z  if not is_valid_experiment_name(exp_name): 2025-12-04T07:56:47.2526691Z  # 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-04T07:56:47.2527817Z  continue 2025-12-04T07:56:47.2528272Z  2025-12-04T07:56:47.2528643Z  valid_settings = {} 2025-12-04T07:56:47.2529185Z  for setting in exp_settings: 2025-12-04T07:56:47.2529760Z  if setting not in Experiment._fields: 2025-12-04T07:56:47.2530333Z  log.warning( 2025-12-04T07:56:47.2531059Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T07:56:47.2531751Z  ) 2025-12-04T07:56:47.2532202Z  else: 2025-12-04T07:56:47.2532754Z  valid_settings[setting] = exp_settings[setting] 2025-12-04T07:56:47.2533318Z  2025-12-04T07:56:47.2533789Z  experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T07:56:47.2534431Z  return Settings(experiments) 2025-12-04T07:56:47.2534937Z  2025-12-04T07:56:47.2535298Z  except Exception: 2025-12-04T07:56:47.2535824Z  log.exception("Failed to parse settings") 2025-12-04T07:56:47.2536351Z  2025-12-04T07:56:47.2536713Z  return Settings() 2025-12-04T07:56:47.2537143Z  2025-12-04T07:56:47.2537583Z  2025-12-04T07:56:47.2538175Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T07:56:47.2538761Z  """ 2025-12-04T07:56:47.2539224Z  Parse settings, if any, from the rollout state. 2025-12-04T07:56:47.2539756Z  2025-12-04T07:56:47.2540294Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.2541063Z  and the text below is the list of opted in users. 2025-12-04T07:56:47.2541618Z  2025-12-04T07:56:47.2542196Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T07:56:47.2542906Z  """ 2025-12-04T07:56:47.2543482Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.2544249Z  return parse_settings_from_text(settings_text) 2025-12-04T07:56:47.2544791Z  2025-12-04T07:56:47.2545121Z  2025-12-04T07:56:47.2545588Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T07:56:47.2546148Z  """ 2025-12-04T07:56:47.2546576Z  Parse users from the rollout state. 2025-12-04T07:56:47.2547082Z  2025-12-04T07:56:47.2547522Z  """ 2025-12-04T07:56:47.2548084Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.2548833Z  return parse_user_opt_in_from_text(users_text) 2025-12-04T07:56:47.2549383Z  2025-12-04T07:56:47.2549715Z  2025-12-04T07:56:47.2550331Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.2551066Z  """ 2025-12-04T07:56:47.2551523Z  Check if a user is opted into an experiment 2025-12-04T07:56:47.2552059Z  """ 2025-12-04T07:56:47.2552546Z  return experiment_name in user_optins.get(user, []) 2025-12-04T07:56:47.2553258Z  2025-12-04T07:56:47.2553594Z  2025-12-04T07:56:47.2554224Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.2554972Z  """ 2025-12-04T07:56:47.2555471Z  Check if a user explicitly opted out of an experiment 2025-12-04T07:56:47.2556043Z  """ 2025-12-04T07:56:47.2556585Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T07:56:47.2557394Z  experiment_optout = "-" + experiment_name 2025-12-04T07:56:47.2558056Z  if experiment_optout not in user_optins.get(user, []): 2025-12-04T07:56:47.2558661Z  return False 2025-12-04T07:56:47.2559082Z  2025-12-04T07:56:47.2559561Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T07:56:47.2560161Z  log.warning( 2025-12-04T07:56:47.2560988Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T07:56:47.2561845Z  ) 2025-12-04T07:56:47.2562220Z  2025-12-04T07:56:47.2562577Z  return True 2025-12-04T07:56:47.2562974Z  2025-12-04T07:56:47.2563310Z  2025-12-04T07:56:47.2563658Z def get_runner_prefix( 2025-12-04T07:56:47.2564135Z  rollout_state: str, 2025-12-04T07:56:47.2564634Z  workflow_requestors: Iterable[str], 2025-12-04T07:56:47.2565159Z  branch: str, 2025-12-04T07:56:47.2565701Z  eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.2566383Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.2566982Z  is_canary: bool = False, 2025-12-04T07:56:47.2567543Z ) -> str: 2025-12-04T07:56:47.2568001Z  settings = parse_settings(rollout_state) 2025-12-04T07:56:47.2568593Z  user_optins = parse_users(rollout_state) 2025-12-04T07:56:47.2569124Z  2025-12-04T07:56:47.2569611Z  fleet_prefix = "" 2025-12-04T07:56:47.2570067Z  prefixes = [] 2025-12-04T07:56:47.2570730Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T07:56:47.2571670Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T07:56:47.2572379Z  log.info( 2025-12-04T07:56:47.2573081Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T07:56:47.2573815Z  ) 2025-12-04T07:56:47.2574233Z  continue 2025-12-04T07:56:47.2574648Z  2025-12-04T07:56:47.2575029Z  if opt_out_experiments: 2025-12-04T07:56:47.2575597Z  if experiment_name in opt_out_experiments: 2025-12-04T07:56:47.2576252Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T07:56:47.2576840Z  log.info( 2025-12-04T07:56:47.2577876Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T07:56:47.2578812Z  ) 2025-12-04T07:56:47.2579248Z  continue 2025-12-04T07:56:47.2579731Z  2025-12-04T07:56:47.2580101Z  if eligible_experiments: 2025-12-04T07:56:47.2580697Z  if experiment_name not in eligible_experiments: 2025-12-04T07:56:47.2581350Z  exp_list = ", ".join(eligible_experiments) 2025-12-04T07:56:47.2581899Z  log.info( 2025-12-04T07:56:47.2582691Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T07:56:47.2583501Z  ) 2025-12-04T07:56:47.2584055Z  continue 2025-12-04T07:56:47.2584573Z  elif not experiment_settings.default: 2025-12-04T07:56:47.2585110Z  log.info( 2025-12-04T07:56:47.2585796Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T07:56:47.2586508Z  ) 2025-12-04T07:56:47.2586919Z  continue 2025-12-04T07:56:47.2587435Z  2025-12-04T07:56:47.2587917Z  # Is any workflow_requestor opted out to this experiment? 2025-12-04T07:56:47.2588528Z  opted_out_users = [ 2025-12-04T07:56:47.2589008Z  requestor 2025-12-04T07:56:47.2589508Z  for requestor in workflow_requestors 2025-12-04T07:56:47.2590192Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.2590816Z  ] 2025-12-04T07:56:47.2591186Z  2025-12-04T07:56:47.2591558Z  if opted_out_users: 2025-12-04T07:56:47.2592041Z  log.info( 2025-12-04T07:56:47.2592692Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T07:56:47.2593374Z  ) 2025-12-04T07:56:47.2593783Z  continue 2025-12-04T07:56:47.2594235Z  2025-12-04T07:56:47.2594702Z  # Is any workflow_requestor opted in to this experiment? 2025-12-04T07:56:47.2595321Z  opted_in_users = [ 2025-12-04T07:56:47.2595795Z  requestor 2025-12-04T07:56:47.2596299Z  for requestor in workflow_requestors 2025-12-04T07:56:47.2596964Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.2597682Z  ] 2025-12-04T07:56:47.2598063Z  2025-12-04T07:56:47.2598420Z  enabled = False 2025-12-04T07:56:47.2598897Z  if opted_in_users: 2025-12-04T07:56:47.2599488Z  log.info( 2025-12-04T07:56:47.2600141Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T07:56:47.2600809Z  ) 2025-12-04T07:56:47.2601228Z  enabled = True 2025-12-04T07:56:47.2601673Z  2025-12-04T07:56:47.2602088Z  elif experiment_settings.rollout_perc: 2025-12-04T07:56:47.2602917Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T07:56:47.2603825Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T07:56:47.2604466Z  log.info( 2025-12-04T07:56:47.2605338Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T07:56:47.2606224Z  ) 2025-12-04T07:56:47.2606674Z  enabled = True 2025-12-04T07:56:47.2607142Z  2025-12-04T07:56:47.2607600Z  if enabled: 2025-12-04T07:56:47.2608063Z  label = experiment_name 2025-12-04T07:56:47.2608635Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T07:56:47.2609449Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T07:56:47.2610326Z  # - If it's enabled, then we always list it's prefix first 2025-12-04T07:56:47.2611092Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T07:56:47.2611742Z  if is_canary: 2025-12-04T07:56:47.2612276Z  label += CANARY_FLEET_SUFFIX 2025-12-04T07:56:47.2612821Z  fleet_prefix = label 2025-12-04T07:56:47.2613322Z  else: 2025-12-04T07:56:47.2613921Z  prefixes.append(label) 2025-12-04T07:56:47.2614417Z  2025-12-04T07:56:47.2614787Z  if len(prefixes) > 1: 2025-12-04T07:56:47.2615251Z  log.error( 2025-12-04T07:56:47.2616290Z  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-04T07:56:47.2617438Z  ) 2025-12-04T07:56:47.2617857Z  prefixes = prefixes[:1] 2025-12-04T07:56:47.2618332Z  2025-12-04T07:56:47.2618701Z  # Fleet always comes first 2025-12-04T07:56:47.2619194Z  if fleet_prefix: 2025-12-04T07:56:47.2619676Z  prefixes.insert(0, fleet_prefix) 2025-12-04T07:56:47.2620184Z  2025-12-04T07:56:47.2620630Z  return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T07:56:47.2621210Z  2025-12-04T07:56:47.2621541Z  2025-12-04T07:56:47.2622181Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T07:56:47.2622930Z  """ 2025-12-04T07:56:47.2623529Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T07:56:47.2624232Z  2025-12-04T07:56:47.2624807Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T07:56:47.2625495Z  """ 2025-12-04T07:56:47.2625902Z  gh = get_gh_client(github_token) 2025-12-04T07:56:47.2626471Z  issue = get_issue(gh, repo, issue_num) 2025-12-04T07:56:47.2627129Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T07:56:47.2627815Z  2025-12-04T07:56:47.2628152Z  2025-12-04T07:56:47.2628742Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T07:56:47.2629617Z  for _ in range(num_retries): 2025-12-04T07:56:47.2630112Z  try: 2025-12-04T07:56:47.2630577Z  req = Request(url=url, headers=headers) 2025-12-04T07:56:47.2631261Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T07:56:47.2631901Z  return json.loads(content) 2025-12-04T07:56:47.2632434Z  except Exception as e: 2025-12-04T07:56:47.2633004Z  log.warning(f"Could not download {url}: {e}") 2025-12-04T07:56:47.2633649Z  2025-12-04T07:56:47.2634228Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T07:56:47.2634932Z  return {} 2025-12-04T07:56:47.2635330Z  2025-12-04T07:56:47.2635664Z  2025-12-04T07:56:47.2636004Z @cache 2025-12-04T07:56:47.2636646Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T07:56:47.2637495Z  """ 2025-12-04T07:56:47.2637904Z  Dynamically get PR information 2025-12-04T07:56:47.2638401Z  """ 2025-12-04T07:56:47.2638914Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T07:56:47.2639541Z  headers = { 2025-12-04T07:56:47.2640040Z  "Accept": "application/vnd.github.v3+json", 2025-12-04T07:56:47.2640658Z  "Authorization": f"token {github_token}", 2025-12-04T07:56:47.2641188Z  } 2025-12-04T07:56:47.2641640Z  json_response: dict[str, Any] = download_json( 2025-12-04T07:56:47.2642261Z  url=f"{github_api}/issues/{pr_number}", 2025-12-04T07:56:47.2642800Z  headers=headers, 2025-12-04T07:56:47.2643252Z  ) 2025-12-04T07:56:47.2643610Z  2025-12-04T07:56:47.2643969Z  if not json_response: 2025-12-04T07:56:47.2644577Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T07:56:47.2645341Z  return {} 2025-12-04T07:56:47.2645757Z  2025-12-04T07:56:47.2646123Z  return json_response 2025-12-04T07:56:47.2646575Z  2025-12-04T07:56:47.2646905Z  2025-12-04T07:56:47.2647619Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T07:56:47.2648333Z  """ 2025-12-04T07:56:47.2648881Z  Dynamically get the latest list of labels from the pull request 2025-12-04T07:56:47.2649525Z  """ 2025-12-04T07:56:47.2650028Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T07:56:47.2650626Z  return { 2025-12-04T07:56:47.2651223Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T07:56:47.2651905Z  } 2025-12-04T07:56:47.2652263Z  2025-12-04T07:56:47.2652601Z  2025-12-04T07:56:47.2652968Z def main() -> None: 2025-12-04T07:56:47.2653414Z  args = parse_args() 2025-12-04T07:56:47.2653851Z  2025-12-04T07:56:47.2654264Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T07:56:47.2654804Z  2025-12-04T07:56:47.2655179Z  # Check if the PR is opt-out 2025-12-04T07:56:47.2655685Z  if args.pr_number: 2025-12-04T07:56:47.2656370Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T07:56:47.2657106Z  if OPT_OUT_LABEL in labels: 2025-12-04T07:56:47.2657710Z  log.info( 2025-12-04T07:56:47.2658418Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T07:56:47.2659166Z  ) 2025-12-04T07:56:47.2659757Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.2660422Z  sys.exit() 2025-12-04T07:56:47.2660983Z  2025-12-04T07:56:47.2661330Z  try: 2025-12-04T07:56:47.2661796Z  rollout_state = get_rollout_state_from_issue( 2025-12-04T07:56:47.2662507Z  args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T07:56:47.2663137Z  ) 2025-12-04T07:56:47.2663511Z  2025-12-04T07:56:47.2663914Z  username = get_potential_pr_author( 2025-12-04T07:56:47.2664455Z  args.github_token, 2025-12-04T07:56:47.2664958Z  args.github_repo, 2025-12-04T07:56:47.2665461Z  args.github_actor, 2025-12-04T07:56:47.2665968Z  args.github_ref_type, 2025-12-04T07:56:47.2666482Z  args.github_branch, 2025-12-04T07:56:47.2666953Z  ) 2025-12-04T07:56:47.2667432Z  2025-12-04T07:56:47.2667923Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T07:56:47.2668530Z  2025-12-04T07:56:47.2668949Z  runner_label_prefix = get_runner_prefix( 2025-12-04T07:56:47.2669507Z  rollout_state, 2025-12-04T07:56:47.2670027Z  (args.github_issue_owner, username), 2025-12-04T07:56:47.2670569Z  args.github_branch, 2025-12-04T07:56:47.2671102Z  args.eligible_experiments, 2025-12-04T07:56:47.2671648Z  args.opt_out_experiments, 2025-12-04T07:56:47.2672163Z  is_canary, 2025-12-04T07:56:47.2672592Z  ) 2025-12-04T07:56:47.2672968Z  2025-12-04T07:56:47.2673347Z  except Exception as e: 2025-12-04T07:56:47.2673819Z  log.error( 2025-12-04T07:56:47.2674527Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T07:56:47.2675385Z  ) 2025-12-04T07:56:47.2675771Z  2025-12-04T07:56:47.2676302Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.2676949Z  2025-12-04T07:56:47.2677378Z  2025-12-04T07:56:47.2677755Z if __name__ == "__main__": 2025-12-04T07:56:47.2678218Z  main() 2025-12-04T07:56:47.2678601Z  2025-12-04T07:56:47.2678946Z EOF 2025-12-04T07:56:47.2679298Z  2025-12-04T07:56:47.2679688Z cat runner_determinator.py 2025-12-04T07:56:47.3236071Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:47.3236827Z env: 2025-12-04T07:56:47.3237880Z GITHUB_TOKEN: *** 2025-12-04T07:56:47.3238310Z ISSUE_NUMBER: 5132 2025-12-04T07:56:47.3238768Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:47.3239251Z ISSUE_OWNER: 2025-12-04T07:56:47.3239638Z CHECK_EXPERIMENTS: 2025-12-04T07:56:47.3240054Z OPT_OUT_EXPERIMENTS: 2025-12-04T07:56:47.3240463Z PR_NUMBER: 2025-12-04T07:56:47.3240844Z ##[endgroup] 2025-12-04T07:56:47.3445333Z # flake8: noqa: G004 2025-12-04T07:56:47.3445667Z 2025-12-04T07:56:47.3446083Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T07:56:47.3447020Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T07:56:47.3448145Z # python .github/scripts/update_runner_determinator.py 2025-12-04T07:56:47.3448584Z 2025-12-04T07:56:47.3448740Z """ 2025-12-04T07:56:47.3449299Z This runner determinator is used to determine which set of runners to run a 2025-12-04T07:56:47.3450141Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T07:56:47.3451010Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T07:56:47.3451805Z of which runners should be used to run which job. 2025-12-04T07:56:47.3452187Z 2025-12-04T07:56:47.3452555Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T07:56:47.3453610Z separated by a line containing "---". If the line is not present, the 2025-12-04T07:56:47.3454459Z settings are considered to be empty with only the second part, the user 2025-12-04T07:56:47.3455113Z list, defined. 2025-12-04T07:56:47.3455340Z 2025-12-04T07:56:47.3455695Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T07:56:47.3456566Z used to define any settings that are needed to determine which runners to use. 2025-12-04T07:56:47.3457613Z It's fields are defined by the RolloutSettings class below. 2025-12-04T07:56:47.3458058Z 2025-12-04T07:56:47.3458418Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T07:56:47.3459259Z The user list is also a comma separated list of additional features or 2025-12-04T07:56:47.3459976Z experiments which the user could be opted in to. 2025-12-04T07:56:47.3460361Z 2025-12-04T07:56:47.3460551Z The user list has the following rules: 2025-12-04T07:56:47.3460911Z 2025-12-04T07:56:47.3461217Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T07:56:47.3462037Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T07:56:47.3462775Z - A "#" prefix opts the user out of all experiments 2025-12-04T07:56:47.3463152Z 2025-12-04T07:56:47.3463320Z Example config: 2025-12-04T07:56:47.3463752Z # A list of experiments that can be opted into. 2025-12-04T07:56:47.3464393Z # This defines the behavior they'll induce when opted into. 2025-12-04T07:56:47.3464987Z # Expected syntax is: 2025-12-04T07:56:47.3465604Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T07:56:47.3466532Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T07:56:47.3467118Z 2025-12-04T07:56:47.3467477Z experiments: 2025-12-04T07:56:47.3467888Z lf: 2025-12-04T07:56:47.3468250Z rollout_percent: 25 2025-12-04T07:56:47.3468857Z all_branches: false 2025-12-04T07:56:47.3469326Z default: true 2025-12-04T07:56:47.3469720Z --- 2025-12-04T07:56:47.3469916Z 2025-12-04T07:56:47.3470072Z # Opt-ins: 2025-12-04T07:56:47.3470633Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T07:56:47.3471495Z # and specifying experiments to enable in a comma-separated list. 2025-12-04T07:56:47.3472250Z # To always opt out of an experiment, prefix it with a "-". 2025-12-04T07:56:47.3472884Z # Experiments should be from the above list. 2025-12-04T07:56:47.3473251Z 2025-12-04T07:56:47.3473424Z @User1,-lf,split_build 2025-12-04T07:56:47.3473848Z @User2,lf 2025-12-04T07:56:47.3474212Z @User3,split_build 2025-12-04T07:56:47.3474605Z """ 2025-12-04T07:56:47.3474789Z 2025-12-04T07:56:47.3474944Z import json 2025-12-04T07:56:47.3475299Z import logging 2025-12-04T07:56:47.3475663Z import os 2025-12-04T07:56:47.3476016Z import random 2025-12-04T07:56:47.3476383Z import re 2025-12-04T07:56:47.3476726Z import sys 2025-12-04T07:56:47.3477115Z from argparse import ArgumentParser 2025-12-04T07:56:47.3477828Z from collections.abc import Iterable 2025-12-04T07:56:47.3478339Z from functools import cache 2025-12-04T07:56:47.3478799Z from logging import LogRecord 2025-12-04T07:56:47.3479271Z from typing import Any, NamedTuple 2025-12-04T07:56:47.3479781Z from urllib.request import Request, urlopen 2025-12-04T07:56:47.3480141Z 2025-12-04T07:56:47.3480295Z import yaml 2025-12-04T07:56:47.3480678Z from github import Auth, Github 2025-12-04T07:56:47.3481152Z from github.Issue import Issue 2025-12-04T07:56:47.3481442Z 2025-12-04T07:56:47.3481448Z 2025-12-04T07:56:47.3481659Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T07:56:47.3482320Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T07:56:47.3483151Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T07:56:47.3483678Z 2025-12-04T07:56:47.3483906Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T07:56:47.3484592Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T07:56:47.3485095Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T07:56:47.3485633Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T07:56:47.3485975Z 2025-12-04T07:56:47.3486172Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T07:56:47.3486497Z 2025-12-04T07:56:47.3486673Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T07:56:47.3487116Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T07:56:47.3487583Z 2025-12-04T07:56:47.3487589Z 2025-12-04T07:56:47.3487780Z class Experiment(NamedTuple): 2025-12-04T07:56:47.3488243Z rollout_perc: float = ( 2025-12-04T07:56:47.3488850Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T07:56:47.3489505Z ) 2025-12-04T07:56:47.3489863Z all_branches: bool = ( 2025-12-04T07:56:47.3490457Z False # If True, the experiment is also enabled on the exception branches 2025-12-04T07:56:47.3491104Z ) 2025-12-04T07:56:47.3491452Z default: bool = ( 2025-12-04T07:56:47.3492006Z True # If True, the experiment is enabled by default for all queries 2025-12-04T07:56:47.3492621Z ) 2025-12-04T07:56:47.3492811Z 2025-12-04T07:56:47.3492986Z # Add more fields as needed 2025-12-04T07:56:47.3493276Z 2025-12-04T07:56:47.3493282Z 2025-12-04T07:56:47.3493463Z class Settings(NamedTuple): 2025-12-04T07:56:47.3493886Z """ 2025-12-04T07:56:47.3494321Z Settings for the experiments that can be opted into. 2025-12-04T07:56:47.3494864Z """ 2025-12-04T07:56:47.3495051Z 2025-12-04T07:56:47.3495254Z experiments: dict[str, Experiment] = {} 2025-12-04T07:56:47.3495600Z 2025-12-04T07:56:47.3495607Z 2025-12-04T07:56:47.3495807Z class ColorFormatter(logging.Formatter): 2025-12-04T07:56:47.3496414Z """Color codes the log messages based on the log level""" 2025-12-04T07:56:47.3496834Z 2025-12-04T07:56:47.3496993Z COLORS = { 2025-12-04T07:56:47.3497547Z "WARNING": "\033[33m", # Yellow 2025-12-04T07:56:47.3498207Z "ERROR": "\033[31m", # Red 2025-12-04T07:56:47.3498678Z "CRITICAL": "\033[31m", # Red 2025-12-04T07:56:47.3499164Z "INFO": "\033[0m", # Reset 2025-12-04T07:56:47.3499629Z "DEBUG": "\033[0m", # Reset 2025-12-04T07:56:47.3500079Z } 2025-12-04T07:56:47.3500262Z 2025-12-04T07:56:47.3500472Z def format(self, record: LogRecord) -> str: 2025-12-04T07:56:47.3501278Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T07:56:47.3502023Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T07:56:47.3502568Z return super().format(record) 2025-12-04T07:56:47.3502886Z 2025-12-04T07:56:47.3502893Z 2025-12-04T07:56:47.3503083Z handler = logging.StreamHandler() 2025-12-04T07:56:47.3503755Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T07:56:47.3504288Z 2025-12-04T07:56:47.3504525Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T07:56:47.3505072Z log.addHandler(handler) 2025-12-04T07:56:47.3505501Z log.setLevel(logging.INFO) 2025-12-04T07:56:47.3505772Z 2025-12-04T07:56:47.3505779Z 2025-12-04T07:56:47.3506019Z def set_github_output(key: str, value: str) -> None: 2025-12-04T07:56:47.3506550Z """ 2025-12-04T07:56:47.3507027Z Defines outputs of the github action that invokes this script 2025-12-04T07:56:47.3507882Z """ 2025-12-04T07:56:47.3508243Z if not GITHUB_OUTPUT: 2025-12-04T07:56:47.3509252Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-12-04T07:56:47.3510296Z log.warning( 2025-12-04T07:56:47.3511094Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-12-04T07:56:47.3511968Z ) 2025-12-04T07:56:47.3521747Z print(f"::set-output name={key}::{value}") 2025-12-04T07:56:47.3522332Z return 2025-12-04T07:56:47.3522574Z 2025-12-04T07:56:47.3522946Z with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T07:56:47.3523532Z log.info(f"Setting output: {key}='{value}'") 2025-12-04T07:56:47.3524088Z f.write(f"{key}={value}\n") 2025-12-04T07:56:47.3524408Z 2025-12-04T07:56:47.3524415Z 2025-12-04T07:56:47.3524709Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T07:56:47.3525312Z return frozenset( 2025-12-04T07:56:47.3525900Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T07:56:47.3526551Z ) 2025-12-04T07:56:47.3526741Z 2025-12-04T07:56:47.3526747Z 2025-12-04T07:56:47.3526914Z def parse_args() -> Any: 2025-12-04T07:56:47.3527701Z parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T07:56:47.3528535Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T07:56:47.3529258Z parser.add_argument( 2025-12-04T07:56:47.3529690Z "--github-issue-repo", 2025-12-04T07:56:47.3530134Z type=str, 2025-12-04T07:56:47.3530518Z required=False, 2025-12-04T07:56:47.3530947Z default="pytorch/test-infra", 2025-12-04T07:56:47.3531449Z help="GitHub repo to get the issue", 2025-12-04T07:56:47.3531931Z ) 2025-12-04T07:56:47.3532274Z parser.add_argument( 2025-12-04T07:56:47.3532700Z "--github-repo", 2025-12-04T07:56:47.3533097Z type=str, 2025-12-04T07:56:47.3533466Z required=True, 2025-12-04T07:56:47.3533894Z help="GitHub repo where CI is running", 2025-12-04T07:56:47.3534389Z ) 2025-12-04T07:56:47.3534735Z parser.add_argument( 2025-12-04T07:56:47.3535306Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T07:56:47.3535929Z ) 2025-12-04T07:56:47.3536276Z parser.add_argument( 2025-12-04T07:56:47.3536876Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T07:56:47.3590117Z ) 2025-12-04T07:56:47.3590604Z parser.add_argument( 2025-12-04T07:56:47.3591535Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T07:56:47.3592218Z ) 2025-12-04T07:56:47.3592580Z parser.add_argument( 2025-12-04T07:56:47.3593230Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T07:56:47.3593898Z ) 2025-12-04T07:56:47.3594256Z parser.add_argument( 2025-12-04T07:56:47.3594697Z "--github-ref-type", 2025-12-04T07:56:47.3595125Z type=str, 2025-12-04T07:56:47.3595502Z required=True, 2025-12-04T07:56:47.3595967Z help="Current GitHub ref type, branch or tag", 2025-12-04T07:56:47.3596500Z ) 2025-12-04T07:56:47.3596848Z parser.add_argument( 2025-12-04T07:56:47.3597421Z "--eligible-experiments", 2025-12-04T07:56:47.3597924Z type=_str_comma_separated_to_set, 2025-12-04T07:56:47.3598423Z required=False, 2025-12-04T07:56:47.3598822Z default="", 2025-12-04T07:56:47.3599632Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T07:56:47.3600518Z ) 2025-12-04T07:56:47.3600866Z parser.add_argument( 2025-12-04T07:56:47.3601298Z "--opt-out-experiments", 2025-12-04T07:56:47.3601776Z type=_str_comma_separated_to_set, 2025-12-04T07:56:47.3602273Z required=False, 2025-12-04T07:56:47.3602664Z default="", 2025-12-04T07:56:47.3603039Z help=( 2025-12-04T07:56:47.3603675Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T07:56:47.3604754Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T07:56:47.3605547Z ), 2025-12-04T07:56:47.3605882Z ) 2025-12-04T07:56:47.3606233Z parser.add_argument( 2025-12-04T07:56:47.3606640Z "--pr-number", 2025-12-04T07:56:47.3607036Z type=str, 2025-12-04T07:56:47.3607524Z required=False, 2025-12-04T07:56:47.3607934Z default="", 2025-12-04T07:56:47.3608506Z help="the optional PR number where this is run", 2025-12-04T07:56:47.3609048Z ) 2025-12-04T07:56:47.3609234Z 2025-12-04T07:56:47.3609414Z return parser.parse_args() 2025-12-04T07:56:47.3609716Z 2025-12-04T07:56:47.3609722Z 2025-12-04T07:56:47.3610124Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.3610853Z auth = Auth.Token(github_token) 2025-12-04T07:56:47.3611335Z return Github(auth=auth) 2025-12-04T07:56:47.3611619Z 2025-12-04T07:56:47.3611632Z 2025-12-04T07:56:47.3612071Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.3612823Z repo = gh.get_repo(repo) 2025-12-04T07:56:47.3613305Z return repo.get_issue(number=issue_num) 2025-12-04T07:56:47.3613656Z 2025-12-04T07:56:47.3613663Z 2025-12-04T07:56:47.3613852Z def get_potential_pr_author( 2025-12-04T07:56:47.3614477Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T07:56:47.3615124Z ) -> str: 2025-12-04T07:56:47.3615620Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T07:56:47.3616385Z # Fetch the actual username from the original PR. The PR number is 2025-12-04T07:56:47.3617087Z # embedded in the tag name: ciflow// 2025-12-04T07:56:47.3617620Z 2025-12-04T07:56:47.3617803Z gh = get_gh_client(github_token) 2025-12-04T07:56:47.3618127Z 2025-12-04T07:56:47.3618394Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T07:56:47.3618993Z split_tag = ref_name.split("/") 2025-12-04T07:56:47.3619475Z if ( 2025-12-04T07:56:47.3619844Z len(split_tag) == 3 2025-12-04T07:56:47.3620311Z and split_tag[0] == "ciflow" 2025-12-04T07:56:47.3620816Z and split_tag[2].isnumeric() 2025-12-04T07:56:47.3621285Z ): 2025-12-04T07:56:47.3621650Z pr_number = split_tag[2] 2025-12-04T07:56:47.3622252Z try: 2025-12-04T07:56:47.3622669Z repository = gh.get_repo(repo) 2025-12-04T07:56:47.3623257Z pull = repository.get_pull(number=int(pr_number)) 2025-12-04T07:56:47.3623830Z except Exception as e: 2025-12-04T07:56:47.3624330Z raise Exception( # noqa: TRY002 2025-12-04T07:56:47.3624977Z f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T07:56:47.3625586Z ) from e 2025-12-04T07:56:47.3626099Z return pull.user.login # type: ignore[no-any-return] 2025-12-04T07:56:47.3626766Z # In all other cases, return the original input username 2025-12-04T07:56:47.3627432Z return username 2025-12-04T07:56:47.3627671Z 2025-12-04T07:56:47.3627677Z 2025-12-04T07:56:47.3627899Z def is_exception_branch(branch: str) -> bool: 2025-12-04T07:56:47.3628409Z """ 2025-12-04T07:56:47.3629025Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T07:56:47.3629767Z """ 2025-12-04T07:56:47.3630293Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T07:56:47.3630792Z 2025-12-04T07:56:47.3630798Z 2025-12-04T07:56:47.3630987Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T07:56:47.3631461Z try: 2025-12-04T07:56:47.3631840Z data = yaml.safe_load(yaml_text) 2025-12-04T07:56:47.3632324Z return data 2025-12-04T07:56:47.3632723Z except yaml.YAMLError: 2025-12-04T07:56:47.3633179Z log.exception("Error loading YAML") 2025-12-04T07:56:47.3633667Z raise 2025-12-04T07:56:47.3633877Z 2025-12-04T07:56:47.3633883Z 2025-12-04T07:56:47.3634274Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T07:56:47.3634977Z """ 2025-12-04T07:56:47.3635564Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T07:56:47.3636137Z 2025-12-04T07:56:47.3636598Z If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.3637433Z and the text below is the list of opted in users. 2025-12-04T07:56:47.3637820Z 2025-12-04T07:56:47.3638178Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T07:56:47.3638839Z """ 2025-12-04T07:56:47.3639258Z rollout_state_parts = rollout_state.split("---") 2025-12-04T07:56:47.3639837Z if len(rollout_state_parts) >= 2: 2025-12-04T07:56:47.3640414Z return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T07:56:47.3640969Z else: 2025-12-04T07:56:47.3641335Z return "", rollout_state 2025-12-04T07:56:47.3641629Z 2025-12-04T07:56:47.3641635Z 2025-12-04T07:56:47.3641824Z class UserOptins(dict[str, list[str]]): 2025-12-04T07:56:47.3642299Z """ 2025-12-04T07:56:47.3642802Z Dictionary of users with a list of features they have opted into 2025-12-04T07:56:47.3643416Z """ 2025-12-04T07:56:47.3643608Z 2025-12-04T07:56:47.3643614Z 2025-12-04T07:56:47.3643932Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T07:56:47.3644556Z """ 2025-12-04T07:56:47.3645231Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-12-04T07:56:47.3645880Z 2025-12-04T07:56:47.3646472Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-12-04T07:56:47.3647723Z - Example line: "@User1,lf,split_build" 2025-12-04T07:56:47.3648408Z - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T07:56:47.3648876Z 2025-12-04T07:56:47.3648882Z 2025-12-04T07:56:47.3649034Z """ 2025-12-04T07:56:47.3649390Z optins = UserOptins() 2025-12-04T07:56:47.3649853Z for user in user_optin_text.split("\n"): 2025-12-04T07:56:47.3650385Z user = user.strip("\r\n\t -") 2025-12-04T07:56:47.3650901Z if not user or not user.startswith("@"): 2025-12-04T07:56:47.3651595Z # Not a valid user. Skip 2025-12-04T07:56:47.3652056Z continue 2025-12-04T07:56:47.3652295Z 2025-12-04T07:56:47.3652445Z if user: 2025-12-04T07:56:47.3652863Z usr_name = user.split(",")[0].strip("@") 2025-12-04T07:56:47.3653535Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T07:56:47.3654004Z 2025-12-04T07:56:47.3654164Z return optins 2025-12-04T07:56:47.3654390Z 2025-12-04T07:56:47.3654396Z 2025-12-04T07:56:47.3654672Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T07:56:47.3655240Z """ 2025-12-04T07:56:47.3655612Z Check if the experiment name is valid. 2025-12-04T07:56:47.3656106Z A valid name: 2025-12-04T07:56:47.3656716Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T07:56:47.3657737Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T07:56:47.3658432Z - Cannot contain spaces 2025-12-04T07:56:47.3658866Z """ 2025-12-04T07:56:47.3659056Z 2025-12-04T07:56:47.3659312Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T07:56:47.3659978Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T07:56:47.3660403Z 2025-12-04T07:56:47.3660557Z if valid: 2025-12-04T07:56:47.3660906Z return True 2025-12-04T07:56:47.3661133Z 2025-12-04T07:56:47.3661284Z log.error( 2025-12-04T07:56:47.3662648Z 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-04T07:56:47.3664090Z ) 2025-12-04T07:56:47.3664422Z return False 2025-12-04T07:56:47.3664641Z 2025-12-04T07:56:47.3664647Z 2025-12-04T07:56:47.3664942Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T07:56:47.3665526Z """ 2025-12-04T07:56:47.3666203Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T07:56:47.3666896Z """ 2025-12-04T07:56:47.3667230Z try: 2025-12-04T07:56:47.3667678Z if settings_text: 2025-12-04T07:56:47.3668376Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-12-04T07:56:47.3669127Z # for easy reading 2025-12-04T07:56:47.3669875Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T07:56:47.3670711Z # the backtick character in shell commands. 2025-12-04T07:56:47.3671286Z backtick = chr(96) # backtick character 2025-12-04T07:56:47.3671954Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T07:56:47.3672578Z settings = load_yaml(settings_text) 2025-12-04T07:56:47.3672944Z 2025-12-04T07:56:47.3673329Z # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T07:56:47.3674043Z experiments = {} 2025-12-04T07:56:47.3674330Z 2025-12-04T07:56:47.3674694Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T07:56:47.3675411Z if not is_valid_experiment_name(exp_name): 2025-12-04T07:56:47.3676438Z # 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-04T07:56:47.3677515Z continue 2025-12-04T07:56:47.3677787Z 2025-12-04T07:56:47.3677963Z valid_settings = {} 2025-12-04T07:56:47.3678463Z for setting in exp_settings: 2025-12-04T07:56:47.3679002Z if setting not in Experiment._fields: 2025-12-04T07:56:47.3679528Z log.warning( 2025-12-04T07:56:47.3680193Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T07:56:47.3681036Z ) 2025-12-04T07:56:47.3681446Z else: 2025-12-04T07:56:47.3681931Z valid_settings[setting] = exp_settings[setting] 2025-12-04T07:56:47.3682340Z 2025-12-04T07:56:47.3682604Z experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T07:56:47.3683208Z return Settings(experiments) 2025-12-04T07:56:47.3683548Z 2025-12-04T07:56:47.3683710Z except Exception: 2025-12-04T07:56:47.3684156Z log.exception("Failed to parse settings") 2025-12-04T07:56:47.3684519Z 2025-12-04T07:56:47.3684681Z return Settings() 2025-12-04T07:56:47.3684921Z 2025-12-04T07:56:47.3684933Z 2025-12-04T07:56:47.3685167Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T07:56:47.3685692Z """ 2025-12-04T07:56:47.3686101Z Parse settings, if any, from the rollout state. 2025-12-04T07:56:47.3686478Z 2025-12-04T07:56:47.3686815Z If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.3687706Z and the text below is the list of opted in users. 2025-12-04T07:56:47.3688095Z 2025-12-04T07:56:47.3688483Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T07:56:47.3689178Z """ 2025-12-04T07:56:47.3689701Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.3690407Z return parse_settings_from_text(settings_text) 2025-12-04T07:56:47.3690793Z 2025-12-04T07:56:47.3690800Z 2025-12-04T07:56:47.3691027Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T07:56:47.3691555Z """ 2025-12-04T07:56:47.3691927Z Parse users from the rollout state. 2025-12-04T07:56:47.3692252Z 2025-12-04T07:56:47.3692405Z """ 2025-12-04T07:56:47.3692906Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.3693604Z return parse_user_opt_in_from_text(users_text) 2025-12-04T07:56:47.3693981Z 2025-12-04T07:56:47.3693987Z 2025-12-04T07:56:47.3694499Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.3695205Z """ 2025-12-04T07:56:47.3695596Z Check if a user is opted into an experiment 2025-12-04T07:56:47.3696093Z """ 2025-12-04T07:56:47.3696516Z return experiment_name in user_optins.get(user, []) 2025-12-04T07:56:47.3696908Z 2025-12-04T07:56:47.3696914Z 2025-12-04T07:56:47.3697767Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.3698489Z """ 2025-12-04T07:56:47.3698912Z Check if a user explicitly opted out of an experiment 2025-12-04T07:56:47.3699459Z """ 2025-12-04T07:56:47.3699934Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T07:56:47.3700576Z experiment_optout = "-" + experiment_name 2025-12-04T07:56:47.3701184Z if experiment_optout not in user_optins.get(user, []): 2025-12-04T07:56:47.3701751Z return False 2025-12-04T07:56:47.3701988Z 2025-12-04T07:56:47.3702247Z if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T07:56:47.3702816Z log.warning( 2025-12-04T07:56:47.3703576Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T07:56:47.3704400Z ) 2025-12-04T07:56:47.3704601Z 2025-12-04T07:56:47.3704753Z return True 2025-12-04T07:56:47.3704968Z 2025-12-04T07:56:47.3704975Z 2025-12-04T07:56:47.3705141Z def get_runner_prefix( 2025-12-04T07:56:47.3705542Z rollout_state: str, 2025-12-04T07:56:47.3705971Z workflow_requestors: Iterable[str], 2025-12-04T07:56:47.3706450Z branch: str, 2025-12-04T07:56:47.3706914Z eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.3707633Z opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.3708194Z is_canary: bool = False, 2025-12-04T07:56:47.3708623Z ) -> str: 2025-12-04T07:56:47.3709156Z settings = parse_settings(rollout_state) 2025-12-04T07:56:47.3709707Z user_optins = parse_users(rollout_state) 2025-12-04T07:56:47.3710051Z 2025-12-04T07:56:47.3710210Z fleet_prefix = "" 2025-12-04T07:56:47.3710599Z prefixes = [] 2025-12-04T07:56:47.3711177Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T07:56:47.3712054Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T07:56:47.3712706Z log.info( 2025-12-04T07:56:47.3713359Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T07:56:47.3714064Z ) 2025-12-04T07:56:47.3714413Z continue 2025-12-04T07:56:47.3714647Z 2025-12-04T07:56:47.3714826Z if opt_out_experiments: 2025-12-04T07:56:47.3715325Z if experiment_name in opt_out_experiments: 2025-12-04T07:56:47.3715929Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T07:56:47.3716476Z log.info( 2025-12-04T07:56:47.3717438Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T07:56:47.3718353Z ) 2025-12-04T07:56:47.3718715Z continue 2025-12-04T07:56:47.3718964Z 2025-12-04T07:56:47.3719145Z if eligible_experiments: 2025-12-04T07:56:47.3719688Z if experiment_name not in eligible_experiments: 2025-12-04T07:56:47.3720283Z exp_list = ", ".join(eligible_experiments) 2025-12-04T07:56:47.3720800Z log.info( 2025-12-04T07:56:47.3721533Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T07:56:47.3722315Z ) 2025-12-04T07:56:47.3722682Z continue 2025-12-04T07:56:47.3723143Z elif not experiment_settings.default: 2025-12-04T07:56:47.3723634Z log.info( 2025-12-04T07:56:47.3724371Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T07:56:47.3725069Z ) 2025-12-04T07:56:47.3725426Z continue 2025-12-04T07:56:47.3725659Z 2025-12-04T07:56:47.3725914Z # Is any workflow_requestor opted out to this experiment? 2025-12-04T07:56:47.3726495Z opted_out_users = [ 2025-12-04T07:56:47.3726918Z requestor 2025-12-04T07:56:47.3727447Z for requestor in workflow_requestors 2025-12-04T07:56:47.3728079Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.3728660Z ] 2025-12-04T07:56:47.3728857Z 2025-12-04T07:56:47.3729024Z if opted_out_users: 2025-12-04T07:56:47.3729435Z log.info( 2025-12-04T07:56:47.3730011Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T07:56:47.3730665Z ) 2025-12-04T07:56:47.3731014Z continue 2025-12-04T07:56:47.3731248Z 2025-12-04T07:56:47.3731505Z # Is any workflow_requestor opted in to this experiment? 2025-12-04T07:56:47.3732067Z opted_in_users = [ 2025-12-04T07:56:47.3732481Z requestor 2025-12-04T07:56:47.3732900Z for requestor in workflow_requestors 2025-12-04T07:56:47.3733527Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.3734098Z ] 2025-12-04T07:56:47.3734288Z 2025-12-04T07:56:47.3734445Z enabled = False 2025-12-04T07:56:47.3734846Z if opted_in_users: 2025-12-04T07:56:47.3735253Z log.info( 2025-12-04T07:56:47.3735812Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T07:56:47.3736445Z ) 2025-12-04T07:56:47.3736810Z enabled = True 2025-12-04T07:56:47.3737072Z 2025-12-04T07:56:47.3737366Z elif experiment_settings.rollout_perc: 2025-12-04T07:56:47.3738152Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T07:56:47.3739149Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T07:56:47.3739761Z log.info( 2025-12-04T07:56:47.3740579Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T07:56:47.3741433Z ) 2025-12-04T07:56:47.3741819Z enabled = True 2025-12-04T07:56:47.3742096Z 2025-12-04T07:56:47.3742248Z if enabled: 2025-12-04T07:56:47.3742642Z label = experiment_name 2025-12-04T07:56:47.3743159Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T07:56:47.3743933Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T07:56:47.3744748Z # - If it's enabled, then we always list it's prefix first 2025-12-04T07:56:47.3745455Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T07:56:47.3746077Z if is_canary: 2025-12-04T07:56:47.3746529Z label += CANARY_FLEET_SUFFIX 2025-12-04T07:56:47.3747043Z fleet_prefix = label 2025-12-04T07:56:47.3747595Z else: 2025-12-04T07:56:47.3747999Z prefixes.append(label) 2025-12-04T07:56:47.3748319Z 2025-12-04T07:56:47.3748487Z if len(prefixes) > 1: 2025-12-04T07:56:47.3748900Z log.error( 2025-12-04T07:56:47.3749856Z 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-04T07:56:47.3750891Z ) 2025-12-04T07:56:47.3751257Z prefixes = prefixes[:1] 2025-12-04T07:56:47.3751544Z 2025-12-04T07:56:47.3751714Z # Fleet always comes first 2025-12-04T07:56:47.3752154Z if fleet_prefix: 2025-12-04T07:56:47.3752572Z prefixes.insert(0, fleet_prefix) 2025-12-04T07:56:47.3752915Z 2025-12-04T07:56:47.3753275Z return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T07:56:47.3753671Z 2025-12-04T07:56:47.3753678Z 2025-12-04T07:56:47.3754095Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T07:56:47.3754802Z """ 2025-12-04T07:56:47.3755348Z Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T07:56:47.3755874Z 2025-12-04T07:56:47.3756239Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T07:56:47.3756894Z """ 2025-12-04T07:56:47.3757345Z gh = get_gh_client(github_token) 2025-12-04T07:56:47.3757859Z issue = get_issue(gh, repo, issue_num) 2025-12-04T07:56:47.3758457Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T07:56:47.3758867Z 2025-12-04T07:56:47.3758874Z 2025-12-04T07:56:47.3759239Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T07:56:47.3759953Z for _ in range(num_retries): 2025-12-04T07:56:47.3760394Z try: 2025-12-04T07:56:47.3760793Z req = Request(url=url, headers=headers) 2025-12-04T07:56:47.3761409Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T07:56:47.3762013Z return json.loads(content) 2025-12-04T07:56:47.3762505Z except Exception as e: 2025-12-04T07:56:47.3763010Z log.warning(f"Could not download {url}: {e}") 2025-12-04T07:56:47.3763392Z 2025-12-04T07:56:47.3763749Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T07:56:47.3764403Z return {} 2025-12-04T07:56:47.3764618Z 2025-12-04T07:56:47.3764624Z 2025-12-04T07:56:47.3764772Z @cache 2025-12-04T07:56:47.3765345Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T07:56:47.3766044Z """ 2025-12-04T07:56:47.3766409Z Dynamically get PR information 2025-12-04T07:56:47.3766980Z """ 2025-12-04T07:56:47.3767551Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T07:56:47.3768136Z headers = { 2025-12-04T07:56:47.3768573Z "Accept": "application/vnd.github.v3+json", 2025-12-04T07:56:47.3769136Z "Authorization": f"token {github_token}", 2025-12-04T07:56:47.3769636Z } 2025-12-04T07:56:47.3770032Z json_response: dict[str, Any] = download_json( 2025-12-04T07:56:47.3770603Z url=f"{github_api}/issues/{pr_number}", 2025-12-04T07:56:47.3771115Z headers=headers, 2025-12-04T07:56:47.3771538Z ) 2025-12-04T07:56:47.3771724Z 2025-12-04T07:56:47.3771903Z if not json_response: 2025-12-04T07:56:47.3772423Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T07:56:47.3773004Z return {} 2025-12-04T07:56:47.3773223Z 2025-12-04T07:56:47.3773388Z return json_response 2025-12-04T07:56:47.3773651Z 2025-12-04T07:56:47.3773657Z 2025-12-04T07:56:47.3774033Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T07:56:47.3774714Z """ 2025-12-04T07:56:47.3775197Z Dynamically get the latest list of labels from the pull request 2025-12-04T07:56:47.3775796Z """ 2025-12-04T07:56:47.3776232Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T07:56:47.3776795Z return { 2025-12-04T07:56:47.3777424Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T07:56:47.3778078Z } 2025-12-04T07:56:47.3778261Z 2025-12-04T07:56:47.3778267Z 2025-12-04T07:56:47.3778423Z def main() -> None: 2025-12-04T07:56:47.3778816Z args = parse_args() 2025-12-04T07:56:47.3779061Z 2025-12-04T07:56:47.3779267Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T07:56:47.3779616Z 2025-12-04T07:56:47.3779792Z # Check if the PR is opt-out 2025-12-04T07:56:47.3780243Z if args.pr_number: 2025-12-04T07:56:47.3780841Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T07:56:47.3781687Z if OPT_OUT_LABEL in labels: 2025-12-04T07:56:47.3782158Z log.info( 2025-12-04T07:56:47.3782815Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T07:56:47.3783539Z ) 2025-12-04T07:56:47.3784054Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3784680Z sys.exit() 2025-12-04T07:56:47.3784921Z 2025-12-04T07:56:47.3785072Z try: 2025-12-04T07:56:47.3785482Z rollout_state = get_rollout_state_from_issue( 2025-12-04T07:56:47.3786134Z args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T07:56:47.3786732Z ) 2025-12-04T07:56:47.3786926Z 2025-12-04T07:56:47.3787116Z username = get_potential_pr_author( 2025-12-04T07:56:47.3787726Z args.github_token, 2025-12-04T07:56:47.3788177Z args.github_repo, 2025-12-04T07:56:47.3788614Z args.github_actor, 2025-12-04T07:56:47.3789064Z args.github_ref_type, 2025-12-04T07:56:47.3789529Z args.github_branch, 2025-12-04T07:56:47.3789949Z ) 2025-12-04T07:56:47.3790141Z 2025-12-04T07:56:47.3790403Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T07:56:47.3790831Z 2025-12-04T07:56:47.3791031Z runner_label_prefix = get_runner_prefix( 2025-12-04T07:56:47.3791545Z rollout_state, 2025-12-04T07:56:47.3792002Z (args.github_issue_owner, username), 2025-12-04T07:56:47.3792523Z args.github_branch, 2025-12-04T07:56:47.3792988Z args.eligible_experiments, 2025-12-04T07:56:47.3793492Z args.opt_out_experiments, 2025-12-04T07:56:47.3793948Z is_canary, 2025-12-04T07:56:47.3794333Z ) 2025-12-04T07:56:47.3794527Z 2025-12-04T07:56:47.3794698Z except Exception as e: 2025-12-04T07:56:47.3795120Z log.error( 2025-12-04T07:56:47.3795734Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T07:56:47.3796577Z ) 2025-12-04T07:56:47.3796765Z 2025-12-04T07:56:47.3797080Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3797644Z 2025-12-04T07:56:47.3797650Z 2025-12-04T07:56:47.3797814Z if __name__ == "__main__": 2025-12-04T07:56:47.3798223Z main() 2025-12-04T07:56:47.3798419Z 2025-12-04T07:56:47.3886391Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T07:56:47.3887221Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T07:56:47.3918882Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:47.3919331Z env: 2025-12-04T07:56:47.3919920Z GITHUB_TOKEN: *** 2025-12-04T07:56:47.3920316Z ISSUE_NUMBER: 5132 2025-12-04T07:56:47.3920734Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:47.3921211Z ISSUE_OWNER: 2025-12-04T07:56:47.3921587Z CHECK_EXPERIMENTS: 2025-12-04T07:56:47.3922001Z OPT_OUT_EXPERIMENTS: 2025-12-04T07:56:47.3922403Z PR_NUMBER: 2025-12-04T07:56:47.3922759Z ##[endgroup] 2025-12-04T07:56:49.1362728Z Defaulting to user installation because normal site-packages is not writeable 2025-12-04T07:56:50.8569026Z Collecting urllib3==1.26.18 2025-12-04T07:56:50.9353975Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-12-04T07:56:50.9686218Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 1.9 MB/s eta 0:00:00 2025-12-04T07:56:51.0093039Z Collecting PyGithub==2.3.0 2025-12-04T07:56:51.0275703Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-12-04T07:56:51.0911198Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-12-04T07:56:51.1095708Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl.metadata (9.8 kB) 2025-12-04T07:56:51.1155882Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-12-04T07:56:51.1181587Z 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-04T07:56:51.1204567Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-12-04T07:56:51.1637656Z Collecting Deprecated (from PyGithub==2.3.0) 2025-12-04T07:56:51.1822089Z Downloading deprecated-1.3.1-py2.py3-none-any.whl.metadata (5.9 kB) 2025-12-04T07:56:51.2042138Z 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-04T07:56:51.3656912Z Collecting cffi>=2.0.0 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T07:56:51.3844902Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.6 kB) 2025-12-04T07:56:51.5624808Z Collecting wrapt<3,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-12-04T07:56:51.5813330Z 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-04T07:56:51.6164114Z Collecting pycparser (from cffi>=2.0.0->pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T07:56:51.6347075Z Downloading pycparser-2.23-py3-none-any.whl.metadata (993 bytes) 2025-12-04T07:56:51.6731357Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-12-04T07:56:51.6970331Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 6.1 MB/s eta 0:00:00 2025-12-04T07:56:51.7155757Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-12-04T07:56:51.7383832Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 16.3 MB/s eta 0:00:00 2025-12-04T07:56:51.7573417Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl (1.4 MB) 2025-12-04T07:56:51.7864899Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 50.7 MB/s eta 0:00:00 2025-12-04T07:56:51.8050710Z Downloading deprecated-1.3.1-py2.py3-none-any.whl (11 kB) 2025-12-04T07:56:51.8258422Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (219 kB) 2025-12-04T07:56:51.8311492Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 219.6/219.6 kB 65.0 MB/s eta 0:00:00 2025-12-04T07:56:51.8502649Z 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-04T07:56:51.8561887Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.5/121.5 kB 33.1 MB/s eta 0:00:00 2025-12-04T07:56:51.8748482Z Downloading pycparser-2.23-py3-none-any.whl (118 kB) 2025-12-04T07:56:51.8789239Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.1/118.1 kB 44.0 MB/s eta 0:00:00 2025-12-04T07:56:52.1887137Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-12-04T07:56:52.7301446Z 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-04T07:56:52.8134867Z ##[group]Run curr_branch="main" 2025-12-04T07:56:52.8135171Z curr_branch="main" 2025-12-04T07:56:52.8135396Z curr_ref_type="branch" 2025-12-04T07:56:52.8135665Z echo "Current branch is '$curr_branch'" 2025-12-04T07:56:52.8135961Z  2025-12-04T07:56:52.8136159Z python3 runner_determinator.py \ 2025-12-04T07:56:52.8136440Z  --github-token "$GITHUB_TOKEN" \ 2025-12-04T07:56:52.8136720Z  --github-issue "$ISSUE_NUMBER" \ 2025-12-04T07:56:52.8136980Z  --github-branch "$curr_branch" \ 2025-12-04T07:56:52.8137513Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-12-04T07:56:52.8137854Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-12-04T07:56:52.8138142Z  --github-ref-type "$curr_ref_type" \ 2025-12-04T07:56:52.8138421Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-12-04T07:56:52.8138715Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-12-04T07:56:52.8139087Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-12-04T07:56:52.8139377Z  --pr-number "${PR_NUMBER}" 2025-12-04T07:56:52.8172742Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:52.8172971Z env: 2025-12-04T07:56:52.8173581Z GITHUB_TOKEN: *** 2025-12-04T07:56:52.8173786Z ISSUE_NUMBER: 5132 2025-12-04T07:56:52.8173993Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:52.8174224Z ISSUE_OWNER: 2025-12-04T07:56:52.8174417Z CHECK_EXPERIMENTS: 2025-12-04T07:56:52.8174606Z OPT_OUT_EXPERIMENTS: 2025-12-04T07:56:52.8174795Z PR_NUMBER: 2025-12-04T07:56:52.8174992Z ##[endgroup] 2025-12-04T07:56:52.8224814Z Current branch is 'main' 2025-12-04T07:56:54.6703738Z INFO : Branch main is an exception branch. Not enabling experiment ephemeral. 2025-12-04T07:56:54.6704897Z INFO : Branch main is an exception branch. Not enabling experiment wincanary. 2025-12-04T07:56:54.6706462Z INFO : Branch main is an exception branch. Not enabling experiment wincanarylf. 2025-12-04T07:56:54.6707526Z INFO : Setting output: label-type='' 2025-12-04T07:56:54.7029884Z Evaluate and set job outputs 2025-12-04T07:56:54.7037591Z Cleaning up orphan processes