2025-12-04T07:56:46.5389611Z Current runner version: '2.329.0' 2025-12-04T07:56:46.5412313Z ##[group]Runner Image Provisioner 2025-12-04T07:56:46.5413112Z Hosted Compute Agent 2025-12-04T07:56:46.5413715Z Version: 20251124.448 2025-12-04T07:56:46.5414341Z Commit: fda5086b43ec66ade217e5fcd18146c879571177 2025-12-04T07:56:46.5415071Z Build Date: 2025-11-24T21:16:26Z 2025-12-04T07:56:46.5415674Z ##[endgroup] 2025-12-04T07:56:46.5416222Z ##[group]Operating System 2025-12-04T07:56:46.5416747Z Ubuntu 2025-12-04T07:56:46.5417562Z 24.04.3 2025-12-04T07:56:46.5418132Z LTS 2025-12-04T07:56:46.5418637Z ##[endgroup] 2025-12-04T07:56:46.5419090Z ##[group]Runner Image 2025-12-04T07:56:46.5419738Z Image: ubuntu-24.04 2025-12-04T07:56:46.5420256Z Version: 20251126.144.1 2025-12-04T07:56:46.5421244Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20251126.144/images/ubuntu/Ubuntu2404-Readme.md 2025-12-04T07:56:46.5422822Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20251126.144 2025-12-04T07:56:46.5423900Z ##[endgroup] 2025-12-04T07:56:46.5424892Z ##[group]GITHUB_TOKEN Permissions 2025-12-04T07:56:46.5426919Z Contents: read 2025-12-04T07:56:46.5427824Z Metadata: read 2025-12-04T07:56:46.5428344Z ##[endgroup] 2025-12-04T07:56:46.5430372Z Secret source: Actions 2025-12-04T07:56:46.5431469Z Prepare workflow directory 2025-12-04T07:56:46.5985441Z Prepare all required actions 2025-12-04T07:56:46.6040209Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (ffd9b0fb4355e97af82fc42cf185c3ffa0fc0a32) 2025-12-04T07:56:46.6044745Z ##[group] Inputs 2025-12-04T07:56:46.6045321Z check_experiments: 2025-12-04T07:56:46.6045958Z opt_out_experiments: lf 2025-12-04T07:56:46.6046586Z triggering_actor: pytorchmergebot 2025-12-04T07:56:46.6047150Z issue_owner: 2025-12-04T07:56:46.6047913Z curr_branch: main 2025-12-04T07:56:46.6048425Z curr_ref_type: branch 2025-12-04T07:56:46.6049011Z issue_number: 5132 2025-12-04T07:56:46.6049625Z ##[endgroup] 2025-12-04T07:56:46.6050200Z Complete job name: get-label-type / runner-determinator 2025-12-04T07:56:47.2603814Z ##[group]Run cat < runner_determinator.py 2025-12-04T07:56:47.2606256Z cat < runner_determinator.py 2025-12-04T07:56:47.2606929Z # flake8: noqa: G004 2025-12-04T07:56:47.2607661Z  2025-12-04T07:56:47.2608425Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T07:56:47.2609482Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T07:56:47.2610425Z # python .github/scripts/update_runner_determinator.py 2025-12-04T07:56:47.2611124Z  2025-12-04T07:56:47.2611588Z """ 2025-12-04T07:56:47.2612252Z This runner determinator is used to determine which set of runners to run a 2025-12-04T07:56:47.2613273Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T07:56:47.2614422Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T07:56:47.2615380Z of which runners should be used to run which job. 2025-12-04T07:56:47.2616117Z  2025-12-04T07:56:47.2616779Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T07:56:47.2617914Z separated by a line containing "---". If the line is not present, the 2025-12-04T07:56:47.2618948Z settings are considered to be empty with only the second part, the user 2025-12-04T07:56:47.2619791Z list, defined. 2025-12-04T07:56:47.2620287Z  2025-12-04T07:56:47.2620986Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T07:56:47.2622028Z used to define any settings that are needed to determine which runners to use. 2025-12-04T07:56:47.2622964Z It's fields are defined by the RolloutSettings class below. 2025-12-04T07:56:47.2623726Z  2025-12-04T07:56:47.2624667Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T07:56:47.2625670Z The user list is also a comma separated list of additional features or 2025-12-04T07:56:47.2626627Z experiments which the user could be opted in to. 2025-12-04T07:56:47.2627382Z  2025-12-04T07:56:47.2627895Z The user list has the following rules: 2025-12-04T07:56:47.2628506Z  2025-12-04T07:56:47.2629185Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T07:56:47.2630137Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T07:56:47.2631016Z - A "#" prefix opts the user out of all experiments 2025-12-04T07:56:47.2631701Z  2025-12-04T07:56:47.2632117Z Example config: 2025-12-04T07:56:47.2632754Z  # A list of experiments that can be opted into. 2025-12-04T07:56:47.2633558Z  # This defines the behavior they'll induce when opted into. 2025-12-04T07:56:47.2634296Z  # Expected syntax is: 2025-12-04T07:56:47.2635121Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T07:56:47.2636174Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T07:56:47.2637009Z  2025-12-04T07:56:47.2715044Z  experiments: 2025-12-04T07:56:47.2715623Z  lf: 2025-12-04T07:56:47.2716049Z  rollout_percent: 25 2025-12-04T07:56:47.2716584Z  all_branches: false 2025-12-04T07:56:47.2717072Z  default: true 2025-12-04T07:56:47.2717835Z  --- 2025-12-04T07:56:47.2718221Z  2025-12-04T07:56:47.2718623Z  # Opt-ins: 2025-12-04T07:56:47.2719310Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T07:56:47.2720551Z  # and specifying experiments to enable in a comma-separated list. 2025-12-04T07:56:47.2721396Z  # To always opt out of an experiment, prefix it with a "-". 2025-12-04T07:56:47.2722106Z  # Experiments should be from the above list. 2025-12-04T07:56:47.2722657Z  2025-12-04T07:56:47.2723048Z  @User1,-lf,split_build 2025-12-04T07:56:47.2723538Z  @User2,lf 2025-12-04T07:56:47.2723970Z  @User3,split_build 2025-12-04T07:56:47.2724431Z """ 2025-12-04T07:56:47.2724792Z  2025-12-04T07:56:47.2725140Z import json 2025-12-04T07:56:47.2725548Z import logging 2025-12-04T07:56:47.2725969Z import os 2025-12-04T07:56:47.2726362Z import random 2025-12-04T07:56:47.2726784Z import re 2025-12-04T07:56:47.2727172Z import sys 2025-12-04T07:56:47.2727943Z from argparse import ArgumentParser 2025-12-04T07:56:47.2728611Z from collections.abc import Iterable 2025-12-04T07:56:47.2729158Z from functools import cache 2025-12-04T07:56:47.2729670Z from logging import LogRecord 2025-12-04T07:56:47.2730208Z from typing import Any, NamedTuple 2025-12-04T07:56:47.2730794Z from urllib.request import Request, urlopen 2025-12-04T07:56:47.2731331Z  2025-12-04T07:56:47.2731681Z import yaml 2025-12-04T07:56:47.2732123Z from github import Auth, Github 2025-12-04T07:56:47.2732647Z from github.Issue import Issue 2025-12-04T07:56:47.2733134Z  2025-12-04T07:56:47.2733480Z  2025-12-04T07:56:47.2733924Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T07:56:47.2734657Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T07:56:47.2735542Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T07:56:47.2736241Z  2025-12-04T07:56:47.2736868Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T07:56:47.2737591Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T07:56:47.2738170Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T07:56:47.2738778Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T07:56:47.2739319Z  2025-12-04T07:56:47.2739728Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T07:56:47.2740246Z  2025-12-04T07:56:47.2740627Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T07:56:47.2741138Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T07:56:47.2741608Z  2025-12-04T07:56:47.2741959Z  2025-12-04T07:56:47.2742342Z class Experiment(NamedTuple): 2025-12-04T07:56:47.2742866Z  rollout_perc: float = ( 2025-12-04T07:56:47.2743567Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T07:56:47.2744242Z  ) 2025-12-04T07:56:47.2744643Z  all_branches: bool = ( 2025-12-04T07:56:47.2745328Z  False # If True, the experiment is also enabled on the exception branches 2025-12-04T07:56:47.2746004Z  ) 2025-12-04T07:56:47.2746396Z  default: bool = ( 2025-12-04T07:56:47.2747024Z  True # If True, the experiment is enabled by default for all queries 2025-12-04T07:56:47.2747767Z  ) 2025-12-04T07:56:47.2748142Z  2025-12-04T07:56:47.2748523Z  # Add more fields as needed 2025-12-04T07:56:47.2749005Z  2025-12-04T07:56:47.2749350Z  2025-12-04T07:56:47.2749731Z class Settings(NamedTuple): 2025-12-04T07:56:47.2750214Z  """ 2025-12-04T07:56:47.2750719Z  Settings for the experiments that can be opted into. 2025-12-04T07:56:47.2751297Z  """ 2025-12-04T07:56:47.2751666Z  2025-12-04T07:56:47.2752092Z  experiments: dict[str, Experiment] = {} 2025-12-04T07:56:47.2752625Z  2025-12-04T07:56:47.2753099Z  2025-12-04T07:56:47.2753546Z class ColorFormatter(logging.Formatter): 2025-12-04T07:56:47.2754219Z  """Color codes the log messages based on the log level""" 2025-12-04T07:56:47.2754815Z  2025-12-04T07:56:47.2755168Z  COLORS = { 2025-12-04T07:56:47.2755623Z  "WARNING": "\033[33m", # Yellow 2025-12-04T07:56:47.2756159Z  "ERROR": "\033[31m", # Red 2025-12-04T07:56:47.2756681Z  "CRITICAL": "\033[31m", # Red 2025-12-04T07:56:47.2757425Z  "INFO": "\033[0m", # Reset 2025-12-04T07:56:47.2757981Z  "DEBUG": "\033[0m", # Reset 2025-12-04T07:56:47.2758481Z  } 2025-12-04T07:56:47.2758847Z  2025-12-04T07:56:47.2759284Z  def format(self, record: LogRecord) -> str: 2025-12-04T07:56:47.2760055Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T07:56:47.2760852Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T07:56:47.2761456Z  return super().format(record) 2025-12-04T07:56:47.2761959Z  2025-12-04T07:56:47.2762306Z  2025-12-04T07:56:47.2762706Z handler = logging.StreamHandler() 2025-12-04T07:56:47.2763463Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T07:56:47.2764178Z  2025-12-04T07:56:47.2764661Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T07:56:47.2765275Z log.addHandler(handler) 2025-12-04T07:56:47.2765754Z log.setLevel(logging.INFO) 2025-12-04T07:56:47.2766222Z  2025-12-04T07:56:47.2766572Z  2025-12-04T07:56:47.2767055Z def set_github_output(key: str, value: str) -> None: 2025-12-04T07:56:47.2767741Z  """ 2025-12-04T07:56:47.2768302Z  Defines outputs of the github action that invokes this script 2025-12-04T07:56:47.2769110Z  """ 2025-12-04T07:56:47.2769509Z  if not GITHUB_OUTPUT: 2025-12-04T07:56:47.2770598Z  # 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.2771679Z  log.warning( 2025-12-04T07:56:47.2772560Z  "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.2773448Z  ) 2025-12-04T07:56:47.2773919Z  print(f"::set-output name={key}::{value}") 2025-12-04T07:56:47.2774474Z  return 2025-12-04T07:56:47.2774910Z  2025-12-04T07:56:47.2775319Z  with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T07:56:47.2775914Z  log.info(f"Setting output: {key}='{value}'") 2025-12-04T07:56:47.2776509Z  f.write(f"{key}={value}\n") 2025-12-04T07:56:47.2777005Z  2025-12-04T07:56:47.2777462Z  2025-12-04T07:56:47.2777989Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T07:56:47.2778648Z  return frozenset( 2025-12-04T07:56:47.2779314Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T07:56:47.2779994Z  ) 2025-12-04T07:56:47.2780365Z  2025-12-04T07:56:47.2780704Z  2025-12-04T07:56:47.2781080Z def parse_args() -> Any: 2025-12-04T07:56:47.2781689Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T07:56:47.2782567Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T07:56:47.2783327Z  parser.add_argument( 2025-12-04T07:56:47.2783815Z  "--github-issue-repo", 2025-12-04T07:56:47.2784319Z  type=str, 2025-12-04T07:56:47.2784764Z  required=False, 2025-12-04T07:56:47.2785396Z  default="pytorch/test-infra", 2025-12-04T07:56:47.2785977Z  help="GitHub repo to get the issue", 2025-12-04T07:56:47.2786496Z  ) 2025-12-04T07:56:47.2786890Z  parser.add_argument( 2025-12-04T07:56:47.2787488Z  "--github-repo", 2025-12-04T07:56:47.2787976Z  type=str, 2025-12-04T07:56:47.2788424Z  required=True, 2025-12-04T07:56:47.2788949Z  help="GitHub repo where CI is running", 2025-12-04T07:56:47.2789480Z  ) 2025-12-04T07:56:47.2789881Z  parser.add_argument( 2025-12-04T07:56:47.2790547Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T07:56:47.2791215Z  ) 2025-12-04T07:56:47.2791620Z  parser.add_argument( 2025-12-04T07:56:47.2792291Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T07:56:47.2792983Z  ) 2025-12-04T07:56:47.2793372Z  parser.add_argument( 2025-12-04T07:56:47.2794057Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T07:56:47.2794741Z  ) 2025-12-04T07:56:47.2795144Z  parser.add_argument( 2025-12-04T07:56:47.2795861Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T07:56:47.2796568Z  ) 2025-12-04T07:56:47.2796966Z  parser.add_argument( 2025-12-04T07:56:47.2797698Z  "--github-ref-type", 2025-12-04T07:56:47.2798202Z  type=str, 2025-12-04T07:56:47.2798651Z  required=True, 2025-12-04T07:56:47.2799207Z  help="Current GitHub ref type, branch or tag", 2025-12-04T07:56:47.2799767Z  ) 2025-12-04T07:56:47.2800160Z  parser.add_argument( 2025-12-04T07:56:47.2800811Z  "--eligible-experiments", 2025-12-04T07:56:47.2801373Z  type=_str_comma_separated_to_set, 2025-12-04T07:56:47.2801907Z  required=False, 2025-12-04T07:56:47.2802378Z  default="", 2025-12-04T07:56:47.2803266Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T07:56:47.2804164Z  ) 2025-12-04T07:56:47.2804557Z  parser.add_argument( 2025-12-04T07:56:47.2805057Z  "--opt-out-experiments", 2025-12-04T07:56:47.2805600Z  type=_str_comma_separated_to_set, 2025-12-04T07:56:47.2806131Z  required=False, 2025-12-04T07:56:47.2806602Z  default="", 2025-12-04T07:56:47.2807039Z  help=( 2025-12-04T07:56:47.2808119Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T07:56:47.2809251Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T07:56:47.2810064Z  ), 2025-12-04T07:56:47.2810451Z  ) 2025-12-04T07:56:47.2810846Z  parser.add_argument( 2025-12-04T07:56:47.2811321Z  "--pr-number", 2025-12-04T07:56:47.2811780Z  type=str, 2025-12-04T07:56:47.2812226Z  required=False, 2025-12-04T07:56:47.2812697Z  default="", 2025-12-04T07:56:47.2813239Z  help="the optional PR number where this is run", 2025-12-04T07:56:47.2813797Z  ) 2025-12-04T07:56:47.2814161Z  2025-12-04T07:56:47.2814558Z  return parser.parse_args() 2025-12-04T07:56:47.2815040Z  2025-12-04T07:56:47.2815390Z  2025-12-04T07:56:47.2816001Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.2816907Z  auth = Auth.Token(github_token) 2025-12-04T07:56:47.2817558Z  return Github(auth=auth) 2025-12-04T07:56:47.2818036Z  2025-12-04T07:56:47.2818386Z  2025-12-04T07:56:47.2819049Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.2819846Z  repo = gh.get_repo(repo) 2025-12-04T07:56:47.2820401Z  return repo.get_issue(number=issue_num) 2025-12-04T07:56:47.2820932Z  2025-12-04T07:56:47.2821275Z  2025-12-04T07:56:47.2821662Z def get_potential_pr_author( 2025-12-04T07:56:47.2822355Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T07:56:47.2823023Z ) -> str: 2025-12-04T07:56:47.2823579Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T07:56:47.2824395Z  # Fetch the actual username from the original PR. The PR number is 2025-12-04T07:56:47.2825178Z  # embedded in the tag name: ciflow// 2025-12-04T07:56:47.2825755Z  2025-12-04T07:56:47.2826159Z  gh = get_gh_client(github_token) 2025-12-04T07:56:47.2826659Z  2025-12-04T07:56:47.2827141Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T07:56:47.2827894Z  split_tag = ref_name.split("/") 2025-12-04T07:56:47.2828407Z  if ( 2025-12-04T07:56:47.2828834Z  len(split_tag) == 3 2025-12-04T07:56:47.2829361Z  and split_tag[0] == "ciflow" 2025-12-04T07:56:47.2829933Z  and split_tag[2].isnumeric() 2025-12-04T07:56:47.2830447Z  ): 2025-12-04T07:56:47.2830880Z  pr_number = split_tag[2] 2025-12-04T07:56:47.2831395Z  try: 2025-12-04T07:56:47.2831867Z  repository = gh.get_repo(repo) 2025-12-04T07:56:47.2832667Z  pull = repository.get_pull(number=int(pr_number)) 2025-12-04T07:56:47.2833297Z  except Exception as e: 2025-12-04T07:56:47.2833855Z  raise Exception( # noqa: TRY002 2025-12-04T07:56:47.2834548Z  f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T07:56:47.2835196Z  ) from e 2025-12-04T07:56:47.2835785Z  return pull.user.login # type: ignore[no-any-return] 2025-12-04T07:56:47.2836509Z  # In all other cases, return the original input username 2025-12-04T07:56:47.2837115Z  return username 2025-12-04T07:56:47.2837785Z  2025-12-04T07:56:47.2838138Z  2025-12-04T07:56:47.2838577Z def is_exception_branch(branch: str) -> bool: 2025-12-04T07:56:47.2839121Z  """ 2025-12-04T07:56:47.2839807Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T07:56:47.2840585Z  """ 2025-12-04T07:56:47.2841179Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T07:56:47.2841840Z  2025-12-04T07:56:47.2842191Z  2025-12-04T07:56:47.2842590Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T07:56:47.2843105Z  try: 2025-12-04T07:56:47.2843536Z  data = yaml.safe_load(yaml_text) 2025-12-04T07:56:47.2844060Z  return data 2025-12-04T07:56:47.2844521Z  except yaml.YAMLError: 2025-12-04T07:56:47.2845051Z  log.exception("Error loading YAML") 2025-12-04T07:56:47.2845580Z  raise 2025-12-04T07:56:47.2845974Z  2025-12-04T07:56:47.2846320Z  2025-12-04T07:56:47.2846945Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T07:56:47.2847789Z  """ 2025-12-04T07:56:47.2848582Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T07:56:47.2849317Z  2025-12-04T07:56:47.2849867Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.2850636Z  and the text below is the list of opted in users. 2025-12-04T07:56:47.2851199Z  2025-12-04T07:56:47.2851776Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T07:56:47.2852468Z  """ 2025-12-04T07:56:47.2852946Z  rollout_state_parts = rollout_state.split("---") 2025-12-04T07:56:47.2853553Z  if len(rollout_state_parts) >= 2: 2025-12-04T07:56:47.2854195Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T07:56:47.2854788Z  else: 2025-12-04T07:56:47.2855201Z  return "", rollout_state 2025-12-04T07:56:47.2855922Z  2025-12-04T07:56:47.2856270Z  2025-12-04T07:56:47.2856675Z class UserOptins(dict[str, list[str]]): 2025-12-04T07:56:47.2857186Z  """ 2025-12-04T07:56:47.2857842Z  Dictionary of users with a list of features they have opted into 2025-12-04T07:56:47.2858477Z  """ 2025-12-04T07:56:47.2858840Z  2025-12-04T07:56:47.2859169Z  2025-12-04T07:56:47.2859708Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T07:56:47.2860356Z  """ 2025-12-04T07:56:47.2861083Z  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.2861898Z  2025-12-04T07:56:47.2862676Z  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.2863649Z  - Example line: "@User1,lf,split_build" 2025-12-04T07:56:47.2864485Z  - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T07:56:47.2865109Z  2025-12-04T07:56:47.2865445Z  2025-12-04T07:56:47.2865780Z  """ 2025-12-04T07:56:47.2866171Z  optins = UserOptins() 2025-12-04T07:56:47.2866693Z  for user in user_optin_text.split("\n"): 2025-12-04T07:56:47.2867362Z  user = user.strip("\r\n\t -") 2025-12-04T07:56:47.2867934Z  if not user or not user.startswith("@"): 2025-12-04T07:56:47.2868508Z  # Not a valid user. Skip 2025-12-04T07:56:47.2869003Z  continue 2025-12-04T07:56:47.2869421Z  2025-12-04T07:56:47.2869765Z  if user: 2025-12-04T07:56:47.2870273Z  usr_name = user.split(",")[0].strip("@") 2025-12-04T07:56:47.2870985Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T07:56:47.2871608Z  2025-12-04T07:56:47.2871971Z  return optins 2025-12-04T07:56:47.2872385Z  2025-12-04T07:56:47.2872724Z  2025-12-04T07:56:47.2873220Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T07:56:47.2873823Z  """ 2025-12-04T07:56:47.2874254Z  Check if the experiment name is valid. 2025-12-04T07:56:47.2874776Z  A valid name: 2025-12-04T07:56:47.2875483Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T07:56:47.2876403Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T07:56:47.2877109Z  - Cannot contain spaces 2025-12-04T07:56:47.2877826Z  """ 2025-12-04T07:56:47.2878190Z  2025-12-04T07:56:47.2878657Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T07:56:47.2879367Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T07:56:47.2880100Z  2025-12-04T07:56:47.2880452Z  if valid: 2025-12-04T07:56:47.2880864Z  return True 2025-12-04T07:56:47.2881294Z  2025-12-04T07:56:47.2881642Z  log.error( 2025-12-04T07:56:47.2883037Z  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.2884487Z  ) 2025-12-04T07:56:47.2884861Z  return False 2025-12-04T07:56:47.2885274Z  2025-12-04T07:56:47.2885614Z  2025-12-04T07:56:47.2886122Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T07:56:47.2886747Z  """ 2025-12-04T07:56:47.2888126Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T07:56:47.2888848Z  """ 2025-12-04T07:56:47.2889216Z  try: 2025-12-04T07:56:47.2889604Z  if settings_text: 2025-12-04T07:56:47.2890349Z  # 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.2891116Z  # for easy reading 2025-12-04T07:56:47.2891967Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T07:56:47.2892854Z  # the backtick character in shell commands. 2025-12-04T07:56:47.2893471Z  backtick = chr(96) # backtick character 2025-12-04T07:56:47.2894152Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T07:56:47.2894822Z  settings = load_yaml(settings_text) 2025-12-04T07:56:47.2895331Z  2025-12-04T07:56:47.2895931Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T07:56:47.2896831Z  experiments = {} 2025-12-04T07:56:47.2897397Z  2025-12-04T07:56:47.2897961Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T07:56:47.2898725Z  if not is_valid_experiment_name(exp_name): 2025-12-04T07:56:47.2899808Z  # 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.2900800Z  continue 2025-12-04T07:56:47.2901249Z  2025-12-04T07:56:47.2901631Z  valid_settings = {} 2025-12-04T07:56:47.2902172Z  for setting in exp_settings: 2025-12-04T07:56:47.2902751Z  if setting not in Experiment._fields: 2025-12-04T07:56:47.2903319Z  log.warning( 2025-12-04T07:56:47.2904048Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T07:56:47.2904739Z  ) 2025-12-04T07:56:47.2905195Z  else: 2025-12-04T07:56:47.2905743Z  valid_settings[setting] = exp_settings[setting] 2025-12-04T07:56:47.2906312Z  2025-12-04T07:56:47.2906786Z  experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T07:56:47.2907636Z  return Settings(experiments) 2025-12-04T07:56:47.2908144Z  2025-12-04T07:56:47.2908505Z  except Exception: 2025-12-04T07:56:47.2909036Z  log.exception("Failed to parse settings") 2025-12-04T07:56:47.2909572Z  2025-12-04T07:56:47.2909932Z  return Settings() 2025-12-04T07:56:47.2910358Z  2025-12-04T07:56:47.2910693Z  2025-12-04T07:56:47.2911289Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T07:56:47.2911869Z  """ 2025-12-04T07:56:47.2912338Z  Parse settings, if any, from the rollout state. 2025-12-04T07:56:47.2912887Z  2025-12-04T07:56:47.2913424Z  If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.2914179Z  and the text below is the list of opted in users. 2025-12-04T07:56:47.2914732Z  2025-12-04T07:56:47.2915320Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T07:56:47.2916029Z  """ 2025-12-04T07:56:47.2916602Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.2917480Z  return parse_settings_from_text(settings_text) 2025-12-04T07:56:47.2918026Z  2025-12-04T07:56:47.2918355Z  2025-12-04T07:56:47.2918818Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T07:56:47.2919373Z  """ 2025-12-04T07:56:47.2919796Z  Parse users from the rollout state. 2025-12-04T07:56:47.2920303Z  2025-12-04T07:56:47.2920636Z  """ 2025-12-04T07:56:47.2921202Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.2921944Z  return parse_user_opt_in_from_text(users_text) 2025-12-04T07:56:47.2922491Z  2025-12-04T07:56:47.2922820Z  2025-12-04T07:56:47.2923436Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.2924157Z  """ 2025-12-04T07:56:47.2924608Z  Check if a user is opted into an experiment 2025-12-04T07:56:47.2925138Z  """ 2025-12-04T07:56:47.2925623Z  return experiment_name in user_optins.get(user, []) 2025-12-04T07:56:47.2926193Z  2025-12-04T07:56:47.2926655Z  2025-12-04T07:56:47.2927393Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.2928129Z  """ 2025-12-04T07:56:47.2928623Z  Check if a user explicitly opted out of an experiment 2025-12-04T07:56:47.2929198Z  """ 2025-12-04T07:56:47.2929727Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T07:56:47.2930430Z  experiment_optout = "-" + experiment_name 2025-12-04T07:56:47.2931083Z  if experiment_optout not in user_optins.get(user, []): 2025-12-04T07:56:47.2931686Z  return False 2025-12-04T07:56:47.2932103Z  2025-12-04T07:56:47.2932577Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T07:56:47.2933183Z  log.warning( 2025-12-04T07:56:47.2934000Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T07:56:47.2934845Z  ) 2025-12-04T07:56:47.2935212Z  2025-12-04T07:56:47.2935569Z  return True 2025-12-04T07:56:47.2935968Z  2025-12-04T07:56:47.2936307Z  2025-12-04T07:56:47.2936662Z def get_runner_prefix( 2025-12-04T07:56:47.2937129Z  rollout_state: str, 2025-12-04T07:56:47.2937736Z  workflow_requestors: Iterable[str], 2025-12-04T07:56:47.2938253Z  branch: str, 2025-12-04T07:56:47.2938801Z  eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.2939484Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.2940079Z  is_canary: bool = False, 2025-12-04T07:56:47.2940544Z ) -> str: 2025-12-04T07:56:47.2940994Z  settings = parse_settings(rollout_state) 2025-12-04T07:56:47.2941592Z  user_optins = parse_users(rollout_state) 2025-12-04T07:56:47.2942111Z  2025-12-04T07:56:47.2942594Z  fleet_prefix = "" 2025-12-04T07:56:47.2943048Z  prefixes = [] 2025-12-04T07:56:47.2943712Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T07:56:47.2944631Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T07:56:47.2945332Z  log.info( 2025-12-04T07:56:47.2946033Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T07:56:47.2946760Z  ) 2025-12-04T07:56:47.2947181Z  continue 2025-12-04T07:56:47.2947703Z  2025-12-04T07:56:47.2948081Z  if opt_out_experiments: 2025-12-04T07:56:47.2948645Z  if experiment_name in opt_out_experiments: 2025-12-04T07:56:47.2949304Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T07:56:47.2949892Z  log.info( 2025-12-04T07:56:47.2950813Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T07:56:47.2951748Z  ) 2025-12-04T07:56:47.2952169Z  continue 2025-12-04T07:56:47.2952640Z  2025-12-04T07:56:47.2953016Z  if eligible_experiments: 2025-12-04T07:56:47.2953606Z  if experiment_name not in eligible_experiments: 2025-12-04T07:56:47.2954248Z  exp_list = ", ".join(eligible_experiments) 2025-12-04T07:56:47.2954796Z  log.info( 2025-12-04T07:56:47.2955590Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T07:56:47.2956383Z  ) 2025-12-04T07:56:47.2956811Z  continue 2025-12-04T07:56:47.2957567Z  elif not experiment_settings.default: 2025-12-04T07:56:47.2958093Z  log.info( 2025-12-04T07:56:47.2958775Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T07:56:47.2959489Z  ) 2025-12-04T07:56:47.2959899Z  continue 2025-12-04T07:56:47.2960316Z  2025-12-04T07:56:47.2960789Z  # Is any workflow_requestor opted out to this experiment? 2025-12-04T07:56:47.2961397Z  opted_out_users = [ 2025-12-04T07:56:47.2961882Z  requestor 2025-12-04T07:56:47.2962389Z  for requestor in workflow_requestors 2025-12-04T07:56:47.2963065Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.2963684Z  ] 2025-12-04T07:56:47.2964056Z  2025-12-04T07:56:47.2964426Z  if opted_out_users: 2025-12-04T07:56:47.2964900Z  log.info( 2025-12-04T07:56:47.2965558Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T07:56:47.2966231Z  ) 2025-12-04T07:56:47.2966629Z  continue 2025-12-04T07:56:47.2967045Z  2025-12-04T07:56:47.2967615Z  # Is any workflow_requestor opted in to this experiment? 2025-12-04T07:56:47.2968232Z  opted_in_users = [ 2025-12-04T07:56:47.2968697Z  requestor 2025-12-04T07:56:47.2969200Z  for requestor in workflow_requestors 2025-12-04T07:56:47.2969871Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.2970477Z  ] 2025-12-04T07:56:47.2970852Z  2025-12-04T07:56:47.2971204Z  enabled = False 2025-12-04T07:56:47.2971677Z  if opted_in_users: 2025-12-04T07:56:47.2972258Z  log.info( 2025-12-04T07:56:47.2972904Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T07:56:47.2973563Z  ) 2025-12-04T07:56:47.2973976Z  enabled = True 2025-12-04T07:56:47.2974430Z  2025-12-04T07:56:47.2974842Z  elif experiment_settings.rollout_perc: 2025-12-04T07:56:47.2975704Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T07:56:47.2976614Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T07:56:47.2977347Z  log.info( 2025-12-04T07:56:47.2978240Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T07:56:47.2979114Z  ) 2025-12-04T07:56:47.2979561Z  enabled = True 2025-12-04T07:56:47.2980027Z  2025-12-04T07:56:47.2980379Z  if enabled: 2025-12-04T07:56:47.2980835Z  label = experiment_name 2025-12-04T07:56:47.2981409Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T07:56:47.2982225Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T07:56:47.2983072Z  # - If it's enabled, then we always list it's prefix first 2025-12-04T07:56:47.2983825Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T07:56:47.2984472Z  if is_canary: 2025-12-04T07:56:47.2984991Z  label += CANARY_FLEET_SUFFIX 2025-12-04T07:56:47.2985541Z  fleet_prefix = label 2025-12-04T07:56:47.2986034Z  else: 2025-12-04T07:56:47.2986632Z  prefixes.append(label) 2025-12-04T07:56:47.2987134Z  2025-12-04T07:56:47.2987690Z  if len(prefixes) > 1: 2025-12-04T07:56:47.2988157Z  log.error( 2025-12-04T07:56:47.2989190Z  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.2990234Z  ) 2025-12-04T07:56:47.2990641Z  prefixes = prefixes[:1] 2025-12-04T07:56:47.2991121Z  2025-12-04T07:56:47.2991490Z  # Fleet always comes first 2025-12-04T07:56:47.2991987Z  if fleet_prefix: 2025-12-04T07:56:47.2992463Z  prefixes.insert(0, fleet_prefix) 2025-12-04T07:56:47.2992970Z  2025-12-04T07:56:47.2993417Z  return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T07:56:47.2993974Z  2025-12-04T07:56:47.2994316Z  2025-12-04T07:56:47.2994945Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T07:56:47.2995696Z  """ 2025-12-04T07:56:47.2996289Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T07:56:47.2996981Z  2025-12-04T07:56:47.2997652Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T07:56:47.2998346Z  """ 2025-12-04T07:56:47.2998761Z  gh = get_gh_client(github_token) 2025-12-04T07:56:47.2999310Z  issue = get_issue(gh, repo, issue_num) 2025-12-04T07:56:47.2999970Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T07:56:47.3000550Z  2025-12-04T07:56:47.3000887Z  2025-12-04T07:56:47.3001473Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T07:56:47.3002346Z  for _ in range(num_retries): 2025-12-04T07:56:47.3002841Z  try: 2025-12-04T07:56:47.3003304Z  req = Request(url=url, headers=headers) 2025-12-04T07:56:47.3003969Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T07:56:47.3004613Z  return json.loads(content) 2025-12-04T07:56:47.3005146Z  except Exception as e: 2025-12-04T07:56:47.3005714Z  log.warning(f"Could not download {url}: {e}") 2025-12-04T07:56:47.3006256Z  2025-12-04T07:56:47.3006835Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T07:56:47.3007640Z  return {} 2025-12-04T07:56:47.3008040Z  2025-12-04T07:56:47.3008371Z  2025-12-04T07:56:47.3008714Z @cache 2025-12-04T07:56:47.3009355Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T07:56:47.3010090Z  """ 2025-12-04T07:56:47.3010501Z  Dynamically get PR information 2025-12-04T07:56:47.3011003Z  """ 2025-12-04T07:56:47.3011523Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T07:56:47.3012139Z  headers = { 2025-12-04T07:56:47.3012646Z  "Accept": "application/vnd.github.v3+json", 2025-12-04T07:56:47.3013263Z  "Authorization": f"token {github_token}", 2025-12-04T07:56:47.3013792Z  } 2025-12-04T07:56:47.3014248Z  json_response: dict[str, Any] = download_json( 2025-12-04T07:56:47.3014865Z  url=f"{github_api}/issues/{pr_number}", 2025-12-04T07:56:47.3015410Z  headers=headers, 2025-12-04T07:56:47.3015853Z  ) 2025-12-04T07:56:47.3016212Z  2025-12-04T07:56:47.3016574Z  if not json_response: 2025-12-04T07:56:47.3017180Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T07:56:47.3018062Z  return {} 2025-12-04T07:56:47.3018477Z  2025-12-04T07:56:47.3018828Z  return json_response 2025-12-04T07:56:47.3019272Z  2025-12-04T07:56:47.3019595Z  2025-12-04T07:56:47.3020179Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T07:56:47.3020876Z  """ 2025-12-04T07:56:47.3021415Z  Dynamically get the latest list of labels from the pull request 2025-12-04T07:56:47.3022053Z  """ 2025-12-04T07:56:47.3022546Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T07:56:47.3023146Z  return { 2025-12-04T07:56:47.3023741Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T07:56:47.3024409Z  } 2025-12-04T07:56:47.3024763Z  2025-12-04T07:56:47.3025097Z  2025-12-04T07:56:47.3025461Z def main() -> None: 2025-12-04T07:56:47.3025911Z  args = parse_args() 2025-12-04T07:56:47.3026364Z  2025-12-04T07:56:47.3026782Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T07:56:47.3027413Z  2025-12-04T07:56:47.3027791Z  # Check if the PR is opt-out 2025-12-04T07:56:47.3028296Z  if args.pr_number: 2025-12-04T07:56:47.3028983Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T07:56:47.3029716Z  if OPT_OUT_LABEL in labels: 2025-12-04T07:56:47.3030221Z  log.info( 2025-12-04T07:56:47.3030939Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T07:56:47.3031676Z  ) 2025-12-04T07:56:47.3032250Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3032909Z  sys.exit() 2025-12-04T07:56:47.3033461Z  2025-12-04T07:56:47.3033804Z  try: 2025-12-04T07:56:47.3034271Z  rollout_state = get_rollout_state_from_issue( 2025-12-04T07:56:47.3034979Z  args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T07:56:47.3035605Z  ) 2025-12-04T07:56:47.3035978Z  2025-12-04T07:56:47.3036379Z  username = get_potential_pr_author( 2025-12-04T07:56:47.3036930Z  args.github_token, 2025-12-04T07:56:47.3037531Z  args.github_repo, 2025-12-04T07:56:47.3038032Z  args.github_actor, 2025-12-04T07:56:47.3038532Z  args.github_ref_type, 2025-12-04T07:56:47.3039051Z  args.github_branch, 2025-12-04T07:56:47.3039524Z  ) 2025-12-04T07:56:47.3039897Z  2025-12-04T07:56:47.3040376Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T07:56:47.3040974Z  2025-12-04T07:56:47.3041392Z  runner_label_prefix = get_runner_prefix( 2025-12-04T07:56:47.3041942Z  rollout_state, 2025-12-04T07:56:47.3042467Z  (args.github_issue_owner, username), 2025-12-04T07:56:47.3043012Z  args.github_branch, 2025-12-04T07:56:47.3043539Z  args.eligible_experiments, 2025-12-04T07:56:47.3044085Z  args.opt_out_experiments, 2025-12-04T07:56:47.3044599Z  is_canary, 2025-12-04T07:56:47.3045038Z  ) 2025-12-04T07:56:47.3045413Z  2025-12-04T07:56:47.3045787Z  except Exception as e: 2025-12-04T07:56:47.3046261Z  log.error( 2025-12-04T07:56:47.3046957Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T07:56:47.3047806Z  ) 2025-12-04T07:56:47.3048312Z  2025-12-04T07:56:47.3048835Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3049471Z  2025-12-04T07:56:47.3049808Z  2025-12-04T07:56:47.3050160Z if __name__ == "__main__": 2025-12-04T07:56:47.3050629Z  main() 2025-12-04T07:56:47.3051007Z  2025-12-04T07:56:47.3051346Z EOF 2025-12-04T07:56:47.3051695Z  2025-12-04T07:56:47.3052071Z cat runner_determinator.py 2025-12-04T07:56:47.3418165Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:47.3419069Z env: 2025-12-04T07:56:47.3419779Z GITHUB_TOKEN: *** 2025-12-04T07:56:47.3420218Z ISSUE_NUMBER: 5132 2025-12-04T07:56:47.3420698Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:47.3421265Z ISSUE_OWNER: 2025-12-04T07:56:47.3421709Z CHECK_EXPERIMENTS: 2025-12-04T07:56:47.3422170Z OPT_OUT_EXPERIMENTS: lf 2025-12-04T07:56:47.3422638Z PR_NUMBER: 2025-12-04T07:56:47.3423057Z ##[endgroup] 2025-12-04T07:56:47.3628535Z # flake8: noqa: G004 2025-12-04T07:56:47.3628849Z 2025-12-04T07:56:47.3629261Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-12-04T07:56:47.3630160Z # must be kept in sync. You can do it easily by running the following command: 2025-12-04T07:56:47.3630922Z # python .github/scripts/update_runner_determinator.py 2025-12-04T07:56:47.3631330Z 2025-12-04T07:56:47.3631481Z """ 2025-12-04T07:56:47.3632026Z This runner determinator is used to determine which set of runners to run a 2025-12-04T07:56:47.3632841Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-12-04T07:56:47.3633702Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-12-04T07:56:47.3634458Z of which runners should be used to run which job. 2025-12-04T07:56:47.3634836Z 2025-12-04T07:56:47.3635208Z The configuration has two parts, the settings and a list of opted-in users, 2025-12-04T07:56:47.3636234Z separated by a line containing "---". If the line is not present, the 2025-12-04T07:56:47.3637065Z settings are considered to be empty with only the second part, the user 2025-12-04T07:56:47.3637976Z list, defined. 2025-12-04T07:56:47.3638192Z 2025-12-04T07:56:47.3638539Z The first part is a YAML block that defines the rollout settings. This can be 2025-12-04T07:56:47.3639398Z used to define any settings that are needed to determine which runners to use. 2025-12-04T07:56:47.3640170Z It's fields are defined by the RolloutSettings class below. 2025-12-04T07:56:47.3640590Z 2025-12-04T07:56:47.3640940Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-12-04T07:56:47.3641753Z The user list is also a comma separated list of additional features or 2025-12-04T07:56:47.3642435Z experiments which the user could be opted in to. 2025-12-04T07:56:47.3642816Z 2025-12-04T07:56:47.3643008Z The user list has the following rules: 2025-12-04T07:56:47.3643333Z 2025-12-04T07:56:47.3643639Z - Users are GitHub usernames, which must start with the @ prefix 2025-12-04T07:56:47.3644442Z - Each user is also a comma-separated list of features/experiments to enable 2025-12-04T07:56:47.3645144Z - A "#" prefix opts the user out of all experiments 2025-12-04T07:56:47.3645514Z 2025-12-04T07:56:47.3645682Z Example config: 2025-12-04T07:56:47.3646123Z # A list of experiments that can be opted into. 2025-12-04T07:56:47.3646757Z # This defines the behavior they'll induce when opted into. 2025-12-04T07:56:47.3647543Z # Expected syntax is: 2025-12-04T07:56:47.3648154Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-12-04T07:56:47.3649078Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-12-04T07:56:47.3649641Z 2025-12-04T07:56:47.3649808Z experiments: 2025-12-04T07:56:47.3650163Z lf: 2025-12-04T07:56:47.3650518Z rollout_percent: 25 2025-12-04T07:56:47.3651155Z all_branches: false 2025-12-04T07:56:47.3651636Z default: true 2025-12-04T07:56:47.3652016Z --- 2025-12-04T07:56:47.3652208Z 2025-12-04T07:56:47.3652366Z # Opt-ins: 2025-12-04T07:56:47.3652904Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-12-04T07:56:47.3653712Z # and specifying experiments to enable in a comma-separated list. 2025-12-04T07:56:47.3654426Z # To always opt out of an experiment, prefix it with a "-". 2025-12-04T07:56:47.3655030Z # Experiments should be from the above list. 2025-12-04T07:56:47.3655381Z 2025-12-04T07:56:47.3655561Z @User1,-lf,split_build 2025-12-04T07:56:47.3655968Z @User2,lf 2025-12-04T07:56:47.3656329Z @User3,split_build 2025-12-04T07:56:47.3656707Z """ 2025-12-04T07:56:47.3656891Z 2025-12-04T07:56:47.3657042Z import json 2025-12-04T07:56:47.3657726Z import logging 2025-12-04T07:56:47.3658088Z import os 2025-12-04T07:56:47.3658427Z import random 2025-12-04T07:56:47.3658781Z import re 2025-12-04T07:56:47.3659127Z import sys 2025-12-04T07:56:47.3659502Z from argparse import ArgumentParser 2025-12-04T07:56:47.3660005Z from collections.abc import Iterable 2025-12-04T07:56:47.3660487Z from functools import cache 2025-12-04T07:56:47.3660927Z from logging import LogRecord 2025-12-04T07:56:47.3661387Z from typing import Any, NamedTuple 2025-12-04T07:56:47.3661889Z from urllib.request import Request, urlopen 2025-12-04T07:56:47.3662231Z 2025-12-04T07:56:47.3662391Z import yaml 2025-12-04T07:56:47.3662763Z from github import Auth, Github 2025-12-04T07:56:47.3663216Z from github.Issue import Issue 2025-12-04T07:56:47.3663503Z 2025-12-04T07:56:47.3663509Z 2025-12-04T07:56:47.3663716Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-12-04T07:56:47.3664362Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-12-04T07:56:47.3665171Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-12-04T07:56:47.3665691Z 2025-12-04T07:56:47.3665907Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-12-04T07:56:47.3666589Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-12-04T07:56:47.3667081Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-12-04T07:56:47.3667895Z OPT_OUT_LABEL = "no-runner-experiments" 2025-12-04T07:56:47.3668227Z 2025-12-04T07:56:47.3668415Z SETTING_EXPERIMENTS = "experiments" 2025-12-04T07:56:47.3668724Z 2025-12-04T07:56:47.3668909Z LF_FLEET_EXPERIMENT = "lf" 2025-12-04T07:56:47.3669339Z CANARY_FLEET_SUFFIX = ".c" 2025-12-04T07:56:47.3669608Z 2025-12-04T07:56:47.3669615Z 2025-12-04T07:56:47.3669797Z class Experiment(NamedTuple): 2025-12-04T07:56:47.3670248Z rollout_perc: float = ( 2025-12-04T07:56:47.3670854Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-12-04T07:56:47.3671492Z ) 2025-12-04T07:56:47.3671831Z all_branches: bool = ( 2025-12-04T07:56:47.3672427Z False # If True, the experiment is also enabled on the exception branches 2025-12-04T07:56:47.3673057Z ) 2025-12-04T07:56:47.3673401Z default: bool = ( 2025-12-04T07:56:47.3673937Z True # If True, the experiment is enabled by default for all queries 2025-12-04T07:56:47.3674535Z ) 2025-12-04T07:56:47.3674717Z 2025-12-04T07:56:47.3674891Z # Add more fields as needed 2025-12-04T07:56:47.3675176Z 2025-12-04T07:56:47.3675182Z 2025-12-04T07:56:47.3675361Z class Settings(NamedTuple): 2025-12-04T07:56:47.3675773Z """ 2025-12-04T07:56:47.3676193Z Settings for the experiments that can be opted into. 2025-12-04T07:56:47.3676729Z """ 2025-12-04T07:56:47.3676908Z 2025-12-04T07:56:47.3677108Z experiments: dict[str, Experiment] = {} 2025-12-04T07:56:47.3677646Z 2025-12-04T07:56:47.3677652Z 2025-12-04T07:56:47.3677859Z class ColorFormatter(logging.Formatter): 2025-12-04T07:56:47.3678446Z """Color codes the log messages based on the log level""" 2025-12-04T07:56:47.3678855Z 2025-12-04T07:56:47.3679010Z COLORS = { 2025-12-04T07:56:47.3679387Z "WARNING": "\033[33m", # Yellow 2025-12-04T07:56:47.3680007Z "ERROR": "\033[31m", # Red 2025-12-04T07:56:47.3680480Z "CRITICAL": "\033[31m", # Red 2025-12-04T07:56:47.3680952Z "INFO": "\033[0m", # Reset 2025-12-04T07:56:47.3681411Z "DEBUG": "\033[0m", # Reset 2025-12-04T07:56:47.3681844Z } 2025-12-04T07:56:47.3682027Z 2025-12-04T07:56:47.3682238Z def format(self, record: LogRecord) -> str: 2025-12-04T07:56:47.3682942Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-12-04T07:56:47.3683681Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-12-04T07:56:47.3684233Z return super().format(record) 2025-12-04T07:56:47.3684544Z 2025-12-04T07:56:47.3684551Z 2025-12-04T07:56:47.3684738Z handler = logging.StreamHandler() 2025-12-04T07:56:47.3685394Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-12-04T07:56:47.3685905Z 2025-12-04T07:56:47.3686136Z log = logging.getLogger(os.path.basename(__file__)) 2025-12-04T07:56:47.3686682Z log.addHandler(handler) 2025-12-04T07:56:47.3687105Z log.setLevel(logging.INFO) 2025-12-04T07:56:47.3687606Z 2025-12-04T07:56:47.3687613Z 2025-12-04T07:56:47.3687849Z def set_github_output(key: str, value: str) -> None: 2025-12-04T07:56:47.3688381Z """ 2025-12-04T07:56:47.3688848Z Defines outputs of the github action that invokes this script 2025-12-04T07:56:47.3689436Z """ 2025-12-04T07:56:47.3689780Z if not GITHUB_OUTPUT: 2025-12-04T07:56:47.3690775Z # 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.3691799Z log.warning( 2025-12-04T07:56:47.3692590Z "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.3693441Z ) 2025-12-04T07:56:47.3703321Z print(f"::set-output name={key}::{value}") 2025-12-04T07:56:47.3703907Z return 2025-12-04T07:56:47.3704121Z 2025-12-04T07:56:47.3704503Z with open(GITHUB_OUTPUT, "a") as f: 2025-12-04T07:56:47.3705071Z log.info(f"Setting output: {key}='{value}'") 2025-12-04T07:56:47.3705607Z f.write(f"{key}={value}\n") 2025-12-04T07:56:47.3705915Z 2025-12-04T07:56:47.3705922Z 2025-12-04T07:56:47.3706209Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-12-04T07:56:47.3706799Z return frozenset( 2025-12-04T07:56:47.3707628Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-12-04T07:56:47.3708278Z ) 2025-12-04T07:56:47.3708460Z 2025-12-04T07:56:47.3708467Z 2025-12-04T07:56:47.3708638Z def parse_args() -> Any: 2025-12-04T07:56:47.3709163Z parser = ArgumentParser("Get dynamic rollout settings") 2025-12-04T07:56:47.3709982Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-12-04T07:56:47.3710716Z parser.add_argument( 2025-12-04T07:56:47.3711149Z "--github-issue-repo", 2025-12-04T07:56:47.3711591Z type=str, 2025-12-04T07:56:47.3711978Z required=False, 2025-12-04T07:56:47.3712399Z default="pytorch/test-infra", 2025-12-04T07:56:47.3712911Z help="GitHub repo to get the issue", 2025-12-04T07:56:47.3713388Z ) 2025-12-04T07:56:47.3713742Z parser.add_argument( 2025-12-04T07:56:47.3714153Z "--github-repo", 2025-12-04T07:56:47.3714556Z type=str, 2025-12-04T07:56:47.3714919Z required=True, 2025-12-04T07:56:47.3715360Z help="GitHub repo where CI is running", 2025-12-04T07:56:47.3715851Z ) 2025-12-04T07:56:47.3716193Z parser.add_argument( 2025-12-04T07:56:47.3716760Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-12-04T07:56:47.3717560Z ) 2025-12-04T07:56:47.3717902Z parser.add_argument( 2025-12-04T07:56:47.3718481Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-12-04T07:56:47.3769377Z ) 2025-12-04T07:56:47.3770106Z parser.add_argument( 2025-12-04T07:56:47.3771317Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-12-04T07:56:47.3771996Z ) 2025-12-04T07:56:47.3772353Z parser.add_argument( 2025-12-04T07:56:47.3772990Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-12-04T07:56:47.3773662Z ) 2025-12-04T07:56:47.3774007Z parser.add_argument( 2025-12-04T07:56:47.3774437Z "--github-ref-type", 2025-12-04T07:56:47.3774855Z type=str, 2025-12-04T07:56:47.3775228Z required=True, 2025-12-04T07:56:47.3775680Z help="Current GitHub ref type, branch or tag", 2025-12-04T07:56:47.3776194Z ) 2025-12-04T07:56:47.3776544Z parser.add_argument( 2025-12-04T07:56:47.3776969Z "--eligible-experiments", 2025-12-04T07:56:47.3777717Z type=_str_comma_separated_to_set, 2025-12-04T07:56:47.3778211Z required=False, 2025-12-04T07:56:47.3778613Z default="", 2025-12-04T07:56:47.3779407Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-12-04T07:56:47.3780265Z ) 2025-12-04T07:56:47.3780599Z parser.add_argument( 2025-12-04T07:56:47.3781030Z "--opt-out-experiments", 2025-12-04T07:56:47.3781494Z type=_str_comma_separated_to_set, 2025-12-04T07:56:47.3781983Z required=False, 2025-12-04T07:56:47.3782374Z default="", 2025-12-04T07:56:47.3782738Z help=( 2025-12-04T07:56:47.3783372Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-12-04T07:56:47.3784436Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-12-04T07:56:47.3785217Z ), 2025-12-04T07:56:47.3785548Z ) 2025-12-04T07:56:47.3785893Z parser.add_argument( 2025-12-04T07:56:47.3786309Z "--pr-number", 2025-12-04T07:56:47.3786692Z type=str, 2025-12-04T07:56:47.3787649Z required=False, 2025-12-04T07:56:47.3788088Z default="", 2025-12-04T07:56:47.3788706Z help="the optional PR number where this is run", 2025-12-04T07:56:47.3789240Z ) 2025-12-04T07:56:47.3789426Z 2025-12-04T07:56:47.3789617Z return parser.parse_args() 2025-12-04T07:56:47.3789908Z 2025-12-04T07:56:47.3789915Z 2025-12-04T07:56:47.3790302Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.3791009Z auth = Auth.Token(github_token) 2025-12-04T07:56:47.3791481Z return Github(auth=auth) 2025-12-04T07:56:47.3791759Z 2025-12-04T07:56:47.3791766Z 2025-12-04T07:56:47.3792195Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-12-04T07:56:47.3792940Z repo = gh.get_repo(repo) 2025-12-04T07:56:47.3793410Z return repo.get_issue(number=issue_num) 2025-12-04T07:56:47.3793749Z 2025-12-04T07:56:47.3793755Z 2025-12-04T07:56:47.3793932Z def get_potential_pr_author( 2025-12-04T07:56:47.3794567Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-12-04T07:56:47.3795211Z ) -> str: 2025-12-04T07:56:47.3795705Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-12-04T07:56:47.3796466Z # Fetch the actual username from the original PR. The PR number is 2025-12-04T07:56:47.3797162Z # embedded in the tag name: ciflow// 2025-12-04T07:56:47.3797765Z 2025-12-04T07:56:47.3797947Z gh = get_gh_client(github_token) 2025-12-04T07:56:47.3798268Z 2025-12-04T07:56:47.3798526Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-12-04T07:56:47.3799110Z split_tag = ref_name.split("/") 2025-12-04T07:56:47.3799589Z if ( 2025-12-04T07:56:47.3799957Z len(split_tag) == 3 2025-12-04T07:56:47.3800413Z and split_tag[0] == "ciflow" 2025-12-04T07:56:47.3800945Z and split_tag[2].isnumeric() 2025-12-04T07:56:47.3801405Z ): 2025-12-04T07:56:47.3801771Z pr_number = split_tag[2] 2025-12-04T07:56:47.3802373Z try: 2025-12-04T07:56:47.3802781Z repository = gh.get_repo(repo) 2025-12-04T07:56:47.3803359Z pull = repository.get_pull(number=int(pr_number)) 2025-12-04T07:56:47.3803922Z except Exception as e: 2025-12-04T07:56:47.3804405Z raise Exception( # noqa: TRY002 2025-12-04T07:56:47.3805039Z f"issue with pull request {pr_number} from repo {repository}" 2025-12-04T07:56:47.3805643Z ) from e 2025-12-04T07:56:47.3806146Z return pull.user.login # type: ignore[no-any-return] 2025-12-04T07:56:47.3806800Z # In all other cases, return the original input username 2025-12-04T07:56:47.3807574Z return username 2025-12-04T07:56:47.3807804Z 2025-12-04T07:56:47.3807810Z 2025-12-04T07:56:47.3808025Z def is_exception_branch(branch: str) -> bool: 2025-12-04T07:56:47.3808524Z """ 2025-12-04T07:56:47.3809127Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-12-04T07:56:47.3809850Z """ 2025-12-04T07:56:47.3810363Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-12-04T07:56:47.3810843Z 2025-12-04T07:56:47.3810851Z 2025-12-04T07:56:47.3811044Z def load_yaml(yaml_text: str) -> Any: 2025-12-04T07:56:47.3811506Z try: 2025-12-04T07:56:47.3811870Z data = yaml.safe_load(yaml_text) 2025-12-04T07:56:47.3812346Z return data 2025-12-04T07:56:47.3812741Z except yaml.YAMLError: 2025-12-04T07:56:47.3813198Z log.exception("Error loading YAML") 2025-12-04T07:56:47.3813682Z raise 2025-12-04T07:56:47.3813884Z 2025-12-04T07:56:47.3813891Z 2025-12-04T07:56:47.3814292Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-12-04T07:56:47.3814969Z """ 2025-12-04T07:56:47.3815550Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-12-04T07:56:47.3816104Z 2025-12-04T07:56:47.3816565Z If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.3817474Z and the text below is the list of opted in users. 2025-12-04T07:56:47.3817862Z 2025-12-04T07:56:47.3818228Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-12-04T07:56:47.3818880Z """ 2025-12-04T07:56:47.3819301Z rollout_state_parts = rollout_state.split("---") 2025-12-04T07:56:47.3819858Z if len(rollout_state_parts) >= 2: 2025-12-04T07:56:47.3820422Z return rollout_state_parts[0], rollout_state_parts[1] 2025-12-04T07:56:47.3820967Z else: 2025-12-04T07:56:47.3821330Z return "", rollout_state 2025-12-04T07:56:47.3821616Z 2025-12-04T07:56:47.3821623Z 2025-12-04T07:56:47.3821817Z class UserOptins(dict[str, list[str]]): 2025-12-04T07:56:47.3822284Z """ 2025-12-04T07:56:47.3822773Z Dictionary of users with a list of features they have opted into 2025-12-04T07:56:47.3823365Z """ 2025-12-04T07:56:47.3823545Z 2025-12-04T07:56:47.3823564Z 2025-12-04T07:56:47.3823894Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-12-04T07:56:47.3824500Z """ 2025-12-04T07:56:47.3825177Z 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.3825809Z 2025-12-04T07:56:47.3826398Z 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.3827506Z - Example line: "@User1,lf,split_build" 2025-12-04T07:56:47.3828164Z - A "#" prefix indicates the user is opted out of all experiments 2025-12-04T07:56:47.3828613Z 2025-12-04T07:56:47.3828619Z 2025-12-04T07:56:47.3828772Z """ 2025-12-04T07:56:47.3829127Z optins = UserOptins() 2025-12-04T07:56:47.3829583Z for user in user_optin_text.split("\n"): 2025-12-04T07:56:47.3830110Z user = user.strip("\r\n\t -") 2025-12-04T07:56:47.3830629Z if not user or not user.startswith("@"): 2025-12-04T07:56:47.3831288Z # Not a valid user. Skip 2025-12-04T07:56:47.3831740Z continue 2025-12-04T07:56:47.3831962Z 2025-12-04T07:56:47.3832117Z if user: 2025-12-04T07:56:47.3832531Z usr_name = user.split(",")[0].strip("@") 2025-12-04T07:56:47.3833187Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-12-04T07:56:47.3833649Z 2025-12-04T07:56:47.3833809Z return optins 2025-12-04T07:56:47.3834026Z 2025-12-04T07:56:47.3834033Z 2025-12-04T07:56:47.3834309Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-12-04T07:56:47.3834871Z """ 2025-12-04T07:56:47.3835247Z Check if the experiment name is valid. 2025-12-04T07:56:47.3835725Z A valid name: 2025-12-04T07:56:47.3836322Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-12-04T07:56:47.3837194Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-12-04T07:56:47.3838066Z - Cannot contain spaces 2025-12-04T07:56:47.3838489Z """ 2025-12-04T07:56:47.3838675Z 2025-12-04T07:56:47.3838924Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-12-04T07:56:47.3839580Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-12-04T07:56:47.3839992Z 2025-12-04T07:56:47.3840145Z if valid: 2025-12-04T07:56:47.3840498Z return True 2025-12-04T07:56:47.3840715Z 2025-12-04T07:56:47.3840869Z log.error( 2025-12-04T07:56:47.3842220Z 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.3843692Z ) 2025-12-04T07:56:47.3844020Z return False 2025-12-04T07:56:47.3844242Z 2025-12-04T07:56:47.3844249Z 2025-12-04T07:56:47.3844532Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-12-04T07:56:47.3845107Z """ 2025-12-04T07:56:47.3845790Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-12-04T07:56:47.3846465Z """ 2025-12-04T07:56:47.3846786Z try: 2025-12-04T07:56:47.3847135Z if settings_text: 2025-12-04T07:56:47.3848042Z # 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.3848774Z # for easy reading 2025-12-04T07:56:47.3849506Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-12-04T07:56:47.3850334Z # the backtick character in shell commands. 2025-12-04T07:56:47.3850890Z backtick = chr(96) # backtick character 2025-12-04T07:56:47.3851523Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-12-04T07:56:47.3852146Z settings = load_yaml(settings_text) 2025-12-04T07:56:47.3852489Z 2025-12-04T07:56:47.3852881Z # For now we just load experiments. We can expand this if/when we add more settings 2025-12-04T07:56:47.3853584Z experiments = {} 2025-12-04T07:56:47.3853858Z 2025-12-04T07:56:47.3854222Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-12-04T07:56:47.3854929Z if not is_valid_experiment_name(exp_name): 2025-12-04T07:56:47.3855960Z # 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.3856907Z continue 2025-12-04T07:56:47.3857170Z 2025-12-04T07:56:47.3857557Z valid_settings = {} 2025-12-04T07:56:47.3858049Z for setting in exp_settings: 2025-12-04T07:56:47.3858586Z if setting not in Experiment._fields: 2025-12-04T07:56:47.3859101Z log.warning( 2025-12-04T07:56:47.3859766Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-12-04T07:56:47.3860614Z ) 2025-12-04T07:56:47.3861011Z else: 2025-12-04T07:56:47.3861496Z valid_settings[setting] = exp_settings[setting] 2025-12-04T07:56:47.3861887Z 2025-12-04T07:56:47.3862160Z experiments[exp_name] = Experiment(**valid_settings) 2025-12-04T07:56:47.3862750Z return Settings(experiments) 2025-12-04T07:56:47.3863078Z 2025-12-04T07:56:47.3863241Z except Exception: 2025-12-04T07:56:47.3863692Z log.exception("Failed to parse settings") 2025-12-04T07:56:47.3864056Z 2025-12-04T07:56:47.3864223Z return Settings() 2025-12-04T07:56:47.3864456Z 2025-12-04T07:56:47.3864463Z 2025-12-04T07:56:47.3864694Z def parse_settings(rollout_state: str) -> Settings: 2025-12-04T07:56:47.3865220Z """ 2025-12-04T07:56:47.3865617Z Parse settings, if any, from the rollout state. 2025-12-04T07:56:47.3865996Z 2025-12-04T07:56:47.3866327Z If the issue body contains "---" then the text above that is the settings 2025-12-04T07:56:47.3867037Z and the text below is the list of opted in users. 2025-12-04T07:56:47.3867600Z 2025-12-04T07:56:47.3867987Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-12-04T07:56:47.3868676Z """ 2025-12-04T07:56:47.3869190Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.3869917Z return parse_settings_from_text(settings_text) 2025-12-04T07:56:47.3870286Z 2025-12-04T07:56:47.3870292Z 2025-12-04T07:56:47.3870522Z def parse_users(rollout_state: str) -> UserOptins: 2025-12-04T07:56:47.3871041Z """ 2025-12-04T07:56:47.3871408Z Parse users from the rollout state. 2025-12-04T07:56:47.3871737Z 2025-12-04T07:56:47.3871884Z """ 2025-12-04T07:56:47.3872386Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-12-04T07:56:47.3873058Z return parse_user_opt_in_from_text(users_text) 2025-12-04T07:56:47.3873436Z 2025-12-04T07:56:47.3873443Z 2025-12-04T07:56:47.3873960Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.3874651Z """ 2025-12-04T07:56:47.3875037Z Check if a user is opted into an experiment 2025-12-04T07:56:47.3875526Z """ 2025-12-04T07:56:47.3875941Z return experiment_name in user_optins.get(user, []) 2025-12-04T07:56:47.3876330Z 2025-12-04T07:56:47.3876338Z 2025-12-04T07:56:47.3876738Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-12-04T07:56:47.3877609Z """ 2025-12-04T07:56:47.3878042Z Check if a user explicitly opted out of an experiment 2025-12-04T07:56:47.3878574Z """ 2025-12-04T07:56:47.3879048Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-12-04T07:56:47.3879678Z experiment_optout = "-" + experiment_name 2025-12-04T07:56:47.3880282Z if experiment_optout not in user_optins.get(user, []): 2025-12-04T07:56:47.3880838Z return False 2025-12-04T07:56:47.3881070Z 2025-12-04T07:56:47.3881331Z if is_user_opted_in(user, user_optins, experiment_name): 2025-12-04T07:56:47.3881888Z log.warning( 2025-12-04T07:56:47.3882625Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-12-04T07:56:47.3883429Z ) 2025-12-04T07:56:47.3883614Z 2025-12-04T07:56:47.3883766Z return True 2025-12-04T07:56:47.3883981Z 2025-12-04T07:56:47.3883988Z 2025-12-04T07:56:47.3884159Z def get_runner_prefix( 2025-12-04T07:56:47.3884563Z rollout_state: str, 2025-12-04T07:56:47.3884987Z workflow_requestors: Iterable[str], 2025-12-04T07:56:47.3885470Z branch: str, 2025-12-04T07:56:47.3885918Z eligible_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.3886533Z opt_out_experiments: frozenset[str] = frozenset(), 2025-12-04T07:56:47.3887076Z is_canary: bool = False, 2025-12-04T07:56:47.3887722Z ) -> str: 2025-12-04T07:56:47.3888319Z settings = parse_settings(rollout_state) 2025-12-04T07:56:47.3888862Z user_optins = parse_users(rollout_state) 2025-12-04T07:56:47.3889214Z 2025-12-04T07:56:47.3889390Z fleet_prefix = "" 2025-12-04T07:56:47.3889781Z prefixes = [] 2025-12-04T07:56:47.3890371Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-12-04T07:56:47.3891237Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-12-04T07:56:47.3891890Z log.info( 2025-12-04T07:56:47.3892512Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-12-04T07:56:47.3893208Z ) 2025-12-04T07:56:47.3893559Z continue 2025-12-04T07:56:47.3893787Z 2025-12-04T07:56:47.3893962Z if opt_out_experiments: 2025-12-04T07:56:47.3894455Z if experiment_name in opt_out_experiments: 2025-12-04T07:56:47.3895045Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-12-04T07:56:47.3895597Z log.info( 2025-12-04T07:56:47.3896451Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-12-04T07:56:47.3897539Z ) 2025-12-04T07:56:47.3897909Z continue 2025-12-04T07:56:47.3898149Z 2025-12-04T07:56:47.3898326Z if eligible_experiments: 2025-12-04T07:56:47.3898863Z if experiment_name not in eligible_experiments: 2025-12-04T07:56:47.3899449Z exp_list = ", ".join(eligible_experiments) 2025-12-04T07:56:47.3899964Z log.info( 2025-12-04T07:56:47.3900716Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-12-04T07:56:47.3901491Z ) 2025-12-04T07:56:47.3901856Z continue 2025-12-04T07:56:47.3902292Z elif not experiment_settings.default: 2025-12-04T07:56:47.3902783Z log.info( 2025-12-04T07:56:47.3903527Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-12-04T07:56:47.3904217Z ) 2025-12-04T07:56:47.3904556Z continue 2025-12-04T07:56:47.3904783Z 2025-12-04T07:56:47.3905045Z # Is any workflow_requestor opted out to this experiment? 2025-12-04T07:56:47.3905606Z opted_out_users = [ 2025-12-04T07:56:47.3906074Z requestor 2025-12-04T07:56:47.3906542Z for requestor in workflow_requestors 2025-12-04T07:56:47.3907176Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.3907937Z ] 2025-12-04T07:56:47.3908129Z 2025-12-04T07:56:47.3908299Z if opted_out_users: 2025-12-04T07:56:47.3908713Z log.info( 2025-12-04T07:56:47.3909281Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-12-04T07:56:47.3909923Z ) 2025-12-04T07:56:47.3910263Z continue 2025-12-04T07:56:47.3910500Z 2025-12-04T07:56:47.3910752Z # Is any workflow_requestor opted in to this experiment? 2025-12-04T07:56:47.3911313Z opted_in_users = [ 2025-12-04T07:56:47.3911713Z requestor 2025-12-04T07:56:47.3912135Z for requestor in workflow_requestors 2025-12-04T07:56:47.3912747Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-12-04T07:56:47.3913317Z ] 2025-12-04T07:56:47.3913500Z 2025-12-04T07:56:47.3913660Z enabled = False 2025-12-04T07:56:47.3914056Z if opted_in_users: 2025-12-04T07:56:47.3914458Z log.info( 2025-12-04T07:56:47.3915015Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-12-04T07:56:47.3915647Z ) 2025-12-04T07:56:47.3916003Z enabled = True 2025-12-04T07:56:47.3916259Z 2025-12-04T07:56:47.3916468Z elif experiment_settings.rollout_perc: 2025-12-04T07:56:47.3917404Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-12-04T07:56:47.3918449Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-12-04T07:56:47.3919058Z log.info( 2025-12-04T07:56:47.3919861Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-12-04T07:56:47.3920708Z ) 2025-12-04T07:56:47.3921083Z enabled = True 2025-12-04T07:56:47.3921354Z 2025-12-04T07:56:47.3921515Z if enabled: 2025-12-04T07:56:47.3921902Z label = experiment_name 2025-12-04T07:56:47.3922414Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-12-04T07:56:47.3923174Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-12-04T07:56:47.3923982Z # - If it's enabled, then we always list it's prefix first 2025-12-04T07:56:47.3924690Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-12-04T07:56:47.3925303Z if is_canary: 2025-12-04T07:56:47.3925755Z label += CANARY_FLEET_SUFFIX 2025-12-04T07:56:47.3926260Z fleet_prefix = label 2025-12-04T07:56:47.3926712Z else: 2025-12-04T07:56:47.3927100Z prefixes.append(label) 2025-12-04T07:56:47.3927636Z 2025-12-04T07:56:47.3927815Z if len(prefixes) > 1: 2025-12-04T07:56:47.3928224Z log.error( 2025-12-04T07:56:47.3929180Z 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.3930246Z ) 2025-12-04T07:56:47.3930624Z prefixes = prefixes[:1] 2025-12-04T07:56:47.3930904Z 2025-12-04T07:56:47.3931082Z # Fleet always comes first 2025-12-04T07:56:47.3931514Z if fleet_prefix: 2025-12-04T07:56:47.3931931Z prefixes.insert(0, fleet_prefix) 2025-12-04T07:56:47.3932266Z 2025-12-04T07:56:47.3932626Z return ".".join(prefixes) + "." if prefixes else "" 2025-12-04T07:56:47.3933020Z 2025-12-04T07:56:47.3933028Z 2025-12-04T07:56:47.3933436Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-12-04T07:56:47.3934149Z """ 2025-12-04T07:56:47.3934680Z Gets the first comment of the issue, which contains the desired rollout state. 2025-12-04T07:56:47.3935192Z 2025-12-04T07:56:47.3935563Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-12-04T07:56:47.3936207Z """ 2025-12-04T07:56:47.3936564Z gh = get_gh_client(github_token) 2025-12-04T07:56:47.3937062Z issue = get_issue(gh, repo, issue_num) 2025-12-04T07:56:47.3938900Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-12-04T07:56:47.3939485Z 2025-12-04T07:56:47.3939493Z 2025-12-04T07:56:47.3939885Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-12-04T07:56:47.3940721Z for _ in range(num_retries): 2025-12-04T07:56:47.3941170Z try: 2025-12-04T07:56:47.3941672Z req = Request(url=url, headers=headers) 2025-12-04T07:56:47.3942415Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-12-04T07:56:47.3943053Z return json.loads(content) 2025-12-04T07:56:47.3943549Z except Exception as e: 2025-12-04T07:56:47.3944060Z log.warning(f"Could not download {url}: {e}") 2025-12-04T07:56:47.3944435Z 2025-12-04T07:56:47.3944793Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-12-04T07:56:47.3945457Z return {} 2025-12-04T07:56:47.3945664Z 2025-12-04T07:56:47.3945671Z 2025-12-04T07:56:47.3945823Z @cache 2025-12-04T07:56:47.3946407Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-12-04T07:56:47.3947100Z """ 2025-12-04T07:56:47.3947621Z Dynamically get PR information 2025-12-04T07:56:47.3948083Z """ 2025-12-04T07:56:47.3948775Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-12-04T07:56:47.3949362Z headers = { 2025-12-04T07:56:47.3949785Z "Accept": "application/vnd.github.v3+json", 2025-12-04T07:56:47.3950343Z "Authorization": f"token {github_token}", 2025-12-04T07:56:47.3950833Z } 2025-12-04T07:56:47.3951228Z json_response: dict[str, Any] = download_json( 2025-12-04T07:56:47.3951792Z url=f"{github_api}/issues/{pr_number}", 2025-12-04T07:56:47.3952301Z headers=headers, 2025-12-04T07:56:47.3952692Z ) 2025-12-04T07:56:47.3952876Z 2025-12-04T07:56:47.3953048Z if not json_response: 2025-12-04T07:56:47.3953574Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-12-04T07:56:47.3954138Z return {} 2025-12-04T07:56:47.3954356Z 2025-12-04T07:56:47.3954527Z return json_response 2025-12-04T07:56:47.3954776Z 2025-12-04T07:56:47.3954783Z 2025-12-04T07:56:47.3955158Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-12-04T07:56:47.3955842Z """ 2025-12-04T07:56:47.3956333Z Dynamically get the latest list of labels from the pull request 2025-12-04T07:56:47.3956929Z """ 2025-12-04T07:56:47.3957482Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-12-04T07:56:47.3958041Z return { 2025-12-04T07:56:47.3958589Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-12-04T07:56:47.3959226Z } 2025-12-04T07:56:47.3959408Z 2025-12-04T07:56:47.3959419Z 2025-12-04T07:56:47.3959582Z def main() -> None: 2025-12-04T07:56:47.3959969Z args = parse_args() 2025-12-04T07:56:47.3960222Z 2025-12-04T07:56:47.3960429Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-12-04T07:56:47.3960782Z 2025-12-04T07:56:47.3960964Z # Check if the PR is opt-out 2025-12-04T07:56:47.3961416Z if args.pr_number: 2025-12-04T07:56:47.3962022Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-12-04T07:56:47.3962835Z if OPT_OUT_LABEL in labels: 2025-12-04T07:56:47.3963305Z log.info( 2025-12-04T07:56:47.3963938Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-12-04T07:56:47.3964651Z ) 2025-12-04T07:56:47.3965156Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3965776Z sys.exit() 2025-12-04T07:56:47.3966014Z 2025-12-04T07:56:47.3966171Z try: 2025-12-04T07:56:47.3966570Z rollout_state = get_rollout_state_from_issue( 2025-12-04T07:56:47.3967329Z args.github_token, args.github_issue_repo, args.github_issue 2025-12-04T07:56:47.3967916Z ) 2025-12-04T07:56:47.3968109Z 2025-12-04T07:56:47.3968303Z username = get_potential_pr_author( 2025-12-04T07:56:47.3968797Z args.github_token, 2025-12-04T07:56:47.3969244Z args.github_repo, 2025-12-04T07:56:47.3969680Z args.github_actor, 2025-12-04T07:56:47.3970135Z args.github_ref_type, 2025-12-04T07:56:47.3970595Z args.github_branch, 2025-12-04T07:56:47.3971017Z ) 2025-12-04T07:56:47.3971202Z 2025-12-04T07:56:47.3971479Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-12-04T07:56:47.3971893Z 2025-12-04T07:56:47.3972097Z runner_label_prefix = get_runner_prefix( 2025-12-04T07:56:47.3972611Z rollout_state, 2025-12-04T07:56:47.3973060Z (args.github_issue_owner, username), 2025-12-04T07:56:47.3973578Z args.github_branch, 2025-12-04T07:56:47.3974034Z args.eligible_experiments, 2025-12-04T07:56:47.3974535Z args.opt_out_experiments, 2025-12-04T07:56:47.3974999Z is_canary, 2025-12-04T07:56:47.3975375Z ) 2025-12-04T07:56:47.3975563Z 2025-12-04T07:56:47.3975738Z except Exception as e: 2025-12-04T07:56:47.3976151Z log.error( 2025-12-04T07:56:47.3976769Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-12-04T07:56:47.3977717Z ) 2025-12-04T07:56:47.3977914Z 2025-12-04T07:56:47.3978223Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-12-04T07:56:47.3978683Z 2025-12-04T07:56:47.3978689Z 2025-12-04T07:56:47.3978862Z if __name__ == "__main__": 2025-12-04T07:56:47.3979268Z main() 2025-12-04T07:56:47.3979459Z 2025-12-04T07:56:47.4068372Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T07:56:47.4069177Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-12-04T07:56:47.4101947Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:47.4102383Z env: 2025-12-04T07:56:47.4102949Z GITHUB_TOKEN: *** 2025-12-04T07:56:47.4103458Z ISSUE_NUMBER: 5132 2025-12-04T07:56:47.4103958Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:47.4104410Z ISSUE_OWNER: 2025-12-04T07:56:47.4104782Z CHECK_EXPERIMENTS: 2025-12-04T07:56:47.4105179Z OPT_OUT_EXPERIMENTS: lf 2025-12-04T07:56:47.4105599Z PR_NUMBER: 2025-12-04T07:56:47.4105939Z ##[endgroup] 2025-12-04T07:56:48.5721502Z Defaulting to user installation because normal site-packages is not writeable 2025-12-04T07:56:49.6458063Z Collecting urllib3==1.26.18 2025-12-04T07:56:49.6997485Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-12-04T07:56:49.7244477Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 3.5 MB/s eta 0:00:00 2025-12-04T07:56:49.7544226Z Collecting PyGithub==2.3.0 2025-12-04T07:56:49.7647585Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-12-04T07:56:49.8165870Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-12-04T07:56:49.8264785Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl.metadata (9.8 kB) 2025-12-04T07:56:49.8307843Z 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:49.8324028Z 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:49.8338432Z 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:49.8650929Z Collecting Deprecated (from PyGithub==2.3.0) 2025-12-04T07:56:49.8748950Z Downloading deprecated-1.3.1-py2.py3-none-any.whl.metadata (5.9 kB) 2025-12-04T07:56:49.8973214Z 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:50.0335857Z Collecting cffi>=2.0.0 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T07:56:50.0437458Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.6 kB) 2025-12-04T07:56:50.2169261Z Collecting wrapt<3,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-12-04T07:56:50.2273310Z 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:50.2558401Z Collecting pycparser (from cffi>=2.0.0->pynacl>=1.4.0->PyGithub==2.3.0) 2025-12-04T07:56:50.2656308Z Downloading pycparser-2.23-py3-none-any.whl.metadata (993 bytes) 2025-12-04T07:56:50.2968477Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-12-04T07:56:50.3131934Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 9.5 MB/s eta 0:00:00 2025-12-04T07:56:50.3232589Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-12-04T07:56:50.3568089Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 10.8 MB/s eta 0:00:00 2025-12-04T07:56:50.3665062Z Downloading pynacl-1.6.1-cp38-abi3-manylinux_2_34_x86_64.whl (1.4 MB) 2025-12-04T07:56:50.4574235Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.4/1.4 MB 15.6 MB/s eta 0:00:00 2025-12-04T07:56:50.4672286Z Downloading deprecated-1.3.1-py2.py3-none-any.whl (11 kB) 2025-12-04T07:56:50.4795554Z Downloading cffi-2.0.0-cp312-cp312-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (219 kB) 2025-12-04T07:56:50.4937174Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 219.6/219.6 kB 17.0 MB/s eta 0:00:00 2025-12-04T07:56:50.5038344Z 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:50.5107962Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 121.5/121.5 kB 21.7 MB/s eta 0:00:00 2025-12-04T07:56:50.5237661Z Downloading pycparser-2.23-py3-none-any.whl (118 kB) 2025-12-04T07:56:50.5326418Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.1/118.1 kB 15.1 MB/s eta 0:00:00 2025-12-04T07:56:50.8264089Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-12-04T07:56:51.3666227Z 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:51.4586227Z ##[group]Run curr_branch="main" 2025-12-04T07:56:51.4586550Z curr_branch="main" 2025-12-04T07:56:51.4586789Z curr_ref_type="branch" 2025-12-04T07:56:51.4587057Z echo "Current branch is '$curr_branch'" 2025-12-04T07:56:51.4587630Z  2025-12-04T07:56:51.4587839Z python3 runner_determinator.py \ 2025-12-04T07:56:51.4588145Z  --github-token "$GITHUB_TOKEN" \ 2025-12-04T07:56:51.4588433Z  --github-issue "$ISSUE_NUMBER" \ 2025-12-04T07:56:51.4588708Z  --github-branch "$curr_branch" \ 2025-12-04T07:56:51.4588979Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-12-04T07:56:51.4589274Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-12-04T07:56:51.4589566Z  --github-ref-type "$curr_ref_type" \ 2025-12-04T07:56:51.4589852Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-12-04T07:56:51.4590161Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-12-04T07:56:51.4590544Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-12-04T07:56:51.4590853Z  --pr-number "${PR_NUMBER}" 2025-12-04T07:56:51.4624333Z shell: /usr/bin/bash -e {0} 2025-12-04T07:56:51.4624586Z env: 2025-12-04T07:56:51.4625187Z GITHUB_TOKEN: *** 2025-12-04T07:56:51.4625419Z ISSUE_NUMBER: 5132 2025-12-04T07:56:51.4625648Z TRIGGERING_ACTOR: pytorchmergebot 2025-12-04T07:56:51.4625908Z ISSUE_OWNER: 2025-12-04T07:56:51.4626103Z CHECK_EXPERIMENTS: 2025-12-04T07:56:51.4626321Z OPT_OUT_EXPERIMENTS: lf 2025-12-04T07:56:51.4626534Z PR_NUMBER: 2025-12-04T07:56:51.4626752Z ##[endgroup] 2025-12-04T07:56:51.4678010Z Current branch is 'main' 2025-12-04T07:56:53.4362919Z INFO : Skipping experiment 'lf', as this workflow has opted-out (opted out experiments are: lf) 2025-12-04T07:56:53.4364165Z INFO : Branch main is an exception branch. Not enabling experiment ephemeral. 2025-12-04T07:56:53.4364959Z INFO : Branch main is an exception branch. Not enabling experiment wincanary. 2025-12-04T07:56:53.4365670Z INFO : Branch main is an exception branch. Not enabling experiment wincanarylf. 2025-12-04T07:56:53.4366250Z INFO : Setting output: label-type='' 2025-12-04T07:56:53.4691253Z Evaluate and set job outputs 2025-12-04T07:56:53.4698657Z Cleaning up orphan processes