2025-03-04T19:47:19.7578842Z Current runner version: '2.322.0' 2025-03-04T19:47:19.7606220Z ##[group]Operating System 2025-03-04T19:47:19.7607292Z Ubuntu 2025-03-04T19:47:19.7607797Z 24.04.2 2025-03-04T19:47:19.7608339Z LTS 2025-03-04T19:47:19.7608917Z ##[endgroup] 2025-03-04T19:47:19.7609454Z ##[group]Runner Image 2025-03-04T19:47:19.7610097Z Image: ubuntu-24.04 2025-03-04T19:47:19.7610655Z Version: 20250223.1.0 2025-03-04T19:47:19.7611709Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250223.1/images/ubuntu/Ubuntu2404-Readme.md 2025-03-04T19:47:19.7613101Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250223.1 2025-03-04T19:47:19.7614034Z ##[endgroup] 2025-03-04T19:47:19.7614599Z ##[group]Runner Image Provisioner 2025-03-04T19:47:19.7615197Z 2.0.422.1 2025-03-04T19:47:19.7615717Z ##[endgroup] 2025-03-04T19:47:19.7618015Z ##[group]GITHUB_TOKEN Permissions 2025-03-04T19:47:19.7620155Z Actions: read 2025-03-04T19:47:19.7620855Z Attestations: read 2025-03-04T19:47:19.7621610Z Checks: read 2025-03-04T19:47:19.7622075Z Contents: read 2025-03-04T19:47:19.7622681Z Deployments: read 2025-03-04T19:47:19.7623182Z Discussions: read 2025-03-04T19:47:19.7623690Z Issues: read 2025-03-04T19:47:19.7624271Z Metadata: read 2025-03-04T19:47:19.7624783Z Packages: read 2025-03-04T19:47:19.7625349Z Pages: read 2025-03-04T19:47:19.7625834Z PullRequests: read 2025-03-04T19:47:19.7626376Z RepositoryProjects: read 2025-03-04T19:47:19.7627034Z SecurityEvents: read 2025-03-04T19:47:19.7627816Z Statuses: read 2025-03-04T19:47:19.7628384Z ##[endgroup] 2025-03-04T19:47:19.7631654Z Secret source: Actions 2025-03-04T19:47:19.7632709Z Prepare workflow directory 2025-03-04T19:47:19.8145844Z Prepare all required actions 2025-03-04T19:47:19.8202070Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (92beda54c8707d476ea8bc193ce79a37653d2e49) 2025-03-04T19:47:19.8207959Z ##[group] Inputs 2025-03-04T19:47:19.8208708Z check_experiments: 2025-03-04T19:47:19.8209421Z triggering_actor: pytorch-bot[bot] 2025-03-04T19:47:19.8210033Z issue_owner: 2025-03-04T19:47:19.8210567Z curr_branch: ciflow/inductor/148205 2025-03-04T19:47:19.8211240Z curr_ref_type: tag 2025-03-04T19:47:19.8211790Z issue_number: 5132 2025-03-04T19:47:19.8212330Z ##[endgroup] 2025-03-04T19:47:19.8212991Z Complete job name: get-label-type / runner-determinator 2025-03-04T19:47:19.8964663Z ##[group]Run cat < runner_determinator.py 2025-03-04T19:47:19.8966391Z cat < runner_determinator.py 2025-03-04T19:47:19.8966962Z # flake8: noqa: G004 2025-03-04T19:47:19.8967611Z  2025-03-04T19:47:19.8968269Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-03-04T19:47:19.8969228Z # must be kept in sync. You can do it easily by running the following command: 2025-03-04T19:47:19.8970073Z # python .github/scripts/update_runner_determinator.py 2025-03-04T19:47:19.8970700Z  2025-03-04T19:47:19.8971093Z """ 2025-03-04T19:47:19.8971704Z This runner determinator is used to determine which set of runners to run a 2025-03-04T19:47:19.8972623Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-03-04T19:47:19.8973615Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-03-04T19:47:19.8974477Z of which runners should be used to run which job. 2025-03-04T19:47:19.8975060Z  2025-03-04T19:47:19.8975674Z The configuration has two parts, the settings and a list of opted-in users, 2025-03-04T19:47:19.8976617Z separated by a line containing "---". If the line is not present, the 2025-03-04T19:47:19.8977659Z settings are considered to be empty with only the second part, the user 2025-03-04T19:47:19.8978380Z list, defined. 2025-03-04T19:47:19.8978815Z  2025-03-04T19:47:19.8979406Z The first part is a YAML block that defines the rollout settings. This can be 2025-03-04T19:47:19.8980731Z used to define any settings that are needed to determine which runners to use. 2025-03-04T19:47:19.8981621Z It's fields are defined by the RolloutSettings class below. 2025-03-04T19:47:19.8982263Z  2025-03-04T19:47:19.8982890Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-03-04T19:47:19.8983820Z The user list is also a comma separated list of additional features or 2025-03-04T19:47:19.8984638Z experiments which the user could be opted in to. 2025-03-04T19:47:19.8985239Z  2025-03-04T19:47:19.8985688Z The user list has the following rules: 2025-03-04T19:47:19.8986248Z  2025-03-04T19:47:19.8986808Z - Users are GitHub usernames, which must start with the @ prefix 2025-03-04T19:47:19.8987820Z - Each user is also a comma-separated list of features/experiments to enable 2025-03-04T19:47:19.8988650Z - A "#" prefix opts the user out of all experiments 2025-03-04T19:47:19.8989232Z  2025-03-04T19:47:19.8989630Z Example config: 2025-03-04T19:47:19.8990164Z  # A list of experiments that can be opted into. 2025-03-04T19:47:19.8990883Z  # This defines the behavior they'll induce when opted into. 2025-03-04T19:47:19.8991552Z  # Expected syntax is: 2025-03-04T19:47:19.8992272Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-03-04T19:47:19.8993287Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-03-04T19:47:19.8994072Z  2025-03-04T19:47:19.8994469Z  experiments: 2025-03-04T19:47:19.8994913Z  lf: 2025-03-04T19:47:19.8995347Z  rollout_percent: 25 2025-03-04T19:47:19.8995883Z  all_branches: false 2025-03-04T19:47:19.8996400Z  default: true 2025-03-04T19:47:19.8996879Z  --- 2025-03-04T19:47:19.8997439Z  2025-03-04T19:47:19.8997826Z  # Opt-ins: 2025-03-04T19:47:19.8998483Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-03-04T19:47:19.8999561Z  # and specifying experiments to enable in a comma-separated list. 2025-03-04T19:47:19.9000398Z  # To always opt out of an experiment, prefix it with a "-". 2025-03-04T19:47:19.9001113Z  # Experiments should be from the above list. 2025-03-04T19:47:19.9001675Z  2025-03-04T19:47:19.9002136Z  @User1,-lf,split_build 2025-03-04T19:47:19.9002640Z  @User2,lf 2025-03-04T19:47:19.9003084Z  @User3,split_build 2025-03-04T19:47:19.9003562Z """ 2025-03-04T19:47:19.9003941Z  2025-03-04T19:47:19.9004317Z import json 2025-03-04T19:47:19.9004757Z import logging 2025-03-04T19:47:19.9005204Z import os 2025-03-04T19:47:19.9005628Z import random 2025-03-04T19:47:19.9006076Z import re 2025-03-04T19:47:19.9006483Z import sys 2025-03-04T19:47:19.9006946Z from argparse import ArgumentParser 2025-03-04T19:47:19.9007657Z from collections.abc import Iterable 2025-03-04T19:47:19.9008227Z from functools import cache 2025-03-04T19:47:19.9008763Z from logging import LogRecord 2025-03-04T19:47:19.9009314Z from typing import Any, NamedTuple 2025-03-04T19:47:19.9009932Z from urllib.request import Request, urlopen 2025-03-04T19:47:19.9010502Z  2025-03-04T19:47:19.9010885Z import yaml 2025-03-04T19:47:19.9011346Z from github import Auth, Github 2025-03-04T19:47:19.9011896Z from github.Issue import Issue 2025-03-04T19:47:19.9012404Z  2025-03-04T19:47:19.9012770Z  2025-03-04T19:47:19.9013225Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-03-04T19:47:19.9014169Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-03-04T19:47:19.9015080Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-03-04T19:47:19.9015810Z  2025-03-04T19:47:19.9016292Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-03-04T19:47:19.9016925Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-03-04T19:47:19.9017610Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-03-04T19:47:19.9018236Z OPT_OUT_LABEL = "no-runner-experiments" 2025-03-04T19:47:19.9018779Z  2025-03-04T19:47:19.9019216Z SETTING_EXPERIMENTS = "experiments" 2025-03-04T19:47:19.9019760Z  2025-03-04T19:47:19.9020155Z LF_FLEET_EXPERIMENT = "lf" 2025-03-04T19:47:19.9020675Z CANARY_FLEET_SUFFIX = ".c" 2025-03-04T19:47:19.9021166Z  2025-03-04T19:47:19.9021531Z  2025-03-04T19:47:19.9021928Z class Experiment(NamedTuple): 2025-03-04T19:47:19.9022474Z  rollout_perc: float = ( 2025-03-04T19:47:19.9023195Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-03-04T19:47:19.9023897Z  ) 2025-03-04T19:47:19.9024312Z  all_branches: bool = ( 2025-03-04T19:47:19.9025018Z  False # If True, the experiment is also enabled on the exception branches 2025-03-04T19:47:19.9025720Z  ) 2025-03-04T19:47:19.9026127Z  default: bool = ( 2025-03-04T19:47:19.9026770Z  True # If True, the experiment is enabled by default for all queries 2025-03-04T19:47:19.9027535Z  ) 2025-03-04T19:47:19.9027925Z  2025-03-04T19:47:19.9028321Z  # Add more fields as needed 2025-03-04T19:47:19.9028827Z  2025-03-04T19:47:19.9029193Z  2025-03-04T19:47:19.9029583Z class Settings(NamedTuple): 2025-03-04T19:47:19.9030085Z  """ 2025-03-04T19:47:19.9030610Z  Settings for the experiments that can be opted into. 2025-03-04T19:47:19.9031352Z  """ 2025-03-04T19:47:19.9031966Z  2025-03-04T19:47:19.9032666Z  experiments: dict[str, Experiment] = {} 2025-03-04T19:47:19.9033499Z  2025-03-04T19:47:19.9034272Z  2025-03-04T19:47:19.9035010Z class ColorFormatter(logging.Formatter): 2025-03-04T19:47:19.9036120Z  """Color codes the log messages based on the log level""" 2025-03-04T19:47:19.9037268Z  2025-03-04T19:47:19.9037667Z  COLORS = { 2025-03-04T19:47:19.9038150Z  "WARNING": "\033[33m", # Yellow 2025-03-04T19:47:19.9038717Z  "ERROR": "\033[31m", # Red 2025-03-04T19:47:19.9039258Z  "CRITICAL": "\033[31m", # Red 2025-03-04T19:47:19.9039804Z  "INFO": "\033[0m", # Reset 2025-03-04T19:47:19.9040386Z  "DEBUG": "\033[0m", # Reset 2025-03-04T19:47:19.9040919Z  } 2025-03-04T19:47:19.9041312Z  2025-03-04T19:47:19.9041775Z  def format(self, record: LogRecord) -> str: 2025-03-04T19:47:19.9042578Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-03-04T19:47:19.9043396Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-03-04T19:47:19.9044020Z  return super().format(record) 2025-03-04T19:47:19.9044545Z  2025-03-04T19:47:19.9044922Z  2025-03-04T19:47:19.9045342Z handler = logging.StreamHandler() 2025-03-04T19:47:19.9046114Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-03-04T19:47:19.9046859Z  2025-03-04T19:47:19.9047470Z log = logging.getLogger(os.path.basename(__file__)) 2025-03-04T19:47:19.9048108Z log.addHandler(handler) 2025-03-04T19:47:19.9048627Z log.setLevel(logging.INFO) 2025-03-04T19:47:19.9049292Z  2025-03-04T19:47:19.9049664Z  2025-03-04T19:47:19.9050157Z def set_github_output(key: str, value: str) -> None: 2025-03-04T19:47:19.9050765Z  """ 2025-03-04T19:47:19.9051328Z  Defines outputs of the github action that invokes this script 2025-03-04T19:47:19.9051993Z  """ 2025-03-04T19:47:19.9052406Z  if not GITHUB_OUTPUT: 2025-03-04T19:47:19.9053529Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-03-04T19:47:19.9054645Z  log.warning( 2025-03-04T19:47:19.9055553Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-03-04T19:47:19.9056493Z  ) 2025-03-04T19:47:19.9056984Z  print(f"::set-output name={key}::{value}") 2025-03-04T19:47:19.9057660Z  return 2025-03-04T19:47:19.9058091Z  2025-03-04T19:47:19.9058515Z  with open(GITHUB_OUTPUT, "a") as f: 2025-03-04T19:47:19.9059140Z  log.info(f"Setting output: {key}='{value}'") 2025-03-04T19:47:19.9059757Z  f.write(f"{key}={value}\n") 2025-03-04T19:47:19.9060265Z  2025-03-04T19:47:19.9060639Z  2025-03-04T19:47:19.9061180Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-03-04T19:47:19.9061855Z  return frozenset( 2025-03-04T19:47:19.9062534Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-03-04T19:47:19.9063243Z  ) 2025-03-04T19:47:19.9063630Z  2025-03-04T19:47:19.9063994Z  2025-03-04T19:47:19.9064399Z def parse_args() -> Any: 2025-03-04T19:47:19.9065033Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-03-04T19:47:19.9065934Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-03-04T19:47:19.9066716Z  parser.add_argument( 2025-03-04T19:47:19.9067335Z  "--github-issue-repo", 2025-03-04T19:47:19.9067869Z  type=str, 2025-03-04T19:47:19.9068336Z  required=False, 2025-03-04T19:47:19.9069001Z  default="pytorch/test-infra", 2025-03-04T19:47:19.9069599Z  help="GitHub repo to get the issue", 2025-03-04T19:47:19.9070136Z  ) 2025-03-04T19:47:19.9070548Z  parser.add_argument( 2025-03-04T19:47:19.9071049Z  "--github-repo", 2025-03-04T19:47:19.9071539Z  type=str, 2025-03-04T19:47:19.9072001Z  required=True, 2025-03-04T19:47:19.9072624Z  help="GitHub repo where CI is running", 2025-03-04T19:47:19.9073176Z  ) 2025-03-04T19:47:19.9073588Z  parser.add_argument( 2025-03-04T19:47:19.9074269Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-03-04T19:47:19.9074949Z  ) 2025-03-04T19:47:19.9075356Z  parser.add_argument( 2025-03-04T19:47:19.9076070Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-03-04T19:47:19.9076774Z  ) 2025-03-04T19:47:19.9077277Z  parser.add_argument( 2025-03-04T19:47:19.9078173Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-03-04T19:47:19.9079040Z  ) 2025-03-04T19:47:19.9079450Z  parser.add_argument( 2025-03-04T19:47:19.9080301Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-03-04T19:47:19.9081538Z  ) 2025-03-04T19:47:19.9082178Z  parser.add_argument( 2025-03-04T19:47:19.9082890Z  "--github-ref-type", 2025-03-04T19:47:19.9083706Z  type=str, 2025-03-04T19:47:19.9084696Z  required=True, 2025-03-04T19:47:19.9085613Z  help="Current GitHub ref type, branch or tag", 2025-03-04T19:47:19.9086592Z  ) 2025-03-04T19:47:19.9087468Z  parser.add_argument( 2025-03-04T19:47:19.9088374Z  "--eligible-experiments", 2025-03-04T19:47:19.9089344Z  type=_str_comma_separated_to_set, 2025-03-04T19:47:19.9090275Z  required=False, 2025-03-04T19:47:19.9091031Z  default="", 2025-03-04T19:47:19.9092577Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-03-04T19:47:19.9094225Z  ) 2025-03-04T19:47:19.9094880Z  parser.add_argument( 2025-03-04T19:47:19.9095619Z  "--pr-number", 2025-03-04T19:47:19.9096351Z  type=str, 2025-03-04T19:47:19.9097280Z  required=False, 2025-03-04T19:47:19.9098105Z  default="", 2025-03-04T19:47:19.9099004Z  help="the optional PR number where this is run", 2025-03-04T19:47:19.9099977Z  ) 2025-03-04T19:47:19.9100603Z  2025-03-04T19:47:19.9101266Z  return parser.parse_args() 2025-03-04T19:47:19.9102107Z  2025-03-04T19:47:19.9102708Z  2025-03-04T19:47:19.9103728Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-03-04T19:47:19.9105090Z  auth = Auth.Token(github_token) 2025-03-04T19:47:19.9106003Z  return Github(auth=auth) 2025-03-04T19:47:19.9106824Z  2025-03-04T19:47:19.9107601Z  2025-03-04T19:47:19.9108638Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-03-04T19:47:19.9109919Z  repo = gh.get_repo(repo) 2025-03-04T19:47:19.9110826Z  return repo.get_issue(number=issue_num) 2025-03-04T19:47:19.9111731Z  2025-03-04T19:47:19.9112323Z  2025-03-04T19:47:19.9112961Z def get_potential_pr_author( 2025-03-04T19:47:19.9113936Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-03-04T19:47:19.9114632Z ) -> str: 2025-03-04T19:47:19.9115410Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-03-04T19:47:19.9116274Z  # Fetch the actual username from the original PR. The PR number is 2025-03-04T19:47:19.9117284Z  # embedded in the tag name: ciflow// 2025-03-04T19:47:19.9117921Z  2025-03-04T19:47:19.9118332Z  gh = get_gh_client(github_token) 2025-03-04T19:47:19.9118847Z  2025-03-04T19:47:19.9119341Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-03-04T19:47:19.9120017Z  split_tag = ref_name.split("/") 2025-03-04T19:47:19.9120546Z  if ( 2025-03-04T19:47:19.9120990Z  len(split_tag) == 3 2025-03-04T19:47:19.9121548Z  and split_tag[0] == "ciflow" 2025-03-04T19:47:19.9122169Z  and split_tag[2].isnumeric() 2025-03-04T19:47:19.9122702Z  ): 2025-03-04T19:47:19.9123152Z  pr_number = split_tag[2] 2025-03-04T19:47:19.9123685Z  try: 2025-03-04T19:47:19.9124181Z  repository = gh.get_repo(repo) 2025-03-04T19:47:19.9124835Z  pull = repository.get_pull(number=int(pr_number)) 2025-03-04T19:47:19.9125475Z  except Exception as e: 2025-03-04T19:47:19.9126046Z  raise Exception( # noqa: TRY002 2025-03-04T19:47:19.9126757Z  f"issue with pull request {pr_number} from repo {repository}" 2025-03-04T19:47:19.9127540Z  ) from e 2025-03-04T19:47:19.9128143Z  return pull.user.login # type: ignore[no-any-return] 2025-03-04T19:47:19.9129033Z  # In all other cases, return the original input username 2025-03-04T19:47:19.9129646Z  return username 2025-03-04T19:47:19.9130097Z  2025-03-04T19:47:19.9130459Z  2025-03-04T19:47:19.9130909Z def is_exception_branch(branch: str) -> bool: 2025-03-04T19:47:19.9131465Z  """ 2025-03-04T19:47:19.9132166Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-03-04T19:47:19.9132960Z  """ 2025-03-04T19:47:19.9133548Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-03-04T19:47:19.9134229Z  2025-03-04T19:47:19.9134576Z  2025-03-04T19:47:19.9134984Z def load_yaml(yaml_text: str) -> Any: 2025-03-04T19:47:19.9135516Z  try: 2025-03-04T19:47:19.9135964Z  data = yaml.safe_load(yaml_text) 2025-03-04T19:47:19.9136514Z  return data 2025-03-04T19:47:19.9137012Z  except yaml.YAMLError: 2025-03-04T19:47:19.9137668Z  log.exception("Error loading YAML") 2025-03-04T19:47:19.9138217Z  raise 2025-03-04T19:47:19.9138626Z  2025-03-04T19:47:19.9138984Z  2025-03-04T19:47:19.9139625Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-03-04T19:47:19.9140419Z  """ 2025-03-04T19:47:19.9141083Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-03-04T19:47:19.9141839Z  2025-03-04T19:47:19.9142393Z  If the issue body contains "---" then the text above that is the settings 2025-03-04T19:47:19.9143180Z  and the text below is the list of opted in users. 2025-03-04T19:47:19.9143750Z  2025-03-04T19:47:19.9144343Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-03-04T19:47:19.9145057Z  """ 2025-03-04T19:47:19.9145543Z  rollout_state_parts = rollout_state.split("---") 2025-03-04T19:47:19.9146172Z  if len(rollout_state_parts) >= 2: 2025-03-04T19:47:19.9146978Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-03-04T19:47:19.9147706Z  else: 2025-03-04T19:47:19.9148138Z  return "", rollout_state 2025-03-04T19:47:19.9148636Z  2025-03-04T19:47:19.9148992Z  2025-03-04T19:47:19.9149413Z class UserOptins(dict[str, list[str]]): 2025-03-04T19:47:19.9149945Z  """ 2025-03-04T19:47:19.9150523Z  Dictionary of users with a list of features they have opted into 2025-03-04T19:47:19.9151192Z  """ 2025-03-04T19:47:19.9151570Z  2025-03-04T19:47:19.9151927Z  2025-03-04T19:47:19.9152491Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-03-04T19:47:19.9153171Z  """ 2025-03-04T19:47:19.9153920Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-03-04T19:47:19.9154747Z  2025-03-04T19:47:19.9155569Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-03-04T19:47:19.9156572Z  - Example line: "@User1,lf,split_build" 2025-03-04T19:47:19.9157379Z  - A "#" prefix indicates the user is opted out of all experiments 2025-03-04T19:47:19.9158025Z  2025-03-04T19:47:19.9158381Z  2025-03-04T19:47:19.9158731Z  """ 2025-03-04T19:47:19.9159139Z  optins = UserOptins() 2025-03-04T19:47:19.9159684Z  for user in user_optin_text.split("\n"): 2025-03-04T19:47:19.9160279Z  user = user.strip("\r\n\t -") 2025-03-04T19:47:19.9161050Z  if not user or not user.startswith("@"): 2025-03-04T19:47:19.9161644Z  # Not a valid user. Skip 2025-03-04T19:47:19.9162159Z  continue 2025-03-04T19:47:19.9162602Z  2025-03-04T19:47:19.9162977Z  if user: 2025-03-04T19:47:19.9163487Z  usr_name = user.split(",")[0].strip("@") 2025-03-04T19:47:19.9164207Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-03-04T19:47:19.9164854Z  2025-03-04T19:47:19.9165227Z  return optins 2025-03-04T19:47:19.9165665Z  2025-03-04T19:47:19.9166013Z  2025-03-04T19:47:19.9166528Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-03-04T19:47:19.9167262Z  """ 2025-03-04T19:47:19.9167706Z  Check if the experiment name is valid. 2025-03-04T19:47:19.9168257Z  A valid name: 2025-03-04T19:47:19.9168948Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-03-04T19:47:19.9169907Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-03-04T19:47:19.9170637Z  - Cannot contain spaces 2025-03-04T19:47:19.9171131Z  """ 2025-03-04T19:47:19.9171515Z  2025-03-04T19:47:19.9171997Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-03-04T19:47:19.9172733Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-03-04T19:47:19.9173344Z  2025-03-04T19:47:19.9173707Z  if valid: 2025-03-04T19:47:19.9174137Z  return True 2025-03-04T19:47:19.9174571Z  2025-03-04T19:47:19.9174936Z  log.error( 2025-03-04T19:47:19.9176372Z  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-03-04T19:47:19.9177978Z  ) 2025-03-04T19:47:19.9178367Z  return False 2025-03-04T19:47:19.9178793Z  2025-03-04T19:47:19.9179151Z  2025-03-04T19:47:19.9179812Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-03-04T19:47:19.9180467Z  """ 2025-03-04T19:47:19.9181084Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-03-04T19:47:19.9181800Z  """ 2025-03-04T19:47:19.9182188Z  try: 2025-03-04T19:47:19.9182589Z  if settings_text: 2025-03-04T19:47:19.9183365Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-03-04T19:47:19.9184162Z  # for easy reading 2025-03-04T19:47:19.9184990Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-03-04T19:47:19.9185898Z  # the backtick character in shell commands. 2025-03-04T19:47:19.9186534Z  backtick = chr(96) # backtick character 2025-03-04T19:47:19.9187347Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-03-04T19:47:19.9188048Z  settings = load_yaml(settings_text) 2025-03-04T19:47:19.9188582Z  2025-03-04T19:47:19.9189185Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-03-04T19:47:19.9189948Z  experiments = {} 2025-03-04T19:47:19.9190442Z  2025-03-04T19:47:19.9191025Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-03-04T19:47:19.9191803Z  if not is_valid_experiment_name(exp_name): 2025-03-04T19:47:19.9192903Z  # 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-03-04T19:47:19.9194056Z  continue 2025-03-04T19:47:19.9194538Z  2025-03-04T19:47:19.9194932Z  valid_settings = {} 2025-03-04T19:47:19.9195501Z  for setting in exp_settings: 2025-03-04T19:47:19.9196110Z  if setting not in Experiment._fields: 2025-03-04T19:47:19.9196696Z  log.warning( 2025-03-04T19:47:19.9197539Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-03-04T19:47:19.9198269Z  ) 2025-03-04T19:47:19.9198739Z  else: 2025-03-04T19:47:19.9199311Z  valid_settings[setting] = exp_settings[setting] 2025-03-04T19:47:19.9199896Z  2025-03-04T19:47:19.9200403Z  experiments[exp_name] = Experiment(**valid_settings) 2025-03-04T19:47:19.9201068Z  return Settings(experiments) 2025-03-04T19:47:19.9201580Z  2025-03-04T19:47:19.9201957Z  except Exception: 2025-03-04T19:47:19.9202494Z  log.exception("Failed to parse settings") 2025-03-04T19:47:19.9203058Z  2025-03-04T19:47:19.9203435Z  return Settings() 2025-03-04T19:47:19.9203891Z  2025-03-04T19:47:19.9204254Z  2025-03-04T19:47:19.9204733Z def parse_settings(rollout_state: str) -> Settings: 2025-03-04T19:47:19.9205338Z  """ 2025-03-04T19:47:19.9205813Z  Parse settings, if any, from the rollout state. 2025-03-04T19:47:19.9206383Z  2025-03-04T19:47:19.9206935Z  If the issue body contains "---" then the text above that is the settings 2025-03-04T19:47:19.9207822Z  and the text below is the list of opted in users. 2025-03-04T19:47:19.9208402Z  2025-03-04T19:47:19.9209009Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-03-04T19:47:19.9209747Z  """ 2025-03-04T19:47:19.9210342Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-03-04T19:47:19.9211249Z  return parse_settings_from_text(settings_text) 2025-03-04T19:47:19.9211817Z  2025-03-04T19:47:19.9212169Z  2025-03-04T19:47:19.9212633Z def parse_users(rollout_state: str) -> UserOptins: 2025-03-04T19:47:19.9213215Z  """ 2025-03-04T19:47:19.9213652Z  Parse users from the rollout state. 2025-03-04T19:47:19.9214172Z  2025-03-04T19:47:19.9214530Z  """ 2025-03-04T19:47:19.9215101Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-03-04T19:47:19.9215873Z  return parse_user_opt_in_from_text(users_text) 2025-03-04T19:47:19.9216433Z  2025-03-04T19:47:19.9216788Z  2025-03-04T19:47:19.9217535Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-03-04T19:47:19.9218300Z  """ 2025-03-04T19:47:19.9218758Z  Check if a user is opted into an experiment 2025-03-04T19:47:19.9219323Z  """ 2025-03-04T19:47:19.9219837Z  return experiment_name in user_optins.get(user, []) 2025-03-04T19:47:19.9220429Z  2025-03-04T19:47:19.9220780Z  2025-03-04T19:47:19.9221415Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-03-04T19:47:19.9222183Z  """ 2025-03-04T19:47:19.9222684Z  Check if a user explicitly opted out of an experiment 2025-03-04T19:47:19.9223285Z  """ 2025-03-04T19:47:19.9223828Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-03-04T19:47:19.9224683Z  experiment_optout = "-" + experiment_name 2025-03-04T19:47:19.9225361Z  if experiment_optout not in user_optins.get(user, []): 2025-03-04T19:47:19.9225973Z  return False 2025-03-04T19:47:19.9226408Z  2025-03-04T19:47:19.9226901Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-03-04T19:47:19.9227638Z  log.warning( 2025-03-04T19:47:19.9228489Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-03-04T19:47:19.9229368Z  ) 2025-03-04T19:47:19.9229753Z  2025-03-04T19:47:19.9230120Z  return True 2025-03-04T19:47:19.9230539Z  2025-03-04T19:47:19.9230883Z  2025-03-04T19:47:19.9231262Z def get_runner_prefix( 2025-03-04T19:47:19.9231748Z  rollout_state: str, 2025-03-04T19:47:19.9232269Z  workflow_requestors: Iterable[str], 2025-03-04T19:47:19.9232811Z  branch: str, 2025-03-04T19:47:19.9233355Z  eligible_experiments: frozenset[str] = frozenset(), 2025-03-04T19:47:19.9233975Z  is_canary: bool = False, 2025-03-04T19:47:19.9234483Z ) -> str: 2025-03-04T19:47:19.9234959Z  settings = parse_settings(rollout_state) 2025-03-04T19:47:19.9235567Z  user_optins = parse_users(rollout_state) 2025-03-04T19:47:19.9236099Z  2025-03-04T19:47:19.9236470Z  fleet_prefix = "" 2025-03-04T19:47:19.9236936Z  prefixes = [] 2025-03-04T19:47:19.9237731Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-03-04T19:47:19.9238687Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-03-04T19:47:19.9239410Z  log.info( 2025-03-04T19:47:19.9240127Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-03-04T19:47:19.9240958Z  ) 2025-03-04T19:47:19.9241385Z  continue 2025-03-04T19:47:19.9241816Z  2025-03-04T19:47:19.9242212Z  if eligible_experiments: 2025-03-04T19:47:19.9242986Z  if experiment_name not in eligible_experiments: 2025-03-04T19:47:19.9243676Z  exp_list = ", ".join(eligible_experiments) 2025-03-04T19:47:19.9244252Z  log.info( 2025-03-04T19:47:19.9245077Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-03-04T19:47:19.9245905Z  ) 2025-03-04T19:47:19.9246341Z  continue 2025-03-04T19:47:19.9246875Z  elif not experiment_settings.default: 2025-03-04T19:47:19.9247516Z  log.info( 2025-03-04T19:47:19.9248231Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-03-04T19:47:19.9248983Z  ) 2025-03-04T19:47:19.9249410Z  continue 2025-03-04T19:47:19.9249847Z  2025-03-04T19:47:19.9250339Z  # Is any workflow_requestor opted out to this experiment? 2025-03-04T19:47:19.9250973Z  opted_out_users = [ 2025-03-04T19:47:19.9251468Z  requestor 2025-03-04T19:47:19.9251984Z  for requestor in workflow_requestors 2025-03-04T19:47:19.9252684Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-03-04T19:47:19.9253320Z  ] 2025-03-04T19:47:19.9253696Z  2025-03-04T19:47:19.9254078Z  if opted_out_users: 2025-03-04T19:47:19.9254578Z  log.info( 2025-03-04T19:47:19.9255246Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-03-04T19:47:19.9256083Z  ) 2025-03-04T19:47:19.9256499Z  continue 2025-03-04T19:47:19.9256934Z  2025-03-04T19:47:19.9257558Z  # Is any workflow_requestor opted in to this experiment? 2025-03-04T19:47:19.9258231Z  opted_in_users = [ 2025-03-04T19:47:19.9258732Z  requestor 2025-03-04T19:47:19.9259239Z  for requestor in workflow_requestors 2025-03-04T19:47:19.9259933Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-03-04T19:47:19.9260566Z  ] 2025-03-04T19:47:19.9260954Z  2025-03-04T19:47:19.9261325Z  enabled = False 2025-03-04T19:47:19.9261802Z  if opted_in_users: 2025-03-04T19:47:19.9262287Z  log.info( 2025-03-04T19:47:19.9262934Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-03-04T19:47:19.9263628Z  ) 2025-03-04T19:47:19.9264055Z  enabled = True 2025-03-04T19:47:19.9264521Z  2025-03-04T19:47:19.9264944Z  elif experiment_settings.rollout_perc: 2025-03-04T19:47:19.9265787Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-03-04T19:47:19.9266731Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-03-04T19:47:19.9267503Z  log.info( 2025-03-04T19:47:19.9268406Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-03-04T19:47:19.9269305Z  ) 2025-03-04T19:47:19.9269759Z  enabled = True 2025-03-04T19:47:19.9270237Z  2025-03-04T19:47:19.9270612Z  if enabled: 2025-03-04T19:47:19.9271096Z  label = experiment_name 2025-03-04T19:47:19.9271691Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-03-04T19:47:19.9272532Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-03-04T19:47:19.9273551Z  # - If it's enabled, then we always list it's prefix first 2025-03-04T19:47:19.9274344Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-03-04T19:47:19.9275019Z  if is_canary: 2025-03-04T19:47:19.9275560Z  label += CANARY_FLEET_SUFFIX 2025-03-04T19:47:19.9276129Z  fleet_prefix = label 2025-03-04T19:47:19.9276651Z  else: 2025-03-04T19:47:19.9277224Z  prefixes.append(label) 2025-03-04T19:47:19.9277751Z  2025-03-04T19:47:19.9278131Z  if len(prefixes) > 1: 2025-03-04T19:47:19.9278614Z  log.error( 2025-03-04T19:47:19.9279673Z  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-03-04T19:47:19.9280759Z  ) 2025-03-04T19:47:19.9281183Z  prefixes = prefixes[:1] 2025-03-04T19:47:19.9281679Z  2025-03-04T19:47:19.9282065Z  # Fleet always comes first 2025-03-04T19:47:19.9282578Z  if fleet_prefix: 2025-03-04T19:47:19.9283070Z  prefixes.insert(0, fleet_prefix) 2025-03-04T19:47:19.9283587Z  2025-03-04T19:47:19.9284063Z  return ".".join(prefixes) + "." if prefixes else "" 2025-03-04T19:47:19.9284641Z  2025-03-04T19:47:19.9284988Z  2025-03-04T19:47:19.9285633Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-03-04T19:47:19.9286402Z  """ 2025-03-04T19:47:19.9287242Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-03-04T19:47:19.9287960Z  2025-03-04T19:47:19.9288834Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-03-04T19:47:19.9289922Z  """ 2025-03-04T19:47:19.9290658Z  gh = get_gh_client(github_token) 2025-03-04T19:47:19.9291549Z  issue = get_issue(gh, repo, issue_num) 2025-03-04T19:47:19.9292635Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-03-04T19:47:19.9293489Z  2025-03-04T19:47:19.9293847Z  2025-03-04T19:47:19.9294464Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-03-04T19:47:19.9295236Z  for _ in range(num_retries): 2025-03-04T19:47:19.9295742Z  try: 2025-03-04T19:47:19.9296227Z  req = Request(url=url, headers=headers) 2025-03-04T19:47:19.9296914Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-03-04T19:47:19.9297749Z  return json.loads(content) 2025-03-04T19:47:19.9298310Z  except Exception as e: 2025-03-04T19:47:19.9298898Z  log.warning(f"Could not download {url}: {e}") 2025-03-04T19:47:19.9299472Z  2025-03-04T19:47:19.9300061Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-03-04T19:47:19.9300788Z  return {} 2025-03-04T19:47:19.9301201Z  2025-03-04T19:47:19.9301550Z  2025-03-04T19:47:19.9301909Z @cache 2025-03-04T19:47:19.9302576Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-03-04T19:47:19.9303326Z  """ 2025-03-04T19:47:19.9303750Z  Dynamically get PR information 2025-03-04T19:47:19.9304262Z  """ 2025-03-04T19:47:19.9304927Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-03-04T19:47:19.9305586Z  headers = { 2025-03-04T19:47:19.9306099Z  "Accept": "application/vnd.github.v3+json", 2025-03-04T19:47:19.9306728Z  "Authorization": f"token {github_token}", 2025-03-04T19:47:19.9307398Z  } 2025-03-04T19:47:19.9308062Z  json_response: dict[str, Any] = download_json( 2025-03-04T19:47:19.9308794Z  url=f"{github_api}/issues/{pr_number}", 2025-03-04T19:47:19.9309350Z  headers=headers, 2025-03-04T19:47:19.9309818Z  ) 2025-03-04T19:47:19.9310195Z  2025-03-04T19:47:19.9310565Z  if not json_response: 2025-03-04T19:47:19.9311189Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-03-04T19:47:19.9311831Z  return {} 2025-03-04T19:47:19.9312270Z  2025-03-04T19:47:19.9312655Z  return json_response 2025-03-04T19:47:19.9313124Z  2025-03-04T19:47:19.9313473Z  2025-03-04T19:47:19.9314079Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-03-04T19:47:19.9314812Z  """ 2025-03-04T19:47:19.9315388Z  Dynamically get the latest list of labels from the pull request 2025-03-04T19:47:19.9316056Z  """ 2025-03-04T19:47:19.9316572Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-03-04T19:47:19.9317298Z  return { 2025-03-04T19:47:19.9317920Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-03-04T19:47:19.9318619Z  } 2025-03-04T19:47:19.9319047Z  2025-03-04T19:47:19.9319395Z  2025-03-04T19:47:19.9319771Z def main() -> None: 2025-03-04T19:47:19.9320238Z  args = parse_args() 2025-03-04T19:47:19.9320707Z  2025-03-04T19:47:19.9321147Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-03-04T19:47:19.9321835Z  2025-03-04T19:47:19.9322228Z  # Check if the PR is opt-out 2025-03-04T19:47:19.9322753Z  if args.pr_number: 2025-03-04T19:47:19.9323450Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-03-04T19:47:19.9324218Z  if OPT_OUT_LABEL in labels: 2025-03-04T19:47:19.9324751Z  log.info( 2025-03-04T19:47:19.9325472Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-03-04T19:47:19.9326234Z  ) 2025-03-04T19:47:19.9326835Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-03-04T19:47:19.9327638Z  sys.exit() 2025-03-04T19:47:19.9328093Z  2025-03-04T19:47:19.9328446Z  try: 2025-03-04T19:47:19.9328924Z  rollout_state = get_rollout_state_from_issue( 2025-03-04T19:47:19.9329664Z  args.github_token, args.github_issue_repo, args.github_issue 2025-03-04T19:47:19.9330309Z  ) 2025-03-04T19:47:19.9330699Z  2025-03-04T19:47:19.9331113Z  username = get_potential_pr_author( 2025-03-04T19:47:19.9331663Z  args.github_token, 2025-03-04T19:47:19.9332183Z  args.github_repo, 2025-03-04T19:47:19.9332705Z  args.github_actor, 2025-03-04T19:47:19.9333234Z  args.github_ref_type, 2025-03-04T19:47:19.9333757Z  args.github_branch, 2025-03-04T19:47:19.9334246Z  ) 2025-03-04T19:47:19.9334634Z  2025-03-04T19:47:19.9335127Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-03-04T19:47:19.9335748Z  2025-03-04T19:47:19.9336181Z  runner_label_prefix = get_runner_prefix( 2025-03-04T19:47:19.9336742Z  rollout_state, 2025-03-04T19:47:19.9337388Z  (args.github_issue_owner, username), 2025-03-04T19:47:19.9338000Z  args.github_branch, 2025-03-04T19:47:19.9338553Z  args.eligible_experiments, 2025-03-04T19:47:19.9339085Z  is_canary, 2025-03-04T19:47:19.9339670Z  ) 2025-03-04T19:47:19.9340068Z  2025-03-04T19:47:19.9340504Z  except Exception as e: 2025-03-04T19:47:19.9340991Z  log.error( 2025-03-04T19:47:19.9341710Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-03-04T19:47:19.9342463Z  ) 2025-03-04T19:47:19.9342845Z  2025-03-04T19:47:19.9343392Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-03-04T19:47:19.9344048Z  2025-03-04T19:47:19.9344404Z  2025-03-04T19:47:19.9344777Z if __name__ == "__main__": 2025-03-04T19:47:19.9345248Z  main() 2025-03-04T19:47:19.9345650Z  2025-03-04T19:47:19.9346007Z EOF 2025-03-04T19:47:19.9346373Z  2025-03-04T19:47:19.9346764Z cat runner_determinator.py 2025-03-04T19:47:19.9750565Z shell: /usr/bin/bash -e {0} 2025-03-04T19:47:19.9751436Z env: 2025-03-04T19:47:19.9752182Z GITHUB_TOKEN: *** 2025-03-04T19:47:19.9752614Z ISSUE_NUMBER: 5132 2025-03-04T19:47:19.9753123Z TRIGGERING_ACTOR: pytorch-bot[bot] 2025-03-04T19:47:19.9753629Z ISSUE_OWNER: 2025-03-04T19:47:19.9754022Z CHECK_EXPERIMENTS: 2025-03-04T19:47:19.9754433Z PR_NUMBER: 2025-03-04T19:47:19.9754818Z ##[endgroup] 2025-03-04T19:47:20.0017838Z # flake8: noqa: G004 2025-03-04T19:47:20.0018194Z 2025-03-04T19:47:20.0018639Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-03-04T19:47:20.0019571Z # must be kept in sync. You can do it easily by running the following command: 2025-03-04T19:47:20.0020358Z # python .github/scripts/update_runner_determinator.py 2025-03-04T19:47:20.0021063Z 2025-03-04T19:47:20.0021219Z """ 2025-03-04T19:47:20.0021778Z This runner determinator is used to determine which set of runners to run a 2025-03-04T19:47:20.0022618Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-03-04T19:47:20.0023505Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-03-04T19:47:20.0024278Z of which runners should be used to run which job. 2025-03-04T19:47:20.0024664Z 2025-03-04T19:47:20.0025032Z The configuration has two parts, the settings and a list of opted-in users, 2025-03-04T19:47:20.0025898Z separated by a line containing "---". If the line is not present, the 2025-03-04T19:47:20.0026733Z settings are considered to be empty with only the second part, the user 2025-03-04T19:47:20.0027635Z list, defined. 2025-03-04T19:47:20.0027872Z 2025-03-04T19:47:20.0028235Z The first part is a YAML block that defines the rollout settings. This can be 2025-03-04T19:47:20.0029116Z used to define any settings that are needed to determine which runners to use. 2025-03-04T19:47:20.0029916Z It's fields are defined by the RolloutSettings class below. 2025-03-04T19:47:20.0030345Z 2025-03-04T19:47:20.0030697Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-03-04T19:47:20.0031541Z The user list is also a comma separated list of additional features or 2025-03-04T19:47:20.0032245Z experiments which the user could be opted in to. 2025-03-04T19:47:20.0032629Z 2025-03-04T19:47:20.0032825Z The user list has the following rules: 2025-03-04T19:47:20.0033158Z 2025-03-04T19:47:20.0033459Z - Users are GitHub usernames, which must start with the @ prefix 2025-03-04T19:47:20.0034312Z - Each user is also a comma-separated list of features/experiments to enable 2025-03-04T19:47:20.0035062Z - A "#" prefix opts the user out of all experiments 2025-03-04T19:47:20.0035444Z 2025-03-04T19:47:20.0035615Z Example config: 2025-03-04T19:47:20.0036054Z # A list of experiments that can be opted into. 2025-03-04T19:47:20.0036697Z # This defines the behavior they'll induce when opted into. 2025-03-04T19:47:20.0037470Z # Expected syntax is: 2025-03-04T19:47:20.0038090Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-03-04T19:47:20.0039188Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-03-04T19:47:20.0039781Z 2025-03-04T19:47:20.0039952Z experiments: 2025-03-04T19:47:20.0040329Z lf: 2025-03-04T19:47:20.0040688Z rollout_percent: 25 2025-03-04T19:47:20.0041140Z all_branches: false 2025-03-04T19:47:20.0041574Z default: true 2025-03-04T19:47:20.0041972Z --- 2025-03-04T19:47:20.0042170Z 2025-03-04T19:47:20.0042336Z # Opt-ins: 2025-03-04T19:47:20.0042902Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-03-04T19:47:20.0043742Z # and specifying experiments to enable in a comma-separated list. 2025-03-04T19:47:20.0044493Z # To always opt out of an experiment, prefix it with a "-". 2025-03-04T19:47:20.0045126Z # Experiments should be from the above list. 2025-03-04T19:47:20.0045492Z 2025-03-04T19:47:20.0045671Z @User1,-lf,split_build 2025-03-04T19:47:20.0046088Z @User2,lf 2025-03-04T19:47:20.0046473Z @User3,split_build 2025-03-04T19:47:20.0046870Z """ 2025-03-04T19:47:20.0047605Z 2025-03-04T19:47:20.0047797Z import json 2025-03-04T19:47:20.0048167Z import logging 2025-03-04T19:47:20.0048535Z import os 2025-03-04T19:47:20.0048893Z import random 2025-03-04T19:47:20.0049255Z import re 2025-03-04T19:47:20.0049609Z import sys 2025-03-04T19:47:20.0049996Z from argparse import ArgumentParser 2025-03-04T19:47:20.0050510Z from collections.abc import Iterable 2025-03-04T19:47:20.0051009Z from functools import cache 2025-03-04T19:47:20.0051471Z from logging import LogRecord 2025-03-04T19:47:20.0051944Z from typing import Any, NamedTuple 2025-03-04T19:47:20.0052635Z from urllib.request import Request, urlopen 2025-03-04T19:47:20.0052991Z 2025-03-04T19:47:20.0053147Z import yaml 2025-03-04T19:47:20.0053533Z from github import Auth, Github 2025-03-04T19:47:20.0054003Z from github.Issue import Issue 2025-03-04T19:47:20.0054299Z 2025-03-04T19:47:20.0054305Z 2025-03-04T19:47:20.0054527Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-03-04T19:47:20.0055185Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-03-04T19:47:20.0056020Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-03-04T19:47:20.0056562Z 2025-03-04T19:47:20.0056777Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-03-04T19:47:20.0057751Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-03-04T19:47:20.0058266Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-03-04T19:47:20.0058806Z OPT_OUT_LABEL = "no-runner-experiments" 2025-03-04T19:47:20.0059143Z 2025-03-04T19:47:20.0059338Z SETTING_EXPERIMENTS = "experiments" 2025-03-04T19:47:20.0059664Z 2025-03-04T19:47:20.0059852Z LF_FLEET_EXPERIMENT = "lf" 2025-03-04T19:47:20.0060301Z CANARY_FLEET_SUFFIX = ".c" 2025-03-04T19:47:20.0060576Z 2025-03-04T19:47:20.0060582Z 2025-03-04T19:47:20.0060769Z class Experiment(NamedTuple): 2025-03-04T19:47:20.0061235Z rollout_perc: float = ( 2025-03-04T19:47:20.0061853Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-03-04T19:47:20.0062513Z ) 2025-03-04T19:47:20.0062865Z all_branches: bool = ( 2025-03-04T19:47:20.0063476Z False # If True, the experiment is also enabled on the exception branches 2025-03-04T19:47:20.0064131Z ) 2025-03-04T19:47:20.0064482Z default: bool = ( 2025-03-04T19:47:20.0065032Z True # If True, the experiment is enabled by default for all queries 2025-03-04T19:47:20.0065658Z ) 2025-03-04T19:47:20.0065853Z 2025-03-04T19:47:20.0066093Z # Add more fields as needed 2025-03-04T19:47:20.0066542Z 2025-03-04T19:47:20.0066556Z 2025-03-04T19:47:20.0066864Z class Settings(NamedTuple): 2025-03-04T19:47:20.0067800Z """ 2025-03-04T19:47:20.0068272Z Settings for the experiments that can be opted into. 2025-03-04T19:47:20.0068824Z """ 2025-03-04T19:47:20.0069021Z 2025-03-04T19:47:20.0069221Z experiments: dict[str, Experiment] = {} 2025-03-04T19:47:20.0069581Z 2025-03-04T19:47:20.0069588Z 2025-03-04T19:47:20.0069969Z class ColorFormatter(logging.Formatter): 2025-03-04T19:47:20.0070580Z """Color codes the log messages based on the log level""" 2025-03-04T19:47:20.0071053Z 2025-03-04T19:47:20.0071230Z COLORS = { 2025-03-04T19:47:20.0071621Z "WARNING": "\033[33m", # Yellow 2025-03-04T19:47:20.0072109Z "ERROR": "\033[31m", # Red 2025-03-04T19:47:20.0072581Z "CRITICAL": "\033[31m", # Red 2025-03-04T19:47:20.0073063Z "INFO": "\033[0m", # Reset 2025-03-04T19:47:20.0073532Z "DEBUG": "\033[0m", # Reset 2025-03-04T19:47:20.0073987Z } 2025-03-04T19:47:20.0074171Z 2025-03-04T19:47:20.0074382Z def format(self, record: LogRecord) -> str: 2025-03-04T19:47:20.0075116Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-03-04T19:47:20.0075853Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-03-04T19:47:20.0076421Z return super().format(record) 2025-03-04T19:47:20.0076744Z 2025-03-04T19:47:20.0076750Z 2025-03-04T19:47:20.0076956Z handler = logging.StreamHandler() 2025-03-04T19:47:20.0077898Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-03-04T19:47:20.0078438Z 2025-03-04T19:47:20.0078674Z log = logging.getLogger(os.path.basename(__file__)) 2025-03-04T19:47:20.0079239Z log.addHandler(handler) 2025-03-04T19:47:20.0079667Z log.setLevel(logging.INFO) 2025-03-04T19:47:20.0079937Z 2025-03-04T19:47:20.0079944Z 2025-03-04T19:47:20.0080187Z def set_github_output(key: str, value: str) -> None: 2025-03-04T19:47:20.0080729Z """ 2025-03-04T19:47:20.0081208Z Defines outputs of the github action that invokes this script 2025-03-04T19:47:20.0081976Z """ 2025-03-04T19:47:20.0082335Z if not GITHUB_OUTPUT: 2025-03-04T19:47:20.0083367Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-03-04T19:47:20.0084537Z log.warning( 2025-03-04T19:47:20.0085346Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-03-04T19:47:20.0086223Z ) 2025-03-04T19:47:20.0097982Z print(f"::set-output name={key}::{value}") 2025-03-04T19:47:20.0098584Z return 2025-03-04T19:47:20.0098815Z 2025-03-04T19:47:20.0099015Z with open(GITHUB_OUTPUT, "a") as f: 2025-03-04T19:47:20.0099587Z log.info(f"Setting output: {key}='{value}'") 2025-03-04T19:47:20.0100144Z f.write(f"{key}={value}\n") 2025-03-04T19:47:20.0100464Z 2025-03-04T19:47:20.0100470Z 2025-03-04T19:47:20.0100757Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-03-04T19:47:20.0101391Z return frozenset( 2025-03-04T19:47:20.0101974Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-03-04T19:47:20.0102638Z ) 2025-03-04T19:47:20.0102833Z 2025-03-04T19:47:20.0102839Z 2025-03-04T19:47:20.0103031Z def parse_args() -> Any: 2025-03-04T19:47:20.0103569Z parser = ArgumentParser("Get dynamic rollout settings") 2025-03-04T19:47:20.0104398Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-03-04T19:47:20.0105130Z parser.add_argument( 2025-03-04T19:47:20.0105578Z "--github-issue-repo", 2025-03-04T19:47:20.0106050Z type=str, 2025-03-04T19:47:20.0106441Z required=False, 2025-03-04T19:47:20.0106883Z default="pytorch/test-infra", 2025-03-04T19:47:20.0107653Z help="GitHub repo to get the issue", 2025-03-04T19:47:20.0108165Z ) 2025-03-04T19:47:20.0108520Z parser.add_argument( 2025-03-04T19:47:20.0108956Z "--github-repo", 2025-03-04T19:47:20.0109377Z type=str, 2025-03-04T19:47:20.0109763Z required=True, 2025-03-04T19:47:20.0110213Z help="GitHub repo where CI is running", 2025-03-04T19:47:20.0110722Z ) 2025-03-04T19:47:20.0111078Z parser.add_argument( 2025-03-04T19:47:20.0111665Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-03-04T19:47:20.0112498Z ) 2025-03-04T19:47:20.0112859Z parser.add_argument( 2025-03-04T19:47:20.0113447Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-03-04T19:47:20.0114093Z ) 2025-03-04T19:47:20.0114444Z parser.add_argument( 2025-03-04T19:47:20.0115048Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-03-04T19:47:20.0115706Z ) 2025-03-04T19:47:20.0116057Z parser.add_argument( 2025-03-04T19:47:20.0116683Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-03-04T19:47:20.0117617Z ) 2025-03-04T19:47:20.0117977Z parser.add_argument( 2025-03-04T19:47:20.0118439Z "--github-ref-type", 2025-03-04T19:47:20.0118880Z type=str, 2025-03-04T19:47:20.0119263Z required=True, 2025-03-04T19:47:20.0119731Z help="Current GitHub ref type, branch or tag", 2025-03-04T19:47:20.0120258Z ) 2025-03-04T19:47:20.0120609Z parser.add_argument( 2025-03-04T19:47:20.0121054Z "--eligible-experiments", 2025-03-04T19:47:20.0121547Z type=_str_comma_separated_to_set, 2025-03-04T19:47:20.0122048Z required=False, 2025-03-04T19:47:20.0122458Z default="", 2025-03-04T19:47:20.0123257Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-03-04T19:47:20.0124157Z ) 2025-03-04T19:47:20.0124511Z parser.add_argument( 2025-03-04T19:47:20.0124935Z "--pr-number", 2025-03-04T19:47:20.0125333Z type=str, 2025-03-04T19:47:20.0125711Z required=False, 2025-03-04T19:47:20.0126115Z default="", 2025-03-04T19:47:20.0126750Z help="the optional PR number where this is run", 2025-03-04T19:47:20.0127562Z ) 2025-03-04T19:47:20.0127762Z 2025-03-04T19:47:20.0127959Z return parser.parse_args() 2025-03-04T19:47:20.0128261Z 2025-03-04T19:47:20.0128267Z 2025-03-04T19:47:20.0128666Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-03-04T19:47:20.0129398Z auth = Auth.Token(github_token) 2025-03-04T19:47:20.0129894Z return Github(auth=auth) 2025-03-04T19:47:20.0130207Z 2025-03-04T19:47:20.0130213Z 2025-03-04T19:47:20.0130649Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-03-04T19:47:20.0131422Z repo = gh.get_repo(repo) 2025-03-04T19:47:20.0131917Z return repo.get_issue(number=issue_num) 2025-03-04T19:47:20.0132272Z 2025-03-04T19:47:20.0132278Z 2025-03-04T19:47:20.0132466Z def get_potential_pr_author( 2025-03-04T19:47:20.0133083Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-03-04T19:47:20.0133741Z ) -> str: 2025-03-04T19:47:20.0134244Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-03-04T19:47:20.0135020Z # Fetch the actual username from the original PR. The PR number is 2025-03-04T19:47:20.0135736Z # embedded in the tag name: ciflow// 2025-03-04T19:47:20.0136134Z 2025-03-04T19:47:20.0136316Z gh = get_gh_client(github_token) 2025-03-04T19:47:20.0136645Z 2025-03-04T19:47:20.0136904Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-03-04T19:47:20.0137674Z split_tag = ref_name.split("/") 2025-03-04T19:47:20.0138161Z if ( 2025-03-04T19:47:20.0138534Z len(split_tag) == 3 2025-03-04T19:47:20.0138994Z and split_tag[0] == "ciflow" 2025-03-04T19:47:20.0139501Z and split_tag[2].isnumeric() 2025-03-04T19:47:20.0139979Z ): 2025-03-04T19:47:20.0140358Z pr_number = split_tag[2] 2025-03-04T19:47:20.0140833Z try: 2025-03-04T19:47:20.0141244Z repository = gh.get_repo(repo) 2025-03-04T19:47:20.0141830Z pull = repository.get_pull(number=int(pr_number)) 2025-03-04T19:47:20.0142408Z except Exception as e: 2025-03-04T19:47:20.0142902Z raise Exception( # noqa: TRY002 2025-03-04T19:47:20.0143703Z f"issue with pull request {pr_number} from repo {repository}" 2025-03-04T19:47:20.0144323Z ) from e 2025-03-04T19:47:20.0144847Z return pull.user.login # type: ignore[no-any-return] 2025-03-04T19:47:20.0145516Z # In all other cases, return the original input username 2025-03-04T19:47:20.0146074Z return username 2025-03-04T19:47:20.0146302Z 2025-03-04T19:47:20.0146308Z 2025-03-04T19:47:20.0146527Z def is_exception_branch(branch: str) -> bool: 2025-03-04T19:47:20.0147041Z """ 2025-03-04T19:47:20.0147786Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-03-04T19:47:20.0148529Z """ 2025-03-04T19:47:20.0149053Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-03-04T19:47:20.0149553Z 2025-03-04T19:47:20.0149558Z 2025-03-04T19:47:20.0149767Z def load_yaml(yaml_text: str) -> Any: 2025-03-04T19:47:20.0150244Z try: 2025-03-04T19:47:20.0150623Z data = yaml.safe_load(yaml_text) 2025-03-04T19:47:20.0151114Z return data 2025-03-04T19:47:20.0151519Z except yaml.YAMLError: 2025-03-04T19:47:20.0151995Z log.exception("Error loading YAML") 2025-03-04T19:47:20.0152497Z raise 2025-03-04T19:47:20.0152706Z 2025-03-04T19:47:20.0152712Z 2025-03-04T19:47:20.0153110Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-03-04T19:47:20.0153809Z """ 2025-03-04T19:47:20.0154405Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-03-04T19:47:20.0154977Z 2025-03-04T19:47:20.0155304Z If the issue body contains "---" then the text above that is the settings 2025-03-04T19:47:20.0156178Z and the text below is the list of opted in users. 2025-03-04T19:47:20.0156566Z 2025-03-04T19:47:20.0156927Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-03-04T19:47:20.0157738Z """ 2025-03-04T19:47:20.0158170Z rollout_state_parts = rollout_state.split("---") 2025-03-04T19:47:20.0158743Z if len(rollout_state_parts) >= 2: 2025-03-04T19:47:20.0159330Z return rollout_state_parts[0], rollout_state_parts[1] 2025-03-04T19:47:20.0159898Z else: 2025-03-04T19:47:20.0160276Z return "", rollout_state 2025-03-04T19:47:20.0160569Z 2025-03-04T19:47:20.0160575Z 2025-03-04T19:47:20.0160769Z class UserOptins(dict[str, list[str]]): 2025-03-04T19:47:20.0161265Z """ 2025-03-04T19:47:20.0161766Z Dictionary of users with a list of features they have opted into 2025-03-04T19:47:20.0162385Z """ 2025-03-04T19:47:20.0162574Z 2025-03-04T19:47:20.0162580Z 2025-03-04T19:47:20.0162915Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-03-04T19:47:20.0163537Z """ 2025-03-04T19:47:20.0164221Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-03-04T19:47:20.0164876Z 2025-03-04T19:47:20.0165902Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-03-04T19:47:20.0166869Z - Example line: "@User1,lf,split_build" 2025-03-04T19:47:20.0167692Z - A "#" prefix indicates the user is opted out of all experiments 2025-03-04T19:47:20.0168155Z 2025-03-04T19:47:20.0168161Z 2025-03-04T19:47:20.0168325Z """ 2025-03-04T19:47:20.0168696Z optins = UserOptins() 2025-03-04T19:47:20.0169156Z for user in user_optin_text.split("\n"): 2025-03-04T19:47:20.0169687Z user = user.strip("\r\n\t -") 2025-03-04T19:47:20.0170208Z if not user or not user.startswith("@"): 2025-03-04T19:47:20.0170749Z # Not a valid user. Skip 2025-03-04T19:47:20.0171211Z continue 2025-03-04T19:47:20.0171453Z 2025-03-04T19:47:20.0171606Z if user: 2025-03-04T19:47:20.0172033Z usr_name = user.split(",")[0].strip("@") 2025-03-04T19:47:20.0172863Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-03-04T19:47:20.0173560Z 2025-03-04T19:47:20.0173739Z return optins 2025-03-04T19:47:20.0173972Z 2025-03-04T19:47:20.0173978Z 2025-03-04T19:47:20.0174367Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-03-04T19:47:20.0175032Z """ 2025-03-04T19:47:20.0175592Z Check if the experiment name is valid. 2025-03-04T19:47:20.0176098Z A valid name: 2025-03-04T19:47:20.0176707Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-03-04T19:47:20.0177741Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-03-04T19:47:20.0178442Z - Cannot contain spaces 2025-03-04T19:47:20.0178885Z """ 2025-03-04T19:47:20.0179082Z 2025-03-04T19:47:20.0179334Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-03-04T19:47:20.0180004Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-03-04T19:47:20.0180423Z 2025-03-04T19:47:20.0180590Z if valid: 2025-03-04T19:47:20.0180958Z return True 2025-03-04T19:47:20.0181186Z 2025-03-04T19:47:20.0181350Z log.error( 2025-03-04T19:47:20.0182729Z 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-03-04T19:47:20.0184232Z ) 2025-03-04T19:47:20.0184589Z return False 2025-03-04T19:47:20.0184817Z 2025-03-04T19:47:20.0184829Z 2025-03-04T19:47:20.0185127Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-03-04T19:47:20.0185731Z """ 2025-03-04T19:47:20.0186298Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-03-04T19:47:20.0187253Z """ 2025-03-04T19:47:20.0187605Z try: 2025-03-04T19:47:20.0187974Z if settings_text: 2025-03-04T19:47:20.0188674Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-03-04T19:47:20.0189441Z # for easy reading 2025-03-04T19:47:20.0190187Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-03-04T19:47:20.0191028Z # the backtick character in shell commands. 2025-03-04T19:47:20.0191625Z backtick = chr(96) # backtick character 2025-03-04T19:47:20.0192259Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-03-04T19:47:20.0192895Z settings = load_yaml(settings_text) 2025-03-04T19:47:20.0193246Z 2025-03-04T19:47:20.0193641Z # For now we just load experiments. We can expand this if/when we add more settings 2025-03-04T19:47:20.0194358Z experiments = {} 2025-03-04T19:47:20.0194641Z 2025-03-04T19:47:20.0194977Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-03-04T19:47:20.0195695Z if not is_valid_experiment_name(exp_name): 2025-03-04T19:47:20.0196749Z # 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-03-04T19:47:20.0197906Z continue 2025-03-04T19:47:20.0198169Z 2025-03-04T19:47:20.0198356Z valid_settings = {} 2025-03-04T19:47:20.0198840Z for setting in exp_settings: 2025-03-04T19:47:20.0199386Z if setting not in Experiment._fields: 2025-03-04T19:47:20.0199917Z log.warning( 2025-03-04T19:47:20.0200596Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-03-04T19:47:20.0201289Z ) 2025-03-04T19:47:20.0201700Z else: 2025-03-04T19:47:20.0202187Z valid_settings[setting] = exp_settings[setting] 2025-03-04T19:47:20.0202596Z 2025-03-04T19:47:20.0202856Z experiments[exp_name] = Experiment(**valid_settings) 2025-03-04T19:47:20.0203626Z return Settings(experiments) 2025-03-04T19:47:20.0203969Z 2025-03-04T19:47:20.0204144Z except Exception: 2025-03-04T19:47:20.0204612Z log.exception("Failed to parse settings") 2025-03-04T19:47:20.0204975Z 2025-03-04T19:47:20.0205137Z return Settings() 2025-03-04T19:47:20.0205387Z 2025-03-04T19:47:20.0205392Z 2025-03-04T19:47:20.0205630Z def parse_settings(rollout_state: str) -> Settings: 2025-03-04T19:47:20.0206168Z """ 2025-03-04T19:47:20.0206584Z Parse settings, if any, from the rollout state. 2025-03-04T19:47:20.0206962Z 2025-03-04T19:47:20.0207458Z If the issue body contains "---" then the text above that is the settings 2025-03-04T19:47:20.0208183Z and the text below is the list of opted in users. 2025-03-04T19:47:20.0208576Z 2025-03-04T19:47:20.0209021Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-03-04T19:47:20.0209733Z """ 2025-03-04T19:47:20.0210262Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-03-04T19:47:20.0210977Z return parse_settings_from_text(settings_text) 2025-03-04T19:47:20.0211355Z 2025-03-04T19:47:20.0211361Z 2025-03-04T19:47:20.0211600Z def parse_users(rollout_state: str) -> UserOptins: 2025-03-04T19:47:20.0212123Z """ 2025-03-04T19:47:20.0212497Z Parse users from the rollout state. 2025-03-04T19:47:20.0212828Z 2025-03-04T19:47:20.0212982Z """ 2025-03-04T19:47:20.0213497Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-03-04T19:47:20.0214196Z return parse_user_opt_in_from_text(users_text) 2025-03-04T19:47:20.0214574Z 2025-03-04T19:47:20.0214580Z 2025-03-04T19:47:20.0215245Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-03-04T19:47:20.0215945Z """ 2025-03-04T19:47:20.0216347Z Check if a user is opted into an experiment 2025-03-04T19:47:20.0216862Z """ 2025-03-04T19:47:20.0217441Z return experiment_name in user_optins.get(user, []) 2025-03-04T19:47:20.0217844Z 2025-03-04T19:47:20.0217850Z 2025-03-04T19:47:20.0218248Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-03-04T19:47:20.0218955Z """ 2025-03-04T19:47:20.0219388Z Check if a user explicitly opted out of an experiment 2025-03-04T19:47:20.0219942Z """ 2025-03-04T19:47:20.0220416Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-03-04T19:47:20.0221076Z experiment_optout = "-" + experiment_name 2025-03-04T19:47:20.0221690Z if experiment_optout not in user_optins.get(user, []): 2025-03-04T19:47:20.0222256Z return False 2025-03-04T19:47:20.0222508Z 2025-03-04T19:47:20.0222768Z if is_user_opted_in(user, user_optins, experiment_name): 2025-03-04T19:47:20.0223329Z log.warning( 2025-03-04T19:47:20.0224090Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-03-04T19:47:20.0224923Z ) 2025-03-04T19:47:20.0225122Z 2025-03-04T19:47:20.0225279Z return True 2025-03-04T19:47:20.0225504Z 2025-03-04T19:47:20.0225510Z 2025-03-04T19:47:20.0225673Z def get_runner_prefix( 2025-03-04T19:47:20.0226087Z rollout_state: str, 2025-03-04T19:47:20.0226525Z workflow_requestors: Iterable[str], 2025-03-04T19:47:20.0227021Z branch: str, 2025-03-04T19:47:20.0227604Z eligible_experiments: frozenset[str] = frozenset(), 2025-03-04T19:47:20.0228162Z is_canary: bool = False, 2025-03-04T19:47:20.0228596Z ) -> str: 2025-03-04T19:47:20.0228995Z settings = parse_settings(rollout_state) 2025-03-04T19:47:20.0229549Z user_optins = parse_users(rollout_state) 2025-03-04T19:47:20.0229900Z 2025-03-04T19:47:20.0230069Z fleet_prefix = "" 2025-03-04T19:47:20.0230469Z prefixes = [] 2025-03-04T19:47:20.0231059Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-03-04T19:47:20.0231938Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-03-04T19:47:20.0232800Z log.info( 2025-03-04T19:47:20.0233466Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-03-04T19:47:20.0234179Z ) 2025-03-04T19:47:20.0234546Z continue 2025-03-04T19:47:20.0234794Z 2025-03-04T19:47:20.0234978Z if eligible_experiments: 2025-03-04T19:47:20.0235505Z if experiment_name not in eligible_experiments: 2025-03-04T19:47:20.0236112Z exp_list = ", ".join(eligible_experiments) 2025-03-04T19:47:20.0236639Z log.info( 2025-03-04T19:47:20.0237512Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-03-04T19:47:20.0238523Z ) 2025-03-04T19:47:20.0239074Z continue 2025-03-04T19:47:20.0239910Z elif not experiment_settings.default: 2025-03-04T19:47:20.0240744Z log.info( 2025-03-04T19:47:20.0241781Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-03-04T19:47:20.0242939Z ) 2025-03-04T19:47:20.0243316Z continue 2025-03-04T19:47:20.0243554Z 2025-03-04T19:47:20.0243829Z # Is any workflow_requestor opted out to this experiment? 2025-03-04T19:47:20.0244416Z opted_out_users = [ 2025-03-04T19:47:20.0244840Z requestor 2025-03-04T19:47:20.0245279Z for requestor in workflow_requestors 2025-03-04T19:47:20.0245913Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-03-04T19:47:20.0246519Z ] 2025-03-04T19:47:20.0246712Z 2025-03-04T19:47:20.0247253Z if opted_out_users: 2025-03-04T19:47:20.0247703Z log.info( 2025-03-04T19:47:20.0248289Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-03-04T19:47:20.0248947Z ) 2025-03-04T19:47:20.0249305Z continue 2025-03-04T19:47:20.0249537Z 2025-03-04T19:47:20.0249801Z # Is any workflow_requestor opted in to this experiment? 2025-03-04T19:47:20.0250379Z opted_in_users = [ 2025-03-04T19:47:20.0250808Z requestor 2025-03-04T19:47:20.0251242Z for requestor in workflow_requestors 2025-03-04T19:47:20.0251879Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-03-04T19:47:20.0252470Z ] 2025-03-04T19:47:20.0252663Z 2025-03-04T19:47:20.0252827Z enabled = False 2025-03-04T19:47:20.0253246Z if opted_in_users: 2025-03-04T19:47:20.0253664Z log.info( 2025-03-04T19:47:20.0254232Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-03-04T19:47:20.0254881Z ) 2025-03-04T19:47:20.0255252Z enabled = True 2025-03-04T19:47:20.0255523Z 2025-03-04T19:47:20.0255728Z elif experiment_settings.rollout_perc: 2025-03-04T19:47:20.0256510Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-03-04T19:47:20.0257542Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-03-04T19:47:20.0258167Z log.info( 2025-03-04T19:47:20.0258978Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-03-04T19:47:20.0259844Z ) 2025-03-04T19:47:20.0260236Z enabled = True 2025-03-04T19:47:20.0260523Z 2025-03-04T19:47:20.0260681Z if enabled: 2025-03-04T19:47:20.0261090Z label = experiment_name 2025-03-04T19:47:20.0261607Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-03-04T19:47:20.0262387Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-03-04T19:47:20.0263214Z # - If it's enabled, then we always list it's prefix first 2025-03-04T19:47:20.0264078Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-03-04T19:47:20.0264713Z if is_canary: 2025-03-04T19:47:20.0265183Z label += CANARY_FLEET_SUFFIX 2025-03-04T19:47:20.0265711Z fleet_prefix = label 2025-03-04T19:47:20.0266176Z else: 2025-03-04T19:47:20.0266586Z prefixes.append(label) 2025-03-04T19:47:20.0266930Z 2025-03-04T19:47:20.0267264Z if len(prefixes) > 1: 2025-03-04T19:47:20.0267703Z log.error( 2025-03-04T19:47:20.0268676Z 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-03-04T19:47:20.0269731Z ) 2025-03-04T19:47:20.0270108Z prefixes = prefixes[:1] 2025-03-04T19:47:20.0270413Z 2025-03-04T19:47:20.0270591Z # Fleet always comes first 2025-03-04T19:47:20.0271039Z if fleet_prefix: 2025-03-04T19:47:20.0271474Z prefixes.insert(0, fleet_prefix) 2025-03-04T19:47:20.0271810Z 2025-03-04T19:47:20.0272053Z return ".".join(prefixes) + "." if prefixes else "" 2025-03-04T19:47:20.0272449Z 2025-03-04T19:47:20.0272455Z 2025-03-04T19:47:20.0272868Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-03-04T19:47:20.0273603Z """ 2025-03-04T19:47:20.0274156Z Gets the first comment of the issue, which contains the desired rollout state. 2025-03-04T19:47:20.0274683Z 2025-03-04T19:47:20.0275042Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-03-04T19:47:20.0275704Z """ 2025-03-04T19:47:20.0276074Z gh = get_gh_client(github_token) 2025-03-04T19:47:20.0276585Z issue = get_issue(gh, repo, issue_num) 2025-03-04T19:47:20.0277462Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-03-04T19:47:20.0277885Z 2025-03-04T19:47:20.0277891Z 2025-03-04T19:47:20.0278273Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-03-04T19:47:20.0278992Z for _ in range(num_retries): 2025-03-04T19:47:20.0279450Z try: 2025-03-04T19:47:20.0279857Z req = Request(url=url, headers=headers) 2025-03-04T19:47:20.0280480Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-03-04T19:47:20.0281185Z return json.loads(content) 2025-03-04T19:47:20.0281960Z except Exception as e: 2025-03-04T19:47:20.0282931Z log.warning(f"Could not download {url}: {e}") 2025-03-04T19:47:20.0283562Z 2025-03-04T19:47:20.0284158Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-03-04T19:47:20.0285275Z return {} 2025-03-04T19:47:20.0285555Z 2025-03-04T19:47:20.0285579Z 2025-03-04T19:47:20.0285736Z @cache 2025-03-04T19:47:20.0286330Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-03-04T19:47:20.0287044Z """ 2025-03-04T19:47:20.0287855Z Dynamically get PR information 2025-03-04T19:47:20.0288552Z """ 2025-03-04T19:47:20.0289045Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-03-04T19:47:20.0289642Z headers = { 2025-03-04T19:47:20.0290086Z "Accept": "application/vnd.github.v3+json", 2025-03-04T19:47:20.0290662Z "Authorization": f"token {github_token}", 2025-03-04T19:47:20.0291155Z } 2025-03-04T19:47:20.0291563Z json_response: dict[str, Any] = download_json( 2025-03-04T19:47:20.0292135Z url=f"{github_api}/issues/{pr_number}", 2025-03-04T19:47:20.0292661Z headers=headers, 2025-03-04T19:47:20.0293065Z ) 2025-03-04T19:47:20.0293251Z 2025-03-04T19:47:20.0293419Z if not json_response: 2025-03-04T19:47:20.0293961Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-03-04T19:47:20.0294543Z return {} 2025-03-04T19:47:20.0294766Z 2025-03-04T19:47:20.0294941Z return json_response 2025-03-04T19:47:20.0295199Z 2025-03-04T19:47:20.0295206Z 2025-03-04T19:47:20.0295585Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-03-04T19:47:20.0296460Z """ 2025-03-04T19:47:20.0296977Z Dynamically get the latest list of labels from the pull request 2025-03-04T19:47:20.0297886Z """ 2025-03-04T19:47:20.0298355Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-03-04T19:47:20.0298982Z return { 2025-03-04T19:47:20.0299533Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-03-04T19:47:20.0300194Z } 2025-03-04T19:47:20.0300390Z 2025-03-04T19:47:20.0300397Z 2025-03-04T19:47:20.0300561Z def main() -> None: 2025-03-04T19:47:20.0300967Z args = parse_args() 2025-03-04T19:47:20.0301217Z 2025-03-04T19:47:20.0301437Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-03-04T19:47:20.0301810Z 2025-03-04T19:47:20.0302004Z # Check if the PR is opt-out 2025-03-04T19:47:20.0302467Z if args.pr_number: 2025-03-04T19:47:20.0303093Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-03-04T19:47:20.0303811Z if OPT_OUT_LABEL in labels: 2025-03-04T19:47:20.0304276Z log.info( 2025-03-04T19:47:20.0304927Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-03-04T19:47:20.0305645Z ) 2025-03-04T19:47:20.0306157Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-03-04T19:47:20.0306778Z sys.exit() 2025-03-04T19:47:20.0307022Z 2025-03-04T19:47:20.0307293Z try: 2025-03-04T19:47:20.0307709Z rollout_state = get_rollout_state_from_issue( 2025-03-04T19:47:20.0308374Z args.github_token, args.github_issue_repo, args.github_issue 2025-03-04T19:47:20.0309130Z ) 2025-03-04T19:47:20.0309330Z 2025-03-04T19:47:20.0309526Z username = get_potential_pr_author( 2025-03-04T19:47:20.0310035Z args.github_token, 2025-03-04T19:47:20.0310488Z args.github_repo, 2025-03-04T19:47:20.0310933Z args.github_actor, 2025-03-04T19:47:20.0311380Z args.github_ref_type, 2025-03-04T19:47:20.0311850Z args.github_branch, 2025-03-04T19:47:20.0312477Z ) 2025-03-04T19:47:20.0312793Z 2025-03-04T19:47:20.0313226Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-03-04T19:47:20.0313724Z 2025-03-04T19:47:20.0313936Z runner_label_prefix = get_runner_prefix( 2025-03-04T19:47:20.0314458Z rollout_state, 2025-03-04T19:47:20.0314920Z (args.github_issue_owner, username), 2025-03-04T19:47:20.0315448Z args.github_branch, 2025-03-04T19:47:20.0315914Z args.eligible_experiments, 2025-03-04T19:47:20.0316421Z is_canary, 2025-03-04T19:47:20.0316816Z ) 2025-03-04T19:47:20.0317016Z 2025-03-04T19:47:20.0317345Z except Exception as e: 2025-03-04T19:47:20.0317781Z log.error( 2025-03-04T19:47:20.0318410Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-03-04T19:47:20.0319129Z ) 2025-03-04T19:47:20.0319321Z 2025-03-04T19:47:20.0319636Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-03-04T19:47:20.0320099Z 2025-03-04T19:47:20.0320104Z 2025-03-04T19:47:20.0320273Z if __name__ == "__main__": 2025-03-04T19:47:20.0320721Z main() 2025-03-04T19:47:20.0320929Z 2025-03-04T19:47:20.0412283Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-03-04T19:47:20.0413171Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-03-04T19:47:20.0460559Z shell: /usr/bin/bash -e {0} 2025-03-04T19:47:20.0461299Z env: 2025-03-04T19:47:20.0462267Z GITHUB_TOKEN: *** 2025-03-04T19:47:20.0462780Z ISSUE_NUMBER: 5132 2025-03-04T19:47:20.0463251Z TRIGGERING_ACTOR: pytorch-bot[bot] 2025-03-04T19:47:20.0463763Z ISSUE_OWNER: 2025-03-04T19:47:20.0464160Z CHECK_EXPERIMENTS: 2025-03-04T19:47:20.0464592Z PR_NUMBER: 2025-03-04T19:47:20.0464969Z ##[endgroup] 2025-03-04T19:47:21.0778000Z Defaulting to user installation because normal site-packages is not writeable 2025-03-04T19:47:21.7679741Z Collecting urllib3==1.26.18 2025-03-04T19:47:21.8492577Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-03-04T19:47:21.8852077Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 2.0 MB/s eta 0:00:00 2025-03-04T19:47:21.9041382Z Collecting PyGithub==2.3.0 2025-03-04T19:47:21.9235915Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-03-04T19:47:21.9689452Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-03-04T19:47:21.9884877Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB) 2025-03-04T19:47:21.9938701Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-03-04T19:47:21.9956965Z 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-03-04T19:47:21.9971924Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-03-04T19:47:22.0241125Z Collecting Deprecated (from PyGithub==2.3.0) 2025-03-04T19:47:22.0435921Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB) 2025-03-04T19:47:22.0675017Z 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-03-04T19:47:22.1833464Z Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-03-04T19:47:22.2039072Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) 2025-03-04T19:47:22.3089670Z Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-03-04T19:47:22.3289029Z Downloading wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.4 kB) 2025-03-04T19:47:22.3587775Z Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub==2.3.0) 2025-03-04T19:47:22.3780425Z Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes) 2025-03-04T19:47:22.4181846Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-03-04T19:47:22.4428542Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 6.0 MB/s eta 0:00:00 2025-03-04T19:47:22.4622233Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-03-04T19:47:22.4865254Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 15.5 MB/s eta 0:00:00 2025-03-04T19:47:22.5061620Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2025-03-04T19:47:22.5319027Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 37.0 MB/s eta 0:00:00 2025-03-04T19:47:22.5516911Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB) 2025-03-04T19:47:22.5744887Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) 2025-03-04T19:47:22.5844620Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 66.0 MB/s eta 0:00:00 2025-03-04T19:47:22.6041513Z Downloading wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (89 kB) 2025-03-04T19:47:22.6086279Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 29.0 MB/s eta 0:00:00 2025-03-04T19:47:22.6279968Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2025-03-04T19:47:22.6436610Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 8.0 MB/s eta 0:00:00 2025-03-04T19:47:22.9527941Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-03-04T19:47:23.5053555Z Successfully installed Deprecated-1.2.18 PyGithub-2.3.0 cffi-1.17.1 pycparser-2.22 pynacl-1.5.0 urllib3-1.26.18 wrapt-1.17.2 2025-03-04T19:47:23.6165435Z ##[group]Run curr_branch="ciflow/inductor/148205" 2025-03-04T19:47:23.6165877Z curr_branch="ciflow/inductor/148205" 2025-03-04T19:47:23.6166155Z curr_ref_type="tag" 2025-03-04T19:47:23.6166406Z echo "Current branch is '$curr_branch'" 2025-03-04T19:47:23.6166675Z  2025-03-04T19:47:23.6166887Z python3 runner_determinator.py \ 2025-03-04T19:47:23.6167468Z  --github-token "$GITHUB_TOKEN" \ 2025-03-04T19:47:23.6167902Z  --github-issue "$ISSUE_NUMBER" \ 2025-03-04T19:47:23.6168176Z  --github-branch "$curr_branch" \ 2025-03-04T19:47:23.6168459Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-03-04T19:47:23.6168756Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-03-04T19:47:23.6169044Z  --github-ref-type "$curr_ref_type" \ 2025-03-04T19:47:23.6169330Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-03-04T19:47:23.6169713Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-03-04T19:47:23.6170022Z  --pr-number "${PR_NUMBER}" 2025-03-04T19:47:23.6217928Z shell: /usr/bin/bash -e {0} 2025-03-04T19:47:23.6218181Z env: 2025-03-04T19:47:23.6218993Z GITHUB_TOKEN: *** 2025-03-04T19:47:23.6219194Z ISSUE_NUMBER: 5132 2025-03-04T19:47:23.6219410Z TRIGGERING_ACTOR: pytorch-bot[bot] 2025-03-04T19:47:23.6219655Z ISSUE_OWNER: 2025-03-04T19:47:23.6219845Z CHECK_EXPERIMENTS: 2025-03-04T19:47:23.6220040Z PR_NUMBER: 2025-03-04T19:47:23.6220224Z ##[endgroup] 2025-03-04T19:47:23.6292338Z Current branch is 'ciflow/inductor/148205' 2025-03-04T19:47:25.8304489Z INFO : Skipping experiment 'awsa100', as it is not a default experiment 2025-03-04T19:47:25.8305570Z INFO : Setting output: label-type='' 2025-03-04T19:47:25.8687848Z Evaluate and set job outputs 2025-03-04T19:47:25.8695696Z Cleaning up orphan processes