2025-07-24T03:40:49.2387725Z Current runner version: '2.326.0' 2025-07-24T03:40:49.2423637Z ##[group]Runner Image Provisioner 2025-07-24T03:40:49.2424912Z Hosted Compute Agent 2025-07-24T03:40:49.2425712Z Version: 20250711.363 2025-07-24T03:40:49.2426676Z Commit: 6785254374ce925a23743850c1cb91912ce5c14c 2025-07-24T03:40:49.2427862Z Build Date: 2025-07-11T20:04:25Z 2025-07-24T03:40:49.2428769Z ##[endgroup] 2025-07-24T03:40:49.2429891Z ##[group]Operating System 2025-07-24T03:40:49.2430785Z Ubuntu 2025-07-24T03:40:49.2431572Z 24.04.2 2025-07-24T03:40:49.2432325Z LTS 2025-07-24T03:40:49.2433046Z ##[endgroup] 2025-07-24T03:40:49.2433750Z ##[group]Runner Image 2025-07-24T03:40:49.2434761Z Image: ubuntu-24.04 2025-07-24T03:40:49.2435552Z Version: 20250720.1.0 2025-07-24T03:40:49.2437197Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250720.1/images/ubuntu/Ubuntu2404-Readme.md 2025-07-24T03:40:49.2440125Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250720.1 2025-07-24T03:40:49.2441767Z ##[endgroup] 2025-07-24T03:40:49.2445781Z ##[group]GITHUB_TOKEN Permissions 2025-07-24T03:40:49.2448474Z Actions: read 2025-07-24T03:40:49.2449565Z Attestations: read 2025-07-24T03:40:49.2450462Z Checks: read 2025-07-24T03:40:49.2451224Z Contents: read 2025-07-24T03:40:49.2452161Z Deployments: read 2025-07-24T03:40:49.2452938Z Discussions: read 2025-07-24T03:40:49.2453664Z Issues: read 2025-07-24T03:40:49.2454548Z Metadata: read 2025-07-24T03:40:49.2455275Z Models: read 2025-07-24T03:40:49.2456006Z Packages: read 2025-07-24T03:40:49.2456843Z Pages: read 2025-07-24T03:40:49.2457657Z PullRequests: read 2025-07-24T03:40:49.2458447Z RepositoryProjects: read 2025-07-24T03:40:49.2459657Z SecurityEvents: read 2025-07-24T03:40:49.2460742Z Statuses: read 2025-07-24T03:40:49.2461505Z ##[endgroup] 2025-07-24T03:40:49.2464581Z Secret source: Actions 2025-07-24T03:40:49.2465893Z Prepare workflow directory 2025-07-24T03:40:49.3199380Z Prepare all required actions 2025-07-24T03:40:49.3279830Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (07df6ba7f5597488a93b3855d52d2ead55675125) 2025-07-24T03:40:49.3286789Z ##[group] Inputs 2025-07-24T03:40:49.3287667Z check_experiments: 2025-07-24T03:40:49.3288713Z opt_out_experiments: 2025-07-24T03:40:49.3290193Z triggering_actor: benjaminglass1 2025-07-24T03:40:49.3291194Z issue_owner: benjaminglass1 2025-07-24T03:40:49.3292401Z curr_branch: gh/benjaminglass1/79/head 2025-07-24T03:40:49.3293378Z curr_ref_type: branch 2025-07-24T03:40:49.3294179Z issue_number: 5132 2025-07-24T03:40:49.3295117Z ##[endgroup] 2025-07-24T03:40:49.3296115Z Complete job name: get-label-type / runner-determinator 2025-07-24T03:40:49.4223178Z ##[group]Run cat < runner_determinator.py 2025-07-24T03:40:49.4225411Z cat < runner_determinator.py 2025-07-24T03:40:49.4226327Z # flake8: noqa: G004 2025-07-24T03:40:49.4227066Z  2025-07-24T03:40:49.4228201Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-07-24T03:40:49.4230008Z # must be kept in sync. You can do it easily by running the following command: 2025-07-24T03:40:49.4231435Z # python .github/scripts/update_runner_determinator.py 2025-07-24T03:40:49.4232460Z  2025-07-24T03:40:49.4233010Z """ 2025-07-24T03:40:49.4234008Z This runner determinator is used to determine which set of runners to run a 2025-07-24T03:40:49.4235564Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-07-24T03:40:49.4237203Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-07-24T03:40:49.4238683Z of which runners should be used to run which job. 2025-07-24T03:40:49.4239853Z  2025-07-24T03:40:49.4240825Z The configuration has two parts, the settings and a list of opted-in users, 2025-07-24T03:40:49.4242425Z separated by a line containing "---". If the line is not present, the 2025-07-24T03:40:49.4244350Z settings are considered to be empty with only the second part, the user 2025-07-24T03:40:49.4245571Z list, defined. 2025-07-24T03:40:49.4246260Z  2025-07-24T03:40:49.4247214Z The first part is a YAML block that defines the rollout settings. This can be 2025-07-24T03:40:49.4248825Z used to define any settings that are needed to determine which runners to use. 2025-07-24T03:40:49.4250537Z It's fields are defined by the RolloutSettings class below. 2025-07-24T03:40:49.4251582Z  2025-07-24T03:40:49.4252556Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-07-24T03:40:49.4254123Z The user list is also a comma separated list of additional features or 2025-07-24T03:40:49.4255442Z experiments which the user could be opted in to. 2025-07-24T03:40:49.4256414Z  2025-07-24T03:40:49.4257082Z The user list has the following rules: 2025-07-24T03:40:49.4257959Z  2025-07-24T03:40:49.4258825Z - Users are GitHub usernames, which must start with the @ prefix 2025-07-24T03:40:49.4260515Z - Each user is also a comma-separated list of features/experiments to enable 2025-07-24T03:40:49.4261856Z - A "#" prefix opts the user out of all experiments 2025-07-24T03:40:49.4262780Z  2025-07-24T03:40:49.4263384Z Example config: 2025-07-24T03:40:49.4264222Z  # A list of experiments that can be opted into. 2025-07-24T03:40:49.4265389Z  # This defines the behavior they'll induce when opted into. 2025-07-24T03:40:49.4266483Z  # Expected syntax is: 2025-07-24T03:40:49.4267664Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-07-24T03:40:49.4269533Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-07-24T03:40:49.4270877Z  2025-07-24T03:40:49.4271456Z  experiments: 2025-07-24T03:40:49.4272139Z  lf: 2025-07-24T03:40:49.4272786Z  rollout_percent: 25 2025-07-24T03:40:49.4273635Z  all_branches: false 2025-07-24T03:40:49.4274468Z  default: true 2025-07-24T03:40:49.4275209Z  --- 2025-07-24T03:40:49.4275827Z  2025-07-24T03:40:49.4276401Z  # Opt-ins: 2025-07-24T03:40:49.4277572Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-07-24T03:40:49.4279589Z  # and specifying experiments to enable in a comma-separated list. 2025-07-24T03:40:49.4280981Z  # To always opt out of an experiment, prefix it with a "-". 2025-07-24T03:40:49.4282179Z  # Experiments should be from the above list. 2025-07-24T03:40:49.4283089Z  2025-07-24T03:40:49.4283699Z  @User1,-lf,split_build 2025-07-24T03:40:49.4284511Z  @User2,lf 2025-07-24T03:40:49.4285239Z  @User3,split_build 2025-07-24T03:40:49.4285989Z """ 2025-07-24T03:40:49.4286569Z  2025-07-24T03:40:49.4287136Z import json 2025-07-24T03:40:49.4287802Z import logging 2025-07-24T03:40:49.4288517Z import os 2025-07-24T03:40:49.4289361Z import random 2025-07-24T03:40:49.4290059Z import re 2025-07-24T03:40:49.4290688Z import sys 2025-07-24T03:40:49.4291426Z from argparse import ArgumentParser 2025-07-24T03:40:49.4292404Z from collections.abc import Iterable 2025-07-24T03:40:49.4293335Z from functools import cache 2025-07-24T03:40:49.4294187Z from logging import LogRecord 2025-07-24T03:40:49.4295066Z from typing import Any, NamedTuple 2025-07-24T03:40:49.4296084Z from urllib.request import Request, urlopen 2025-07-24T03:40:49.4296983Z  2025-07-24T03:40:49.4297558Z import yaml 2025-07-24T03:40:49.4298526Z from github import Auth, Github 2025-07-24T03:40:49.4299643Z from github.Issue import Issue 2025-07-24T03:40:49.4300464Z  2025-07-24T03:40:49.4301012Z  2025-07-24T03:40:49.4301713Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-07-24T03:40:49.4302937Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-07-24T03:40:49.4304477Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-07-24T03:40:49.4305691Z  2025-07-24T03:40:49.4306458Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-07-24T03:40:49.4307464Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-07-24T03:40:49.4308377Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-07-24T03:40:49.4309611Z OPT_OUT_LABEL = "no-runner-experiments" 2025-07-24T03:40:49.4310524Z  2025-07-24T03:40:49.4311185Z SETTING_EXPERIMENTS = "experiments" 2025-07-24T03:40:49.4312031Z  2025-07-24T03:40:49.4312639Z LF_FLEET_EXPERIMENT = "lf" 2025-07-24T03:40:49.4313478Z CANARY_FLEET_SUFFIX = ".c" 2025-07-24T03:40:49.4314252Z  2025-07-24T03:40:49.4314808Z  2025-07-24T03:40:49.4315428Z class Experiment(NamedTuple): 2025-07-24T03:40:49.4316276Z  rollout_perc: float = ( 2025-07-24T03:40:49.4317447Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-07-24T03:40:49.4318614Z  ) 2025-07-24T03:40:49.4319426Z  all_branches: bool = ( 2025-07-24T03:40:49.4320603Z  False # If True, the experiment is also enabled on the exception branches 2025-07-24T03:40:49.4321775Z  ) 2025-07-24T03:40:49.4322392Z  default: bool = ( 2025-07-24T03:40:49.4323429Z  True # If True, the experiment is enabled by default for all queries 2025-07-24T03:40:49.4324552Z  ) 2025-07-24T03:40:49.4325170Z  2025-07-24T03:40:49.4325770Z  # Add more fields as needed 2025-07-24T03:40:49.4326575Z  2025-07-24T03:40:49.4327146Z  2025-07-24T03:40:49.4327761Z class Settings(NamedTuple): 2025-07-24T03:40:49.4328616Z  """ 2025-07-24T03:40:49.4329592Z  Settings for the experiments that can be opted into. 2025-07-24T03:40:49.4330588Z  """ 2025-07-24T03:40:49.4331208Z  2025-07-24T03:40:49.4331888Z  experiments: dict[str, Experiment] = {} 2025-07-24T03:40:49.4332759Z  2025-07-24T03:40:49.4333552Z  2025-07-24T03:40:49.4334297Z class ColorFormatter(logging.Formatter): 2025-07-24T03:40:49.4335439Z  """Color codes the log messages based on the log level""" 2025-07-24T03:40:49.4336431Z  2025-07-24T03:40:49.4337008Z  COLORS = { 2025-07-24T03:40:49.4337760Z  "WARNING": "\033[33m", # Yellow 2025-07-24T03:40:49.4338666Z  "ERROR": "\033[31m", # Red 2025-07-24T03:40:49.4339735Z  "CRITICAL": "\033[31m", # Red 2025-07-24T03:40:49.4340598Z  "INFO": "\033[0m", # Reset 2025-07-24T03:40:49.4341480Z  "DEBUG": "\033[0m", # Reset 2025-07-24T03:40:49.4342311Z  } 2025-07-24T03:40:49.4342909Z  2025-07-24T03:40:49.4343608Z  def format(self, record: LogRecord) -> str: 2025-07-24T03:40:49.4344937Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-07-24T03:40:49.4346330Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-07-24T03:40:49.4347326Z  return super().format(record) 2025-07-24T03:40:49.4348177Z  2025-07-24T03:40:49.4348755Z  2025-07-24T03:40:49.4349589Z handler = logging.StreamHandler() 2025-07-24T03:40:49.4350890Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-07-24T03:40:49.4352396Z  2025-07-24T03:40:49.4353196Z log = logging.getLogger(os.path.basename(__file__)) 2025-07-24T03:40:49.4354212Z log.addHandler(handler) 2025-07-24T03:40:49.4355011Z log.setLevel(logging.INFO) 2025-07-24T03:40:49.4355804Z  2025-07-24T03:40:49.4356379Z  2025-07-24T03:40:49.4357146Z def set_github_output(key: str, value: str) -> None: 2025-07-24T03:40:49.4358126Z  """ 2025-07-24T03:40:49.4359027Z  Defines outputs of the github action that invokes this script 2025-07-24T03:40:49.4360345Z  """ 2025-07-24T03:40:49.4360995Z  if not GITHUB_OUTPUT: 2025-07-24T03:40:49.4362873Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-07-24T03:40:49.4364847Z  log.warning( 2025-07-24T03:40:49.4366328Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-07-24T03:40:49.4367946Z  ) 2025-07-24T03:40:49.4368711Z  print(f"::set-output name={key}::{value}") 2025-07-24T03:40:49.4369802Z  return 2025-07-24T03:40:49.4370495Z  2025-07-24T03:40:49.4371148Z  with open(GITHUB_OUTPUT, "a") as f: 2025-07-24T03:40:49.4372156Z  log.info(f"Setting output: {key}='{value}'") 2025-07-24T03:40:49.4373123Z  f.write(f"{key}={value}\n") 2025-07-24T03:40:49.4373951Z  2025-07-24T03:40:49.4374550Z  2025-07-24T03:40:49.4375407Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-07-24T03:40:49.4376516Z  return frozenset( 2025-07-24T03:40:49.4377632Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-07-24T03:40:49.4378829Z  ) 2025-07-24T03:40:49.4379618Z  2025-07-24T03:40:49.4380164Z  2025-07-24T03:40:49.4380768Z def parse_args() -> Any: 2025-07-24T03:40:49.4381803Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-07-24T03:40:49.4383301Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-07-24T03:40:49.4384616Z  parser.add_argument( 2025-07-24T03:40:49.4385463Z  "--github-issue-repo", 2025-07-24T03:40:49.4386301Z  type=str, 2025-07-24T03:40:49.4387023Z  required=False, 2025-07-24T03:40:49.4388065Z  default="pytorch/test-infra", 2025-07-24T03:40:49.4389082Z  help="GitHub repo to get the issue", 2025-07-24T03:40:49.4390169Z  ) 2025-07-24T03:40:49.4390819Z  parser.add_argument( 2025-07-24T03:40:49.4391597Z  "--github-repo", 2025-07-24T03:40:49.4392370Z  type=str, 2025-07-24T03:40:49.4393132Z  required=True, 2025-07-24T03:40:49.4393976Z  help="GitHub repo where CI is running", 2025-07-24T03:40:49.4394866Z  ) 2025-07-24T03:40:49.4395495Z  parser.add_argument( 2025-07-24T03:40:49.4396603Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-07-24T03:40:49.4397734Z  ) 2025-07-24T03:40:49.4398356Z  parser.add_argument( 2025-07-24T03:40:49.4399699Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-07-24T03:40:49.4400906Z  ) 2025-07-24T03:40:49.4401551Z  parser.add_argument( 2025-07-24T03:40:49.4402691Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-07-24T03:40:49.4403917Z  ) 2025-07-24T03:40:49.4404573Z  parser.add_argument( 2025-07-24T03:40:49.4405748Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-07-24T03:40:49.4407256Z  ) 2025-07-24T03:40:49.4407895Z  parser.add_argument( 2025-07-24T03:40:49.4408696Z  "--github-ref-type", 2025-07-24T03:40:49.4409686Z  type=str, 2025-07-24T03:40:49.4410439Z  required=True, 2025-07-24T03:40:49.4411361Z  help="Current GitHub ref type, branch or tag", 2025-07-24T03:40:49.4412277Z  ) 2025-07-24T03:40:49.4412912Z  parser.add_argument( 2025-07-24T03:40:49.4413741Z  "--eligible-experiments", 2025-07-24T03:40:49.4414707Z  type=_str_comma_separated_to_set, 2025-07-24T03:40:49.4415591Z  required=False, 2025-07-24T03:40:49.4416357Z  default="", 2025-07-24T03:40:49.4417893Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-07-24T03:40:49.4419701Z  ) 2025-07-24T03:40:49.4420341Z  parser.add_argument( 2025-07-24T03:40:49.4421163Z  "--opt-out-experiments", 2025-07-24T03:40:49.4422093Z  type=_str_comma_separated_to_set, 2025-07-24T03:40:49.4422976Z  required=False, 2025-07-24T03:40:49.4423735Z  default="", 2025-07-24T03:40:49.4424467Z  help=( 2025-07-24T03:40:49.4425695Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-07-24T03:40:49.4427663Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-07-24T03:40:49.4429357Z  ), 2025-07-24T03:40:49.4430017Z  ) 2025-07-24T03:40:49.4430644Z  parser.add_argument( 2025-07-24T03:40:49.4431440Z  "--pr-number", 2025-07-24T03:40:49.4432218Z  type=str, 2025-07-24T03:40:49.4432966Z  required=False, 2025-07-24T03:40:49.4433732Z  default="", 2025-07-24T03:40:49.4434598Z  help="the optional PR number where this is run", 2025-07-24T03:40:49.4435577Z  ) 2025-07-24T03:40:49.4436355Z  2025-07-24T03:40:49.4436992Z  return parser.parse_args() 2025-07-24T03:40:49.4437794Z  2025-07-24T03:40:49.4438354Z  2025-07-24T03:40:49.4439585Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-07-24T03:40:49.4441116Z  auth = Auth.Token(github_token) 2025-07-24T03:40:49.4442016Z  return Github(auth=auth) 2025-07-24T03:40:49.4442818Z  2025-07-24T03:40:49.4443398Z  2025-07-24T03:40:49.4444499Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-07-24T03:40:49.4445885Z  repo = gh.get_repo(repo) 2025-07-24T03:40:49.4446835Z  return repo.get_issue(number=issue_num) 2025-07-24T03:40:49.4447707Z  2025-07-24T03:40:49.4448263Z  2025-07-24T03:40:49.4448864Z def get_potential_pr_author( 2025-07-24T03:40:49.4450235Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-07-24T03:40:49.4451394Z ) -> str: 2025-07-24T03:40:49.4452300Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-07-24T03:40:49.4453710Z  # Fetch the actual username from the original PR. The PR number is 2025-07-24T03:40:49.4455052Z  # embedded in the tag name: ciflow// 2025-07-24T03:40:49.4456021Z  2025-07-24T03:40:49.4456674Z  gh = get_gh_client(github_token) 2025-07-24T03:40:49.4457535Z  2025-07-24T03:40:49.4458317Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-07-24T03:40:49.4459803Z  split_tag = ref_name.split("/") 2025-07-24T03:40:49.4460684Z  if ( 2025-07-24T03:40:49.4461385Z  len(split_tag) == 3 2025-07-24T03:40:49.4462263Z  and split_tag[0] == "ciflow" 2025-07-24T03:40:49.4463167Z  and split_tag[2].isnumeric() 2025-07-24T03:40:49.4464038Z  ): 2025-07-24T03:40:49.4464736Z  pr_number = split_tag[2] 2025-07-24T03:40:49.4465578Z  try: 2025-07-24T03:40:49.4466339Z  repository = gh.get_repo(repo) 2025-07-24T03:40:49.4467439Z  pull = repository.get_pull(number=int(pr_number)) 2025-07-24T03:40:49.4468516Z  except Exception as e: 2025-07-24T03:40:49.4469643Z  raise Exception( # noqa: TRY002 2025-07-24T03:40:49.4470785Z  f"issue with pull request {pr_number} from repo {repository}" 2025-07-24T03:40:49.4471934Z  ) from e 2025-07-24T03:40:49.4472918Z  return pull.user.login # type: ignore[no-any-return] 2025-07-24T03:40:49.4474128Z  # In all other cases, return the original input username 2025-07-24T03:40:49.4475195Z  return username 2025-07-24T03:40:49.4475911Z  2025-07-24T03:40:49.4476468Z  2025-07-24T03:40:49.4477167Z def is_exception_branch(branch: str) -> bool: 2025-07-24T03:40:49.4478123Z  """ 2025-07-24T03:40:49.4479462Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-07-24T03:40:49.4480817Z  """ 2025-07-24T03:40:49.4481757Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-07-24T03:40:49.4482912Z  2025-07-24T03:40:49.4483470Z  2025-07-24T03:40:49.4484112Z def load_yaml(yaml_text: str) -> Any: 2025-07-24T03:40:49.4484972Z  try: 2025-07-24T03:40:49.4485693Z  data = yaml.safe_load(yaml_text) 2025-07-24T03:40:49.4486619Z  return data 2025-07-24T03:40:49.4487366Z  except yaml.YAMLError: 2025-07-24T03:40:49.4488220Z  log.exception("Error loading YAML") 2025-07-24T03:40:49.4489295Z  raise 2025-07-24T03:40:49.4489978Z  2025-07-24T03:40:49.4490524Z  2025-07-24T03:40:49.4491573Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-07-24T03:40:49.4492864Z  """ 2025-07-24T03:40:49.4494175Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-07-24T03:40:49.4495459Z  2025-07-24T03:40:49.4496388Z  If the issue body contains "---" then the text above that is the settings 2025-07-24T03:40:49.4497714Z  and the text below is the list of opted in users. 2025-07-24T03:40:49.4498671Z  2025-07-24T03:40:49.4499841Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-07-24T03:40:49.4501066Z  """ 2025-07-24T03:40:49.4501841Z  rollout_state_parts = rollout_state.split("---") 2025-07-24T03:40:49.4502850Z  if len(rollout_state_parts) >= 2: 2025-07-24T03:40:49.4504433Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-07-24T03:40:49.4505483Z  else: 2025-07-24T03:40:49.4506178Z  return "", rollout_state 2025-07-24T03:40:49.4506987Z  2025-07-24T03:40:49.4507552Z  2025-07-24T03:40:49.4508237Z class UserOptins(dict[str, list[str]]): 2025-07-24T03:40:49.4509297Z  """ 2025-07-24T03:40:49.4510224Z  Dictionary of users with a list of features they have opted into 2025-07-24T03:40:49.4511343Z  """ 2025-07-24T03:40:49.4511943Z  2025-07-24T03:40:49.4512498Z  2025-07-24T03:40:49.4513618Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-07-24T03:40:49.4514788Z  """ 2025-07-24T03:40:49.4516033Z  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:40:49.4517448Z  2025-07-24T03:40:49.4518835Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-07-24T03:40:49.4520804Z  - Example line: "@User1,lf,split_build" 2025-07-24T03:40:49.4522010Z  - A "#" prefix indicates the user is opted out of all experiments 2025-07-24T03:40:49.4523129Z  2025-07-24T03:40:49.4523704Z  2025-07-24T03:40:49.4524238Z  """ 2025-07-24T03:40:49.4524871Z  optins = UserOptins() 2025-07-24T03:40:49.4525771Z  for user in user_optin_text.split("\n"): 2025-07-24T03:40:49.4526736Z  user = user.strip("\r\n\t -") 2025-07-24T03:40:49.4527684Z  if not user or not user.startswith("@"): 2025-07-24T03:40:49.4528689Z  # Not a valid user. Skip 2025-07-24T03:40:49.4529730Z  continue 2025-07-24T03:40:49.4530426Z  2025-07-24T03:40:49.4530989Z  if user: 2025-07-24T03:40:49.4531772Z  usr_name = user.split(",")[0].strip("@") 2025-07-24T03:40:49.4532984Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-07-24T03:40:49.4534066Z  2025-07-24T03:40:49.4534690Z  return optins 2025-07-24T03:40:49.4535388Z  2025-07-24T03:40:49.4535949Z  2025-07-24T03:40:49.4536789Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-07-24T03:40:49.4537843Z  """ 2025-07-24T03:40:49.4538540Z  Check if the experiment name is valid. 2025-07-24T03:40:49.4539732Z  A valid name: 2025-07-24T03:40:49.4540907Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-07-24T03:40:49.4542528Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-07-24T03:40:49.4543776Z  - Cannot contain spaces 2025-07-24T03:40:49.4544731Z  """ 2025-07-24T03:40:49.4545625Z  2025-07-24T03:40:49.4546398Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-07-24T03:40:49.4547647Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-07-24T03:40:49.4548864Z  2025-07-24T03:40:49.4549627Z  if valid: 2025-07-24T03:40:49.4550315Z  return True 2025-07-24T03:40:49.4551035Z  2025-07-24T03:40:49.4551608Z  log.error( 2025-07-24T03:40:49.4554112Z  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:40:49.4556811Z  ) 2025-07-24T03:40:49.4557438Z  return False 2025-07-24T03:40:49.4558151Z  2025-07-24T03:40:49.4558710Z  2025-07-24T03:40:49.4559772Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-07-24T03:40:49.4560863Z  """ 2025-07-24T03:40:49.4561904Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-07-24T03:40:49.4563122Z  """ 2025-07-24T03:40:49.4563730Z  try: 2025-07-24T03:40:49.4564356Z  if settings_text: 2025-07-24T03:40:49.4565596Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-07-24T03:40:49.4566955Z  # for easy reading 2025-07-24T03:40:49.4568676Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-07-24T03:40:49.4570504Z  # the backtick character in shell commands. 2025-07-24T03:40:49.4571548Z  backtick = chr(96) # backtick character 2025-07-24T03:40:49.4572735Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-07-24T03:40:49.4573946Z  settings = load_yaml(settings_text) 2025-07-24T03:40:49.4574841Z  2025-07-24T03:40:49.4575837Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-07-24T03:40:49.4577062Z  experiments = {} 2025-07-24T03:40:49.4577829Z  2025-07-24T03:40:49.4578756Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-07-24T03:40:49.4580241Z  if not is_valid_experiment_name(exp_name): 2025-07-24T03:40:49.4582097Z  # 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:40:49.4583862Z  continue 2025-07-24T03:40:49.4584654Z  2025-07-24T03:40:49.4585261Z  valid_settings = {} 2025-07-24T03:40:49.4586135Z  for setting in exp_settings: 2025-07-24T03:40:49.4587085Z  if setting not in Experiment._fields: 2025-07-24T03:40:49.4588016Z  log.warning( 2025-07-24T03:40:49.4589448Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-07-24T03:40:49.4590738Z  ) 2025-07-24T03:40:49.4591521Z  else: 2025-07-24T03:40:49.4592522Z  valid_settings[setting] = exp_settings[setting] 2025-07-24T03:40:49.4593575Z  2025-07-24T03:40:49.4594414Z  experiments[exp_name] = Experiment(**valid_settings) 2025-07-24T03:40:49.4595539Z  return Settings(experiments) 2025-07-24T03:40:49.4596364Z  2025-07-24T03:40:49.4596942Z  except Exception: 2025-07-24T03:40:49.4597823Z  log.exception("Failed to parse settings") 2025-07-24T03:40:49.4598723Z  2025-07-24T03:40:49.4599512Z  return Settings() 2025-07-24T03:40:49.4600245Z  2025-07-24T03:40:49.4600782Z  2025-07-24T03:40:49.4601770Z def parse_settings(rollout_state: str) -> Settings: 2025-07-24T03:40:49.4602802Z  """ 2025-07-24T03:40:49.4603600Z  Parse settings, if any, from the rollout state. 2025-07-24T03:40:49.4604535Z  2025-07-24T03:40:49.4605446Z  If the issue body contains "---" then the text above that is the settings 2025-07-24T03:40:49.4606772Z  and the text below is the list of opted in users. 2025-07-24T03:40:49.4607678Z  2025-07-24T03:40:49.4608718Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-07-24T03:40:49.4610174Z  """ 2025-07-24T03:40:49.4611114Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:40:49.4612458Z  return parse_settings_from_text(settings_text) 2025-07-24T03:40:49.4613465Z  2025-07-24T03:40:49.4614040Z  2025-07-24T03:40:49.4614853Z def parse_users(rollout_state: str) -> UserOptins: 2025-07-24T03:40:49.4615966Z  """ 2025-07-24T03:40:49.4616638Z  Parse users from the rollout state. 2025-07-24T03:40:49.4617528Z  2025-07-24T03:40:49.4618130Z  """ 2025-07-24T03:40:49.4619320Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:40:49.4621005Z  return parse_user_opt_in_from_text(users_text) 2025-07-24T03:40:49.4622002Z  2025-07-24T03:40:49.4622618Z  2025-07-24T03:40:49.4623771Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:40:49.4625140Z  """ 2025-07-24T03:40:49.4625931Z  Check if a user is opted into an experiment 2025-07-24T03:40:49.4626853Z  """ 2025-07-24T03:40:49.4627692Z  return experiment_name in user_optins.get(user, []) 2025-07-24T03:40:49.4628772Z  2025-07-24T03:40:49.4629571Z  2025-07-24T03:40:49.4630696Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:40:49.4632141Z  """ 2025-07-24T03:40:49.4632923Z  Check if a user explicitly opted out of an experiment 2025-07-24T03:40:49.4633530Z  """ 2025-07-24T03:40:49.4634049Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-07-24T03:40:49.4634776Z  experiment_optout = "-" + experiment_name 2025-07-24T03:40:49.4635434Z  if experiment_optout not in user_optins.get(user, []): 2025-07-24T03:40:49.4636032Z  return False 2025-07-24T03:40:49.4636449Z  2025-07-24T03:40:49.4636904Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-07-24T03:40:49.4637500Z  log.warning( 2025-07-24T03:40:49.4638319Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-07-24T03:40:49.4639470Z  ) 2025-07-24T03:40:49.4639871Z  2025-07-24T03:40:49.4640210Z  return True 2025-07-24T03:40:49.4640601Z  2025-07-24T03:40:49.4640925Z  2025-07-24T03:40:49.4641276Z def get_runner_prefix( 2025-07-24T03:40:49.4641733Z  rollout_state: str, 2025-07-24T03:40:49.4642241Z  workflow_requestors: Iterable[str], 2025-07-24T03:40:49.4642752Z  branch: str, 2025-07-24T03:40:49.4643289Z  eligible_experiments: frozenset[str] = frozenset(), 2025-07-24T03:40:49.4643975Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-07-24T03:40:49.4644550Z  is_canary: bool = False, 2025-07-24T03:40:49.4645018Z ) -> str: 2025-07-24T03:40:49.4645512Z  settings = parse_settings(rollout_state) 2025-07-24T03:40:49.4646102Z  user_optins = parse_users(rollout_state) 2025-07-24T03:40:49.4646607Z  2025-07-24T03:40:49.4647148Z  fleet_prefix = "" 2025-07-24T03:40:49.4647598Z  prefixes = [] 2025-07-24T03:40:49.4648252Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-07-24T03:40:49.4649379Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-07-24T03:40:49.4650095Z  log.info( 2025-07-24T03:40:49.4650786Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-07-24T03:40:49.4651517Z  ) 2025-07-24T03:40:49.4651915Z  continue 2025-07-24T03:40:49.4652331Z  2025-07-24T03:40:49.4652689Z  if opt_out_experiments: 2025-07-24T03:40:49.4653278Z  if experiment_name in opt_out_experiments: 2025-07-24T03:40:49.4653915Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-07-24T03:40:49.4654489Z  log.info( 2025-07-24T03:40:49.4655409Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-07-24T03:40:49.4656461Z  ) 2025-07-24T03:40:49.4656875Z  continue 2025-07-24T03:40:49.4657442Z  2025-07-24T03:40:49.4657809Z  if eligible_experiments: 2025-07-24T03:40:49.4658383Z  if experiment_name not in eligible_experiments: 2025-07-24T03:40:49.4659017Z  exp_list = ", ".join(eligible_experiments) 2025-07-24T03:40:49.4659720Z  log.info( 2025-07-24T03:40:49.4660511Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-07-24T03:40:49.4661325Z  ) 2025-07-24T03:40:49.4661750Z  continue 2025-07-24T03:40:49.4662257Z  elif not experiment_settings.default: 2025-07-24T03:40:49.4662770Z  log.info( 2025-07-24T03:40:49.4663454Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-07-24T03:40:49.4664167Z  ) 2025-07-24T03:40:49.4664562Z  continue 2025-07-24T03:40:49.4664990Z  2025-07-24T03:40:49.4665447Z  # Is any workflow_requestor opted out to this experiment? 2025-07-24T03:40:49.4666069Z  opted_out_users = [ 2025-07-24T03:40:49.4666530Z  requestor 2025-07-24T03:40:49.4667034Z  for requestor in workflow_requestors 2025-07-24T03:40:49.4667702Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-07-24T03:40:49.4668315Z  ] 2025-07-24T03:40:49.4668679Z  2025-07-24T03:40:49.4669028Z  if opted_out_users: 2025-07-24T03:40:49.4669730Z  log.info( 2025-07-24T03:40:49.4670376Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-07-24T03:40:49.4671055Z  ) 2025-07-24T03:40:49.4671442Z  continue 2025-07-24T03:40:49.4671849Z  2025-07-24T03:40:49.4672304Z  # Is any workflow_requestor opted in to this experiment? 2025-07-24T03:40:49.4672905Z  opted_in_users = [ 2025-07-24T03:40:49.4673367Z  requestor 2025-07-24T03:40:49.4673847Z  for requestor in workflow_requestors 2025-07-24T03:40:49.4674514Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-07-24T03:40:49.4675113Z  ] 2025-07-24T03:40:49.4675477Z  2025-07-24T03:40:49.4675816Z  enabled = False 2025-07-24T03:40:49.4676279Z  if opted_in_users: 2025-07-24T03:40:49.4676896Z  log.info( 2025-07-24T03:40:49.4677544Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-07-24T03:40:49.4678219Z  ) 2025-07-24T03:40:49.4678615Z  enabled = True 2025-07-24T03:40:49.4679058Z  2025-07-24T03:40:49.4679682Z  elif experiment_settings.rollout_perc: 2025-07-24T03:40:49.4680513Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-07-24T03:40:49.4681443Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-07-24T03:40:49.4682070Z  log.info( 2025-07-24T03:40:49.4682968Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-07-24T03:40:49.4683862Z  ) 2025-07-24T03:40:49.4684303Z  enabled = True 2025-07-24T03:40:49.4684762Z  2025-07-24T03:40:49.4685097Z  if enabled: 2025-07-24T03:40:49.4685544Z  label = experiment_name 2025-07-24T03:40:49.4686091Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-07-24T03:40:49.4686900Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-07-24T03:40:49.4687889Z  # - If it's enabled, then we always list it's prefix first 2025-07-24T03:40:49.4688639Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-07-24T03:40:49.4689491Z  if is_canary: 2025-07-24T03:40:49.4690006Z  label += CANARY_FLEET_SUFFIX 2025-07-24T03:40:49.4690554Z  fleet_prefix = label 2025-07-24T03:40:49.4691038Z  else: 2025-07-24T03:40:49.4691498Z  prefixes.append(label) 2025-07-24T03:40:49.4691981Z  2025-07-24T03:40:49.4692349Z  if len(prefixes) > 1: 2025-07-24T03:40:49.4692804Z  log.error( 2025-07-24T03:40:49.4693842Z  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:40:49.4694934Z  ) 2025-07-24T03:40:49.4695330Z  prefixes = prefixes[:1] 2025-07-24T03:40:49.4695902Z  2025-07-24T03:40:49.4696251Z  # Fleet always comes first 2025-07-24T03:40:49.4696741Z  if fleet_prefix: 2025-07-24T03:40:49.4697213Z  prefixes.insert(0, fleet_prefix) 2025-07-24T03:40:49.4697703Z  2025-07-24T03:40:49.4698144Z  return ".".join(prefixes) + "." if prefixes else "" 2025-07-24T03:40:49.4698698Z  2025-07-24T03:40:49.4699024Z  2025-07-24T03:40:49.4699874Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-07-24T03:40:49.4700640Z  """ 2025-07-24T03:40:49.4701225Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-07-24T03:40:49.4701912Z  2025-07-24T03:40:49.4702478Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-07-24T03:40:49.4703238Z  """ 2025-07-24T03:40:49.4703975Z  gh = get_gh_client(github_token) 2025-07-24T03:40:49.4704686Z  issue = get_issue(gh, repo, issue_num) 2025-07-24T03:40:49.4705335Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-07-24T03:40:49.4705933Z  2025-07-24T03:40:49.4706251Z  2025-07-24T03:40:49.4706837Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-07-24T03:40:49.4707736Z  for _ in range(num_retries): 2025-07-24T03:40:49.4708232Z  try: 2025-07-24T03:40:49.4708672Z  req = Request(url=url, headers=headers) 2025-07-24T03:40:49.4709458Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-07-24T03:40:49.4710103Z  return json.loads(content) 2025-07-24T03:40:49.4710629Z  except Exception as e: 2025-07-24T03:40:49.4711189Z  log.warning(f"Could not download {url}: {e}") 2025-07-24T03:40:49.4711715Z  2025-07-24T03:40:49.4712281Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-07-24T03:40:49.4712984Z  return {} 2025-07-24T03:40:49.4713370Z  2025-07-24T03:40:49.4713685Z  2025-07-24T03:40:49.4714012Z @cache 2025-07-24T03:40:49.4714641Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-07-24T03:40:49.4715406Z  """ 2025-07-24T03:40:49.4715805Z  Dynamically get PR information 2025-07-24T03:40:49.4716312Z  """ 2025-07-24T03:40:49.4716823Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-07-24T03:40:49.4717434Z  headers = { 2025-07-24T03:40:49.4717911Z  "Accept": "application/vnd.github.v3+json", 2025-07-24T03:40:49.4718677Z  "Authorization": f"token {github_token}", 2025-07-24T03:40:49.4719291Z  } 2025-07-24T03:40:49.4719793Z  json_response: dict[str, Any] = download_json( 2025-07-24T03:40:49.4720390Z  url=f"{github_api}/issues/{pr_number}", 2025-07-24T03:40:49.4720949Z  headers=headers, 2025-07-24T03:40:49.4721397Z  ) 2025-07-24T03:40:49.4721745Z  2025-07-24T03:40:49.4722094Z  if not json_response: 2025-07-24T03:40:49.4722680Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-07-24T03:40:49.4723301Z  return {} 2025-07-24T03:40:49.4723693Z  2025-07-24T03:40:49.4724044Z  return json_response 2025-07-24T03:40:49.4724478Z  2025-07-24T03:40:49.4724803Z  2025-07-24T03:40:49.4725372Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-07-24T03:40:49.4726094Z  """ 2025-07-24T03:40:49.4726625Z  Dynamically get the latest list of labels from the pull request 2025-07-24T03:40:49.4727265Z  """ 2025-07-24T03:40:49.4727754Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-07-24T03:40:49.4728380Z  return { 2025-07-24T03:40:49.4728969Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-07-24T03:40:49.4729730Z  } 2025-07-24T03:40:49.4730079Z  2025-07-24T03:40:49.4730397Z  2025-07-24T03:40:49.4730748Z def main() -> None: 2025-07-24T03:40:49.4731191Z  args = parse_args() 2025-07-24T03:40:49.4731611Z  2025-07-24T03:40:49.4732019Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-07-24T03:40:49.4732532Z  2025-07-24T03:40:49.4732893Z  # Check if the PR is opt-out 2025-07-24T03:40:49.4733396Z  if args.pr_number: 2025-07-24T03:40:49.4734073Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-07-24T03:40:49.4734813Z  if OPT_OUT_LABEL in labels: 2025-07-24T03:40:49.4735305Z  log.info( 2025-07-24T03:40:49.4736012Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-07-24T03:40:49.4736755Z  ) 2025-07-24T03:40:49.4737327Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:40:49.4737983Z  sys.exit() 2025-07-24T03:40:49.4738542Z  2025-07-24T03:40:49.4738874Z  try: 2025-07-24T03:40:49.4739492Z  rollout_state = get_rollout_state_from_issue( 2025-07-24T03:40:49.4740232Z  args.github_token, args.github_issue_repo, args.github_issue 2025-07-24T03:40:49.4740875Z  ) 2025-07-24T03:40:49.4741254Z  2025-07-24T03:40:49.4741636Z  username = get_potential_pr_author( 2025-07-24T03:40:49.4742173Z  args.github_token, 2025-07-24T03:40:49.4742654Z  args.github_repo, 2025-07-24T03:40:49.4743141Z  args.github_actor, 2025-07-24T03:40:49.4743640Z  args.github_ref_type, 2025-07-24T03:40:49.4744137Z  args.github_branch, 2025-07-24T03:40:49.4744615Z  ) 2025-07-24T03:40:49.4744970Z  2025-07-24T03:40:49.4745445Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-07-24T03:40:49.4746030Z  2025-07-24T03:40:49.4746430Z  runner_label_prefix = get_runner_prefix( 2025-07-24T03:40:49.4746963Z  rollout_state, 2025-07-24T03:40:49.4747466Z  (args.github_issue_owner, username), 2025-07-24T03:40:49.4748003Z  args.github_branch, 2025-07-24T03:40:49.4748685Z  args.eligible_experiments, 2025-07-24T03:40:49.4749332Z  args.opt_out_experiments, 2025-07-24T03:40:49.4749831Z  is_canary, 2025-07-24T03:40:49.4750259Z  ) 2025-07-24T03:40:49.4750614Z  2025-07-24T03:40:49.4750969Z  except Exception as e: 2025-07-24T03:40:49.4751430Z  log.error( 2025-07-24T03:40:49.4752147Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-07-24T03:40:49.4752897Z  ) 2025-07-24T03:40:49.4753260Z  2025-07-24T03:40:49.4753772Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:40:49.4754402Z  2025-07-24T03:40:49.4754727Z  2025-07-24T03:40:49.4755063Z if __name__ == "__main__": 2025-07-24T03:40:49.4755513Z  main() 2025-07-24T03:40:49.4755871Z  2025-07-24T03:40:49.4756212Z EOF 2025-07-24T03:40:49.4756546Z  2025-07-24T03:40:49.4756899Z cat runner_determinator.py 2025-07-24T03:40:49.5038976Z shell: /usr/bin/bash -e {0} 2025-07-24T03:40:49.5040100Z env: 2025-07-24T03:40:49.5040735Z GITHUB_TOKEN: *** 2025-07-24T03:40:49.5041146Z ISSUE_NUMBER: 5132 2025-07-24T03:40:49.5041567Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:40:49.5042068Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:40:49.5042525Z CHECK_EXPERIMENTS: 2025-07-24T03:40:49.5042942Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:40:49.5043353Z PR_NUMBER: 149961 2025-07-24T03:40:49.5043759Z ##[endgroup] 2025-07-24T03:40:49.5249726Z # flake8: noqa: G004 2025-07-24T03:40:49.5250042Z 2025-07-24T03:40:49.5250451Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-07-24T03:40:49.5251347Z # must be kept in sync. You can do it easily by running the following command: 2025-07-24T03:40:49.5252126Z # python .github/scripts/update_runner_determinator.py 2025-07-24T03:40:49.5252556Z 2025-07-24T03:40:49.5252709Z """ 2025-07-24T03:40:49.5253253Z This runner determinator is used to determine which set of runners to run a 2025-07-24T03:40:49.5254103Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-07-24T03:40:49.5254956Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-07-24T03:40:49.5255724Z of which runners should be used to run which job. 2025-07-24T03:40:49.5256095Z 2025-07-24T03:40:49.5256462Z The configuration has two parts, the settings and a list of opted-in users, 2025-07-24T03:40:49.5257493Z separated by a line containing "---". If the line is not present, the 2025-07-24T03:40:49.5258339Z settings are considered to be empty with only the second part, the user 2025-07-24T03:40:49.5258982Z list, defined. 2025-07-24T03:40:49.5259477Z 2025-07-24T03:40:49.5259833Z The first part is a YAML block that defines the rollout settings. This can be 2025-07-24T03:40:49.5260696Z used to define any settings that are needed to determine which runners to use. 2025-07-24T03:40:49.5261475Z It's fields are defined by the RolloutSettings class below. 2025-07-24T03:40:49.5261890Z 2025-07-24T03:40:49.5262241Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-07-24T03:40:49.5263048Z The user list is also a comma separated list of additional features or 2025-07-24T03:40:49.5263740Z experiments which the user could be opted in to. 2025-07-24T03:40:49.5264111Z 2025-07-24T03:40:49.5264295Z The user list has the following rules: 2025-07-24T03:40:49.5264625Z 2025-07-24T03:40:49.5264920Z - Users are GitHub usernames, which must start with the @ prefix 2025-07-24T03:40:49.5265714Z - Each user is also a comma-separated list of features/experiments to enable 2025-07-24T03:40:49.5266426Z - A "#" prefix opts the user out of all experiments 2025-07-24T03:40:49.5266803Z 2025-07-24T03:40:49.5266964Z Example config: 2025-07-24T03:40:49.5267384Z # A list of experiments that can be opted into. 2025-07-24T03:40:49.5268155Z # This defines the behavior they'll induce when opted into. 2025-07-24T03:40:49.5268730Z # Expected syntax is: 2025-07-24T03:40:49.5269499Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-07-24T03:40:49.5270422Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-07-24T03:40:49.5271003Z 2025-07-24T03:40:49.5271159Z experiments: 2025-07-24T03:40:49.5271512Z lf: 2025-07-24T03:40:49.5271850Z rollout_percent: 25 2025-07-24T03:40:49.5272271Z all_branches: false 2025-07-24T03:40:49.5272684Z default: true 2025-07-24T03:40:49.5273064Z --- 2025-07-24T03:40:49.5273252Z 2025-07-24T03:40:49.5273402Z # Opt-ins: 2025-07-24T03:40:49.5273945Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-07-24T03:40:49.5274748Z # and specifying experiments to enable in a comma-separated list. 2025-07-24T03:40:49.5275482Z # To always opt out of an experiment, prefix it with a "-". 2025-07-24T03:40:49.5276088Z # Experiments should be from the above list. 2025-07-24T03:40:49.5276438Z 2025-07-24T03:40:49.5276604Z @User1,-lf,split_build 2025-07-24T03:40:49.5277014Z @User2,lf 2025-07-24T03:40:49.5277357Z @User3,split_build 2025-07-24T03:40:49.5277726Z """ 2025-07-24T03:40:49.5277898Z 2025-07-24T03:40:49.5278053Z import json 2025-07-24T03:40:49.5278390Z import logging 2025-07-24T03:40:49.5278733Z import os 2025-07-24T03:40:49.5279067Z import random 2025-07-24T03:40:49.5329959Z import re 2025-07-24T03:40:49.5330486Z import sys 2025-07-24T03:40:49.5330920Z from argparse import ArgumentParser 2025-07-24T03:40:49.5331433Z from collections.abc import Iterable 2025-07-24T03:40:49.5331922Z from functools import cache 2025-07-24T03:40:49.5332370Z from logging import LogRecord 2025-07-24T03:40:49.5332829Z from typing import Any, NamedTuple 2025-07-24T03:40:49.5333332Z from urllib.request import Request, urlopen 2025-07-24T03:40:49.5333683Z 2025-07-24T03:40:49.5333840Z import yaml 2025-07-24T03:40:49.5334209Z from github import Auth, Github 2025-07-24T03:40:49.5334682Z from github.Issue import Issue 2025-07-24T03:40:49.5334967Z 2025-07-24T03:40:49.5334973Z 2025-07-24T03:40:49.5335181Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-07-24T03:40:49.5335832Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-07-24T03:40:49.5336663Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-07-24T03:40:49.5337192Z 2025-07-24T03:40:49.5337582Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-07-24T03:40:49.5338143Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-07-24T03:40:49.5338609Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-07-24T03:40:49.5339323Z OPT_OUT_LABEL = "no-runner-experiments" 2025-07-24T03:40:49.5339750Z 2025-07-24T03:40:49.5339935Z SETTING_EXPERIMENTS = "experiments" 2025-07-24T03:40:49.5340252Z 2025-07-24T03:40:49.5340434Z LF_FLEET_EXPERIMENT = "lf" 2025-07-24T03:40:49.5340865Z CANARY_FLEET_SUFFIX = ".c" 2025-07-24T03:40:49.5341124Z 2025-07-24T03:40:49.5341130Z 2025-07-24T03:40:49.5341306Z class Experiment(NamedTuple): 2025-07-24T03:40:49.5341753Z rollout_perc: float = ( 2025-07-24T03:40:49.5342344Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-07-24T03:40:49.5343013Z ) 2025-07-24T03:40:49.5343353Z all_branches: bool = ( 2025-07-24T03:40:49.5343937Z False # If True, the experiment is also enabled on the exception branches 2025-07-24T03:40:49.5344568Z ) 2025-07-24T03:40:49.5344904Z default: bool = ( 2025-07-24T03:40:49.5345434Z True # If True, the experiment is enabled by default for all queries 2025-07-24T03:40:49.5346033Z ) 2025-07-24T03:40:49.5346207Z 2025-07-24T03:40:49.5346379Z # Add more fields as needed 2025-07-24T03:40:49.5346655Z 2025-07-24T03:40:49.5346661Z 2025-07-24T03:40:49.5346835Z class Settings(NamedTuple): 2025-07-24T03:40:49.5347392Z """ 2025-07-24T03:40:49.5347808Z Settings for the experiments that can be opted into. 2025-07-24T03:40:49.5348345Z """ 2025-07-24T03:40:49.5348527Z 2025-07-24T03:40:49.5348724Z experiments: dict[str, Experiment] = {} 2025-07-24T03:40:49.5349063Z 2025-07-24T03:40:49.5349070Z 2025-07-24T03:40:49.5349394Z class ColorFormatter(logging.Formatter): 2025-07-24T03:40:49.5349988Z """Color codes the log messages based on the log level""" 2025-07-24T03:40:49.5350399Z 2025-07-24T03:40:49.5350547Z COLORS = { 2025-07-24T03:40:49.5350913Z "WARNING": "\033[33m", # Yellow 2025-07-24T03:40:49.5351381Z "ERROR": "\033[31m", # Red 2025-07-24T03:40:49.5351841Z "CRITICAL": "\033[31m", # Red 2025-07-24T03:40:49.5352307Z "INFO": "\033[0m", # Reset 2025-07-24T03:40:49.5352752Z "DEBUG": "\033[0m", # Reset 2025-07-24T03:40:49.5353182Z } 2025-07-24T03:40:49.5353357Z 2025-07-24T03:40:49.5353557Z def format(self, record: LogRecord) -> str: 2025-07-24T03:40:49.5354268Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-07-24T03:40:49.5354989Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-07-24T03:40:49.5355538Z return super().format(record) 2025-07-24T03:40:49.5355845Z 2025-07-24T03:40:49.5355852Z 2025-07-24T03:40:49.5356037Z handler = logging.StreamHandler() 2025-07-24T03:40:49.5356697Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-07-24T03:40:49.5357225Z 2025-07-24T03:40:49.5357459Z log = logging.getLogger(os.path.basename(__file__)) 2025-07-24T03:40:49.5357989Z log.addHandler(handler) 2025-07-24T03:40:49.5358407Z log.setLevel(logging.INFO) 2025-07-24T03:40:49.5358665Z 2025-07-24T03:40:49.5358672Z 2025-07-24T03:40:49.5358902Z def set_github_output(key: str, value: str) -> None: 2025-07-24T03:40:49.5359558Z """ 2025-07-24T03:40:49.5360028Z Defines outputs of the github action that invokes this script 2025-07-24T03:40:49.5360609Z """ 2025-07-24T03:40:49.5360949Z if not GITHUB_OUTPUT: 2025-07-24T03:40:49.5361946Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-07-24T03:40:49.5362998Z log.warning( 2025-07-24T03:40:49.5363795Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-07-24T03:40:49.5364667Z ) 2025-07-24T03:40:49.5374597Z print(f"::set-output name={key}::{value}") 2025-07-24T03:40:49.5375209Z return 2025-07-24T03:40:49.5375421Z 2025-07-24T03:40:49.5375801Z with open(GITHUB_OUTPUT, "a") as f: 2025-07-24T03:40:49.5376353Z log.info(f"Setting output: {key}='{value}'") 2025-07-24T03:40:49.5376893Z f.write(f"{key}={value}\n") 2025-07-24T03:40:49.5377197Z 2025-07-24T03:40:49.5377204Z 2025-07-24T03:40:49.5377500Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-07-24T03:40:49.5378107Z return frozenset( 2025-07-24T03:40:49.5378664Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-07-24T03:40:49.5379624Z ) 2025-07-24T03:40:49.5379812Z 2025-07-24T03:40:49.5379818Z 2025-07-24T03:40:49.5379992Z def parse_args() -> Any: 2025-07-24T03:40:49.5380542Z parser = ArgumentParser("Get dynamic rollout settings") 2025-07-24T03:40:49.5381352Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-07-24T03:40:49.5382076Z parser.add_argument( 2025-07-24T03:40:49.5382495Z "--github-issue-repo", 2025-07-24T03:40:49.5382914Z type=str, 2025-07-24T03:40:49.5383289Z required=False, 2025-07-24T03:40:49.5383708Z default="pytorch/test-infra", 2025-07-24T03:40:49.5384206Z help="GitHub repo to get the issue", 2025-07-24T03:40:49.5384675Z ) 2025-07-24T03:40:49.5385005Z parser.add_argument( 2025-07-24T03:40:49.5385412Z "--github-repo", 2025-07-24T03:40:49.5385796Z type=str, 2025-07-24T03:40:49.5386300Z required=True, 2025-07-24T03:40:49.5386712Z help="GitHub repo where CI is running", 2025-07-24T03:40:49.5387195Z ) 2025-07-24T03:40:49.5387522Z parser.add_argument( 2025-07-24T03:40:49.5388075Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-07-24T03:40:49.5388678Z ) 2025-07-24T03:40:49.5389012Z parser.add_argument( 2025-07-24T03:40:49.5389706Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-07-24T03:40:49.5390336Z ) 2025-07-24T03:40:49.5390665Z parser.add_argument( 2025-07-24T03:40:49.5391255Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-07-24T03:40:49.5391899Z ) 2025-07-24T03:40:49.5392227Z parser.add_argument( 2025-07-24T03:40:49.5392832Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-07-24T03:40:49.5393497Z ) 2025-07-24T03:40:49.5393829Z parser.add_argument( 2025-07-24T03:40:49.5394246Z "--github-ref-type", 2025-07-24T03:40:49.5394657Z type=str, 2025-07-24T03:40:49.5395021Z required=True, 2025-07-24T03:40:49.5395455Z help="Current GitHub ref type, branch or tag", 2025-07-24T03:40:49.5395961Z ) 2025-07-24T03:40:49.5396286Z parser.add_argument( 2025-07-24T03:40:49.5396708Z "--eligible-experiments", 2025-07-24T03:40:49.5397172Z type=_str_comma_separated_to_set, 2025-07-24T03:40:49.5397651Z required=False, 2025-07-24T03:40:49.5398021Z default="", 2025-07-24T03:40:49.5398830Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-07-24T03:40:49.5399845Z ) 2025-07-24T03:40:49.5400171Z parser.add_argument( 2025-07-24T03:40:49.5400594Z "--opt-out-experiments", 2025-07-24T03:40:49.5401052Z type=_str_comma_separated_to_set, 2025-07-24T03:40:49.5401535Z required=False, 2025-07-24T03:40:49.5401915Z default="", 2025-07-24T03:40:49.5402270Z help=( 2025-07-24T03:40:49.5402881Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-07-24T03:40:49.5403953Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-07-24T03:40:49.5404731Z ), 2025-07-24T03:40:49.5405050Z ) 2025-07-24T03:40:49.5405384Z parser.add_argument( 2025-07-24T03:40:49.5405777Z "--pr-number", 2025-07-24T03:40:49.5406152Z type=str, 2025-07-24T03:40:49.5406508Z required=False, 2025-07-24T03:40:49.5407009Z default="", 2025-07-24T03:40:49.5407434Z help="the optional PR number where this is run", 2025-07-24T03:40:49.5407948Z ) 2025-07-24T03:40:49.5408124Z 2025-07-24T03:40:49.5408299Z return parser.parse_args() 2025-07-24T03:40:49.5408586Z 2025-07-24T03:40:49.5408592Z 2025-07-24T03:40:49.5408971Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-07-24T03:40:49.5409823Z auth = Auth.Token(github_token) 2025-07-24T03:40:49.5410286Z return Github(auth=auth) 2025-07-24T03:40:49.5410556Z 2025-07-24T03:40:49.5410568Z 2025-07-24T03:40:49.5410989Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-07-24T03:40:49.5411739Z repo = gh.get_repo(repo) 2025-07-24T03:40:49.5412201Z return repo.get_issue(number=issue_num) 2025-07-24T03:40:49.5412534Z 2025-07-24T03:40:49.5412541Z 2025-07-24T03:40:49.5412714Z def get_potential_pr_author( 2025-07-24T03:40:49.5413303Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-07-24T03:40:49.5413937Z ) -> str: 2025-07-24T03:40:49.5414404Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-07-24T03:40:49.5415157Z # Fetch the actual username from the original PR. The PR number is 2025-07-24T03:40:49.5415839Z # embedded in the tag name: ciflow// 2025-07-24T03:40:49.5416361Z 2025-07-24T03:40:49.5416538Z gh = get_gh_client(github_token) 2025-07-24T03:40:49.5416842Z 2025-07-24T03:40:49.5417103Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-07-24T03:40:49.5417673Z split_tag = ref_name.split("/") 2025-07-24T03:40:49.5418147Z if ( 2025-07-24T03:40:49.5418494Z len(split_tag) == 3 2025-07-24T03:40:49.5418941Z and split_tag[0] == "ciflow" 2025-07-24T03:40:49.5419654Z and split_tag[2].isnumeric() 2025-07-24T03:40:49.5420121Z ): 2025-07-24T03:40:49.5420470Z pr_number = split_tag[2] 2025-07-24T03:40:49.5420922Z try: 2025-07-24T03:40:49.5421306Z repository = gh.get_repo(repo) 2025-07-24T03:40:49.5421867Z pull = repository.get_pull(number=int(pr_number)) 2025-07-24T03:40:49.5422414Z except Exception as e: 2025-07-24T03:40:49.5422880Z raise Exception( # noqa: TRY002 2025-07-24T03:40:49.5423501Z f"issue with pull request {pr_number} from repo {repository}" 2025-07-24T03:40:49.5424084Z ) from e 2025-07-24T03:40:49.5424569Z return pull.user.login # type: ignore[no-any-return] 2025-07-24T03:40:49.5425202Z # In all other cases, return the original input username 2025-07-24T03:40:49.5425745Z return username 2025-07-24T03:40:49.5425963Z 2025-07-24T03:40:49.5425969Z 2025-07-24T03:40:49.5426179Z def is_exception_branch(branch: str) -> bool: 2025-07-24T03:40:49.5426662Z """ 2025-07-24T03:40:49.5427257Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-07-24T03:40:49.5427968Z """ 2025-07-24T03:40:49.5428481Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-07-24T03:40:49.5428972Z 2025-07-24T03:40:49.5428979Z 2025-07-24T03:40:49.5429622Z def load_yaml(yaml_text: str) -> Any: 2025-07-24T03:40:49.5430099Z try: 2025-07-24T03:40:49.5430451Z data = yaml.safe_load(yaml_text) 2025-07-24T03:40:49.5430919Z return data 2025-07-24T03:40:49.5431293Z except yaml.YAMLError: 2025-07-24T03:40:49.5431727Z log.exception("Error loading YAML") 2025-07-24T03:40:49.5432197Z raise 2025-07-24T03:40:49.5432391Z 2025-07-24T03:40:49.5432397Z 2025-07-24T03:40:49.5432779Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-07-24T03:40:49.5433469Z """ 2025-07-24T03:40:49.5434027Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-07-24T03:40:49.5434593Z 2025-07-24T03:40:49.5435052Z If the issue body contains "---" then the text above that is the settings 2025-07-24T03:40:49.5435766Z and the text below is the list of opted in users. 2025-07-24T03:40:49.5436140Z 2025-07-24T03:40:49.5436485Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-07-24T03:40:49.5437147Z """ 2025-07-24T03:40:49.5437547Z rollout_state_parts = rollout_state.split("---") 2025-07-24T03:40:49.5438103Z if len(rollout_state_parts) >= 2: 2025-07-24T03:40:49.5438653Z return rollout_state_parts[0], rollout_state_parts[1] 2025-07-24T03:40:49.5439293Z else: 2025-07-24T03:40:49.5439646Z return "", rollout_state 2025-07-24T03:40:49.5439930Z 2025-07-24T03:40:49.5439937Z 2025-07-24T03:40:49.5440119Z class UserOptins(dict[str, list[str]]): 2025-07-24T03:40:49.5440580Z """ 2025-07-24T03:40:49.5441051Z Dictionary of users with a list of features they have opted into 2025-07-24T03:40:49.5441654Z """ 2025-07-24T03:40:49.5441830Z 2025-07-24T03:40:49.5441837Z 2025-07-24T03:40:49.5442149Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-07-24T03:40:49.5442751Z """ 2025-07-24T03:40:49.5443411Z 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:40:49.5444057Z 2025-07-24T03:40:49.5444649Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-07-24T03:40:49.5445710Z - Example line: "@User1,lf,split_build" 2025-07-24T03:40:49.5446339Z - A "#" prefix indicates the user is opted out of all experiments 2025-07-24T03:40:49.5446797Z 2025-07-24T03:40:49.5446803Z 2025-07-24T03:40:49.5446951Z """ 2025-07-24T03:40:49.5447287Z optins = UserOptins() 2025-07-24T03:40:49.5447735Z for user in user_optin_text.split("\n"): 2025-07-24T03:40:49.5448242Z user = user.strip("\r\n\t -") 2025-07-24T03:40:49.5448736Z if not user or not user.startswith("@"): 2025-07-24T03:40:49.5449380Z # Not a valid user. Skip 2025-07-24T03:40:49.5449818Z continue 2025-07-24T03:40:49.5450042Z 2025-07-24T03:40:49.5450187Z if user: 2025-07-24T03:40:49.5450591Z usr_name = user.split(",")[0].strip("@") 2025-07-24T03:40:49.5451224Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-07-24T03:40:49.5451687Z 2025-07-24T03:40:49.5451850Z return optins 2025-07-24T03:40:49.5452065Z 2025-07-24T03:40:49.5452071Z 2025-07-24T03:40:49.5452332Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-07-24T03:40:49.5452885Z """ 2025-07-24T03:40:49.5453234Z Check if the experiment name is valid. 2025-07-24T03:40:49.5453709Z A valid name: 2025-07-24T03:40:49.5454293Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-07-24T03:40:49.5455168Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-07-24T03:40:49.5455837Z - Cannot contain spaces 2025-07-24T03:40:49.5456241Z """ 2025-07-24T03:40:49.5456421Z 2025-07-24T03:40:49.5456659Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-07-24T03:40:49.5457297Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-07-24T03:40:49.5457712Z 2025-07-24T03:40:49.5457858Z if valid: 2025-07-24T03:40:49.5458199Z return True 2025-07-24T03:40:49.5458419Z 2025-07-24T03:40:49.5458565Z log.error( 2025-07-24T03:40:49.5460171Z 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:40:49.5461713Z ) 2025-07-24T03:40:49.5462037Z return False 2025-07-24T03:40:49.5462246Z 2025-07-24T03:40:49.5462252Z 2025-07-24T03:40:49.5462532Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-07-24T03:40:49.5463106Z """ 2025-07-24T03:40:49.5463781Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-07-24T03:40:49.5464445Z """ 2025-07-24T03:40:49.5464759Z try: 2025-07-24T03:40:49.5465092Z if settings_text: 2025-07-24T03:40:49.5465762Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-07-24T03:40:49.5466497Z # for easy reading 2025-07-24T03:40:49.5467216Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-07-24T03:40:49.5468047Z # the backtick character in shell commands. 2025-07-24T03:40:49.5468595Z backtick = chr(96) # backtick character 2025-07-24T03:40:49.5469319Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-07-24T03:40:49.5469927Z settings = load_yaml(settings_text) 2025-07-24T03:40:49.5470272Z 2025-07-24T03:40:49.5470654Z # For now we just load experiments. We can expand this if/when we add more settings 2025-07-24T03:40:49.5471343Z experiments = {} 2025-07-24T03:40:49.5471611Z 2025-07-24T03:40:49.5471961Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-07-24T03:40:49.5472658Z if not is_valid_experiment_name(exp_name): 2025-07-24T03:40:49.5473687Z # 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:40:49.5474798Z continue 2025-07-24T03:40:49.5475056Z 2025-07-24T03:40:49.5475225Z valid_settings = {} 2025-07-24T03:40:49.5475691Z for setting in exp_settings: 2025-07-24T03:40:49.5476209Z if setting not in Experiment._fields: 2025-07-24T03:40:49.5476718Z log.warning( 2025-07-24T03:40:49.5477375Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-07-24T03:40:49.5478037Z ) 2025-07-24T03:40:49.5478429Z else: 2025-07-24T03:40:49.5478889Z valid_settings[setting] = exp_settings[setting] 2025-07-24T03:40:49.5479415Z 2025-07-24T03:40:49.5479670Z experiments[exp_name] = Experiment(**valid_settings) 2025-07-24T03:40:49.5480257Z return Settings(experiments) 2025-07-24T03:40:49.5480609Z 2025-07-24T03:40:49.5480766Z except Exception: 2025-07-24T03:40:49.5481202Z log.exception("Failed to parse settings") 2025-07-24T03:40:49.5481554Z 2025-07-24T03:40:49.5481706Z return Settings() 2025-07-24T03:40:49.5481940Z 2025-07-24T03:40:49.5481946Z 2025-07-24T03:40:49.5482169Z def parse_settings(rollout_state: str) -> Settings: 2025-07-24T03:40:49.5482696Z """ 2025-07-24T03:40:49.5483084Z Parse settings, if any, from the rollout state. 2025-07-24T03:40:49.5483447Z 2025-07-24T03:40:49.5483780Z If the issue body contains "---" then the text above that is the settings 2025-07-24T03:40:49.5484472Z and the text below is the list of opted in users. 2025-07-24T03:40:49.5484851Z 2025-07-24T03:40:49.5485224Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-07-24T03:40:49.5485894Z """ 2025-07-24T03:40:49.5486402Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:40:49.5487101Z return parse_settings_from_text(settings_text) 2025-07-24T03:40:49.5487476Z 2025-07-24T03:40:49.5487483Z 2025-07-24T03:40:49.5487703Z def parse_users(rollout_state: str) -> UserOptins: 2025-07-24T03:40:49.5488210Z """ 2025-07-24T03:40:49.5488553Z Parse users from the rollout state. 2025-07-24T03:40:49.5488877Z 2025-07-24T03:40:49.5489016Z """ 2025-07-24T03:40:49.5489617Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-07-24T03:40:49.5490293Z return parse_user_opt_in_from_text(users_text) 2025-07-24T03:40:49.5490651Z 2025-07-24T03:40:49.5490658Z 2025-07-24T03:40:49.5491164Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:40:49.5491848Z """ 2025-07-24T03:40:49.5492213Z Check if a user is opted into an experiment 2025-07-24T03:40:49.5492698Z """ 2025-07-24T03:40:49.5493102Z return experiment_name in user_optins.get(user, []) 2025-07-24T03:40:49.5493487Z 2025-07-24T03:40:49.5493493Z 2025-07-24T03:40:49.5493880Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-07-24T03:40:49.5494560Z """ 2025-07-24T03:40:49.5494965Z Check if a user explicitly opted out of an experiment 2025-07-24T03:40:49.5495484Z """ 2025-07-24T03:40:49.5495935Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-07-24T03:40:49.5496557Z experiment_optout = "-" + experiment_name 2025-07-24T03:40:49.5497137Z if experiment_optout not in user_optins.get(user, []): 2025-07-24T03:40:49.5497687Z return False 2025-07-24T03:40:49.5497921Z 2025-07-24T03:40:49.5498163Z if is_user_opted_in(user, user_optins, experiment_name): 2025-07-24T03:40:49.5498705Z log.warning( 2025-07-24T03:40:49.5499674Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-07-24T03:40:49.5500496Z ) 2025-07-24T03:40:49.5500824Z 2025-07-24T03:40:49.5500974Z return True 2025-07-24T03:40:49.5501181Z 2025-07-24T03:40:49.5501194Z 2025-07-24T03:40:49.5501351Z def get_runner_prefix( 2025-07-24T03:40:49.5501736Z rollout_state: str, 2025-07-24T03:40:49.5502149Z workflow_requestors: Iterable[str], 2025-07-24T03:40:49.5502623Z branch: str, 2025-07-24T03:40:49.5503062Z eligible_experiments: frozenset[str] = frozenset(), 2025-07-24T03:40:49.5503667Z opt_out_experiments: frozenset[str] = frozenset(), 2025-07-24T03:40:49.5504205Z is_canary: bool = False, 2025-07-24T03:40:49.5504616Z ) -> str: 2025-07-24T03:40:49.5504985Z settings = parse_settings(rollout_state) 2025-07-24T03:40:49.5505513Z user_optins = parse_users(rollout_state) 2025-07-24T03:40:49.5505850Z 2025-07-24T03:40:49.5506005Z fleet_prefix = "" 2025-07-24T03:40:49.5506379Z prefixes = [] 2025-07-24T03:40:49.5506941Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-07-24T03:40:49.5507807Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-07-24T03:40:49.5508470Z log.info( 2025-07-24T03:40:49.5509080Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-07-24T03:40:49.5509899Z ) 2025-07-24T03:40:49.5510231Z continue 2025-07-24T03:40:49.5510451Z 2025-07-24T03:40:49.5510617Z if opt_out_experiments: 2025-07-24T03:40:49.5511088Z if experiment_name in opt_out_experiments: 2025-07-24T03:40:49.5511669Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-07-24T03:40:49.5512227Z log.info( 2025-07-24T03:40:49.5513101Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-07-24T03:40:49.5514005Z ) 2025-07-24T03:40:49.5514350Z continue 2025-07-24T03:40:49.5514585Z 2025-07-24T03:40:49.5514754Z if eligible_experiments: 2025-07-24T03:40:49.5515250Z if experiment_name not in eligible_experiments: 2025-07-24T03:40:49.5515830Z exp_list = ", ".join(eligible_experiments) 2025-07-24T03:40:49.5516330Z log.info( 2025-07-24T03:40:49.5517039Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-07-24T03:40:49.5517820Z ) 2025-07-24T03:40:49.5518164Z continue 2025-07-24T03:40:49.5518592Z elif not experiment_settings.default: 2025-07-24T03:40:49.5519069Z log.info( 2025-07-24T03:40:49.5519934Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-07-24T03:40:49.5520617Z ) 2025-07-24T03:40:49.5520950Z continue 2025-07-24T03:40:49.5521167Z 2025-07-24T03:40:49.5521410Z # Is any workflow_requestor opted out to this experiment? 2025-07-24T03:40:49.5521965Z opted_out_users = [ 2025-07-24T03:40:49.5522367Z requestor 2025-07-24T03:40:49.5522764Z for requestor in workflow_requestors 2025-07-24T03:40:49.5523370Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-07-24T03:40:49.5523946Z ] 2025-07-24T03:40:49.5524158Z 2025-07-24T03:40:49.5524319Z if opted_out_users: 2025-07-24T03:40:49.5524713Z log.info( 2025-07-24T03:40:49.5525268Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-07-24T03:40:49.5525909Z ) 2025-07-24T03:40:49.5526239Z continue 2025-07-24T03:40:49.5526457Z 2025-07-24T03:40:49.5526707Z # Is any workflow_requestor opted in to this experiment? 2025-07-24T03:40:49.5527252Z opted_in_users = [ 2025-07-24T03:40:49.5527658Z requestor 2025-07-24T03:40:49.5528060Z for requestor in workflow_requestors 2025-07-24T03:40:49.5528658Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-07-24T03:40:49.5529444Z ] 2025-07-24T03:40:49.5529626Z 2025-07-24T03:40:49.5529775Z enabled = False 2025-07-24T03:40:49.5530163Z if opted_in_users: 2025-07-24T03:40:49.5530554Z log.info( 2025-07-24T03:40:49.5531097Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-07-24T03:40:49.5531723Z ) 2025-07-24T03:40:49.5532071Z enabled = True 2025-07-24T03:40:49.5532320Z 2025-07-24T03:40:49.5532512Z elif experiment_settings.rollout_perc: 2025-07-24T03:40:49.5533277Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-07-24T03:40:49.5534137Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-07-24T03:40:49.5534734Z log.info( 2025-07-24T03:40:49.5535532Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-07-24T03:40:49.5536388Z ) 2025-07-24T03:40:49.5536751Z enabled = True 2025-07-24T03:40:49.5537018Z 2025-07-24T03:40:49.5537164Z if enabled: 2025-07-24T03:40:49.5537539Z label = experiment_name 2025-07-24T03:40:49.5538026Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-07-24T03:40:49.5538780Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-07-24T03:40:49.5539864Z # - If it's enabled, then we always list it's prefix first 2025-07-24T03:40:49.5540564Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-07-24T03:40:49.5541173Z if is_canary: 2025-07-24T03:40:49.5541612Z label += CANARY_FLEET_SUFFIX 2025-07-24T03:40:49.5542109Z fleet_prefix = label 2025-07-24T03:40:49.5542542Z else: 2025-07-24T03:40:49.5542923Z prefixes.append(label) 2025-07-24T03:40:49.5543248Z 2025-07-24T03:40:49.5543413Z if len(prefixes) > 1: 2025-07-24T03:40:49.5543801Z log.error( 2025-07-24T03:40:49.5544766Z 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:40:49.5545793Z ) 2025-07-24T03:40:49.5546144Z prefixes = prefixes[:1] 2025-07-24T03:40:49.5546423Z 2025-07-24T03:40:49.5546589Z # Fleet always comes first 2025-07-24T03:40:49.5547014Z if fleet_prefix: 2025-07-24T03:40:49.5547410Z prefixes.insert(0, fleet_prefix) 2025-07-24T03:40:49.5547739Z 2025-07-24T03:40:49.5548103Z return ".".join(prefixes) + "." if prefixes else "" 2025-07-24T03:40:49.5548492Z 2025-07-24T03:40:49.5548499Z 2025-07-24T03:40:49.5548908Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-07-24T03:40:49.5549725Z """ 2025-07-24T03:40:49.5550264Z Gets the first comment of the issue, which contains the desired rollout state. 2025-07-24T03:40:49.5550792Z 2025-07-24T03:40:49.5551142Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-07-24T03:40:49.5551786Z """ 2025-07-24T03:40:49.5552128Z gh = get_gh_client(github_token) 2025-07-24T03:40:49.5552610Z issue = get_issue(gh, repo, issue_num) 2025-07-24T03:40:49.5553183Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-07-24T03:40:49.5553589Z 2025-07-24T03:40:49.5553596Z 2025-07-24T03:40:49.5553965Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-07-24T03:40:49.5554664Z for _ in range(num_retries): 2025-07-24T03:40:49.5555085Z try: 2025-07-24T03:40:49.5555471Z req = Request(url=url, headers=headers) 2025-07-24T03:40:49.5556073Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-07-24T03:40:49.5556644Z return json.loads(content) 2025-07-24T03:40:49.5557114Z except Exception as e: 2025-07-24T03:40:49.5557728Z log.warning(f"Could not download {url}: {e}") 2025-07-24T03:40:49.5558103Z 2025-07-24T03:40:49.5558447Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-07-24T03:40:49.5559188Z return {} 2025-07-24T03:40:49.5559398Z 2025-07-24T03:40:49.5559404Z 2025-07-24T03:40:49.5559547Z @cache 2025-07-24T03:40:49.5560115Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-07-24T03:40:49.5560801Z """ 2025-07-24T03:40:49.5561162Z Dynamically get PR information 2025-07-24T03:40:49.5561598Z """ 2025-07-24T03:40:49.5562048Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-07-24T03:40:49.5562610Z headers = { 2025-07-24T03:40:49.5563021Z "Accept": "application/vnd.github.v3+json", 2025-07-24T03:40:49.5563568Z "Authorization": f"token {github_token}", 2025-07-24T03:40:49.5564054Z } 2025-07-24T03:40:49.5564432Z json_response: dict[str, Any] = download_json( 2025-07-24T03:40:49.5564991Z url=f"{github_api}/issues/{pr_number}", 2025-07-24T03:40:49.5565490Z headers=headers, 2025-07-24T03:40:49.5565866Z ) 2025-07-24T03:40:49.5566040Z 2025-07-24T03:40:49.5566217Z if not json_response: 2025-07-24T03:40:49.5566723Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-07-24T03:40:49.5567278Z return {} 2025-07-24T03:40:49.5567486Z 2025-07-24T03:40:49.5567653Z return json_response 2025-07-24T03:40:49.5567905Z 2025-07-24T03:40:49.5567911Z 2025-07-24T03:40:49.5568283Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-07-24T03:40:49.5568950Z """ 2025-07-24T03:40:49.5569527Z Dynamically get the latest list of labels from the pull request 2025-07-24T03:40:49.5570130Z """ 2025-07-24T03:40:49.5570569Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-07-24T03:40:49.5571122Z return { 2025-07-24T03:40:49.5571638Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-07-24T03:40:49.5572290Z } 2025-07-24T03:40:49.5572469Z 2025-07-24T03:40:49.5572475Z 2025-07-24T03:40:49.5572634Z def main() -> None: 2025-07-24T03:40:49.5573010Z args = parse_args() 2025-07-24T03:40:49.5573249Z 2025-07-24T03:40:49.5573455Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-07-24T03:40:49.5573801Z 2025-07-24T03:40:49.5573971Z # Check if the PR is opt-out 2025-07-24T03:40:49.5574408Z if args.pr_number: 2025-07-24T03:40:49.5574993Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-07-24T03:40:49.5575868Z if OPT_OUT_LABEL in labels: 2025-07-24T03:40:49.5576309Z log.info( 2025-07-24T03:40:49.5576931Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-07-24T03:40:49.5577637Z ) 2025-07-24T03:40:49.5578120Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:40:49.5578731Z sys.exit() 2025-07-24T03:40:49.5578959Z 2025-07-24T03:40:49.5579291Z try: 2025-07-24T03:40:49.5579787Z rollout_state = get_rollout_state_from_issue( 2025-07-24T03:40:49.5580455Z args.github_token, args.github_issue_repo, args.github_issue 2025-07-24T03:40:49.5581039Z ) 2025-07-24T03:40:49.5581220Z 2025-07-24T03:40:49.5581410Z username = get_potential_pr_author( 2025-07-24T03:40:49.5581895Z args.github_token, 2025-07-24T03:40:49.5582325Z args.github_repo, 2025-07-24T03:40:49.5582744Z args.github_actor, 2025-07-24T03:40:49.5583180Z args.github_ref_type, 2025-07-24T03:40:49.5583621Z args.github_branch, 2025-07-24T03:40:49.5584029Z ) 2025-07-24T03:40:49.5584205Z 2025-07-24T03:40:49.5584462Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-07-24T03:40:49.5584880Z 2025-07-24T03:40:49.5585074Z runner_label_prefix = get_runner_prefix( 2025-07-24T03:40:49.5585718Z rollout_state, 2025-07-24T03:40:49.5586144Z (args.github_issue_owner, username), 2025-07-24T03:40:49.5586645Z args.github_branch, 2025-07-24T03:40:49.5587082Z args.eligible_experiments, 2025-07-24T03:40:49.5587571Z args.opt_out_experiments, 2025-07-24T03:40:49.5588018Z is_canary, 2025-07-24T03:40:49.5588380Z ) 2025-07-24T03:40:49.5588561Z 2025-07-24T03:40:49.5588727Z except Exception as e: 2025-07-24T03:40:49.5589259Z log.error( 2025-07-24T03:40:49.5589874Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-07-24T03:40:49.5590576Z ) 2025-07-24T03:40:49.5590757Z 2025-07-24T03:40:49.5591061Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-07-24T03:40:49.5591514Z 2025-07-24T03:40:49.5591521Z 2025-07-24T03:40:49.5591678Z if __name__ == "__main__": 2025-07-24T03:40:49.5592067Z main() 2025-07-24T03:40:49.5592255Z 2025-07-24T03:40:49.5684943Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-07-24T03:40:49.5685767Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-07-24T03:40:49.5713295Z shell: /usr/bin/bash -e {0} 2025-07-24T03:40:49.5713714Z env: 2025-07-24T03:40:49.5714268Z GITHUB_TOKEN: *** 2025-07-24T03:40:49.5714644Z ISSUE_NUMBER: 5132 2025-07-24T03:40:49.5715036Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:40:49.5715491Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:40:49.5715912Z CHECK_EXPERIMENTS: 2025-07-24T03:40:49.5716305Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:40:49.5716685Z PR_NUMBER: 149961 2025-07-24T03:40:49.5717047Z ##[endgroup] 2025-07-24T03:40:49.9216868Z Defaulting to user installation because normal site-packages is not writeable 2025-07-24T03:40:50.2819632Z Collecting urllib3==1.26.18 2025-07-24T03:40:50.3199024Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-07-24T03:40:50.3418236Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 3.6 MB/s eta 0:00:00 2025-07-24T03:40:50.3674729Z Collecting PyGithub==2.3.0 2025-07-24T03:40:50.3708895Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-07-24T03:40:50.4126186Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-07-24T03:40:50.4161707Z 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:40:50.4209547Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-07-24T03:40:50.4227630Z 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:40:50.4242680Z 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:40:50.4513884Z Collecting Deprecated (from PyGithub==2.3.0) 2025-07-24T03:40:50.4572711Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB) 2025-07-24T03:40:50.4803426Z 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:40:50.5884677Z Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-07-24T03:40:50.5922189Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) 2025-07-24T03:40:50.7074635Z Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-07-24T03:40:50.7122344Z 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:40:50.7307734Z Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub==2.3.0) 2025-07-24T03:40:50.7343111Z Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes) 2025-07-24T03:40:50.7573663Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-07-24T03:40:50.7684045Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 14.8 MB/s eta 0:00:00 2025-07-24T03:40:50.7721573Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-07-24T03:40:50.7855214Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 30.5 MB/s eta 0:00:00 2025-07-24T03:40:50.7931115Z 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:40:50.8173324Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 38.1 MB/s eta 0:00:00 2025-07-24T03:40:50.8208954Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB) 2025-07-24T03:40:50.8264526Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) 2025-07-24T03:40:50.8375944Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 50.3 MB/s eta 0:00:00 2025-07-24T03:40:50.8414547Z 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:40:50.8453873Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 34.3 MB/s eta 0:00:00 2025-07-24T03:40:50.8487341Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2025-07-24T03:40:50.8529561Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 43.1 MB/s eta 0:00:00 2025-07-24T03:40:51.1408916Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-07-24T03:40:51.6790650Z 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:40:51.7581127Z ##[group]Run curr_branch="gh/benjaminglass1/79/head" 2025-07-24T03:40:51.7581589Z curr_branch="gh/benjaminglass1/79/head" 2025-07-24T03:40:51.7581923Z curr_ref_type="branch" 2025-07-24T03:40:51.7582214Z echo "Current branch is '$curr_branch'" 2025-07-24T03:40:51.7582506Z  2025-07-24T03:40:51.7582742Z python3 runner_determinator.py \ 2025-07-24T03:40:51.7583061Z  --github-token "$GITHUB_TOKEN" \ 2025-07-24T03:40:51.7583400Z  --github-issue "$ISSUE_NUMBER" \ 2025-07-24T03:40:51.7583700Z  --github-branch "$curr_branch" \ 2025-07-24T03:40:51.7584008Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-07-24T03:40:51.7584327Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-07-24T03:40:51.7584649Z  --github-ref-type "$curr_ref_type" \ 2025-07-24T03:40:51.7584961Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-07-24T03:40:51.7585339Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-07-24T03:40:51.7585733Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-07-24T03:40:51.7586069Z  --pr-number "${PR_NUMBER}" 2025-07-24T03:40:51.7615166Z shell: /usr/bin/bash -e {0} 2025-07-24T03:40:51.7615443Z env: 2025-07-24T03:40:51.7616103Z GITHUB_TOKEN: *** 2025-07-24T03:40:51.7616340Z ISSUE_NUMBER: 5132 2025-07-24T03:40:51.7616587Z TRIGGERING_ACTOR: benjaminglass1 2025-07-24T03:40:51.7616864Z ISSUE_OWNER: benjaminglass1 2025-07-24T03:40:51.7617146Z CHECK_EXPERIMENTS: 2025-07-24T03:40:51.7617373Z OPT_OUT_EXPERIMENTS: 2025-07-24T03:40:51.7617621Z PR_NUMBER: 149961 2025-07-24T03:40:51.7617842Z ##[endgroup] 2025-07-24T03:40:51.7665309Z Current branch is 'gh/benjaminglass1/79/head' 2025-07-24T03:40:54.1340517Z INFO : Setting output: label-type='' 2025-07-24T03:40:54.1662105Z Evaluate and set job outputs 2025-07-24T03:40:54.1669284Z Cleaning up orphan processes