2025-07-24T03:45:52.8382403Z Current runner version: '2.326.0' 2025-07-24T03:45:52.8407386Z ##[group]Runner Image Provisioner 2025-07-24T03:45:52.8408242Z Hosted Compute Agent 2025-07-24T03:45:52.8408842Z Version: 20250711.363 2025-07-24T03:45:52.8409454Z Commit: 6785254374ce925a23743850c1cb91912ce5c14c 2025-07-24T03:45:52.8410161Z Build Date: 2025-07-11T20:04:25Z 2025-07-24T03:45:52.8410975Z ##[endgroup] 2025-07-24T03:45:52.8411487Z ##[group]Operating System 2025-07-24T03:45:52.8412044Z Ubuntu 2025-07-24T03:45:52.8412475Z 24.04.2 2025-07-24T03:45:52.8413007Z LTS 2025-07-24T03:45:52.8413419Z ##[endgroup] 2025-07-24T03:45:52.8413973Z ##[group]Runner Image 2025-07-24T03:45:52.8414575Z Image: ubuntu-24.04 2025-07-24T03:45:52.8415034Z Version: 20250720.1.0 2025-07-24T03:45:52.8416044Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250720.1/images/ubuntu/Ubuntu2404-Readme.md 2025-07-24T03:45:52.8417594Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250720.1 2025-07-24T03:45:52.8418536Z ##[endgroup] 2025-07-24T03:45:52.8419545Z ##[group]GITHUB_TOKEN Permissions 2025-07-24T03:45:52.8422031Z Contents: read 2025-07-24T03:45:52.8422681Z Metadata: read 2025-07-24T03:45:52.8423151Z ##[endgroup] 2025-07-24T03:45:52.8425488Z Secret source: Actions 2025-07-24T03:45:52.8426507Z Prepare workflow directory 2025-07-24T03:45:52.8968521Z Prepare all required actions 2025-07-24T03:45:52.9026930Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (07df6ba7f5597488a93b3855d52d2ead55675125) 2025-07-24T03:45:52.9032212Z ##[group] Inputs 2025-07-24T03:45:52.9032884Z check_experiments: 2025-07-24T03:45:52.9033490Z opt_out_experiments: 2025-07-24T03:45:52.9034089Z triggering_actor: benjaminglass1 2025-07-24T03:45:52.9034662Z issue_owner: benjaminglass1 2025-07-24T03:45:52.9035710Z curr_branch: gh/benjaminglass1/79/head 2025-07-24T03:45:52.9036389Z curr_ref_type: branch 2025-07-24T03:45:52.9037014Z issue_number: 5132 2025-07-24T03:45:52.9037653Z ##[endgroup] 2025-07-24T03:45:52.9038305Z Complete job name: before-test / get-label-type / runner-determinator 2025-07-24T03:45:53.4796753Z ##[group]Run cat < runner_determinator.py 2025-07-24T03:45:53.4798527Z cat < runner_determinator.py 2025-07-24T03:45:53.4799138Z # flake8: noqa: G004 2025-07-24T03:45:53.4799615Z  2025-07-24T03:45:53.4800317Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-07-24T03:45:53.4802022Z # must be kept in sync. You can do it easily by running the following command: 2025-07-24T03:45:53.4802903Z # python .github/scripts/update_runner_determinator.py 2025-07-24T03:45:53.4803547Z  2025-07-24T03:45:53.4803923Z """ 2025-07-24T03:45:53.4804561Z This runner determinator is used to determine which set of runners to run a 2025-07-24T03:45:53.4805502Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-07-24T03:45:53.4806559Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-07-24T03:45:53.4807446Z of which runners should be used to run which job. 2025-07-24T03:45:53.4808048Z  2025-07-24T03:45:53.4808682Z The configuration has two parts, the settings and a list of opted-in users, 2025-07-24T03:45:53.4809672Z separated by a line containing "---". If the line is not present, the 2025-07-24T03:45:53.4810800Z settings are considered to be empty with only the second part, the user 2025-07-24T03:45:53.4811576Z list, defined. 2025-07-24T03:45:53.4812016Z  2025-07-24T03:45:53.4812624Z The first part is a YAML block that defines the rollout settings. This can be 2025-07-24T03:45:53.4813650Z used to define any settings that are needed to determine which runners to use. 2025-07-24T03:45:53.4814556Z It's fields are defined by the RolloutSettings class below. 2025-07-24T03:45:53.4815520Z  2025-07-24T03:45:53.4816154Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-07-24T03:45:53.4817112Z The user list is also a comma separated list of additional features or 2025-07-24T03:45:53.4817924Z experiments which the user could be opted in to. 2025-07-24T03:45:53.4818519Z  2025-07-24T03:45:53.4818949Z The user list has the following rules: 2025-07-24T03:45:53.4819489Z  2025-07-24T03:45:53.4820089Z - Users are GitHub usernames, which must start with the @ prefix 2025-07-24T03:45:53.4821244Z - Each user is also a comma-separated list of features/experiments to enable 2025-07-24T03:45:53.4822090Z - A "#" prefix opts the user out of all experiments 2025-07-24T03:45:53.4822680Z  2025-07-24T03:45:53.4823064Z Example config: 2025-07-24T03:45:53.4823598Z  # A list of experiments that can be opted into. 2025-07-24T03:45:53.4824352Z  # This defines the behavior they'll induce when opted into. 2025-07-24T03:45:53.4825031Z  # Expected syntax is: 2025-07-24T03:45:53.4825762Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-07-24T03:45:53.4826803Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-07-24T03:45:53.4827606Z  2025-07-24T03:45:53.4827994Z  experiments: 2025-07-24T03:45:53.4828437Z  lf: 2025-07-24T03:45:53.4828870Z  rollout_percent: 25 2025-07-24T03:45:53.4829391Z  all_branches: false 2025-07-24T03:45:53.4829912Z  default: true 2025-07-24T03:45:53.4830381Z  --- 2025-07-24T03:45:53.4831041Z  2025-07-24T03:45:53.4831436Z  # Opt-ins: 2025-07-24T03:45:53.4832127Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-07-24T03:45:53.4833294Z  # and specifying experiments to enable in a comma-separated list. 2025-07-24T03:45:53.4834176Z  # To always opt out of an experiment, prefix it with a "-". 2025-07-24T03:45:53.4834912Z  # Experiments should be from the above list. 2025-07-24T03:45:53.4835500Z  2025-07-24T03:45:53.4835912Z  @User1,-lf,split_build 2025-07-24T03:45:53.4836421Z  @User2,lf 2025-07-24T03:45:53.4836888Z  @User3,split_build 2025-07-24T03:45:53.4837374Z """ 2025-07-24T03:45:53.4837772Z  2025-07-24T03:45:53.4838162Z import json 2025-07-24T03:45:53.4838601Z import logging 2025-07-24T03:45:53.4839058Z import os 2025-07-24T03:45:53.4839481Z import random 2025-07-24T03:45:53.4839925Z import re 2025-07-24T03:45:53.4840333Z import sys 2025-07-24T03:45:53.4840932Z from argparse import ArgumentParser 2025-07-24T03:45:53.4841622Z from collections.abc import Iterable 2025-07-24T03:45:53.4842203Z from functools import cache 2025-07-24T03:45:53.4842751Z from logging import LogRecord 2025-07-24T03:45:53.4843321Z from typing import Any, NamedTuple 2025-07-24T03:45:53.4843958Z from urllib.request import Request, urlopen 2025-07-24T03:45:53.4844527Z  2025-07-24T03:45:53.4844916Z import yaml 2025-07-24T03:45:53.4845386Z from github import Auth, Github 2025-07-24T03:45:53.4845946Z from github.Issue import Issue 2025-07-24T03:45:53.4846469Z  2025-07-24T03:45:53.4846831Z  2025-07-24T03:45:53.4847296Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-07-24T03:45:53.4848071Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-07-24T03:45:53.4849047Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-07-24T03:45:53.4850015Z  2025-07-24T03:45:53.4850491Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-07-24T03:45:53.4851250Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-07-24T03:45:53.4851845Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-07-24T03:45:53.4852506Z OPT_OUT_LABEL = "no-runner-experiments" 2025-07-24T03:45:53.4853068Z  2025-07-24T03:45:53.4853504Z SETTING_EXPERIMENTS = "experiments" 2025-07-24T03:45:53.4854041Z  2025-07-24T03:45:53.4854453Z LF_FLEET_EXPERIMENT = "lf" 2025-07-24T03:45:53.4855004Z CANARY_FLEET_SUFFIX = ".c" 2025-07-24T03:45:53.4855505Z  2025-07-24T03:45:53.4855885Z  2025-07-24T03:45:53.4856293Z class Experiment(NamedTuple): 2025-07-24T03:45:53.4856848Z  rollout_perc: float = ( 2025-07-24T03:45:53.4857581Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-07-24T03:45:53.4858323Z  ) 2025-07-24T03:45:53.4858756Z  all_branches: bool = ( 2025-07-24T03:45:53.4859490Z  False # If True, the experiment is also enabled on the exception branches 2025-07-24T03:45:53.4860222Z  ) 2025-07-24T03:45:53.4860791Z  default: bool = ( 2025-07-24T03:45:53.4861474Z  True # If True, the experiment is enabled by default for all queries 2025-07-24T03:45:53.4862166Z  ) 2025-07-24T03:45:53.4862558Z  2025-07-24T03:45:53.4862959Z  # Add more fields as needed 2025-07-24T03:45:53.4863480Z  2025-07-24T03:45:53.4863847Z  2025-07-24T03:45:53.4864265Z class Settings(NamedTuple): 2025-07-24T03:45:53.4864783Z  """ 2025-07-24T03:45:53.4865330Z  Settings for the experiments that can be opted into. 2025-07-24T03:45:53.4865966Z  """ 2025-07-24T03:45:53.4866369Z  2025-07-24T03:45:53.4866814Z  experiments: dict[str, Experiment] = {} 2025-07-24T03:45:53.4867392Z  2025-07-24T03:45:53.4867924Z  2025-07-24T03:45:53.4868389Z class ColorFormatter(logging.Formatter): 2025-07-24T03:45:53.4869097Z  """Color codes the log messages based on the log level""" 2025-07-24T03:45:53.4869729Z  2025-07-24T03:45:53.4870110Z  COLORS = { 2025-07-24T03:45:53.4870699Z  "WARNING": "\033[33m", # Yellow 2025-07-24T03:45:53.4871273Z  "ERROR": "\033[31m", # Red 2025-07-24T03:45:53.4871833Z  "CRITICAL": "\033[31m", # Red 2025-07-24T03:45:53.4872393Z  "INFO": "\033[0m", # Reset 2025-07-24T03:45:53.4872950Z  "DEBUG": "\033[0m", # Reset 2025-07-24T03:45:53.4873477Z  } 2025-07-24T03:45:53.4873878Z  2025-07-24T03:45:53.4874337Z  def format(self, record: LogRecord) -> str: 2025-07-24T03:45:53.4875167Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-07-24T03:45:53.4876075Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-07-24T03:45:53.4876709Z  return super().format(record) 2025-07-24T03:45:53.4877242Z  2025-07-24T03:45:53.4877607Z  2025-07-24T03:45:53.4878027Z handler = logging.StreamHandler() 2025-07-24T03:45:53.4878934Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-07-24T03:45:53.4879702Z  2025-07-24T03:45:53.4880200Z log = logging.getLogger(os.path.basename(__file__)) 2025-07-24T03:45:53.4880956Z log.addHandler(handler) 2025-07-24T03:45:53.4881474Z log.setLevel(logging.INFO) 2025-07-24T03:45:53.4881969Z  2025-07-24T03:45:53.4882339Z  2025-07-24T03:45:53.4882835Z def set_github_output(key: str, value: str) -> None: 2025-07-24T03:45:53.4883465Z  """ 2025-07-24T03:45:53.4884045Z  Defines outputs of the github action that invokes this script 2025-07-24T03:45:53.4884888Z  """ 2025-07-24T03:45:53.4885305Z  if not GITHUB_OUTPUT: 2025-07-24T03:45:53.4886472Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-07-24T03:45:53.4887680Z  log.warning( 2025-07-24T03:45:53.4888632Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-07-24T03:45:53.4889621Z  ) 2025-07-24T03:45:53.4890118Z  print(f"::set-output name={key}::{value}") 2025-07-24T03:45:53.4890834Z  return 2025-07-24T03:45:53.4891271Z  2025-07-24T03:45:53.4891694Z  with open(GITHUB_OUTPUT, "a") as f: 2025-07-24T03:45:53.4892331Z  log.info(f"Setting output: {key}='{value}'") 2025-07-24T03:45:53.4892955Z  f.write(f"{key}={value}\n") 2025-07-24T03:45:53.4893496Z  2025-07-24T03:45:53.4893869Z  2025-07-24T03:45:53.4894432Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-07-24T03:45:53.4895150Z  return frozenset( 2025-07-24T03:45:53.4895849Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-07-24T03:45:53.4896596Z  ) 2025-07-24T03:45:53.4897004Z  2025-07-24T03:45:53.4897381Z  2025-07-24T03:45:53.4897778Z def parse_args() -> Any: 2025-07-24T03:45:53.4898454Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-07-24T03:45:53.4899398Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-07-24T03:45:53.4900226Z  parser.add_argument( 2025-07-24T03:45:53.4901109Z  "--github-issue-repo", 2025-07-24T03:45:53.4901667Z  type=str, 2025-07-24T03:45:53.4902161Z  required=False, 2025-07-24T03:45:53.4902843Z  default="pytorch/test-infra", 2025-07-24T03:45:53.4903471Z  help="GitHub repo to get the issue", 2025-07-24T03:45:53.4904027Z  ) 2025-07-24T03:45:53.4904459Z  parser.add_argument( 2025-07-24T03:45:53.4904976Z  "--github-repo", 2025-07-24T03:45:53.4905472Z  type=str, 2025-07-24T03:45:53.4905946Z  required=True, 2025-07-24T03:45:53.4906493Z  help="GitHub repo where CI is running", 2025-07-24T03:45:53.4907066Z  ) 2025-07-24T03:45:53.4907481Z  parser.add_argument( 2025-07-24T03:45:53.4908185Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-07-24T03:45:53.4908894Z  ) 2025-07-24T03:45:53.4909314Z  parser.add_argument( 2025-07-24T03:45:53.4910041Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-07-24T03:45:53.4911006Z  ) 2025-07-24T03:45:53.4911434Z  parser.add_argument( 2025-07-24T03:45:53.4912163Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-07-24T03:45:53.4912911Z  ) 2025-07-24T03:45:53.4913331Z  parser.add_argument( 2025-07-24T03:45:53.4914089Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-07-24T03:45:53.4914851Z  ) 2025-07-24T03:45:53.4915295Z  parser.add_argument( 2025-07-24T03:45:53.4915824Z  "--github-ref-type", 2025-07-24T03:45:53.4916344Z  type=str, 2025-07-24T03:45:53.4916822Z  required=True, 2025-07-24T03:45:53.4917411Z  help="Current GitHub ref type, branch or tag", 2025-07-24T03:45:53.4918015Z  ) 2025-07-24T03:45:53.4918447Z  parser.add_argument( 2025-07-24T03:45:53.4919140Z  "--eligible-experiments", 2025-07-24T03:45:53.4919736Z  type=_str_comma_separated_to_set, 2025-07-24T03:45:53.4920308Z  required=False, 2025-07-24T03:45:53.4920917Z  default="", 2025-07-24T03:45:53.4921865Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-07-24T03:45:53.4922848Z  ) 2025-07-24T03:45:53.4923271Z  parser.add_argument( 2025-07-24T03:45:53.4923807Z  "--opt-out-experiments", 2025-07-24T03:45:53.4924386Z  type=_str_comma_separated_to_set, 2025-07-24T03:45:53.4924966Z  required=False, 2025-07-24T03:45:53.4925457Z  default="", 2025-07-24T03:45:53.4925932Z  help=( 2025-07-24T03:45:53.4926691Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-07-24T03:45:53.4927922Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-07-24T03:45:53.4928818Z  ), 2025-07-24T03:45:53.4929227Z  ) 2025-07-24T03:45:53.4929651Z  parser.add_argument( 2025-07-24T03:45:53.4930164Z  "--pr-number", 2025-07-24T03:45:53.4930760Z  type=str, 2025-07-24T03:45:53.4931236Z  required=False, 2025-07-24T03:45:53.4931736Z  default="", 2025-07-24T03:45:53.4932311Z  help="the optional PR number where this is run", 2025-07-24T03:45:53.4932910Z  ) 2025-07-24T03:45:53.4933302Z  2025-07-24T03:45:53.4933710Z  return parser.parse_args() 2025-07-24T03:45:53.4934234Z  2025-07-24T03:45:53.4934605Z  2025-07-24T03:45:53.4935256Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-07-24T03:45:53.4936274Z  auth = Auth.Token(github_token) 2025-07-24T03:45:53.4936907Z  return Github(auth=auth) 2025-07-24T03:45:53.4937426Z  2025-07-24T03:45:53.4937794Z  2025-07-24T03:45:53.4938517Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-07-24T03:45:53.4939380Z  repo = gh.get_repo(repo) 2025-07-24T03:45:53.4939972Z  return repo.get_issue(number=issue_num) 2025-07-24T03:45:53.4940702Z  2025-07-24T03:45:53.4941085Z  2025-07-24T03:45:53.4941486Z def get_potential_pr_author( 2025-07-24T03:45:53.4942247Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-07-24T03:45:53.4942979Z ) -> str: 2025-07-24T03:45:53.4943573Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-07-24T03:45:53.4944465Z  # Fetch the actual username from the original PR. The PR number is 2025-07-24T03:45:53.4945313Z  # embedded in the tag name: ciflow// 2025-07-24T03:45:53.4945932Z  2025-07-24T03:45:53.4946351Z  gh = get_gh_client(github_token) 2025-07-24T03:45:53.4946901Z  2025-07-24T03:45:53.4947416Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-07-24T03:45:53.4948105Z  split_tag = ref_name.split("/") 2025-07-24T03:45:53.4948658Z  if ( 2025-07-24T03:45:53.4949113Z  len(split_tag) == 3 2025-07-24T03:45:53.4949673Z  and split_tag[0] == "ciflow" 2025-07-24T03:45:53.4950260Z  and split_tag[2].isnumeric() 2025-07-24T03:45:53.4950913Z  ): 2025-07-24T03:45:53.4951376Z  pr_number = split_tag[2] 2025-07-24T03:45:53.4951915Z  try: 2025-07-24T03:45:53.4952425Z  repository = gh.get_repo(repo) 2025-07-24T03:45:53.4953271Z  pull = repository.get_pull(number=int(pr_number)) 2025-07-24T03:45:53.4953945Z  except Exception as e: 2025-07-24T03:45:53.4954536Z  raise Exception( # noqa: TRY002 2025-07-24T03:45:53.4955282Z  f"issue with pull request {pr_number} from repo {repository}" 2025-07-24T03:45:53.4955990Z  ) from e 2025-07-24T03:45:53.4956611Z  return pull.user.login # type: ignore[no-any-return] 2025-07-24T03:45:53.4957393Z  # In all other cases, return the original input username 2025-07-24T03:45:53.4958033Z  return username 2025-07-24T03:45:53.4958501Z  2025-07-24T03:45:53.4958866Z  2025-07-24T03:45:53.4959333Z def is_exception_branch(branch: str) -> bool: 2025-07-24T03:45:53.4959917Z  """ 2025-07-24T03:45:53.4960747Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-07-24T03:45:53.4961596Z  """ 2025-07-24T03:45:53.4962202Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-07-24T03:45:53.4962915Z  2025-07-24T03:45:53.4963274Z  2025-07-24T03:45:53.4963697Z def load_yaml(yaml_text: str) -> Any: 2025-07-24T03:45:53.4964232Z  try: 2025-07-24T03:45:53.4964686Z  data = yaml.safe_load(yaml_text) 2025-07-24T03:45:53.4965244Z  return data 2025-07-24T03:45:53.4965730Z  except yaml.YAMLError: 2025-07-24T03:45:53.4966447Z  log.exception("Error loading YAML") 2025-07-24T03:45:53.4967128Z  raise 2025-07-24T03:45:53.4967565Z  2025-07-24T03:45:53.4967929Z  2025-07-24T03:45:53.4968601Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-07-24T03:45:53.4969406Z  """ 2025-07-24T03:45:53.4970236Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-07-24T03:45:53.4971187Z  2025-07-24T03:45:53.4971771Z  If the issue body contains "---" then the text above that is the settings 2025-07-24T03:45:53.4972611Z  and the text below is the list of opted in users. 2025-07-24T03:45:53.4973212Z  2025-07-24T03:45:53.4973841Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-07-24T03:45:53.4974589Z  """ 2025-07-24T03:45:53.4975091Z  rollout_state_parts = rollout_state.split("---") 2025-07-24T03:45:53.4975781Z  if len(rollout_state_parts) >= 2: 2025-07-24T03:45:53.4976458Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-07-24T03:45:53.4977101Z  else: 2025-07-24T03:45:53.4977538Z  return "", rollout_state 2025-07-24T03:45:53.4978059Z  2025-07-24T03:45:53.4978417Z  2025-07-24T03:45:53.4978856Z class UserOptins(dict[str, list[str]]): 2025-07-24T03:45:53.4979416Z  """ 2025-07-24T03:45:53.4979996Z  Dictionary of users with a list of features they have opted into 2025-07-24T03:45:53.4980850Z  """ 2025-07-24T03:45:53.4981240Z  2025-07-24T03:45:53.4981599Z  2025-07-24T03:45:53.4982183Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-07-24T03:45:53.4982895Z  """ 2025-07-24T03:45:53.4983788Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-07-24T03:45:53.4984788Z  2025-07-24T03:45:53.4985708Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-07-24T03:45:53.4986775Z  - Example line: "@User1,lf,split_build" 2025-07-24T03:45:53.4987701Z  - A "#" prefix indicates the user is opted out of all experiments 2025-07-24T03:45:53.4988386Z  2025-07-24T03:45:53.4988753Z  2025-07-24T03:45:53.4989115Z  """ 2025-07-24T03:45:53.4989530Z  optins = UserOptins() 2025-07-24T03:45:53.4990099Z  for user in user_optin_text.split("\n"): 2025-07-24T03:45:53.4990900Z  user = user.strip("\r\n\t -") 2025-07-24T03:45:53.4991527Z  if not user or not user.startswith("@"): 2025-07-24T03:45:53.4992138Z  # Not a valid user. Skip 2025-07-24T03:45:53.4992688Z  continue 2025-07-24T03:45:53.4993144Z  2025-07-24T03:45:53.4993513Z  if user: 2025-07-24T03:45:53.4994025Z  usr_name = user.split(",")[0].strip("@") 2025-07-24T03:45:53.4994776Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-07-24T03:45:53.4995461Z  2025-07-24T03:45:53.4995844Z  return optins 2025-07-24T03:45:53.4996295Z  2025-07-24T03:45:53.4996649Z  2025-07-24T03:45:53.4997191Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-07-24T03:45:53.4997858Z  """ 2025-07-24T03:45:53.4998317Z  Check if the experiment name is valid. 2025-07-24T03:45:53.4998886Z  A valid name: 2025-07-24T03:45:53.4999612Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-07-24T03:45:53.5000728Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-07-24T03:45:53.5001499Z  - Cannot contain spaces 2025-07-24T03:45:53.5002020Z  """ 2025-07-24T03:45:53.5002405Z  2025-07-24T03:45:53.5002899Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-07-24T03:45:53.5003691Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-07-24T03:45:53.5004472Z  2025-07-24T03:45:53.5004856Z  if valid: 2025-07-24T03:45:53.5005291Z  return True 2025-07-24T03:45:53.5005746Z  2025-07-24T03:45:53.5006117Z  log.error( 2025-07-24T03:45:53.5007678Z  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-07-24T03:45:53.5009337Z  ) 2025-07-24T03:45:53.5009739Z  return False 2025-07-24T03:45:53.5010182Z  2025-07-24T03:45:53.5010646Z  2025-07-24T03:45:53.5011214Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-07-24T03:45:53.5011892Z  """ 2025-07-24T03:45:53.5012556Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-07-24T03:45:53.5013330Z  """ 2025-07-24T03:45:53.5013724Z  try: 2025-07-24T03:45:53.5014134Z  if settings_text: 2025-07-24T03:45:53.5014942Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-07-24T03:45:53.5015785Z  # for easy reading 2025-07-24T03:45:53.5016662Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-07-24T03:45:53.5017620Z  # the backtick character in shell commands. 2025-07-24T03:45:53.5018294Z  backtick = chr(96) # backtick character 2025-07-24T03:45:53.5019033Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-07-24T03:45:53.5019760Z  settings = load_yaml(settings_text) 2025-07-24T03:45:53.5020314Z  2025-07-24T03:45:53.5021252Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-07-24T03:45:53.5022054Z  experiments = {} 2025-07-24T03:45:53.5022549Z  2025-07-24T03:45:53.5023156Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-07-24T03:45:53.5023969Z  if not is_valid_experiment_name(exp_name): 2025-07-24T03:45:53.5025149Z  # 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-07-24T03:45:53.5026262Z  continue 2025-07-24T03:45:53.5026750Z  2025-07-24T03:45:53.5027160Z  valid_settings = {} 2025-07-24T03:45:53.5027735Z  for setting in exp_settings: 2025-07-24T03:45:53.5028354Z  if setting not in Experiment._fields: 2025-07-24T03:45:53.5028970Z  log.warning( 2025-07-24T03:45:53.5029744Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-07-24T03:45:53.5030497Z  ) 2025-07-24T03:45:53.5031086Z  else: 2025-07-24T03:45:53.5031678Z  valid_settings[setting] = exp_settings[setting] 2025-07-24T03:45:53.5032284Z  2025-07-24T03:45:53.5032790Z  experiments[exp_name] = Experiment(**valid_settings) 2025-07-24T03:45:53.5033486Z  return Settings(experiments) 2025-07-24T03:45:53.5034021Z  2025-07-24T03:45:53.5034405Z  except Exception: 2025-07-24T03:45:53.5034961Z  log.exception("Failed to parse settings") 2025-07-24T03:45:53.5035535Z  2025-07-24T03:45:53.5035912Z  return Settings() 2025-07-24T03:45:53.5036378Z  2025-07-24T03:45:53.5036737Z  2025-07-24T03:45:53.5037393Z def parse_settings(rollout_state: str) -> Settings: 2025-07-24T03:45:53.5038023Z  """ 2025-07-24T03:45:53.5038514Z  Parse settings, if any, from the rollout state. 2025-07-24T03:45:53.5039102Z  2025-07-24T03:45:53.5039685Z  If the issue body contains "---" then the text above that is the settings 2025-07-24T03:45:53.5040509Z  and the text below is the list of opted in users. 2025-07-24T03:45:53.5041252Z  2025-07-24T03:45:53.5041895Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-07-24T03:45:53.5042665Z  """ 2025-07-24T03:45:53.5043284Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:45:53.5044122Z  return parse_settings_from_text(settings_text) 2025-07-24T03:45:53.5044706Z  2025-07-24T03:45:53.5045079Z  2025-07-24T03:45:53.5045573Z def parse_users(rollout_state: str) -> UserOptins: 2025-07-24T03:45:53.5046190Z  """ 2025-07-24T03:45:53.5046635Z  Parse users from the rollout state. 2025-07-24T03:45:53.5047181Z  2025-07-24T03:45:53.5047539Z  """ 2025-07-24T03:45:53.5048138Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:45:53.5048953Z  return parse_user_opt_in_from_text(users_text) 2025-07-24T03:45:53.5049539Z  2025-07-24T03:45:53.5049903Z  2025-07-24T03:45:53.5050687Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:45:53.5051499Z  """ 2025-07-24T03:45:53.5051979Z  Check if a user is opted into an experiment 2025-07-24T03:45:53.5052553Z  """ 2025-07-24T03:45:53.5053077Z  return experiment_name in user_optins.get(user, []) 2025-07-24T03:45:53.5053856Z  2025-07-24T03:45:53.5054221Z  2025-07-24T03:45:53.5054897Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:45:53.5055705Z  """ 2025-07-24T03:45:53.5056227Z  Check if a user explicitly opted out of an experiment 2025-07-24T03:45:53.5056851Z  """ 2025-07-24T03:45:53.5057418Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-07-24T03:45:53.5058167Z  experiment_optout = "-" + experiment_name 2025-07-24T03:45:53.5058875Z  if experiment_optout not in user_optins.get(user, []): 2025-07-24T03:45:53.5059513Z  return False 2025-07-24T03:45:53.5059969Z  2025-07-24T03:45:53.5060467Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-07-24T03:45:53.5061232Z  log.warning( 2025-07-24T03:45:53.5062145Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-07-24T03:45:53.5063070Z  ) 2025-07-24T03:45:53.5063468Z  2025-07-24T03:45:53.5063833Z  return True 2025-07-24T03:45:53.5064263Z  2025-07-24T03:45:53.5064621Z  2025-07-24T03:45:53.5065007Z def get_runner_prefix( 2025-07-24T03:45:53.5065500Z  rollout_state: str, 2025-07-24T03:45:53.5066033Z  workflow_requestors: Iterable[str], 2025-07-24T03:45:53.5066591Z  branch: str, 2025-07-24T03:45:53.5067152Z  eligible_experiments: frozenset[str] = frozenset(), 2025-07-24T03:45:53.5067894Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-07-24T03:45:53.5068523Z  is_canary: bool = False, 2025-07-24T03:45:53.5069031Z ) -> str: 2025-07-24T03:45:53.5069515Z  settings = parse_settings(rollout_state) 2025-07-24T03:45:53.5070198Z  user_optins = parse_users(rollout_state) 2025-07-24T03:45:53.5070861Z  2025-07-24T03:45:53.5071379Z  fleet_prefix = "" 2025-07-24T03:45:53.5071883Z  prefixes = [] 2025-07-24T03:45:53.5072594Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-07-24T03:45:53.5073611Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-07-24T03:45:53.5074371Z  log.info( 2025-07-24T03:45:53.5075130Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-07-24T03:45:53.5075969Z  ) 2025-07-24T03:45:53.5076425Z  continue 2025-07-24T03:45:53.5076888Z  2025-07-24T03:45:53.5077284Z  if opt_out_experiments: 2025-07-24T03:45:53.5077892Z  if experiment_name in opt_out_experiments: 2025-07-24T03:45:53.5078600Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-07-24T03:45:53.5079243Z  log.info( 2025-07-24T03:45:53.5080258Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-07-24T03:45:53.5081410Z  ) 2025-07-24T03:45:53.5081880Z  continue 2025-07-24T03:45:53.5082352Z  2025-07-24T03:45:53.5082767Z  if eligible_experiments: 2025-07-24T03:45:53.5083397Z  if experiment_name not in eligible_experiments: 2025-07-24T03:45:53.5084099Z  exp_list = ", ".join(eligible_experiments) 2025-07-24T03:45:53.5084696Z  log.info( 2025-07-24T03:45:53.5085554Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-07-24T03:45:53.5086434Z  ) 2025-07-24T03:45:53.5087054Z  continue 2025-07-24T03:45:53.5087610Z  elif not experiment_settings.default: 2025-07-24T03:45:53.5088184Z  log.info( 2025-07-24T03:45:53.5088917Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-07-24T03:45:53.5089701Z  ) 2025-07-24T03:45:53.5090135Z  continue 2025-07-24T03:45:53.5090688Z  2025-07-24T03:45:53.5091200Z  # Is any workflow_requestor opted out to this experiment? 2025-07-24T03:45:53.5091864Z  opted_out_users = [ 2025-07-24T03:45:53.5092374Z  requestor 2025-07-24T03:45:53.5092908Z  for requestor in workflow_requestors 2025-07-24T03:45:53.5093636Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-07-24T03:45:53.5094307Z  ] 2025-07-24T03:45:53.5094723Z  2025-07-24T03:45:53.5095112Z  if opted_out_users: 2025-07-24T03:45:53.5095650Z  log.info( 2025-07-24T03:45:53.5096358Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-07-24T03:45:53.5097102Z  ) 2025-07-24T03:45:53.5097541Z  continue 2025-07-24T03:45:53.5097990Z  2025-07-24T03:45:53.5098497Z  # Is any workflow_requestor opted in to this experiment? 2025-07-24T03:45:53.5099146Z  opted_in_users = [ 2025-07-24T03:45:53.5099683Z  requestor 2025-07-24T03:45:53.5100205Z  for requestor in workflow_requestors 2025-07-24T03:45:53.5101039Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-07-24T03:45:53.5101708Z  ] 2025-07-24T03:45:53.5102107Z  2025-07-24T03:45:53.5102490Z  enabled = False 2025-07-24T03:45:53.5102997Z  if opted_in_users: 2025-07-24T03:45:53.5103629Z  log.info( 2025-07-24T03:45:53.5104319Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-07-24T03:45:53.5105039Z  ) 2025-07-24T03:45:53.5105475Z  enabled = True 2025-07-24T03:45:53.5105962Z  2025-07-24T03:45:53.5106409Z  elif experiment_settings.rollout_perc: 2025-07-24T03:45:53.5107295Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-07-24T03:45:53.5108305Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-07-24T03:45:53.5109012Z  log.info( 2025-07-24T03:45:53.5109971Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-07-24T03:45:53.5111076Z  ) 2025-07-24T03:45:53.5111551Z  enabled = True 2025-07-24T03:45:53.5112062Z  2025-07-24T03:45:53.5112438Z  if enabled: 2025-07-24T03:45:53.5112939Z  label = experiment_name 2025-07-24T03:45:53.5113545Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-07-24T03:45:53.5114440Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-07-24T03:45:53.5115387Z  # - If it's enabled, then we always list it's prefix first 2025-07-24T03:45:53.5116200Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-07-24T03:45:53.5116911Z  if is_canary: 2025-07-24T03:45:53.5117467Z  label += CANARY_FLEET_SUFFIX 2025-07-24T03:45:53.5118060Z  fleet_prefix = label 2025-07-24T03:45:53.5118750Z  else: 2025-07-24T03:45:53.5119248Z  prefixes.append(label) 2025-07-24T03:45:53.5119783Z  2025-07-24T03:45:53.5120171Z  if len(prefixes) > 1: 2025-07-24T03:45:53.5120786Z  log.error( 2025-07-24T03:45:53.5121909Z  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-07-24T03:45:53.5123105Z  ) 2025-07-24T03:45:53.5123547Z  prefixes = prefixes[:1] 2025-07-24T03:45:53.5124058Z  2025-07-24T03:45:53.5124456Z  # Fleet always comes first 2025-07-24T03:45:53.5124983Z  if fleet_prefix: 2025-07-24T03:45:53.5125505Z  prefixes.insert(0, fleet_prefix) 2025-07-24T03:45:53.5126044Z  2025-07-24T03:45:53.5126534Z  return ".".join(prefixes) + "." if prefixes else "" 2025-07-24T03:45:53.5127161Z  2025-07-24T03:45:53.5127523Z  2025-07-24T03:45:53.5128220Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-07-24T03:45:53.5129041Z  """ 2025-07-24T03:45:53.5129686Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-07-24T03:45:53.5130429Z  2025-07-24T03:45:53.5131158Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-07-24T03:45:53.5131904Z  """ 2025-07-24T03:45:53.5132348Z  gh = get_gh_client(github_token) 2025-07-24T03:45:53.5132973Z  issue = get_issue(gh, repo, issue_num) 2025-07-24T03:45:53.5133670Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-07-24T03:45:53.5134306Z  2025-07-24T03:45:53.5134665Z  2025-07-24T03:45:53.5135309Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-07-24T03:45:53.5136248Z  for _ in range(num_retries): 2025-07-24T03:45:53.5136780Z  try: 2025-07-24T03:45:53.5137277Z  req = Request(url=url, headers=headers) 2025-07-24T03:45:53.5137988Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-07-24T03:45:53.5138689Z  return json.loads(content) 2025-07-24T03:45:53.5139254Z  except Exception as e: 2025-07-24T03:45:53.5139868Z  log.warning(f"Could not download {url}: {e}") 2025-07-24T03:45:53.5140453Z  2025-07-24T03:45:53.5141184Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-07-24T03:45:53.5141946Z  return {} 2025-07-24T03:45:53.5142365Z  2025-07-24T03:45:53.5142729Z  2025-07-24T03:45:53.5143086Z @cache 2025-07-24T03:45:53.5143782Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-07-24T03:45:53.5144586Z  """ 2025-07-24T03:45:53.5145037Z  Dynamically get PR information 2025-07-24T03:45:53.5145569Z  """ 2025-07-24T03:45:53.5146119Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-07-24T03:45:53.5146799Z  headers = { 2025-07-24T03:45:53.5147331Z  "Accept": "application/vnd.github.v3+json", 2025-07-24T03:45:53.5147989Z  "Authorization": f"token {github_token}", 2025-07-24T03:45:53.5148553Z  } 2025-07-24T03:45:53.5149035Z  json_response: dict[str, Any] = download_json( 2025-07-24T03:45:53.5149687Z  url=f"{github_api}/issues/{pr_number}", 2025-07-24T03:45:53.5150272Z  headers=headers, 2025-07-24T03:45:53.5150920Z  ) 2025-07-24T03:45:53.5151311Z  2025-07-24T03:45:53.5151711Z  if not json_response: 2025-07-24T03:45:53.5152508Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-07-24T03:45:53.5153194Z  return {} 2025-07-24T03:45:53.5153635Z  2025-07-24T03:45:53.5154025Z  return json_response 2025-07-24T03:45:53.5154504Z  2025-07-24T03:45:53.5154861Z  2025-07-24T03:45:53.5155506Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-07-24T03:45:53.5156277Z  """ 2025-07-24T03:45:53.5156876Z  Dynamically get the latest list of labels from the pull request 2025-07-24T03:45:53.5157578Z  """ 2025-07-24T03:45:53.5158120Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-07-24T03:45:53.5158772Z  return { 2025-07-24T03:45:53.5159420Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-07-24T03:45:53.5160146Z  } 2025-07-24T03:45:53.5160631Z  2025-07-24T03:45:53.5161009Z  2025-07-24T03:45:53.5161388Z def main() -> None: 2025-07-24T03:45:53.5161872Z  args = parse_args() 2025-07-24T03:45:53.5162350Z  2025-07-24T03:45:53.5162809Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-07-24T03:45:53.5163376Z  2025-07-24T03:45:53.5163775Z  # Check if the PR is opt-out 2025-07-24T03:45:53.5164317Z  if args.pr_number: 2025-07-24T03:45:53.5165063Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-07-24T03:45:53.5165870Z  if OPT_OUT_LABEL in labels: 2025-07-24T03:45:53.5166409Z  log.info( 2025-07-24T03:45:53.5167176Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-07-24T03:45:53.5167976Z  ) 2025-07-24T03:45:53.5168610Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:45:53.5169335Z  sys.exit() 2025-07-24T03:45:53.5169944Z  2025-07-24T03:45:53.5170326Z  try: 2025-07-24T03:45:53.5170935Z  rollout_state = get_rollout_state_from_issue( 2025-07-24T03:45:53.5171712Z  args.github_token, args.github_issue_repo, args.github_issue 2025-07-24T03:45:53.5172392Z  ) 2025-07-24T03:45:53.5172796Z  2025-07-24T03:45:53.5173217Z  username = get_potential_pr_author( 2025-07-24T03:45:53.5173796Z  args.github_token, 2025-07-24T03:45:53.5174335Z  args.github_repo, 2025-07-24T03:45:53.5174870Z  args.github_actor, 2025-07-24T03:45:53.5175416Z  args.github_ref_type, 2025-07-24T03:45:53.5175997Z  args.github_branch, 2025-07-24T03:45:53.5176511Z  ) 2025-07-24T03:45:53.5176907Z  2025-07-24T03:45:53.5177435Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-07-24T03:45:53.5178075Z  2025-07-24T03:45:53.5178519Z  runner_label_prefix = get_runner_prefix( 2025-07-24T03:45:53.5179115Z  rollout_state, 2025-07-24T03:45:53.5179671Z  (args.github_issue_owner, username), 2025-07-24T03:45:53.5180273Z  args.github_branch, 2025-07-24T03:45:53.5180931Z  args.eligible_experiments, 2025-07-24T03:45:53.5181530Z  args.opt_out_experiments, 2025-07-24T03:45:53.5182077Z  is_canary, 2025-07-24T03:45:53.5182546Z  ) 2025-07-24T03:45:53.5182950Z  2025-07-24T03:45:53.5183340Z  except Exception as e: 2025-07-24T03:45:53.5183856Z  log.error( 2025-07-24T03:45:53.5184610Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-07-24T03:45:53.5185593Z  ) 2025-07-24T03:45:53.5185992Z  2025-07-24T03:45:53.5186565Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:45:53.5187250Z  2025-07-24T03:45:53.5187610Z  2025-07-24T03:45:53.5188000Z if __name__ == "__main__": 2025-07-24T03:45:53.5188491Z  main() 2025-07-24T03:45:53.5188904Z  2025-07-24T03:45:53.5189261Z EOF 2025-07-24T03:45:53.5189638Z  2025-07-24T03:45:53.5190030Z cat runner_determinator.py 2025-07-24T03:45:53.5454306Z shell: /usr/bin/bash -e {0} 2025-07-24T03:45:53.5455213Z env: 2025-07-24T03:45:53.5455990Z GITHUB_TOKEN: *** 2025-07-24T03:45:53.5456441Z ISSUE_NUMBER: 5132 2025-07-24T03:45:53.5456907Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:45:53.5457459Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:45:53.5457960Z CHECK_EXPERIMENTS: 2025-07-24T03:45:53.5458408Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:45:53.5458891Z PR_NUMBER: 149961 2025-07-24T03:45:53.5459293Z ##[endgroup] 2025-07-24T03:45:53.5675293Z # flake8: noqa: G004 2025-07-24T03:45:53.5675837Z 2025-07-24T03:45:53.5676292Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-07-24T03:45:53.5677252Z # must be kept in sync. You can do it easily by running the following command: 2025-07-24T03:45:53.5678050Z # python .github/scripts/update_runner_determinator.py 2025-07-24T03:45:53.5678504Z 2025-07-24T03:45:53.5678667Z """ 2025-07-24T03:45:53.5679254Z This runner determinator is used to determine which set of runners to run a 2025-07-24T03:45:53.5680128Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-07-24T03:45:53.5681353Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-07-24T03:45:53.5682187Z of which runners should be used to run which job. 2025-07-24T03:45:53.5682611Z 2025-07-24T03:45:53.5735059Z The configuration has two parts, the settings and a list of opted-in users, 2025-07-24T03:45:53.5736482Z separated by a line containing "---". If the line is not present, the 2025-07-24T03:45:53.5737427Z settings are considered to be empty with only the second part, the user 2025-07-24T03:45:53.5738133Z list, defined. 2025-07-24T03:45:53.5738366Z 2025-07-24T03:45:53.5738739Z The first part is a YAML block that defines the rollout settings. This can be 2025-07-24T03:45:53.5739683Z used to define any settings that are needed to determine which runners to use. 2025-07-24T03:45:53.5740511Z It's fields are defined by the RolloutSettings class below. 2025-07-24T03:45:53.5741237Z 2025-07-24T03:45:53.5741628Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-07-24T03:45:53.5742498Z The user list is also a comma separated list of additional features or 2025-07-24T03:45:53.5743234Z experiments which the user could be opted in to. 2025-07-24T03:45:53.5743633Z 2025-07-24T03:45:53.5743839Z The user list has the following rules: 2025-07-24T03:45:53.5744201Z 2025-07-24T03:45:53.5744524Z - Users are GitHub usernames, which must start with the @ prefix 2025-07-24T03:45:53.5745383Z - Each user is also a comma-separated list of features/experiments to enable 2025-07-24T03:45:53.5746143Z - A "#" prefix opts the user out of all experiments 2025-07-24T03:45:53.5746544Z 2025-07-24T03:45:53.5746720Z Example config: 2025-07-24T03:45:53.5747171Z # A list of experiments that can be opted into. 2025-07-24T03:45:53.5747844Z # This defines the behavior they'll induce when opted into. 2025-07-24T03:45:53.5748464Z # Expected syntax is: 2025-07-24T03:45:53.5749099Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-07-24T03:45:53.5750071Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-07-24T03:45:53.5750951Z 2025-07-24T03:45:53.5751136Z experiments: 2025-07-24T03:45:53.5751544Z lf: 2025-07-24T03:45:53.5752120Z rollout_percent: 25 2025-07-24T03:45:53.5752593Z all_branches: false 2025-07-24T03:45:53.5753046Z default: true 2025-07-24T03:45:53.5753467Z --- 2025-07-24T03:45:53.5753667Z 2025-07-24T03:45:53.5753840Z # Opt-ins: 2025-07-24T03:45:53.5754421Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-07-24T03:45:53.5755306Z # and specifying experiments to enable in a comma-separated list. 2025-07-24T03:45:53.5756080Z # To always opt out of an experiment, prefix it with a "-". 2025-07-24T03:45:53.5756742Z # Experiments should be from the above list. 2025-07-24T03:45:53.5757128Z 2025-07-24T03:45:53.5757314Z @User1,-lf,split_build 2025-07-24T03:45:53.5757757Z @User2,lf 2025-07-24T03:45:53.5758150Z @User3,split_build 2025-07-24T03:45:53.5758578Z """ 2025-07-24T03:45:53.5758775Z 2025-07-24T03:45:53.5758952Z import json 2025-07-24T03:45:53.5759329Z import logging 2025-07-24T03:45:53.5759715Z import os 2025-07-24T03:45:53.5760095Z import random 2025-07-24T03:45:53.5760482Z import re 2025-07-24T03:45:53.5761070Z import sys 2025-07-24T03:45:53.5761478Z from argparse import ArgumentParser 2025-07-24T03:45:53.5762015Z from collections.abc import Iterable 2025-07-24T03:45:53.5762553Z from functools import cache 2025-07-24T03:45:53.5763035Z from logging import LogRecord 2025-07-24T03:45:53.5763536Z from typing import Any, NamedTuple 2025-07-24T03:45:53.5764075Z from urllib.request import Request, urlopen 2025-07-24T03:45:53.5764456Z 2025-07-24T03:45:53.5764625Z import yaml 2025-07-24T03:45:53.5765024Z from github import Auth, Github 2025-07-24T03:45:53.5765516Z from github.Issue import Issue 2025-07-24T03:45:53.5765817Z 2025-07-24T03:45:53.5765825Z 2025-07-24T03:45:53.5766050Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-07-24T03:45:53.5766732Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-07-24T03:45:53.5767616Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-07-24T03:45:53.5768174Z 2025-07-24T03:45:53.5768583Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-07-24T03:45:53.5769169Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-07-24T03:45:53.5769682Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-07-24T03:45:53.5770234Z OPT_OUT_LABEL = "no-runner-experiments" 2025-07-24T03:45:53.5771022Z 2025-07-24T03:45:53.5771248Z SETTING_EXPERIMENTS = "experiments" 2025-07-24T03:45:53.5771589Z 2025-07-24T03:45:53.5771779Z LF_FLEET_EXPERIMENT = "lf" 2025-07-24T03:45:53.5772245Z CANARY_FLEET_SUFFIX = ".c" 2025-07-24T03:45:53.5772531Z 2025-07-24T03:45:53.5772538Z 2025-07-24T03:45:53.5772737Z class Experiment(NamedTuple): 2025-07-24T03:45:53.5773216Z rollout_perc: float = ( 2025-07-24T03:45:53.5773863Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-07-24T03:45:53.5774538Z ) 2025-07-24T03:45:53.5774927Z all_branches: bool = ( 2025-07-24T03:45:53.5775547Z False # If True, the experiment is also enabled on the exception branches 2025-07-24T03:45:53.5776240Z ) 2025-07-24T03:45:53.5776594Z default: bool = ( 2025-07-24T03:45:53.5777167Z True # If True, the experiment is enabled by default for all queries 2025-07-24T03:45:53.5777809Z ) 2025-07-24T03:45:53.5778006Z 2025-07-24T03:45:53.5778190Z # Add more fields as needed 2025-07-24T03:45:53.5778492Z 2025-07-24T03:45:53.5778499Z 2025-07-24T03:45:53.5778697Z class Settings(NamedTuple): 2025-07-24T03:45:53.5779134Z """ 2025-07-24T03:45:53.5779597Z Settings for the experiments that can be opted into. 2025-07-24T03:45:53.5780171Z """ 2025-07-24T03:45:53.5780378Z 2025-07-24T03:45:53.5780833Z experiments: dict[str, Experiment] = {} 2025-07-24T03:45:53.5781218Z 2025-07-24T03:45:53.5781226Z 2025-07-24T03:45:53.5781452Z class ColorFormatter(logging.Formatter): 2025-07-24T03:45:53.5782074Z """Color codes the log messages based on the log level""" 2025-07-24T03:45:53.5782502Z 2025-07-24T03:45:53.5782670Z COLORS = { 2025-07-24T03:45:53.5783241Z "WARNING": "\033[33m", # Yellow 2025-07-24T03:45:53.5783767Z "ERROR": "\033[31m", # Red 2025-07-24T03:45:53.5784279Z "CRITICAL": "\033[31m", # Red 2025-07-24T03:45:53.5784789Z "INFO": "\033[0m", # Reset 2025-07-24T03:45:53.5785272Z "DEBUG": "\033[0m", # Reset 2025-07-24T03:45:53.5785753Z } 2025-07-24T03:45:53.5785949Z 2025-07-24T03:45:53.5786178Z def format(self, record: LogRecord) -> str: 2025-07-24T03:45:53.5786921Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-07-24T03:45:53.5787704Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-07-24T03:45:53.5788281Z return super().format(record) 2025-07-24T03:45:53.5788623Z 2025-07-24T03:45:53.5788631Z 2025-07-24T03:45:53.5788833Z handler = logging.StreamHandler() 2025-07-24T03:45:53.5789535Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-07-24T03:45:53.5790097Z 2025-07-24T03:45:53.5790346Z log = logging.getLogger(os.path.basename(__file__)) 2025-07-24T03:45:53.5791274Z log.addHandler(handler) 2025-07-24T03:45:53.5791729Z log.setLevel(logging.INFO) 2025-07-24T03:45:53.5792018Z 2025-07-24T03:45:53.5792024Z 2025-07-24T03:45:53.5792291Z def set_github_output(key: str, value: str) -> None: 2025-07-24T03:45:53.5792854Z """ 2025-07-24T03:45:53.5793376Z Defines outputs of the github action that invokes this script 2025-07-24T03:45:53.5793997Z """ 2025-07-24T03:45:53.5794373Z if not GITHUB_OUTPUT: 2025-07-24T03:45:53.5795441Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-07-24T03:45:53.5796563Z log.warning( 2025-07-24T03:45:53.5797410Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-07-24T03:45:53.5798360Z ) 2025-07-24T03:45:53.5809670Z print(f"::set-output name={key}::{value}") 2025-07-24T03:45:53.5810311Z return 2025-07-24T03:45:53.5810728Z 2025-07-24T03:45:53.5811142Z with open(GITHUB_OUTPUT, "a") as f: 2025-07-24T03:45:53.5811781Z log.info(f"Setting output: {key}='{value}'") 2025-07-24T03:45:53.5812356Z f.write(f"{key}={value}\n") 2025-07-24T03:45:53.5812675Z 2025-07-24T03:45:53.5812683Z 2025-07-24T03:45:53.5813005Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-07-24T03:45:53.5813648Z return frozenset( 2025-07-24T03:45:53.5814375Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-07-24T03:45:53.5815369Z ) 2025-07-24T03:45:53.5815593Z 2025-07-24T03:45:53.5815601Z 2025-07-24T03:45:53.5815789Z def parse_args() -> Any: 2025-07-24T03:45:53.5816367Z parser = ArgumentParser("Get dynamic rollout settings") 2025-07-24T03:45:53.5817344Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-07-24T03:45:53.5818270Z parser.add_argument( 2025-07-24T03:45:53.5818754Z "--github-issue-repo", 2025-07-24T03:45:53.5819222Z type=str, 2025-07-24T03:45:53.5819633Z required=False, 2025-07-24T03:45:53.5820094Z default="pytorch/test-infra", 2025-07-24T03:45:53.5820802Z help="GitHub repo to get the issue", 2025-07-24T03:45:53.5821327Z ) 2025-07-24T03:45:53.5821705Z parser.add_argument( 2025-07-24T03:45:53.5822162Z "--github-repo", 2025-07-24T03:45:53.5822593Z type=str, 2025-07-24T03:45:53.5822986Z required=True, 2025-07-24T03:45:53.5823457Z help="GitHub repo where CI is running", 2025-07-24T03:45:53.5823989Z ) 2025-07-24T03:45:53.5824363Z parser.add_argument( 2025-07-24T03:45:53.5824975Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-07-24T03:45:53.5825639Z ) 2025-07-24T03:45:53.5826002Z parser.add_argument( 2025-07-24T03:45:53.5826635Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-07-24T03:45:53.5827308Z ) 2025-07-24T03:45:53.5827877Z parser.add_argument( 2025-07-24T03:45:53.5828523Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-07-24T03:45:53.5829213Z ) 2025-07-24T03:45:53.5829588Z parser.add_argument( 2025-07-24T03:45:53.5830241Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-07-24T03:45:53.5831078Z ) 2025-07-24T03:45:53.5831448Z parser.add_argument( 2025-07-24T03:45:53.5831904Z "--github-ref-type", 2025-07-24T03:45:53.5832356Z type=str, 2025-07-24T03:45:53.5832759Z required=True, 2025-07-24T03:45:53.5833248Z help="Current GitHub ref type, branch or tag", 2025-07-24T03:45:53.5833801Z ) 2025-07-24T03:45:53.5834175Z parser.add_argument( 2025-07-24T03:45:53.5834630Z "--eligible-experiments", 2025-07-24T03:45:53.5835153Z type=_str_comma_separated_to_set, 2025-07-24T03:45:53.5835672Z required=False, 2025-07-24T03:45:53.5836093Z default="", 2025-07-24T03:45:53.5836950Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-07-24T03:45:53.5837874Z ) 2025-07-24T03:45:53.5838238Z parser.add_argument( 2025-07-24T03:45:53.5838702Z "--opt-out-experiments", 2025-07-24T03:45:53.5839207Z type=_str_comma_separated_to_set, 2025-07-24T03:45:53.5839722Z required=False, 2025-07-24T03:45:53.5840143Z default="", 2025-07-24T03:45:53.5840694Z help=( 2025-07-24T03:45:53.5841394Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-07-24T03:45:53.5842514Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-07-24T03:45:53.5843345Z ), 2025-07-24T03:45:53.5843699Z ) 2025-07-24T03:45:53.5844076Z parser.add_argument( 2025-07-24T03:45:53.5844515Z "--pr-number", 2025-07-24T03:45:53.5844933Z type=str, 2025-07-24T03:45:53.5845343Z required=False, 2025-07-24T03:45:53.5845893Z default="", 2025-07-24T03:45:53.5846384Z help="the optional PR number where this is run", 2025-07-24T03:45:53.5846934Z ) 2025-07-24T03:45:53.5847127Z 2025-07-24T03:45:53.5847326Z return parser.parse_args() 2025-07-24T03:45:53.5847634Z 2025-07-24T03:45:53.5847642Z 2025-07-24T03:45:53.5848046Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-07-24T03:45:53.5848807Z auth = Auth.Token(github_token) 2025-07-24T03:45:53.5849311Z return Github(auth=auth) 2025-07-24T03:45:53.5849606Z 2025-07-24T03:45:53.5849614Z 2025-07-24T03:45:53.5850068Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-07-24T03:45:53.5851013Z repo = gh.get_repo(repo) 2025-07-24T03:45:53.5851510Z return repo.get_issue(number=issue_num) 2025-07-24T03:45:53.5851877Z 2025-07-24T03:45:53.5851884Z 2025-07-24T03:45:53.5852077Z def get_potential_pr_author( 2025-07-24T03:45:53.5852721Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-07-24T03:45:53.5853399Z ) -> str: 2025-07-24T03:45:53.5853918Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-07-24T03:45:53.5854717Z # Fetch the actual username from the original PR. The PR number is 2025-07-24T03:45:53.5855463Z # embedded in the tag name: ciflow// 2025-07-24T03:45:53.5855877Z 2025-07-24T03:45:53.5856072Z gh = get_gh_client(github_token) 2025-07-24T03:45:53.5856410Z 2025-07-24T03:45:53.5856679Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-07-24T03:45:53.5857295Z split_tag = ref_name.split("/") 2025-07-24T03:45:53.5857800Z if ( 2025-07-24T03:45:53.5858194Z len(split_tag) == 3 2025-07-24T03:45:53.5858675Z and split_tag[0] == "ciflow" 2025-07-24T03:45:53.5859208Z and split_tag[2].isnumeric() 2025-07-24T03:45:53.5859697Z ): 2025-07-24T03:45:53.5860234Z pr_number = split_tag[2] 2025-07-24T03:45:53.5860840Z try: 2025-07-24T03:45:53.5861278Z repository = gh.get_repo(repo) 2025-07-24T03:45:53.5861905Z pull = repository.get_pull(number=int(pr_number)) 2025-07-24T03:45:53.5862520Z except Exception as e: 2025-07-24T03:45:53.5863045Z raise Exception( # noqa: TRY002 2025-07-24T03:45:53.5863721Z f"issue with pull request {pr_number} from repo {repository}" 2025-07-24T03:45:53.5864383Z ) from e 2025-07-24T03:45:53.5864934Z return pull.user.login # type: ignore[no-any-return] 2025-07-24T03:45:53.5865637Z # In all other cases, return the original input username 2025-07-24T03:45:53.5866221Z return username 2025-07-24T03:45:53.5866470Z 2025-07-24T03:45:53.5866477Z 2025-07-24T03:45:53.5866707Z def is_exception_branch(branch: str) -> bool: 2025-07-24T03:45:53.5867254Z """ 2025-07-24T03:45:53.5867909Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-07-24T03:45:53.5868682Z """ 2025-07-24T03:45:53.5869230Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-07-24T03:45:53.5869754Z 2025-07-24T03:45:53.5869761Z 2025-07-24T03:45:53.5869960Z def load_yaml(yaml_text: str) -> Any: 2025-07-24T03:45:53.5870455Z try: 2025-07-24T03:45:53.5870957Z data = yaml.safe_load(yaml_text) 2025-07-24T03:45:53.5871470Z return data 2025-07-24T03:45:53.5871888Z except yaml.YAMLError: 2025-07-24T03:45:53.5872374Z log.exception("Error loading YAML") 2025-07-24T03:45:53.5872888Z raise 2025-07-24T03:45:53.5873112Z 2025-07-24T03:45:53.5873119Z 2025-07-24T03:45:53.5873543Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-07-24T03:45:53.5874276Z """ 2025-07-24T03:45:53.5874899Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-07-24T03:45:53.5875502Z 2025-07-24T03:45:53.5875990Z If the issue body contains "---" then the text above that is the settings 2025-07-24T03:45:53.5876757Z and the text below is the list of opted in users. 2025-07-24T03:45:53.5877162Z 2025-07-24T03:45:53.5877543Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-07-24T03:45:53.5878239Z """ 2025-07-24T03:45:53.5878688Z rollout_state_parts = rollout_state.split("---") 2025-07-24T03:45:53.5879313Z if len(rollout_state_parts) >= 2: 2025-07-24T03:45:53.5879921Z return rollout_state_parts[0], rollout_state_parts[1] 2025-07-24T03:45:53.5880512Z else: 2025-07-24T03:45:53.5881074Z return "", rollout_state 2025-07-24T03:45:53.5881386Z 2025-07-24T03:45:53.5881396Z 2025-07-24T03:45:53.5881606Z class UserOptins(dict[str, list[str]]): 2025-07-24T03:45:53.5882115Z """ 2025-07-24T03:45:53.5882640Z Dictionary of users with a list of features they have opted into 2025-07-24T03:45:53.5883293Z """ 2025-07-24T03:45:53.5883494Z 2025-07-24T03:45:53.5883501Z 2025-07-24T03:45:53.5883848Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-07-24T03:45:53.5884498Z """ 2025-07-24T03:45:53.5885211Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-07-24T03:45:53.5885891Z 2025-07-24T03:45:53.5886509Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-07-24T03:45:53.5887489Z - Example line: "@User1,lf,split_build" 2025-07-24T03:45:53.5888173Z - A "#" prefix indicates the user is opted out of all experiments 2025-07-24T03:45:53.5888651Z 2025-07-24T03:45:53.5888659Z 2025-07-24T03:45:53.5888817Z """ 2025-07-24T03:45:53.5889200Z optins = UserOptins() 2025-07-24T03:45:53.5889688Z for user in user_optin_text.split("\n"): 2025-07-24T03:45:53.5890237Z user = user.strip("\r\n\t -") 2025-07-24T03:45:53.5891087Z if not user or not user.startswith("@"): 2025-07-24T03:45:53.5891651Z # Not a valid user. Skip 2025-07-24T03:45:53.5892137Z continue 2025-07-24T03:45:53.5892381Z 2025-07-24T03:45:53.5892545Z if user: 2025-07-24T03:45:53.5892989Z usr_name = user.split(",")[0].strip("@") 2025-07-24T03:45:53.5893677Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-07-24T03:45:53.5894173Z 2025-07-24T03:45:53.5894345Z return optins 2025-07-24T03:45:53.5894577Z 2025-07-24T03:45:53.5894585Z 2025-07-24T03:45:53.5894876Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-07-24T03:45:53.5895476Z """ 2025-07-24T03:45:53.5895881Z Check if the experiment name is valid. 2025-07-24T03:45:53.5896395Z A valid name: 2025-07-24T03:45:53.5897027Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-07-24T03:45:53.5897976Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-07-24T03:45:53.5898716Z - Cannot contain spaces 2025-07-24T03:45:53.5899455Z """ 2025-07-24T03:45:53.5899785Z 2025-07-24T03:45:53.5900225Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-07-24T03:45:53.5901665Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-07-24T03:45:53.5902501Z 2025-07-24T03:45:53.5902790Z if valid: 2025-07-24T03:45:53.5903461Z return True 2025-07-24T03:45:53.5903822Z 2025-07-24T03:45:53.5903996Z log.error( 2025-07-24T03:45:53.5905471Z 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-07-24T03:45:53.5908031Z ) 2025-07-24T03:45:53.5908429Z return False 2025-07-24T03:45:53.5908681Z 2025-07-24T03:45:53.5908689Z 2025-07-24T03:45:53.5909009Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-07-24T03:45:53.5909660Z """ 2025-07-24T03:45:53.5910435Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-07-24T03:45:53.5911485Z """ 2025-07-24T03:45:53.5911843Z try: 2025-07-24T03:45:53.5912222Z if settings_text: 2025-07-24T03:45:53.5912944Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-07-24T03:45:53.5913735Z # for easy reading 2025-07-24T03:45:53.5914520Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-07-24T03:45:53.5915410Z # the backtick character in shell commands. 2025-07-24T03:45:53.5916020Z backtick = chr(96) # backtick character 2025-07-24T03:45:53.5916681Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-07-24T03:45:53.5917367Z settings = load_yaml(settings_text) 2025-07-24T03:45:53.5917741Z 2025-07-24T03:45:53.5918172Z # For now we just load experiments. We can expand this if/when we add more settings 2025-07-24T03:45:53.5918939Z experiments = {} 2025-07-24T03:45:53.5919234Z 2025-07-24T03:45:53.5919655Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-07-24T03:45:53.5920418Z if not is_valid_experiment_name(exp_name): 2025-07-24T03:45:53.5921703Z # 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-07-24T03:45:53.5922748Z continue 2025-07-24T03:45:53.5923036Z 2025-07-24T03:45:53.5923223Z valid_settings = {} 2025-07-24T03:45:53.5923744Z for setting in exp_settings: 2025-07-24T03:45:53.5924316Z if setting not in Experiment._fields: 2025-07-24T03:45:53.5924887Z log.warning( 2025-07-24T03:45:53.5925587Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-07-24T03:45:53.5927366Z ) 2025-07-24T03:45:53.5928210Z else: 2025-07-24T03:45:53.5929147Z valid_settings[setting] = exp_settings[setting] 2025-07-24T03:45:53.5930299Z 2025-07-24T03:45:53.5931114Z experiments[exp_name] = Experiment(**valid_settings) 2025-07-24T03:45:53.5932370Z return Settings(experiments) 2025-07-24T03:45:53.5933012Z 2025-07-24T03:45:53.5933356Z except Exception: 2025-07-24T03:45:53.5934297Z log.exception("Failed to parse settings") 2025-07-24T03:45:53.5934876Z 2025-07-24T03:45:53.5935078Z return Settings() 2025-07-24T03:45:53.5935348Z 2025-07-24T03:45:53.5935355Z 2025-07-24T03:45:53.5935609Z def parse_settings(rollout_state: str) -> Settings: 2025-07-24T03:45:53.5936196Z """ 2025-07-24T03:45:53.5936632Z Parse settings, if any, from the rollout state. 2025-07-24T03:45:53.5937405Z 2025-07-24T03:45:53.5937840Z If the issue body contains "---" then the text above that is the settings 2025-07-24T03:45:53.5938620Z and the text below is the list of opted in users. 2025-07-24T03:45:53.5939034Z 2025-07-24T03:45:53.5939438Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-07-24T03:45:53.5940180Z """ 2025-07-24T03:45:53.5941015Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:45:53.5941802Z return parse_settings_from_text(settings_text) 2025-07-24T03:45:53.5942207Z 2025-07-24T03:45:53.5942214Z 2025-07-24T03:45:53.5942473Z def parse_users(rollout_state: str) -> UserOptins: 2025-07-24T03:45:53.5943028Z """ 2025-07-24T03:45:53.5943425Z Parse users from the rollout state. 2025-07-24T03:45:53.5943770Z 2025-07-24T03:45:53.5943933Z """ 2025-07-24T03:45:53.5944464Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:45:53.5945216Z return parse_user_opt_in_from_text(users_text) 2025-07-24T03:45:53.5945633Z 2025-07-24T03:45:53.5945641Z 2025-07-24T03:45:53.5946265Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:45:53.5947036Z """ 2025-07-24T03:45:53.5947443Z Check if a user is opted into an experiment 2025-07-24T03:45:53.5947982Z """ 2025-07-24T03:45:53.5948435Z return experiment_name in user_optins.get(user, []) 2025-07-24T03:45:53.5948862Z 2025-07-24T03:45:53.5948875Z 2025-07-24T03:45:53.5949296Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:45:53.5950036Z """ 2025-07-24T03:45:53.5950488Z Check if a user explicitly opted out of an experiment 2025-07-24T03:45:53.5951301Z """ 2025-07-24T03:45:53.5951807Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-07-24T03:45:53.5952497Z experiment_optout = "-" + experiment_name 2025-07-24T03:45:53.5953131Z if experiment_optout not in user_optins.get(user, []): 2025-07-24T03:45:53.5953754Z return False 2025-07-24T03:45:53.5954009Z 2025-07-24T03:45:53.5954279Z if is_user_opted_in(user, user_optins, experiment_name): 2025-07-24T03:45:53.5954872Z log.warning( 2025-07-24T03:45:53.5955658Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-07-24T03:45:53.5956535Z ) 2025-07-24T03:45:53.5956741Z 2025-07-24T03:45:53.5956916Z return True 2025-07-24T03:45:53.5957146Z 2025-07-24T03:45:53.5957153Z 2025-07-24T03:45:53.5957328Z def get_runner_prefix( 2025-07-24T03:45:53.5957764Z rollout_state: str, 2025-07-24T03:45:53.5958225Z workflow_requestors: Iterable[str], 2025-07-24T03:45:53.5958750Z branch: str, 2025-07-24T03:45:53.5959233Z eligible_experiments: frozenset[str] = frozenset(), 2025-07-24T03:45:53.5959893Z opt_out_experiments: frozenset[str] = frozenset(), 2025-07-24T03:45:53.5960473Z is_canary: bool = False, 2025-07-24T03:45:53.5961394Z ) -> str: 2025-07-24T03:45:53.5961824Z settings = parse_settings(rollout_state) 2025-07-24T03:45:53.5962394Z user_optins = parse_users(rollout_state) 2025-07-24T03:45:53.5962755Z 2025-07-24T03:45:53.5962940Z fleet_prefix = "" 2025-07-24T03:45:53.5963357Z prefixes = [] 2025-07-24T03:45:53.5963987Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-07-24T03:45:53.5964919Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-07-24T03:45:53.5965623Z log.info( 2025-07-24T03:45:53.5966302Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-07-24T03:45:53.5967050Z ) 2025-07-24T03:45:53.5967431Z continue 2025-07-24T03:45:53.5967676Z 2025-07-24T03:45:53.5967870Z if opt_out_experiments: 2025-07-24T03:45:53.5968405Z if experiment_name in opt_out_experiments: 2025-07-24T03:45:53.5969165Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-07-24T03:45:53.5969852Z log.info( 2025-07-24T03:45:53.5971199Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-07-24T03:45:53.5972388Z ) 2025-07-24T03:45:53.5972791Z continue 2025-07-24T03:45:53.5973058Z 2025-07-24T03:45:53.5973249Z if eligible_experiments: 2025-07-24T03:45:53.5973845Z if experiment_name not in eligible_experiments: 2025-07-24T03:45:53.5974621Z exp_list = ", ".join(eligible_experiments) 2025-07-24T03:45:53.5975194Z log.info( 2025-07-24T03:45:53.5975957Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-07-24T03:45:53.5976785Z ) 2025-07-24T03:45:53.5977183Z continue 2025-07-24T03:45:53.5977913Z elif not experiment_settings.default: 2025-07-24T03:45:53.5979029Z log.info( 2025-07-24T03:45:53.5980515Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-07-24T03:45:53.5982257Z ) 2025-07-24T03:45:53.5983018Z continue 2025-07-24T03:45:53.5983522Z 2025-07-24T03:45:53.5984061Z # Is any workflow_requestor opted out to this experiment? 2025-07-24T03:45:53.5985216Z opted_out_users = [ 2025-07-24T03:45:53.5986093Z requestor 2025-07-24T03:45:53.5987014Z for requestor in workflow_requestors 2025-07-24T03:45:53.5987991Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-07-24T03:45:53.5988636Z ] 2025-07-24T03:45:53.5988847Z 2025-07-24T03:45:53.5989101Z if opted_out_users: 2025-07-24T03:45:53.5989924Z log.info( 2025-07-24T03:45:53.5991325Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-07-24T03:45:53.5992076Z ) 2025-07-24T03:45:53.5992489Z continue 2025-07-24T03:45:53.5992750Z 2025-07-24T03:45:53.5993043Z # Is any workflow_requestor opted in to this experiment? 2025-07-24T03:45:53.5993664Z opted_in_users = [ 2025-07-24T03:45:53.5994106Z requestor 2025-07-24T03:45:53.5994965Z for requestor in workflow_requestors 2025-07-24T03:45:53.5996312Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-07-24T03:45:53.5997525Z ] 2025-07-24T03:45:53.5997930Z 2025-07-24T03:45:53.5998281Z enabled = False 2025-07-24T03:45:53.5999084Z if opted_in_users: 2025-07-24T03:45:53.5999545Z log.info( 2025-07-24T03:45:53.6000252Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-07-24T03:45:53.6001573Z ) 2025-07-24T03:45:53.6002132Z enabled = True 2025-07-24T03:45:53.6002420Z 2025-07-24T03:45:53.6002653Z elif experiment_settings.rollout_perc: 2025-07-24T03:45:53.6003839Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-07-24T03:45:53.6004762Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-07-24T03:45:53.6005415Z log.info( 2025-07-24T03:45:53.6006274Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-07-24T03:45:53.6007182Z ) 2025-07-24T03:45:53.6007580Z enabled = True 2025-07-24T03:45:53.6007875Z 2025-07-24T03:45:53.6008050Z if enabled: 2025-07-24T03:45:53.6008605Z label = experiment_name 2025-07-24T03:45:53.6009736Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-07-24T03:45:53.6011937Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-07-24T03:45:53.6013296Z # - If it's enabled, then we always list it's prefix first 2025-07-24T03:45:53.6014088Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-07-24T03:45:53.6014738Z if is_canary: 2025-07-24T03:45:53.6015237Z label += CANARY_FLEET_SUFFIX 2025-07-24T03:45:53.6015778Z fleet_prefix = label 2025-07-24T03:45:53.6016265Z else: 2025-07-24T03:45:53.6016691Z prefixes.append(label) 2025-07-24T03:45:53.6017039Z 2025-07-24T03:45:53.6017221Z if len(prefixes) > 1: 2025-07-24T03:45:53.6017653Z log.error( 2025-07-24T03:45:53.6018906Z 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-07-24T03:45:53.6020026Z ) 2025-07-24T03:45:53.6020407Z prefixes = prefixes[:1] 2025-07-24T03:45:53.6021025Z 2025-07-24T03:45:53.6021228Z # Fleet always comes first 2025-07-24T03:45:53.6021691Z if fleet_prefix: 2025-07-24T03:45:53.6022151Z prefixes.insert(0, fleet_prefix) 2025-07-24T03:45:53.6022502Z 2025-07-24T03:45:53.6022947Z return ".".join(prefixes) + "." if prefixes else "" 2025-07-24T03:45:53.6023384Z 2025-07-24T03:45:53.6023391Z 2025-07-24T03:45:53.6023838Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-07-24T03:45:53.6024612Z """ 2025-07-24T03:45:53.6025191Z Gets the first comment of the issue, which contains the desired rollout state. 2025-07-24T03:45:53.6025753Z 2025-07-24T03:45:53.6026141Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-07-24T03:45:53.6026833Z """ 2025-07-24T03:45:53.6027224Z gh = get_gh_client(github_token) 2025-07-24T03:45:53.6027757Z issue = get_issue(gh, repo, issue_num) 2025-07-24T03:45:53.6028388Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-07-24T03:45:53.6028832Z 2025-07-24T03:45:53.6028840Z 2025-07-24T03:45:53.6029241Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-07-24T03:45:53.6029998Z for _ in range(num_retries): 2025-07-24T03:45:53.6030461Z try: 2025-07-24T03:45:53.6031119Z req = Request(url=url, headers=headers) 2025-07-24T03:45:53.6031774Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-07-24T03:45:53.6032401Z return json.loads(content) 2025-07-24T03:45:53.6032922Z except Exception as e: 2025-07-24T03:45:53.6033454Z log.warning(f"Could not download {url}: {e}") 2025-07-24T03:45:53.6033846Z 2025-07-24T03:45:53.6034225Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-07-24T03:45:53.6034932Z return {} 2025-07-24T03:45:53.6035151Z 2025-07-24T03:45:53.6035158Z 2025-07-24T03:45:53.6035313Z @cache 2025-07-24T03:45:53.6035935Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-07-24T03:45:53.6036674Z """ 2025-07-24T03:45:53.6037068Z Dynamically get PR information 2025-07-24T03:45:53.6037724Z """ 2025-07-24T03:45:53.6038222Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-07-24T03:45:53.6038838Z headers = { 2025-07-24T03:45:53.6039291Z "Accept": "application/vnd.github.v3+json", 2025-07-24T03:45:53.6039898Z "Authorization": f"token {github_token}", 2025-07-24T03:45:53.6040424Z } 2025-07-24T03:45:53.6041073Z json_response: dict[str, Any] = download_json( 2025-07-24T03:45:53.6041671Z url=f"{github_api}/issues/{pr_number}", 2025-07-24T03:45:53.6042217Z headers=headers, 2025-07-24T03:45:53.6042633Z ) 2025-07-24T03:45:53.6042844Z 2025-07-24T03:45:53.6043030Z if not json_response: 2025-07-24T03:45:53.6043601Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-07-24T03:45:53.6044227Z return {} 2025-07-24T03:45:53.6044470Z 2025-07-24T03:45:53.6044661Z return json_response 2025-07-24T03:45:53.6044943Z 2025-07-24T03:45:53.6044950Z 2025-07-24T03:45:53.6045358Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-07-24T03:45:53.6046085Z """ 2025-07-24T03:45:53.6046616Z Dynamically get the latest list of labels from the pull request 2025-07-24T03:45:53.6047276Z """ 2025-07-24T03:45:53.6047756Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-07-24T03:45:53.6048357Z return { 2025-07-24T03:45:53.6048963Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-07-24T03:45:53.6049655Z } 2025-07-24T03:45:53.6049857Z 2025-07-24T03:45:53.6049864Z 2025-07-24T03:45:53.6050034Z def main() -> None: 2025-07-24T03:45:53.6050448Z args = parse_args() 2025-07-24T03:45:53.6050997Z 2025-07-24T03:45:53.6051231Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-07-24T03:45:53.6051619Z 2025-07-24T03:45:53.6051820Z # Check if the PR is opt-out 2025-07-24T03:45:53.6052301Z if args.pr_number: 2025-07-24T03:45:53.6052943Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-07-24T03:45:53.6053878Z if OPT_OUT_LABEL in labels: 2025-07-24T03:45:53.6054394Z log.info( 2025-07-24T03:45:53.6055073Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-07-24T03:45:53.6055829Z ) 2025-07-24T03:45:53.6056362Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:45:53.6057020Z sys.exit() 2025-07-24T03:45:53.6057276Z 2025-07-24T03:45:53.6057445Z try: 2025-07-24T03:45:53.6057869Z rollout_state = get_rollout_state_from_issue( 2025-07-24T03:45:53.6058570Z args.github_token, args.github_issue_repo, args.github_issue 2025-07-24T03:45:53.6059197Z ) 2025-07-24T03:45:53.6059406Z 2025-07-24T03:45:53.6059613Z username = get_potential_pr_author( 2025-07-24T03:45:53.6060144Z args.github_token, 2025-07-24T03:45:53.6060855Z args.github_repo, 2025-07-24T03:45:53.6061362Z args.github_actor, 2025-07-24T03:45:53.6061840Z args.github_ref_type, 2025-07-24T03:45:53.6062346Z args.github_branch, 2025-07-24T03:45:53.6062794Z ) 2025-07-24T03:45:53.6062994Z 2025-07-24T03:45:53.6063284Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-07-24T03:45:53.6063727Z 2025-07-24T03:45:53.6063942Z runner_label_prefix = get_runner_prefix( 2025-07-24T03:45:53.6064493Z rollout_state, 2025-07-24T03:45:53.6064974Z (args.github_issue_owner, username), 2025-07-24T03:45:53.6065515Z args.github_branch, 2025-07-24T03:45:53.6066008Z args.eligible_experiments, 2025-07-24T03:45:53.6066538Z args.opt_out_experiments, 2025-07-24T03:45:53.6067035Z is_canary, 2025-07-24T03:45:53.6067448Z ) 2025-07-24T03:45:53.6067650Z 2025-07-24T03:45:53.6067843Z except Exception as e: 2025-07-24T03:45:53.6068283Z log.error( 2025-07-24T03:45:53.6069134Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-07-24T03:45:53.6069876Z ) 2025-07-24T03:45:53.6070087Z 2025-07-24T03:45:53.6070409Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:45:53.6071146Z 2025-07-24T03:45:53.6071155Z 2025-07-24T03:45:53.6071354Z if __name__ == "__main__": 2025-07-24T03:45:53.6071794Z main() 2025-07-24T03:45:53.6072001Z 2025-07-24T03:45:53.6174238Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-07-24T03:45:53.6175145Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-07-24T03:45:53.6203909Z shell: /usr/bin/bash -e {0} 2025-07-24T03:45:53.6204374Z env: 2025-07-24T03:45:53.6205039Z GITHUB_TOKEN: *** 2025-07-24T03:45:53.6205448Z ISSUE_NUMBER: 5132 2025-07-24T03:45:53.6205879Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:45:53.6206399Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:45:53.6206860Z CHECK_EXPERIMENTS: 2025-07-24T03:45:53.6207308Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:45:53.6207722Z PR_NUMBER: 149961 2025-07-24T03:45:53.6208118Z ##[endgroup] 2025-07-24T03:45:55.1902496Z Defaulting to user installation because normal site-packages is not writeable 2025-07-24T03:45:57.1604924Z Collecting urllib3==1.26.18 2025-07-24T03:45:57.2015527Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-07-24T03:45:57.2254844Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 3.9 MB/s eta 0:00:00 2025-07-24T03:45:57.2492913Z Collecting PyGithub==2.3.0 2025-07-24T03:45:57.2544263Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-07-24T03:45:57.2978474Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-07-24T03:45:57.3017172Z 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-07-24T03:45:57.3066187Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-07-24T03:45:57.3084526Z 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-07-24T03:45:57.3099628Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-07-24T03:45:57.3353443Z Collecting Deprecated (from PyGithub==2.3.0) 2025-07-24T03:45:57.3391883Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB) 2025-07-24T03:45:57.3625123Z 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-07-24T03:45:57.4759302Z Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-07-24T03:45:57.4796883Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) 2025-07-24T03:45:57.6016872Z Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-07-24T03:45:57.6064703Z 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-07-24T03:45:57.6263371Z Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub==2.3.0) 2025-07-24T03:45:57.6299448Z Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes) 2025-07-24T03:45:57.6538819Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-07-24T03:45:57.6653048Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 14.4 MB/s eta 0:00:00 2025-07-24T03:45:57.6706460Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-07-24T03:45:57.6829170Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 33.5 MB/s eta 0:00:00 2025-07-24T03:45:57.6866191Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2025-07-24T03:45:57.7088780Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 41.8 MB/s eta 0:00:00 2025-07-24T03:45:57.7132101Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB) 2025-07-24T03:45:57.7192385Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) 2025-07-24T03:45:57.7314113Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 45.8 MB/s eta 0:00:00 2025-07-24T03:45:57.7354092Z 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-07-24T03:45:57.7398847Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 29.3 MB/s eta 0:00:00 2025-07-24T03:45:57.7436353Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2025-07-24T03:45:57.7484611Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 34.6 MB/s eta 0:00:00 2025-07-24T03:45:58.0728080Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-07-24T03:45:58.6192070Z 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-07-24T03:45:58.7111614Z ##[group]Run curr_branch="gh/benjaminglass1/79/head" 2025-07-24T03:45:58.7112061Z curr_branch="gh/benjaminglass1/79/head" 2025-07-24T03:45:58.7112342Z curr_ref_type="branch" 2025-07-24T03:45:58.7112586Z echo "Current branch is '$curr_branch'" 2025-07-24T03:45:58.7112830Z  2025-07-24T03:45:58.7113014Z python3 runner_determinator.py \ 2025-07-24T03:45:58.7113294Z  --github-token "$GITHUB_TOKEN" \ 2025-07-24T03:45:58.7113563Z  --github-issue "$ISSUE_NUMBER" \ 2025-07-24T03:45:58.7113828Z  --github-branch "$curr_branch" \ 2025-07-24T03:45:58.7114098Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-07-24T03:45:58.7114374Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-07-24T03:45:58.7114652Z  --github-ref-type "$curr_ref_type" \ 2025-07-24T03:45:58.7114919Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-07-24T03:45:58.7115253Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-07-24T03:45:58.7115591Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-07-24T03:45:58.7115886Z  --pr-number "${PR_NUMBER}" 2025-07-24T03:45:58.7144887Z shell: /usr/bin/bash -e {0} 2025-07-24T03:45:58.7145119Z env: 2025-07-24T03:45:58.7145712Z GITHUB_TOKEN: *** 2025-07-24T03:45:58.7145904Z ISSUE_NUMBER: 5132 2025-07-24T03:45:58.7146108Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:45:58.7146366Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:45:58.7146581Z CHECK_EXPERIMENTS: 2025-07-24T03:45:58.7146767Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:45:58.7146958Z PR_NUMBER: 149961 2025-07-24T03:45:58.7147132Z ##[endgroup] 2025-07-24T03:45:58.7196222Z Current branch is 'gh/benjaminglass1/79/head' 2025-07-24T03:46:00.6471342Z INFO : Setting output: label-type='' 2025-07-24T03:46:00.6867592Z Evaluate and set job outputs 2025-07-24T03:46:00.6874795Z Cleaning up orphan processes