2024-12-17T23:33:53.9438479Z Current runner version: '2.321.0' 2024-12-17T23:33:53.9464402Z ##[group]Operating System 2024-12-17T23:33:53.9465348Z Ubuntu 2024-12-17T23:33:53.9465791Z 22.04.5 2024-12-17T23:33:53.9466405Z LTS 2024-12-17T23:33:53.9466880Z ##[endgroup] 2024-12-17T23:33:53.9467358Z ##[group]Runner Image 2024-12-17T23:33:53.9468053Z Image: ubuntu-22.04 2024-12-17T23:33:53.9468563Z Version: 20241211.1.0 2024-12-17T23:33:53.9469526Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241211.1/images/ubuntu/Ubuntu2204-Readme.md 2024-12-17T23:33:53.9470996Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241211.1 2024-12-17T23:33:53.9471892Z ##[endgroup] 2024-12-17T23:33:53.9472355Z ##[group]Runner Image Provisioner 2024-12-17T23:33:53.9473031Z 2.0.404.1 2024-12-17T23:33:53.9473495Z ##[endgroup] 2024-12-17T23:33:53.9474547Z ##[group]GITHUB_TOKEN Permissions 2024-12-17T23:33:53.9476525Z Contents: read 2024-12-17T23:33:53.9477051Z Metadata: read 2024-12-17T23:33:53.9477882Z ##[endgroup] 2024-12-17T23:33:53.9481258Z Secret source: Actions 2024-12-17T23:33:53.9482302Z Prepare workflow directory 2024-12-17T23:33:53.9974012Z Prepare all required actions 2024-12-17T23:33:54.0028950Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/release/2.6 (0cdf8b1d09254cfda66191d1bd01e3041c3c76f7) 2024-12-17T23:33:54.0034342Z ##[group] Inputs 2024-12-17T23:33:54.0034988Z check_experiments: 2024-12-17T23:33:54.0035770Z triggering_actor: malfet 2024-12-17T23:33:54.0036299Z issue_owner: 2024-12-17T23:33:54.0036803Z curr_branch: release/2.6 2024-12-17T23:33:54.0037480Z curr_ref_type: branch 2024-12-17T23:33:54.0037988Z issue_number: 5132 2024-12-17T23:33:54.0038505Z ##[endgroup] 2024-12-17T23:33:54.0039287Z Complete job name: before-test / get-label-type / runner-determinator 2024-12-17T23:33:54.7049387Z ##[group]Run cat < runner_determinator.py 2024-12-17T23:33:54.7052311Z cat < runner_determinator.py 2024-12-17T23:33:54.7053099Z # flake8: noqa: G004 2024-12-17T23:33:54.7053710Z  2024-12-17T23:33:54.7054534Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-12-17T23:33:54.7055715Z # must be kept in sync. You can do it easily by running the following command: 2024-12-17T23:33:54.7056686Z # python .github/scripts/update_runner_determinator.py 2024-12-17T23:33:54.7057441Z  2024-12-17T23:33:54.7057967Z """ 2024-12-17T23:33:54.7058727Z This runner determinator is used to determine which set of runners to run a 2024-12-17T23:33:54.7059806Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-12-17T23:33:54.7061094Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-12-17T23:33:54.7062097Z of which runners should be used to run which job. 2024-12-17T23:33:54.7062796Z  2024-12-17T23:33:54.7063642Z The configuration has two parts, the settings and a list of opted-in users, 2024-12-17T23:33:54.7064737Z separated by a line containing "---". If the line is not present, the 2024-12-17T23:33:54.7065759Z settings are considered to be empty with only the second part, the user 2024-12-17T23:33:54.7066691Z list, defined. 2024-12-17T23:33:54.7067241Z  2024-12-17T23:33:54.7067941Z The first part is a YAML block that defines the rollout settings. This can be 2024-12-17T23:33:54.7069141Z used to define any settings that are needed to determine which runners to use. 2024-12-17T23:33:54.7070167Z It's fields are defined by the RolloutSettings class below. 2024-12-17T23:33:54.7070894Z  2024-12-17T23:33:54.7071715Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-12-17T23:33:54.7072788Z The user list is also a comma separated list of additional features or 2024-12-17T23:33:54.7074053Z experiments which the user could be opted in to. 2024-12-17T23:33:54.7074761Z  2024-12-17T23:33:54.7075315Z The user list has the following rules: 2024-12-17T23:33:54.7076024Z  2024-12-17T23:33:54.7076709Z - Users are GitHub usernames, which must start with the @ prefix 2024-12-17T23:33:54.7077774Z - Each user is also a comma-separated list of features/experiments to enable 2024-12-17T23:33:54.7078781Z - A "#" prefix opts the user out of all experiments 2024-12-17T23:33:54.7079463Z  2024-12-17T23:33:54.7080072Z Example config: 2024-12-17T23:33:54.7081182Z  # A list of experiments that can be opted into. 2024-12-17T23:33:54.7082111Z  # This defines the behavior they'll induce when opted into. 2024-12-17T23:33:54.7082872Z  # Expected syntax is: 2024-12-17T23:33:54.7083791Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-12-17T23:33:54.7085003Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-12-17T23:33:54.7085908Z  2024-12-17T23:33:54.7086467Z  experiments: 2024-12-17T23:33:54.7087058Z  lf: 2024-12-17T23:33:54.7087587Z  rollout_percent: 25 2024-12-17T23:33:54.7088293Z  all_branches: false 2024-12-17T23:33:54.7088947Z  default: true 2024-12-17T23:33:54.7089535Z  --- 2024-12-17T23:33:54.7090428Z  2024-12-17T23:33:54.7090956Z  # Opt-ins: 2024-12-17T23:33:54.7091725Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2024-12-17T23:33:54.7093082Z  # and specifying experiments to enable in a comma-separated list. 2024-12-17T23:33:54.7094151Z  # To always opt out of an experiment, prefix it with a "-". 2024-12-17T23:33:54.7094992Z  # Experiments should be from the above list. 2024-12-17T23:33:54.7095708Z  2024-12-17T23:33:54.7096265Z  @User1,-lf,split_build 2024-12-17T23:33:54.7096887Z  @User2,lf 2024-12-17T23:33:54.7097468Z  @User3,split_build 2024-12-17T23:33:54.7098112Z """ 2024-12-17T23:33:54.7098613Z  2024-12-17T23:33:54.7099111Z import json 2024-12-17T23:33:54.7099694Z import logging 2024-12-17T23:33:54.7100263Z import os 2024-12-17T23:33:54.7100820Z import random 2024-12-17T23:33:54.7101405Z import re 2024-12-17T23:33:54.7101933Z import sys 2024-12-17T23:33:54.7102561Z from argparse import ArgumentParser 2024-12-17T23:33:54.7103281Z from functools import lru_cache 2024-12-17T23:33:54.7103964Z from logging import LogRecord 2024-12-17T23:33:54.7104888Z from typing import Any, Dict, FrozenSet, Iterable, List, NamedTuple, Set, Tuple 2024-12-17T23:33:54.7105899Z from urllib.request import Request, urlopen 2024-12-17T23:33:54.7106582Z  2024-12-17T23:33:54.7107099Z import yaml 2024-12-17T23:33:54.7107694Z from github import Auth, Github 2024-12-17T23:33:54.7108386Z from github.Issue import Issue 2024-12-17T23:33:54.7109025Z  2024-12-17T23:33:54.7109517Z  2024-12-17T23:33:54.7110112Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-12-17T23:33:54.7111065Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-12-17T23:33:54.7112106Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-12-17T23:33:54.7112998Z  2024-12-17T23:33:54.7113654Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-12-17T23:33:54.7114382Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-12-17T23:33:54.7115102Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-12-17T23:33:54.7115914Z OPT_OUT_LABEL = "no-runner-experiments" 2024-12-17T23:33:54.7116774Z  2024-12-17T23:33:54.7117366Z SETTING_EXPERIMENTS = "experiments" 2024-12-17T23:33:54.7118082Z  2024-12-17T23:33:54.7118573Z LF_FLEET_EXPERIMENT = "lf" 2024-12-17T23:33:54.7119216Z CANARY_FLEET_SUFFIX = ".c" 2024-12-17T23:33:54.7119883Z  2024-12-17T23:33:54.7120340Z  2024-12-17T23:33:54.7120857Z class Experiment(NamedTuple): 2024-12-17T23:33:54.7121624Z  rollout_perc: float = ( 2024-12-17T23:33:54.7122458Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2024-12-17T23:33:54.7123299Z  ) 2024-12-17T23:33:54.7123920Z  all_branches: bool = ( 2024-12-17T23:33:54.7124732Z  False # If True, the experiment is also enabled on the exception branches 2024-12-17T23:33:54.7125569Z  ) 2024-12-17T23:33:54.7126215Z  default: bool = ( 2024-12-17T23:33:54.7127010Z  True # If True, the experiment is enabled by default for all queries 2024-12-17T23:33:54.7127783Z  ) 2024-12-17T23:33:54.7128371Z  2024-12-17T23:33:54.7128885Z  # Add more fields as needed 2024-12-17T23:33:54.7129468Z  2024-12-17T23:33:54.7130372Z  2024-12-17T23:33:54.7130917Z class Settings(NamedTuple): 2024-12-17T23:33:54.7131515Z  """ 2024-12-17T23:33:54.7132263Z  Settings for the experiments that can be opted into. 2024-12-17T23:33:54.7133000Z  """ 2024-12-17T23:33:54.7133466Z  2024-12-17T23:33:54.7134095Z  experiments: Dict[str, Experiment] = {} 2024-12-17T23:33:54.7134765Z  2024-12-17T23:33:54.7135216Z  2024-12-17T23:33:54.7136031Z class ColorFormatter(logging.Formatter): 2024-12-17T23:33:54.7136888Z  """Color codes the log messages based on the log level""" 2024-12-17T23:33:54.7137638Z  2024-12-17T23:33:54.7138199Z  COLORS = { 2024-12-17T23:33:54.7138803Z  "WARNING": "\033[33m", # Yellow 2024-12-17T23:33:54.7139451Z  "ERROR": "\033[31m", # Red 2024-12-17T23:33:54.7140172Z  "CRITICAL": "\033[31m", # Red 2024-12-17T23:33:54.7140867Z  "INFO": "\033[0m", # Reset 2024-12-17T23:33:54.7141515Z  "DEBUG": "\033[0m", # Reset 2024-12-17T23:33:54.7142195Z  } 2024-12-17T23:33:54.7142711Z  2024-12-17T23:33:54.7143253Z  def format(self, record: LogRecord) -> str: 2024-12-17T23:33:54.7144256Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-12-17T23:33:54.7145239Z  record.msg = f"{log_color}{record.msg}\033[0m" 2024-12-17T23:33:54.7145997Z  return super().format(record) 2024-12-17T23:33:54.7146691Z  2024-12-17T23:33:54.7147186Z  2024-12-17T23:33:54.7147720Z handler = logging.StreamHandler() 2024-12-17T23:33:54.7148765Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-12-17T23:33:54.7149626Z  2024-12-17T23:33:54.7150256Z log = logging.getLogger(os.path.basename(__file__)) 2024-12-17T23:33:54.7151122Z log.addHandler(handler) 2024-12-17T23:33:54.7151723Z log.setLevel(logging.INFO) 2024-12-17T23:33:54.7152311Z  2024-12-17T23:33:54.7152886Z  2024-12-17T23:33:54.7153459Z def set_github_output(key: str, value: str) -> None: 2024-12-17T23:33:54.7154194Z  """ 2024-12-17T23:33:54.7154987Z  Defines outputs of the github action that invokes this script 2024-12-17T23:33:54.7155743Z  """ 2024-12-17T23:33:54.7156259Z  if not GITHUB_OUTPUT: 2024-12-17T23:33:54.7157654Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-12-17T23:33:54.7159094Z  log.warning( 2024-12-17T23:33:54.7160156Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2024-12-17T23:33:54.7161326Z  ) 2024-12-17T23:33:54.7161927Z  print(f"::set-output name={key}::{value}") 2024-12-17T23:33:54.7162598Z  return 2024-12-17T23:33:54.7163222Z  2024-12-17T23:33:54.7163790Z  with open(GITHUB_OUTPUT, "a") as f: 2024-12-17T23:33:54.7164492Z  log.info(f"Setting output: {key}='{value}'") 2024-12-17T23:33:54.7165320Z  f.write(f"{key}={value}\n") 2024-12-17T23:33:54.7166000Z  2024-12-17T23:33:54.7166441Z  2024-12-17T23:33:54.7167206Z def _str_comma_separated_to_set(value: str) -> FrozenSet[str]: 2024-12-17T23:33:54.7168056Z  return frozenset( 2024-12-17T23:33:54.7168821Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2024-12-17T23:33:54.7169910Z  ) 2024-12-17T23:33:54.7170455Z  2024-12-17T23:33:54.7170893Z  2024-12-17T23:33:54.7171686Z def parse_args() -> Any: 2024-12-17T23:33:54.7172502Z  parser = ArgumentParser("Get dynamic rollout settings") 2024-12-17T23:33:54.7173523Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-12-17T23:33:54.7174614Z  parser.add_argument( 2024-12-17T23:33:54.7175277Z  "--github-issue-repo", 2024-12-17T23:33:54.7175972Z  type=str, 2024-12-17T23:33:54.7176556Z  required=False, 2024-12-17T23:33:54.7177381Z  default="pytorch/test-infra", 2024-12-17T23:33:54.7178284Z  help="GitHub repo to get the issue", 2024-12-17T23:33:54.7178960Z  ) 2024-12-17T23:33:54.7179505Z  parser.add_argument( 2024-12-17T23:33:54.7180182Z  "--github-repo", 2024-12-17T23:33:54.7180795Z  type=str, 2024-12-17T23:33:54.7181388Z  required=True, 2024-12-17T23:33:54.7182123Z  help="GitHub repo where CI is running", 2024-12-17T23:33:54.7182783Z  ) 2024-12-17T23:33:54.7183318Z  parser.add_argument( 2024-12-17T23:33:54.7184196Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2024-12-17T23:33:54.7185018Z  ) 2024-12-17T23:33:54.7185549Z  parser.add_argument( 2024-12-17T23:33:54.7186453Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-12-17T23:33:54.7187278Z  ) 2024-12-17T23:33:54.7187815Z  parser.add_argument( 2024-12-17T23:33:54.7188723Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-12-17T23:33:54.7189616Z  ) 2024-12-17T23:33:54.7190105Z  parser.add_argument( 2024-12-17T23:33:54.7191040Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-12-17T23:33:54.7191926Z  ) 2024-12-17T23:33:54.7192438Z  parser.add_argument( 2024-12-17T23:33:54.7193119Z  "--github-ref-type", 2024-12-17T23:33:54.7193763Z  type=str, 2024-12-17T23:33:54.7194328Z  required=True, 2024-12-17T23:33:54.7195064Z  help="Current GitHub ref type, branch or tag", 2024-12-17T23:33:54.7195790Z  ) 2024-12-17T23:33:54.7196303Z  parser.add_argument( 2024-12-17T23:33:54.7196994Z  "--eligible-experiments", 2024-12-17T23:33:54.7197770Z  type=_str_comma_separated_to_set, 2024-12-17T23:33:54.7198441Z  required=False, 2024-12-17T23:33:54.7199094Z  default="", 2024-12-17T23:33:54.7200369Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2024-12-17T23:33:54.7201435Z  ) 2024-12-17T23:33:54.7202020Z  parser.add_argument( 2024-12-17T23:33:54.7202673Z  "--pr-number", 2024-12-17T23:33:54.7203242Z  type=str, 2024-12-17T23:33:54.7203882Z  required=False, 2024-12-17T23:33:54.7204519Z  default="", 2024-12-17T23:33:54.7205198Z  help="the optional PR number where this is run", 2024-12-17T23:33:54.7205939Z  ) 2024-12-17T23:33:54.7206491Z  2024-12-17T23:33:54.7207010Z  return parser.parse_args() 2024-12-17T23:33:54.7207691Z  2024-12-17T23:33:54.7208220Z  2024-12-17T23:33:54.7208819Z def get_gh_client(github_token: str) -> Github: 2024-12-17T23:33:54.7209622Z  auth = Auth.Token(github_token) 2024-12-17T23:33:54.7210673Z  return Github(auth=auth) 2024-12-17T23:33:54.7211300Z  2024-12-17T23:33:54.7211838Z  2024-12-17T23:33:54.7212531Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-12-17T23:33:54.7213380Z  repo = gh.get_repo(repo) 2024-12-17T23:33:54.7214119Z  return repo.get_issue(number=issue_num) 2024-12-17T23:33:54.7214813Z  2024-12-17T23:33:54.7215314Z  2024-12-17T23:33:54.7215861Z def get_potential_pr_author( 2024-12-17T23:33:54.7216730Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-12-17T23:33:54.7217607Z ) -> str: 2024-12-17T23:33:54.7218511Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2024-12-17T23:33:54.7219704Z  # Fetch the actual username from the original PR. The PR number is 2024-12-17T23:33:54.7220634Z  # embedded in the tag name: ciflow// 2024-12-17T23:33:54.7221460Z  2024-12-17T23:33:54.7222022Z  gh = get_gh_client(github_token) 2024-12-17T23:33:54.7222654Z  2024-12-17T23:33:54.7223358Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-12-17T23:33:54.7224183Z  split_tag = ref_name.split("/") 2024-12-17T23:33:54.7224812Z  if ( 2024-12-17T23:33:54.7225438Z  len(split_tag) == 3 2024-12-17T23:33:54.7226125Z  and split_tag[0] == "ciflow" 2024-12-17T23:33:54.7226816Z  and split_tag[2].isnumeric() 2024-12-17T23:33:54.7227540Z  ): 2024-12-17T23:33:54.7228128Z  pr_number = split_tag[2] 2024-12-17T23:33:54.7228776Z  try: 2024-12-17T23:33:54.7229470Z  repository = gh.get_repo(repo) 2024-12-17T23:33:54.7230275Z  pull = repository.get_pull(number=int(pr_number)) 2024-12-17T23:33:54.7231067Z  except Exception as e: 2024-12-17T23:33:54.7231843Z  raise Exception( # noqa: TRY002 2024-12-17T23:33:54.7232702Z  f"issue with pull request {pr_number} from repo {repository}" 2024-12-17T23:33:54.7233500Z  ) from e 2024-12-17T23:33:54.7234205Z  return pull.user.login 2024-12-17T23:33:54.7234986Z  # In all other cases, return the original input username 2024-12-17T23:33:54.7235733Z  return username 2024-12-17T23:33:54.7236407Z  2024-12-17T23:33:54.7236861Z  2024-12-17T23:33:54.7237430Z def is_exception_branch(branch: str) -> bool: 2024-12-17T23:33:54.7238234Z  """ 2024-12-17T23:33:54.7239054Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-12-17T23:33:54.7240013Z  """ 2024-12-17T23:33:54.7240823Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-12-17T23:33:54.7241792Z  2024-12-17T23:33:54.7242271Z  2024-12-17T23:33:54.7242902Z def load_yaml(yaml_text: str) -> Any: 2024-12-17T23:33:54.7243524Z  try: 2024-12-17T23:33:54.7244081Z  data = yaml.safe_load(yaml_text) 2024-12-17T23:33:54.7244834Z  return data 2024-12-17T23:33:54.7245413Z  except yaml.YAMLError: 2024-12-17T23:33:54.7246078Z  log.exception("Error loading YAML") 2024-12-17T23:33:54.7246830Z  raise 2024-12-17T23:33:54.7247362Z  2024-12-17T23:33:54.7247835Z  2024-12-17T23:33:54.7248706Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-12-17T23:33:54.7249609Z  """ 2024-12-17T23:33:54.7250709Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-12-17T23:33:54.7251745Z  2024-12-17T23:33:54.7252442Z  If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:54.7253405Z  and the text below is the list of opted in users. 2024-12-17T23:33:54.7254222Z  2024-12-17T23:33:54.7254956Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-12-17T23:33:54.7255771Z  """ 2024-12-17T23:33:54.7256493Z  rollout_state_parts = rollout_state.split("---") 2024-12-17T23:33:54.7257276Z  if len(rollout_state_parts) >= 2: 2024-12-17T23:33:54.7258008Z  return rollout_state_parts[0], rollout_state_parts[1] 2024-12-17T23:33:54.7258859Z  else: 2024-12-17T23:33:54.7259589Z  return "", rollout_state 2024-12-17T23:33:54.7260198Z  2024-12-17T23:33:54.7260788Z  2024-12-17T23:33:54.7261337Z class UserOptins(Dict[str, List[str]]): 2024-12-17T23:33:54.7261971Z  """ 2024-12-17T23:33:54.7262792Z  Dictionary of users with a list of features they have opted into 2024-12-17T23:33:54.7263589Z  """ 2024-12-17T23:33:54.7264058Z  2024-12-17T23:33:54.7264628Z  2024-12-17T23:33:54.7265321Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-12-17T23:33:54.7266102Z  """ 2024-12-17T23:33:54.7267079Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2024-12-17T23:33:54.7268071Z  2024-12-17T23:33:54.7269105Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-12-17T23:33:54.7270262Z  - Example line: "@User1,lf,split_build" 2024-12-17T23:33:54.7271141Z  - A "#" prefix indicates the user is opted out of all experiments 2024-12-17T23:33:54.7272008Z  2024-12-17T23:33:54.7272467Z  2024-12-17T23:33:54.7272964Z  """ 2024-12-17T23:33:54.7273539Z  optins = UserOptins() 2024-12-17T23:33:54.7274213Z  for user in user_optin_text.split("\n"): 2024-12-17T23:33:54.7274952Z  user = user.strip("\r\n\t -") 2024-12-17T23:33:54.7275719Z  if not user or not user.startswith("@"): 2024-12-17T23:33:54.7276418Z  # Not a valid user. Skip 2024-12-17T23:33:54.7277092Z  continue 2024-12-17T23:33:54.7277702Z  2024-12-17T23:33:54.7278170Z  if user: 2024-12-17T23:33:54.7278808Z  usr_name = user.split(",")[0].strip("@") 2024-12-17T23:33:54.7279806Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-12-17T23:33:54.7280679Z  2024-12-17T23:33:54.7281130Z  return optins 2024-12-17T23:33:54.7281734Z  2024-12-17T23:33:54.7282428Z  2024-12-17T23:33:54.7283042Z def is_valid_experiment_name(experiment_name: str) -> bool: 2024-12-17T23:33:54.7283873Z  """ 2024-12-17T23:33:54.7284481Z  Check if the experiment name is valid. 2024-12-17T23:33:54.7285122Z  A valid name: 2024-12-17T23:33:54.7286013Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2024-12-17T23:33:54.7287177Z  - The special characters "_" & "-" shouldn't be the first or last characters 2024-12-17T23:33:54.7288033Z  - Cannot contain spaces 2024-12-17T23:33:54.7288737Z  """ 2024-12-17T23:33:54.7289256Z  2024-12-17T23:33:54.7290106Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2024-12-17T23:33:54.7291195Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2024-12-17T23:33:54.7291993Z  2024-12-17T23:33:54.7292443Z  if valid: 2024-12-17T23:33:54.7293062Z  return True 2024-12-17T23:33:54.7293642Z  2024-12-17T23:33:54.7294090Z  log.error( 2024-12-17T23:33:54.7295846Z  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." 2024-12-17T23:33:54.7297640Z  ) 2024-12-17T23:33:54.7298173Z  return False 2024-12-17T23:33:54.7298738Z  2024-12-17T23:33:54.7299237Z  2024-12-17T23:33:54.7299941Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-12-17T23:33:54.7300746Z  """ 2024-12-17T23:33:54.7301712Z  Parse the experiments from the issue body into a list of ExperimentSettings 2024-12-17T23:33:54.7302636Z  """ 2024-12-17T23:33:54.7303167Z  try: 2024-12-17T23:33:54.7303722Z  if settings_text: 2024-12-17T23:33:54.7304661Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-12-17T23:33:54.7305684Z  # for easy reading 2024-12-17T23:33:54.7306668Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-12-17T23:33:54.7307741Z  # the backtick character in shell commands. 2024-12-17T23:33:54.7308590Z  backtick = chr(96) # backtick character 2024-12-17T23:33:54.7309425Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-12-17T23:33:54.7310282Z  settings = load_yaml(settings_text) 2024-12-17T23:33:54.7311027Z  2024-12-17T23:33:54.7311819Z  # For now we just load experiments. We can expand this if/when we add more settings 2024-12-17T23:33:54.7312707Z  experiments = {} 2024-12-17T23:33:54.7313408Z  2024-12-17T23:33:54.7314142Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-12-17T23:33:54.7315056Z  if not is_valid_experiment_name(exp_name): 2024-12-17T23:33:54.7316443Z  # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2024-12-17T23:33:54.7317675Z  continue 2024-12-17T23:33:54.7318284Z  2024-12-17T23:33:54.7318888Z  valid_settings = {} 2024-12-17T23:33:54.7319595Z  for setting in exp_settings: 2024-12-17T23:33:54.7320323Z  if setting not in Experiment._fields: 2024-12-17T23:33:54.7321116Z  log.warning( 2024-12-17T23:33:54.7322014Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-12-17T23:33:54.7323211Z  ) 2024-12-17T23:33:54.7323870Z  else: 2024-12-17T23:33:54.7324586Z  valid_settings[setting] = exp_settings[setting] 2024-12-17T23:33:54.7325327Z  2024-12-17T23:33:54.7325992Z  experiments[exp_name] = Experiment(**valid_settings) 2024-12-17T23:33:54.7326798Z  return Settings(experiments) 2024-12-17T23:33:54.7327442Z  2024-12-17T23:33:54.7327983Z  except Exception: 2024-12-17T23:33:54.7328679Z  log.exception("Failed to parse settings") 2024-12-17T23:33:54.7329372Z  2024-12-17T23:33:54.7330651Z  return Settings() 2024-12-17T23:33:54.7331257Z  2024-12-17T23:33:54.7331721Z  2024-12-17T23:33:54.7332436Z def parse_settings(rollout_state: str) -> Settings: 2024-12-17T23:33:54.7333158Z  """ 2024-12-17T23:33:54.7333758Z  Parse settings, if any, from the rollout state. 2024-12-17T23:33:54.7334551Z  2024-12-17T23:33:54.7335264Z  If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:54.7336204Z  and the text below is the list of opted in users. 2024-12-17T23:33:54.7337014Z  2024-12-17T23:33:54.7337807Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2024-12-17T23:33:54.7338686Z  """ 2024-12-17T23:33:54.7339527Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:54.7340454Z  return parse_settings_from_text(settings_text) 2024-12-17T23:33:54.7341144Z  2024-12-17T23:33:54.7341884Z  2024-12-17T23:33:54.7342478Z def parse_users(rollout_state: str) -> UserOptins: 2024-12-17T23:33:54.7343193Z  """ 2024-12-17T23:33:54.7343879Z  Parse users from the rollout state. 2024-12-17T23:33:54.7344719Z  2024-12-17T23:33:54.7345203Z  """ 2024-12-17T23:33:54.7346082Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:54.7347023Z  return parse_user_opt_in_from_text(users_text) 2024-12-17T23:33:54.7347753Z  2024-12-17T23:33:54.7348530Z  2024-12-17T23:33:54.7349327Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:54.7350322Z  """ 2024-12-17T23:33:54.7351009Z  Check if a user is opted into an experiment 2024-12-17T23:33:54.7351703Z  """ 2024-12-17T23:33:54.7352313Z  return experiment_name in user_optins.get(user, []) 2024-12-17T23:33:54.7353137Z  2024-12-17T23:33:54.7353607Z  2024-12-17T23:33:54.7354351Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:54.7355393Z  """ 2024-12-17T23:33:54.7356055Z  Check if a user explicitly opted out of an experiment 2024-12-17T23:33:54.7356740Z  """ 2024-12-17T23:33:54.7357499Z  # if the experiment is prefixed with a "-", then it's an opt-out 2024-12-17T23:33:54.7358386Z  experiment_optout = "-" + experiment_name 2024-12-17T23:33:54.7359255Z  if experiment_optout not in user_optins.get(user, []): 2024-12-17T23:33:54.7360000Z  return False 2024-12-17T23:33:54.7360583Z  2024-12-17T23:33:54.7361240Z  if is_user_opted_in(user, user_optins, experiment_name): 2024-12-17T23:33:54.7361977Z  log.warning( 2024-12-17T23:33:54.7362989Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2024-12-17T23:33:54.7364167Z  ) 2024-12-17T23:33:54.7364666Z  2024-12-17T23:33:54.7365379Z  return True 2024-12-17T23:33:54.7366003Z  2024-12-17T23:33:54.7366481Z  2024-12-17T23:33:54.7366979Z def get_runner_prefix( 2024-12-17T23:33:54.7367649Z  rollout_state: str, 2024-12-17T23:33:54.7368292Z  workflow_requestors: Iterable[str], 2024-12-17T23:33:54.7368958Z  branch: str, 2024-12-17T23:33:54.7369875Z  eligible_experiments: FrozenSet[str] = frozenset(), 2024-12-17T23:33:54.7370791Z  is_canary: bool = False, 2024-12-17T23:33:54.7371417Z ) -> str: 2024-12-17T23:33:54.7372100Z  settings = parse_settings(rollout_state) 2024-12-17T23:33:54.7372856Z  user_optins = parse_users(rollout_state) 2024-12-17T23:33:54.7373542Z  2024-12-17T23:33:54.7374115Z  fleet_prefix = "" 2024-12-17T23:33:54.7374695Z  prefixes = [] 2024-12-17T23:33:54.7375521Z  for experiment_name, experiment_settings in settings.experiments.items(): 2024-12-17T23:33:54.7376715Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2024-12-17T23:33:54.7377976Z  log.info( 2024-12-17T23:33:54.7378832Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-12-17T23:33:54.7379823Z  ) 2024-12-17T23:33:54.7380390Z  continue 2024-12-17T23:33:54.7380922Z  2024-12-17T23:33:54.7381524Z  if eligible_experiments: 2024-12-17T23:33:54.7382285Z  if experiment_name not in eligible_experiments: 2024-12-17T23:33:54.7383052Z  exp_list = ", ".join(eligible_experiments) 2024-12-17T23:33:54.7383993Z  log.info( 2024-12-17T23:33:54.7385011Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2024-12-17T23:33:54.7386029Z  ) 2024-12-17T23:33:54.7386613Z  continue 2024-12-17T23:33:54.7387287Z  elif not experiment_settings.default: 2024-12-17T23:33:54.7387992Z  log.info( 2024-12-17T23:33:54.7388845Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2024-12-17T23:33:54.7389759Z  ) 2024-12-17T23:33:54.7390313Z  continue 2024-12-17T23:33:54.7390887Z  2024-12-17T23:33:54.7391540Z  # Is any workflow_requestor opted out to this experiment? 2024-12-17T23:33:54.7392313Z  opted_out_users = [ 2024-12-17T23:33:54.7392950Z  requestor 2024-12-17T23:33:54.7393644Z  for requestor in workflow_requestors 2024-12-17T23:33:54.7394488Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2024-12-17T23:33:54.7395341Z  ] 2024-12-17T23:33:54.7395840Z  2024-12-17T23:33:54.7396340Z  if opted_out_users: 2024-12-17T23:33:54.7397030Z  log.info( 2024-12-17T23:33:54.7397817Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2024-12-17T23:33:54.7398671Z  ) 2024-12-17T23:33:54.7399288Z  continue 2024-12-17T23:33:54.7399820Z  2024-12-17T23:33:54.7400423Z  # Is any workflow_requestor opted in to this experiment? 2024-12-17T23:33:54.7401260Z  opted_in_users = [ 2024-12-17T23:33:54.7401840Z  requestor 2024-12-17T23:33:54.7402496Z  for requestor in workflow_requestors 2024-12-17T23:33:54.7403409Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2024-12-17T23:33:54.7404150Z  ] 2024-12-17T23:33:54.7404657Z  2024-12-17T23:33:54.7405402Z  enabled = False 2024-12-17T23:33:54.7405986Z  if opted_in_users: 2024-12-17T23:33:54.7406613Z  log.info( 2024-12-17T23:33:54.7407470Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-12-17T23:33:54.7408265Z  ) 2024-12-17T23:33:54.7408825Z  enabled = True 2024-12-17T23:33:54.7409488Z  2024-12-17T23:33:54.7410477Z  elif experiment_settings.rollout_perc: 2024-12-17T23:33:54.7411488Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-12-17T23:33:54.7412745Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-12-17T23:33:54.7413574Z  log.info( 2024-12-17T23:33:54.7414587Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-12-17T23:33:54.7415763Z  ) 2024-12-17T23:33:54.7416359Z  enabled = True 2024-12-17T23:33:54.7417028Z  2024-12-17T23:33:54.7417513Z  if enabled: 2024-12-17T23:33:54.7418147Z  label = experiment_name 2024-12-17T23:33:54.7418916Z  if experiment_name == LF_FLEET_EXPERIMENT: 2024-12-17T23:33:54.7419912Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-12-17T23:33:54.7420985Z  # - If it's enabled, then we always list it's prefix first 2024-12-17T23:33:54.7422159Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-12-17T23:33:54.7423038Z  if is_canary: 2024-12-17T23:33:54.7423711Z  label += CANARY_FLEET_SUFFIX 2024-12-17T23:33:54.7424477Z  fleet_prefix = label 2024-12-17T23:33:54.7425171Z  else: 2024-12-17T23:33:54.7425740Z  prefixes.append(label) 2024-12-17T23:33:54.7426437Z  2024-12-17T23:33:54.7426976Z  if len(prefixes) > 1: 2024-12-17T23:33:54.7427553Z  log.error( 2024-12-17T23:33:54.7428860Z  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:])}" 2024-12-17T23:33:54.7430155Z  ) 2024-12-17T23:33:54.7430670Z  prefixes = prefixes[:1] 2024-12-17T23:33:54.7431365Z  2024-12-17T23:33:54.7431900Z  # Fleet always comes first 2024-12-17T23:33:54.7432505Z  if fleet_prefix: 2024-12-17T23:33:54.7433215Z  prefixes.insert(0, fleet_prefix) 2024-12-17T23:33:54.7433898Z  2024-12-17T23:33:54.7434507Z  return ".".join(prefixes) + "." if prefixes else "" 2024-12-17T23:33:54.7435317Z  2024-12-17T23:33:54.7435818Z  2024-12-17T23:33:54.7436584Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-12-17T23:33:54.7437597Z  """ 2024-12-17T23:33:54.7438372Z  Gets the first comment of the issue, which contains the desired rollout state. 2024-12-17T23:33:54.7439243Z  2024-12-17T23:33:54.7439980Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-12-17T23:33:54.7440860Z  """ 2024-12-17T23:33:54.7441434Z  gh = get_gh_client(github_token) 2024-12-17T23:33:54.7442182Z  issue = get_issue(gh, repo, issue_num) 2024-12-17T23:33:54.7443029Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-12-17T23:33:54.7443797Z  2024-12-17T23:33:54.7444291Z  2024-12-17T23:33:54.7445261Z def download_json(url: str, headers: Dict[str, str], num_retries: int = 3) -> Any: 2024-12-17T23:33:54.7446434Z  for _ in range(num_retries): 2024-12-17T23:33:54.7447099Z  try: 2024-12-17T23:33:54.7447732Z  req = Request(url=url, headers=headers) 2024-12-17T23:33:54.7448553Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2024-12-17T23:33:54.7449420Z  return json.loads(content) 2024-12-17T23:33:54.7450432Z  except Exception as e: 2024-12-17T23:33:54.7451192Z  log.warning(f"Could not download {url}: {e}") 2024-12-17T23:33:54.7451989Z  2024-12-17T23:33:54.7452692Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2024-12-17T23:33:54.7453580Z  return {} 2024-12-17T23:33:54.7454192Z  2024-12-17T23:33:54.7454642Z  2024-12-17T23:33:54.7455141Z @lru_cache(maxsize=None) 2024-12-17T23:33:54.7456113Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> Dict[str, Any]: 2024-12-17T23:33:54.7456983Z  """ 2024-12-17T23:33:54.7457534Z  Dynamically get PR information 2024-12-17T23:33:54.7458257Z  """ 2024-12-17T23:33:54.7458884Z  github_api = f"https://api.github.com/repos/{github_repo}" 2024-12-17T23:33:54.7459672Z  headers = { 2024-12-17T23:33:54.7460387Z  "Accept": "application/vnd.github.v3+json", 2024-12-17T23:33:54.7461137Z  "Authorization": f"token {github_token}", 2024-12-17T23:33:54.7461813Z  } 2024-12-17T23:33:54.7462492Z  json_response: Dict[str, Any] = download_json( 2024-12-17T23:33:54.7463426Z  url=f"{github_api}/issues/{pr_number}", 2024-12-17T23:33:54.7464118Z  headers=headers, 2024-12-17T23:33:54.7464776Z  ) 2024-12-17T23:33:54.7465271Z  2024-12-17T23:33:54.7465758Z  if not json_response: 2024-12-17T23:33:54.7466580Z  log.warning(f"Failed to get the labels for #{pr_number}") 2024-12-17T23:33:54.7467383Z  return {} 2024-12-17T23:33:54.7467901Z  2024-12-17T23:33:54.7468460Z  return json_response 2024-12-17T23:33:54.7469062Z  2024-12-17T23:33:54.7469493Z  2024-12-17T23:33:54.7470298Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> Set[str]: 2024-12-17T23:33:54.7471180Z  """ 2024-12-17T23:33:54.7471845Z  Dynamically get the latest list of labels from the pull request 2024-12-17T23:33:54.7472719Z  """ 2024-12-17T23:33:54.7473391Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2024-12-17T23:33:54.7474115Z  return { 2024-12-17T23:33:54.7474922Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2024-12-17T23:33:54.7475783Z  } 2024-12-17T23:33:54.7476243Z  2024-12-17T23:33:54.7476770Z  2024-12-17T23:33:54.7477278Z def main() -> None: 2024-12-17T23:33:54.7477831Z  args = parse_args() 2024-12-17T23:33:54.7478490Z  2024-12-17T23:33:54.7479060Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-12-17T23:33:54.7479708Z  2024-12-17T23:33:54.7480299Z  # Check if the PR is opt-out 2024-12-17T23:33:54.7480947Z  if args.pr_number: 2024-12-17T23:33:54.7481749Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2024-12-17T23:33:54.7482743Z  if OPT_OUT_LABEL in labels: 2024-12-17T23:33:54.7483398Z  log.info( 2024-12-17T23:33:54.7484260Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2024-12-17T23:33:54.7485228Z  ) 2024-12-17T23:33:54.7486140Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:54.7486964Z  sys.exit() 2024-12-17T23:33:54.7487590Z  2024-12-17T23:33:54.7488071Z  try: 2024-12-17T23:33:54.7488670Z  rollout_state = get_rollout_state_from_issue( 2024-12-17T23:33:54.7489579Z  args.github_token, args.github_issue_repo, args.github_issue 2024-12-17T23:33:54.7490635Z  ) 2024-12-17T23:33:54.7491152Z  2024-12-17T23:33:54.7491765Z  username = get_potential_pr_author( 2024-12-17T23:33:54.7492455Z  args.github_token, 2024-12-17T23:33:54.7493108Z  args.github_repo, 2024-12-17T23:33:54.7493831Z  args.github_actor, 2024-12-17T23:33:54.7494465Z  args.github_ref_type, 2024-12-17T23:33:54.7495163Z  args.github_branch, 2024-12-17T23:33:54.7495940Z  ) 2024-12-17T23:33:54.7496437Z  2024-12-17T23:33:54.7497051Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-12-17T23:33:54.7497875Z  2024-12-17T23:33:54.7498424Z  runner_label_prefix = get_runner_prefix( 2024-12-17T23:33:54.7499096Z  rollout_state, 2024-12-17T23:33:54.7499857Z  (args.github_issue_owner, username), 2024-12-17T23:33:54.7500522Z  args.github_branch, 2024-12-17T23:33:54.7501168Z  args.eligible_experiments, 2024-12-17T23:33:54.7501916Z  is_canary, 2024-12-17T23:33:54.7502463Z  ) 2024-12-17T23:33:54.7503063Z  2024-12-17T23:33:54.7503672Z  except Exception as e: 2024-12-17T23:33:54.7504408Z  log.error( 2024-12-17T23:33:54.7505276Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-12-17T23:33:54.7506283Z  ) 2024-12-17T23:33:54.7506763Z  2024-12-17T23:33:54.7507441Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:54.7508334Z  2024-12-17T23:33:54.7508767Z  2024-12-17T23:33:54.7509262Z if __name__ == "__main__": 2024-12-17T23:33:54.7509931Z  main() 2024-12-17T23:33:54.7510409Z  2024-12-17T23:33:54.7510880Z EOF 2024-12-17T23:33:54.7511436Z  2024-12-17T23:33:54.7511912Z cat runner_determinator.py 2024-12-17T23:33:54.7986864Z shell: /usr/bin/bash -e {0} 2024-12-17T23:33:54.7987861Z env: 2024-12-17T23:33:54.7988882Z GITHUB_TOKEN: *** 2024-12-17T23:33:54.7989460Z ISSUE_NUMBER: 5132 2024-12-17T23:33:54.7990005Z TRIGGERING_ACTOR: malfet 2024-12-17T23:33:54.7990650Z ISSUE_OWNER: 2024-12-17T23:33:54.7991180Z CHECK_EXPERIMENTS: 2024-12-17T23:33:54.7991688Z PR_NUMBER: 2024-12-17T23:33:54.7992245Z ##[endgroup] 2024-12-17T23:33:54.8225052Z # flake8: noqa: G004 2024-12-17T23:33:54.8225488Z 2024-12-17T23:33:54.8225965Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-12-17T23:33:54.8227038Z # must be kept in sync. You can do it easily by running the following command: 2024-12-17T23:33:54.8227984Z # python .github/scripts/update_runner_determinator.py 2024-12-17T23:33:54.8228547Z 2024-12-17T23:33:54.8228740Z """ 2024-12-17T23:33:54.8229441Z This runner determinator is used to determine which set of runners to run a 2024-12-17T23:33:54.8230491Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-12-17T23:33:54.8231458Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-12-17T23:33:54.8232430Z of which runners should be used to run which job. 2024-12-17T23:33:54.8232859Z 2024-12-17T23:33:54.8233403Z The configuration has two parts, the settings and a list of opted-in users, 2024-12-17T23:33:54.8234365Z separated by a line containing "---". If the line is not present, the 2024-12-17T23:33:54.8235624Z settings are considered to be empty with only the second part, the user 2024-12-17T23:33:54.8236497Z list, defined. 2024-12-17T23:33:54.8236763Z 2024-12-17T23:33:54.8237181Z The first part is a YAML block that defines the rollout settings. This can be 2024-12-17T23:33:54.8238209Z used to define any settings that are needed to determine which runners to use. 2024-12-17T23:33:54.8239237Z It's fields are defined by the RolloutSettings class below. 2024-12-17T23:33:54.8239723Z 2024-12-17T23:33:54.8240179Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-12-17T23:33:54.8241115Z The user list is also a comma separated list of additional features or 2024-12-17T23:33:54.8242024Z experiments which the user could be opted in to. 2024-12-17T23:33:54.8242486Z 2024-12-17T23:33:54.8242754Z The user list has the following rules: 2024-12-17T23:33:54.8243136Z 2024-12-17T23:33:54.8243479Z - Users are GitHub usernames, which must start with the @ prefix 2024-12-17T23:33:54.8244528Z - Each user is also a comma-separated list of features/experiments to enable 2024-12-17T23:33:54.8245406Z - A "#" prefix opts the user out of all experiments 2024-12-17T23:33:54.8245836Z 2024-12-17T23:33:54.8246039Z Example config: 2024-12-17T23:33:54.8246675Z # A list of experiments that can be opted into. 2024-12-17T23:33:54.8247447Z # This defines the behavior they'll induce when opted into. 2024-12-17T23:33:54.8248144Z # Expected syntax is: 2024-12-17T23:33:54.8249007Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-12-17T23:33:54.8250592Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-12-17T23:33:54.8251307Z 2024-12-17T23:33:54.8251731Z experiments: 2024-12-17T23:33:54.8252350Z lf: 2024-12-17T23:33:54.8252835Z rollout_percent: 25 2024-12-17T23:33:54.8253391Z all_branches: false 2024-12-17T23:33:54.8253999Z default: true 2024-12-17T23:33:54.8254505Z --- 2024-12-17T23:33:54.8254743Z 2024-12-17T23:33:54.8254976Z # Opt-ins: 2024-12-17T23:33:54.8255706Z # Users can opt into the LF fleet by adding their GitHub username to this list 2024-12-17T23:33:54.8256681Z # and specifying experiments to enable in a comma-separated list. 2024-12-17T23:33:54.8257580Z # To always opt out of an experiment, prefix it with a "-". 2024-12-17T23:33:54.8258393Z # Experiments should be from the above list. 2024-12-17T23:33:54.8258845Z 2024-12-17T23:33:54.8259060Z @User1,-lf,split_build 2024-12-17T23:33:54.8259606Z @User2,lf 2024-12-17T23:33:54.8260138Z @User3,split_build 2024-12-17T23:33:54.8260646Z """ 2024-12-17T23:33:54.8260887Z 2024-12-17T23:33:54.8261126Z import json 2024-12-17T23:33:54.8261645Z import logging 2024-12-17T23:33:54.8262146Z import os 2024-12-17T23:33:54.8262584Z import random 2024-12-17T23:33:54.8263098Z import re 2024-12-17T23:33:54.8263584Z import sys 2024-12-17T23:33:54.8264080Z from argparse import ArgumentParser 2024-12-17T23:33:54.8264751Z from functools import lru_cache 2024-12-17T23:33:54.8265360Z from logging import LogRecord 2024-12-17T23:33:54.8266129Z from typing import Any, Dict, FrozenSet, Iterable, List, NamedTuple, Set, Tuple 2024-12-17T23:33:54.8267037Z from urllib.request import Request, urlopen 2024-12-17T23:33:54.8267502Z 2024-12-17T23:33:54.8267697Z import yaml 2024-12-17T23:33:54.8268167Z from github import Auth, Github 2024-12-17T23:33:54.8268813Z from github.Issue import Issue 2024-12-17T23:33:54.8269214Z 2024-12-17T23:33:54.8269222Z 2024-12-17T23:33:54.8269481Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-12-17T23:33:54.8270251Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-12-17T23:33:54.8271272Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-12-17T23:33:54.8271928Z 2024-12-17T23:33:54.8272204Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-12-17T23:33:54.8273026Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-12-17T23:33:54.8273746Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-12-17T23:33:54.8274366Z OPT_OUT_LABEL = "no-runner-experiments" 2024-12-17T23:33:54.8274783Z 2024-12-17T23:33:54.8274995Z SETTING_EXPERIMENTS = "experiments" 2024-12-17T23:33:54.8275441Z 2024-12-17T23:33:54.8275710Z LF_FLEET_EXPERIMENT = "lf" 2024-12-17T23:33:54.8276235Z CANARY_FLEET_SUFFIX = ".c" 2024-12-17T23:33:54.8276590Z 2024-12-17T23:33:54.8276596Z 2024-12-17T23:33:54.8276798Z class Experiment(NamedTuple): 2024-12-17T23:33:54.8277482Z rollout_perc: float = ( 2024-12-17T23:33:54.8278182Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2024-12-17T23:33:54.8278960Z ) 2024-12-17T23:33:54.8279501Z all_branches: bool = ( 2024-12-17T23:33:54.8280213Z False # If True, the experiment is also enabled on the exception branches 2024-12-17T23:33:54.8280979Z ) 2024-12-17T23:33:54.8281512Z default: bool = ( 2024-12-17T23:33:54.8282211Z True # If True, the experiment is enabled by default for all queries 2024-12-17T23:33:54.8282947Z ) 2024-12-17T23:33:54.8283236Z 2024-12-17T23:33:54.8283502Z # Add more fields as needed 2024-12-17T23:33:54.8283837Z 2024-12-17T23:33:54.8283844Z 2024-12-17T23:33:54.8284109Z class Settings(NamedTuple): 2024-12-17T23:33:54.8284604Z """ 2024-12-17T23:33:54.8285238Z Settings for the experiments that can be opted into. 2024-12-17T23:33:54.8285934Z """ 2024-12-17T23:33:54.8286161Z 2024-12-17T23:33:54.8286385Z experiments: Dict[str, Experiment] = {} 2024-12-17T23:33:54.8286911Z 2024-12-17T23:33:54.8286918Z 2024-12-17T23:33:54.8287192Z class ColorFormatter(logging.Formatter): 2024-12-17T23:33:54.8287940Z """Color codes the log messages based on the log level""" 2024-12-17T23:33:54.8288540Z 2024-12-17T23:33:54.8288736Z COLORS = { 2024-12-17T23:33:54.8289327Z "WARNING": "\033[33m", # Yellow 2024-12-17T23:33:54.8290211Z "ERROR": "\033[31m", # Red 2024-12-17T23:33:54.8290779Z "CRITICAL": "\033[31m", # Red 2024-12-17T23:33:54.8291489Z "INFO": "\033[0m", # Reset 2024-12-17T23:33:54.8292068Z "DEBUG": "\033[0m", # Reset 2024-12-17T23:33:54.8292587Z } 2024-12-17T23:33:54.8292934Z 2024-12-17T23:33:54.8293208Z def format(self, record: LogRecord) -> str: 2024-12-17T23:33:54.8294070Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-12-17T23:33:54.8294921Z record.msg = f"{log_color}{record.msg}\033[0m" 2024-12-17T23:33:54.8295720Z return super().format(record) 2024-12-17T23:33:54.8296125Z 2024-12-17T23:33:54.8296133Z 2024-12-17T23:33:54.8296356Z handler = logging.StreamHandler() 2024-12-17T23:33:54.8297245Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-12-17T23:33:54.8297913Z 2024-12-17T23:33:54.8298203Z log = logging.getLogger(os.path.basename(__file__)) 2024-12-17T23:33:54.8298895Z log.addHandler(handler) 2024-12-17T23:33:54.8299513Z log.setLevel(logging.INFO) 2024-12-17T23:33:54.8299873Z 2024-12-17T23:33:54.8299880Z 2024-12-17T23:33:54.8300167Z def set_github_output(key: str, value: str) -> None: 2024-12-17T23:33:54.8300833Z """ 2024-12-17T23:33:54.8301501Z Defines outputs of the github action that invokes this script 2024-12-17T23:33:54.8302264Z """ 2024-12-17T23:33:54.8302735Z if not GITHUB_OUTPUT: 2024-12-17T23:33:54.8303975Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-12-17T23:33:54.8305224Z log.warning( 2024-12-17T23:33:54.8306184Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2024-12-17T23:33:54.8307290Z ) 2024-12-17T23:33:54.8317392Z print(f"::set-output name={key}::{value}") 2024-12-17T23:33:54.8318086Z return 2024-12-17T23:33:54.8318373Z 2024-12-17T23:33:54.8318720Z with open(GITHUB_OUTPUT, "a") as f: 2024-12-17T23:33:54.8319688Z log.info(f"Setting output: {key}='{value}'") 2024-12-17T23:33:54.8320326Z f.write(f"{key}={value}\n") 2024-12-17T23:33:54.8320719Z 2024-12-17T23:33:54.8320727Z 2024-12-17T23:33:54.8321152Z def _str_comma_separated_to_set(value: str) -> FrozenSet[str]: 2024-12-17T23:33:54.8321914Z return frozenset( 2024-12-17T23:33:54.8322671Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2024-12-17T23:33:54.8323523Z ) 2024-12-17T23:33:54.8323769Z 2024-12-17T23:33:54.8323778Z 2024-12-17T23:33:54.8324031Z def parse_args() -> Any: 2024-12-17T23:33:54.8324640Z parser = ArgumentParser("Get dynamic rollout settings") 2024-12-17T23:33:54.8325677Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-12-17T23:33:54.8326855Z parser.add_argument( 2024-12-17T23:33:54.8327420Z "--github-issue-repo", 2024-12-17T23:33:54.8328072Z type=str, 2024-12-17T23:33:54.8328609Z required=False, 2024-12-17T23:33:54.8329146Z default="pytorch/test-infra", 2024-12-17T23:33:54.8330067Z help="GitHub repo to get the issue", 2024-12-17T23:33:54.8330743Z ) 2024-12-17T23:33:54.8331202Z parser.add_argument( 2024-12-17T23:33:54.8331795Z "--github-repo", 2024-12-17T23:33:54.8332347Z type=str, 2024-12-17T23:33:54.8332826Z required=True, 2024-12-17T23:33:54.8333438Z help="GitHub repo where CI is running", 2024-12-17T23:33:54.8334098Z ) 2024-12-17T23:33:54.8334516Z parser.add_argument( 2024-12-17T23:33:54.8335298Z "--github-issue", type=int, required=True, help="GitHub issue number" 2024-12-17T23:33:54.8336090Z ) 2024-12-17T23:33:54.8336518Z parser.add_argument( 2024-12-17T23:33:54.8337826Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-12-17T23:33:54.8338740Z ) 2024-12-17T23:33:54.8339192Z parser.add_argument( 2024-12-17T23:33:54.8340005Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-12-17T23:33:54.8340847Z ) 2024-12-17T23:33:54.8341288Z parser.add_argument( 2024-12-17T23:33:54.8342084Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-12-17T23:33:54.8342917Z ) 2024-12-17T23:33:54.8343363Z parser.add_argument( 2024-12-17T23:33:54.8343958Z "--github-ref-type", 2024-12-17T23:33:54.8344569Z type=str, 2024-12-17T23:33:54.8345056Z required=True, 2024-12-17T23:33:54.8345681Z help="Current GitHub ref type, branch or tag", 2024-12-17T23:33:54.8346374Z ) 2024-12-17T23:33:54.8346899Z parser.add_argument( 2024-12-17T23:33:54.8347797Z "--eligible-experiments", 2024-12-17T23:33:54.8348476Z type=_str_comma_separated_to_set, 2024-12-17T23:33:54.8349078Z required=False, 2024-12-17T23:33:54.8349656Z default="", 2024-12-17T23:33:54.8350646Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2024-12-17T23:33:54.8351635Z ) 2024-12-17T23:33:54.8352142Z parser.add_argument( 2024-12-17T23:33:54.8352712Z "--pr-number", 2024-12-17T23:33:54.8353179Z type=str, 2024-12-17T23:33:54.8353717Z required=False, 2024-12-17T23:33:54.8354271Z default="", 2024-12-17T23:33:54.8354796Z help="the optional PR number where this is run", 2024-12-17T23:33:54.8355506Z ) 2024-12-17T23:33:54.8355773Z 2024-12-17T23:33:54.8356027Z return parser.parse_args() 2024-12-17T23:33:54.8356370Z 2024-12-17T23:33:54.8356377Z 2024-12-17T23:33:54.8356670Z def get_gh_client(github_token: str) -> Github: 2024-12-17T23:33:54.8357366Z auth = Auth.Token(github_token) 2024-12-17T23:33:54.8357983Z return Github(auth=auth) 2024-12-17T23:33:54.8358317Z 2024-12-17T23:33:54.8358326Z 2024-12-17T23:33:54.8358689Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-12-17T23:33:54.8359467Z repo = gh.get_repo(repo) 2024-12-17T23:33:54.8360285Z return repo.get_issue(number=issue_num) 2024-12-17T23:33:54.8360684Z 2024-12-17T23:33:54.8360692Z 2024-12-17T23:33:54.8360963Z def get_potential_pr_author( 2024-12-17T23:33:54.8361715Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-12-17T23:33:54.8362516Z ) -> str: 2024-12-17T23:33:54.8363145Z # If the trigger was a new tag added by a bot, this is a ciflow case 2024-12-17T23:33:54.8364064Z # Fetch the actual username from the original PR. The PR number is 2024-12-17T23:33:54.8364930Z # embedded in the tag name: ciflow// 2024-12-17T23:33:54.8365432Z 2024-12-17T23:33:54.8365650Z gh = get_gh_client(github_token) 2024-12-17T23:33:54.8366000Z 2024-12-17T23:33:54.8366426Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-12-17T23:33:54.8367112Z split_tag = ref_name.split("/") 2024-12-17T23:33:54.8367720Z if ( 2024-12-17T23:33:54.8368263Z len(split_tag) == 3 2024-12-17T23:33:54.8368817Z and split_tag[0] == "ciflow" 2024-12-17T23:33:54.8369462Z and split_tag[2].isnumeric() 2024-12-17T23:33:54.8370410Z ): 2024-12-17T23:33:54.8370907Z pr_number = split_tag[2] 2024-12-17T23:33:54.8371533Z try: 2024-12-17T23:33:54.8372135Z repository = gh.get_repo(repo) 2024-12-17T23:33:54.8372833Z pull = repository.get_pull(number=int(pr_number)) 2024-12-17T23:33:54.8373522Z except Exception as e: 2024-12-17T23:33:54.8374196Z raise Exception( # noqa: TRY002 2024-12-17T23:33:54.8374946Z f"issue with pull request {pr_number} from repo {repository}" 2024-12-17T23:33:54.8375686Z ) from e 2024-12-17T23:33:54.8376282Z return pull.user.login 2024-12-17T23:33:54.8377113Z # In all other cases, return the original input username 2024-12-17T23:33:54.8377827Z return username 2024-12-17T23:33:54.8378095Z 2024-12-17T23:33:54.8378110Z 2024-12-17T23:33:54.8378513Z def is_exception_branch(branch: str) -> bool: 2024-12-17T23:33:54.8379107Z """ 2024-12-17T23:33:54.8379846Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-12-17T23:33:54.8380801Z """ 2024-12-17T23:33:54.8381405Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-12-17T23:33:54.8382003Z 2024-12-17T23:33:54.8382009Z 2024-12-17T23:33:54.8382234Z def load_yaml(yaml_text: str) -> Any: 2024-12-17T23:33:54.8382908Z try: 2024-12-17T23:33:54.8383368Z data = yaml.safe_load(yaml_text) 2024-12-17T23:33:54.8383977Z return data 2024-12-17T23:33:54.8384578Z except yaml.YAMLError: 2024-12-17T23:33:54.8385122Z log.exception("Error loading YAML") 2024-12-17T23:33:54.8385768Z raise 2024-12-17T23:33:54.8386108Z 2024-12-17T23:33:54.8386114Z 2024-12-17T23:33:54.8386577Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-12-17T23:33:54.8387442Z """ 2024-12-17T23:33:54.8388138Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-12-17T23:33:54.8388862Z 2024-12-17T23:33:54.8389260Z If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:54.8390121Z and the text below is the list of opted in users. 2024-12-17T23:33:54.8390570Z 2024-12-17T23:33:54.8390975Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-12-17T23:33:54.8391839Z """ 2024-12-17T23:33:54.8392378Z rollout_state_parts = rollout_state.split("---") 2024-12-17T23:33:54.8393046Z if len(rollout_state_parts) >= 2: 2024-12-17T23:33:54.8393807Z return rollout_state_parts[0], rollout_state_parts[1] 2024-12-17T23:33:54.8394501Z else: 2024-12-17T23:33:54.8394957Z return "", rollout_state 2024-12-17T23:33:54.8395382Z 2024-12-17T23:33:54.8395389Z 2024-12-17T23:33:54.8395637Z class UserOptins(Dict[str, List[str]]): 2024-12-17T23:33:54.8396426Z """ 2024-12-17T23:33:54.8397030Z Dictionary of users with a list of features they have opted into 2024-12-17T23:33:54.8397831Z """ 2024-12-17T23:33:54.8398114Z 2024-12-17T23:33:54.8398121Z 2024-12-17T23:33:54.8398488Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-12-17T23:33:54.8399222Z """ 2024-12-17T23:33:54.8400070Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2024-12-17T23:33:54.8400846Z 2024-12-17T23:33:54.8401494Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-12-17T23:33:54.8402570Z - Example line: "@User1,lf,split_build" 2024-12-17T23:33:54.8403415Z - A "#" prefix indicates the user is opted out of all experiments 2024-12-17T23:33:54.8403967Z 2024-12-17T23:33:54.8403974Z 2024-12-17T23:33:54.8404168Z """ 2024-12-17T23:33:54.8404627Z optins = UserOptins() 2024-12-17T23:33:54.8405312Z for user in user_optin_text.split("\n"): 2024-12-17T23:33:54.8405926Z user = user.strip("\r\n\t -") 2024-12-17T23:33:54.8406552Z if not user or not user.startswith("@"): 2024-12-17T23:33:54.8407293Z # Not a valid user. Skip 2024-12-17T23:33:54.8407839Z continue 2024-12-17T23:33:54.8408148Z 2024-12-17T23:33:54.8408324Z if user: 2024-12-17T23:33:54.8408944Z usr_name = user.split(",")[0].strip("@") 2024-12-17T23:33:54.8410253Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-12-17T23:33:54.8410980Z 2024-12-17T23:33:54.8411171Z return optins 2024-12-17T23:33:54.8411549Z 2024-12-17T23:33:54.8411556Z 2024-12-17T23:33:54.8411930Z def is_valid_experiment_name(experiment_name: str) -> bool: 2024-12-17T23:33:54.8412797Z """ 2024-12-17T23:33:54.8413322Z Check if the experiment name is valid. 2024-12-17T23:33:54.8414044Z A valid name: 2024-12-17T23:33:54.8414753Z - Contains only alphanumeric characters and the special characters "_" & "-" 2024-12-17T23:33:54.8415800Z - The special characters "_" & "-" shouldn't be the first or last characters 2024-12-17T23:33:54.8416708Z - Cannot contain spaces 2024-12-17T23:33:54.8417228Z """ 2024-12-17T23:33:54.8417515Z 2024-12-17T23:33:54.8417793Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2024-12-17T23:33:54.8418673Z valid = bool(re.match(valid_char_regex, experiment_name)) 2024-12-17T23:33:54.8419161Z 2024-12-17T23:33:54.8419406Z if valid: 2024-12-17T23:33:54.8419833Z return True 2024-12-17T23:33:54.8420222Z 2024-12-17T23:33:54.8420429Z log.error( 2024-12-17T23:33:54.8422006Z 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." 2024-12-17T23:33:54.8423665Z ) 2024-12-17T23:33:54.8424194Z return False 2024-12-17T23:33:54.8424487Z 2024-12-17T23:33:54.8424494Z 2024-12-17T23:33:54.8424869Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-12-17T23:33:54.8425535Z """ 2024-12-17T23:33:54.8426291Z Parse the experiments from the issue body into a list of ExperimentSettings 2024-12-17T23:33:54.8427132Z """ 2024-12-17T23:33:54.8427557Z try: 2024-12-17T23:33:54.8428119Z if settings_text: 2024-12-17T23:33:54.8428933Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-12-17T23:33:54.8429860Z # for easy reading 2024-12-17T23:33:54.8430751Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-12-17T23:33:54.8431758Z # the backtick character in shell commands. 2024-12-17T23:33:54.8432514Z backtick = chr(96) # backtick character 2024-12-17T23:33:54.8433272Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-12-17T23:33:54.8434210Z settings = load_yaml(settings_text) 2024-12-17T23:33:54.8434610Z 2024-12-17T23:33:54.8435154Z # For now we just load experiments. We can expand this if/when we add more settings 2024-12-17T23:33:54.8435990Z experiments = {} 2024-12-17T23:33:54.8436352Z 2024-12-17T23:33:54.8436735Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-12-17T23:33:54.8437652Z if not is_valid_experiment_name(exp_name): 2024-12-17T23:33:54.8438876Z # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2024-12-17T23:33:54.8439975Z continue 2024-12-17T23:33:54.8440329Z 2024-12-17T23:33:54.8440621Z valid_settings = {} 2024-12-17T23:33:54.8441277Z for setting in exp_settings: 2024-12-17T23:33:54.8441911Z if setting not in Experiment._fields: 2024-12-17T23:33:54.8442644Z log.warning( 2024-12-17T23:33:54.8443461Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-12-17T23:33:54.8444240Z ) 2024-12-17T23:33:54.8444828Z else: 2024-12-17T23:33:54.8445452Z valid_settings[setting] = exp_settings[setting] 2024-12-17T23:33:54.8445907Z 2024-12-17T23:33:54.8446226Z experiments[exp_name] = Experiment(**valid_settings) 2024-12-17T23:33:54.8446996Z return Settings(experiments) 2024-12-17T23:33:54.8447401Z 2024-12-17T23:33:54.8447641Z except Exception: 2024-12-17T23:33:54.8448189Z log.exception("Failed to parse settings") 2024-12-17T23:33:54.8448623Z 2024-12-17T23:33:54.8449026Z return Settings() 2024-12-17T23:33:54.8449393Z 2024-12-17T23:33:54.8449400Z 2024-12-17T23:33:54.8449890Z def parse_settings(rollout_state: str) -> Settings: 2024-12-17T23:33:54.8450597Z """ 2024-12-17T23:33:54.8451170Z Parse settings, if any, from the rollout state. 2024-12-17T23:33:54.8451663Z 2024-12-17T23:33:54.8452064Z If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:54.8452954Z and the text below is the list of opted in users. 2024-12-17T23:33:54.8453382Z 2024-12-17T23:33:54.8453887Z If it doesn't contain "---" then the settings are empty and the default values are used. 2024-12-17T23:33:54.8454760Z """ 2024-12-17T23:33:54.8455439Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:54.8456320Z return parse_settings_from_text(settings_text) 2024-12-17T23:33:54.8456828Z 2024-12-17T23:33:54.8456835Z 2024-12-17T23:33:54.8457123Z def parse_users(rollout_state: str) -> UserOptins: 2024-12-17T23:33:54.8457790Z """ 2024-12-17T23:33:54.8458354Z Parse users from the rollout state. 2024-12-17T23:33:54.8458745Z 2024-12-17T23:33:54.8458934Z """ 2024-12-17T23:33:54.8459553Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:54.8460475Z return parse_user_opt_in_from_text(users_text) 2024-12-17T23:33:54.8460914Z 2024-12-17T23:33:54.8460921Z 2024-12-17T23:33:54.8461377Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:54.8462217Z """ 2024-12-17T23:33:54.8462811Z Check if a user is opted into an experiment 2024-12-17T23:33:54.8463422Z """ 2024-12-17T23:33:54.8463980Z return experiment_name in user_optins.get(user, []) 2024-12-17T23:33:54.8464413Z 2024-12-17T23:33:54.8464533Z 2024-12-17T23:33:54.8464998Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:54.8465857Z """ 2024-12-17T23:33:54.8466393Z Check if a user explicitly opted out of an experiment 2024-12-17T23:33:54.8467169Z """ 2024-12-17T23:33:54.8467777Z # if the experiment is prefixed with a "-", then it's an opt-out 2024-12-17T23:33:54.8468728Z experiment_optout = "-" + experiment_name 2024-12-17T23:33:54.8469549Z if experiment_optout not in user_optins.get(user, []): 2024-12-17T23:33:54.8470258Z return False 2024-12-17T23:33:54.8470561Z 2024-12-17T23:33:54.8470859Z if is_user_opted_in(user, user_optins, experiment_name): 2024-12-17T23:33:54.8471626Z log.warning( 2024-12-17T23:33:54.8472515Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2024-12-17T23:33:54.8473475Z ) 2024-12-17T23:33:54.8473809Z 2024-12-17T23:33:54.8474028Z return True 2024-12-17T23:33:54.8474297Z 2024-12-17T23:33:54.8474303Z 2024-12-17T23:33:54.8474574Z def get_runner_prefix( 2024-12-17T23:33:54.8475074Z rollout_state: str, 2024-12-17T23:33:54.8475706Z workflow_requestors: Iterable[str], 2024-12-17T23:33:54.8476344Z branch: str, 2024-12-17T23:33:54.8476892Z eligible_experiments: FrozenSet[str] = frozenset(), 2024-12-17T23:33:54.8477793Z is_canary: bool = False, 2024-12-17T23:33:54.8478384Z ) -> str: 2024-12-17T23:33:54.8478860Z settings = parse_settings(rollout_state) 2024-12-17T23:33:54.8479607Z user_optins = parse_users(rollout_state) 2024-12-17T23:33:54.8480031Z 2024-12-17T23:33:54.8480273Z fleet_prefix = "" 2024-12-17T23:33:54.8480755Z prefixes = [] 2024-12-17T23:33:54.8481549Z for experiment_name, experiment_settings in settings.experiments.items(): 2024-12-17T23:33:54.8482641Z if not experiment_settings.all_branches and is_exception_branch(branch): 2024-12-17T23:33:54.8483437Z log.info( 2024-12-17T23:33:54.8484266Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-12-17T23:33:54.8485119Z ) 2024-12-17T23:33:54.8485752Z continue 2024-12-17T23:33:54.8486149Z 2024-12-17T23:33:54.8486397Z if eligible_experiments: 2024-12-17T23:33:54.8487064Z if experiment_name not in eligible_experiments: 2024-12-17T23:33:54.8487786Z exp_list = ", ".join(eligible_experiments) 2024-12-17T23:33:54.8488509Z log.info( 2024-12-17T23:33:54.8489388Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2024-12-17T23:33:54.8490634Z ) 2024-12-17T23:33:54.8491203Z continue 2024-12-17T23:33:54.8491790Z elif not experiment_settings.default: 2024-12-17T23:33:54.8492429Z log.info( 2024-12-17T23:33:54.8493229Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2024-12-17T23:33:54.8494074Z ) 2024-12-17T23:33:54.8494552Z continue 2024-12-17T23:33:54.8494907Z 2024-12-17T23:33:54.8495251Z # Is any workflow_requestor opted out to this experiment? 2024-12-17T23:33:54.8495979Z opted_out_users = [ 2024-12-17T23:33:54.8496525Z requestor 2024-12-17T23:33:54.8497145Z for requestor in workflow_requestors 2024-12-17T23:33:54.8497923Z if is_user_opted_out(requestor, user_optins, experiment_name) 2024-12-17T23:33:54.8498652Z ] 2024-12-17T23:33:54.8498979Z 2024-12-17T23:33:54.8499216Z if opted_out_users: 2024-12-17T23:33:54.8499797Z log.info( 2024-12-17T23:33:54.8500490Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2024-12-17T23:33:54.8501451Z ) 2024-12-17T23:33:54.8501897Z continue 2024-12-17T23:33:54.8502258Z 2024-12-17T23:33:54.8502579Z # Is any workflow_requestor opted in to this experiment? 2024-12-17T23:33:54.8503304Z opted_in_users = [ 2024-12-17T23:33:54.8503814Z requestor 2024-12-17T23:33:54.8504453Z for requestor in workflow_requestors 2024-12-17T23:33:54.8505237Z if is_user_opted_in(requestor, user_optins, experiment_name) 2024-12-17T23:33:54.8505916Z ] 2024-12-17T23:33:54.8506244Z 2024-12-17T23:33:54.8506673Z enabled = False 2024-12-17T23:33:54.8507227Z if opted_in_users: 2024-12-17T23:33:54.8507727Z log.info( 2024-12-17T23:33:54.8508515Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-12-17T23:33:54.8509303Z ) 2024-12-17T23:33:54.8509757Z enabled = True 2024-12-17T23:33:54.8510156Z 2024-12-17T23:33:54.8510438Z elif experiment_settings.rollout_perc: 2024-12-17T23:33:54.8511360Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-12-17T23:33:54.8512344Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-12-17T23:33:54.8513170Z log.info( 2024-12-17T23:33:54.8514147Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-12-17T23:33:54.8515170Z ) 2024-12-17T23:33:54.8515771Z enabled = True 2024-12-17T23:33:54.8516148Z 2024-12-17T23:33:54.8516351Z if enabled: 2024-12-17T23:33:54.8516874Z label = experiment_name 2024-12-17T23:33:54.8517570Z if experiment_name == LF_FLEET_EXPERIMENT: 2024-12-17T23:33:54.8518492Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-12-17T23:33:54.8519474Z # - If it's enabled, then we always list it's prefix first 2024-12-17T23:33:54.8520372Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-12-17T23:33:54.8521134Z if is_canary: 2024-12-17T23:33:54.8521717Z label += CANARY_FLEET_SUFFIX 2024-12-17T23:33:54.8522450Z fleet_prefix = label 2024-12-17T23:33:54.8523216Z else: 2024-12-17T23:33:54.8523747Z prefixes.append(label) 2024-12-17T23:33:54.8523758Z 2024-12-17T23:33:54.8524045Z if len(prefixes) > 1: 2024-12-17T23:33:54.8524274Z log.error( 2024-12-17T23:33:54.8525140Z 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:])}" 2024-12-17T23:33:54.8525353Z ) 2024-12-17T23:33:54.8525572Z prefixes = prefixes[:1] 2024-12-17T23:33:54.8525617Z 2024-12-17T23:33:54.8525819Z # Fleet always comes first 2024-12-17T23:33:54.8526094Z if fleet_prefix: 2024-12-17T23:33:54.8526378Z prefixes.insert(0, fleet_prefix) 2024-12-17T23:33:54.8526387Z 2024-12-17T23:33:54.8526686Z return ".".join(prefixes) + "." if prefixes else "" 2024-12-17T23:33:54.8526694Z 2024-12-17T23:33:54.8526700Z 2024-12-17T23:33:54.8527167Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-12-17T23:33:54.8527407Z """ 2024-12-17T23:33:54.8527807Z Gets the first comment of the issue, which contains the desired rollout state. 2024-12-17T23:33:54.8527815Z 2024-12-17T23:33:54.8528346Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-12-17T23:33:54.8528550Z """ 2024-12-17T23:33:54.8528791Z gh = get_gh_client(github_token) 2024-12-17T23:33:54.8529065Z issue = get_issue(gh, repo, issue_num) 2024-12-17T23:33:54.8529384Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-12-17T23:33:54.8529392Z 2024-12-17T23:33:54.8529398Z 2024-12-17T23:33:54.8530482Z def download_json(url: str, headers: Dict[str, str], num_retries: int = 3) -> Any: 2024-12-17T23:33:54.8530901Z for _ in range(num_retries): 2024-12-17T23:33:54.8531121Z try: 2024-12-17T23:33:54.8531377Z req = Request(url=url, headers=headers) 2024-12-17T23:33:54.8531750Z content = urlopen(req, timeout=5).read().decode("utf-8") 2024-12-17T23:33:54.8531991Z return json.loads(content) 2024-12-17T23:33:54.8532305Z except Exception as e: 2024-12-17T23:33:54.8532594Z log.warning(f"Could not download {url}: {e}") 2024-12-17T23:33:54.8532792Z 2024-12-17T23:33:54.8533232Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2024-12-17T23:33:54.8533472Z return {} 2024-12-17T23:33:54.8533479Z 2024-12-17T23:33:54.8533485Z 2024-12-17T23:33:54.8533695Z @lru_cache(maxsize=None) 2024-12-17T23:33:54.8534154Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> Dict[str, Any]: 2024-12-17T23:33:54.8534436Z """ 2024-12-17T23:33:54.8534702Z Dynamically get PR information 2024-12-17T23:33:54.8534897Z """ 2024-12-17T23:33:54.8535260Z github_api = f"https://api.github.com/repos/{github_repo}" 2024-12-17T23:33:54.8535460Z headers = { 2024-12-17T23:33:54.8535723Z "Accept": "application/vnd.github.v3+json", 2024-12-17T23:33:54.8536073Z "Authorization": f"token {github_token}", 2024-12-17T23:33:54.8536286Z } 2024-12-17T23:33:54.8536586Z json_response: Dict[str, Any] = download_json( 2024-12-17T23:33:54.8536830Z url=f"{github_api}/issues/{pr_number}", 2024-12-17T23:33:54.8537048Z headers=headers, 2024-12-17T23:33:54.8537260Z ) 2024-12-17T23:33:54.8537268Z 2024-12-17T23:33:54.8537555Z if not json_response: 2024-12-17T23:33:54.8537890Z log.warning(f"Failed to get the labels for #{pr_number}") 2024-12-17T23:33:54.8538131Z return {} 2024-12-17T23:33:54.8538139Z 2024-12-17T23:33:54.8538357Z return json_response 2024-12-17T23:33:54.8538365Z 2024-12-17T23:33:54.8538371Z 2024-12-17T23:33:54.8538806Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> Set[str]: 2024-12-17T23:33:54.8539038Z """ 2024-12-17T23:33:54.8539465Z Dynamically get the latest list of labels from the pull request 2024-12-17T23:33:54.8539709Z """ 2024-12-17T23:33:54.8540179Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2024-12-17T23:33:54.8540390Z return { 2024-12-17T23:33:54.8540845Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2024-12-17T23:33:54.8541029Z } 2024-12-17T23:33:54.8541039Z 2024-12-17T23:33:54.8541046Z 2024-12-17T23:33:54.8541330Z def main() -> None: 2024-12-17T23:33:54.8541593Z args = parse_args() 2024-12-17T23:33:54.8541601Z 2024-12-17T23:33:54.8541858Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-12-17T23:33:54.8541866Z 2024-12-17T23:33:54.8542089Z # Check if the PR is opt-out 2024-12-17T23:33:54.8542345Z if args.pr_number: 2024-12-17T23:33:54.8542770Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2024-12-17T23:33:54.8543106Z if OPT_OUT_LABEL in labels: 2024-12-17T23:33:54.8543310Z log.info( 2024-12-17T23:33:54.8543787Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2024-12-17T23:33:54.8544042Z ) 2024-12-17T23:33:54.8544405Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:54.8544596Z sys.exit() 2024-12-17T23:33:54.8544610Z 2024-12-17T23:33:54.8544919Z try: 2024-12-17T23:33:54.8545204Z rollout_state = get_rollout_state_from_issue( 2024-12-17T23:33:54.8545547Z args.github_token, args.github_issue_repo, args.github_issue 2024-12-17T23:33:54.8545795Z ) 2024-12-17T23:33:54.8545805Z 2024-12-17T23:33:54.8546040Z username = get_potential_pr_author( 2024-12-17T23:33:54.8546350Z args.github_token, 2024-12-17T23:33:54.8546583Z args.github_repo, 2024-12-17T23:33:54.8546797Z args.github_actor, 2024-12-17T23:33:54.8547067Z args.github_ref_type, 2024-12-17T23:33:54.8547279Z args.github_branch, 2024-12-17T23:33:54.8547474Z ) 2024-12-17T23:33:54.8547483Z 2024-12-17T23:33:54.8547887Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-12-17T23:33:54.8547896Z 2024-12-17T23:33:54.8548161Z runner_label_prefix = get_runner_prefix( 2024-12-17T23:33:54.8548370Z rollout_state, 2024-12-17T23:33:54.8548833Z (args.github_issue_owner, username), 2024-12-17T23:33:54.8549044Z args.github_branch, 2024-12-17T23:33:54.8549275Z args.eligible_experiments, 2024-12-17T23:33:54.8549566Z is_canary, 2024-12-17T23:33:54.8549793Z ) 2024-12-17T23:33:54.8549803Z 2024-12-17T23:33:54.8550057Z except Exception as e: 2024-12-17T23:33:54.8550259Z log.error( 2024-12-17T23:33:54.8550727Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-12-17T23:33:54.8550956Z ) 2024-12-17T23:33:54.8550964Z 2024-12-17T23:33:54.8551391Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:54.8551399Z 2024-12-17T23:33:54.8551406Z 2024-12-17T23:33:54.8551657Z if __name__ == "__main__": 2024-12-17T23:33:54.8551900Z main() 2024-12-17T23:33:54.8551909Z 2024-12-17T23:33:54.8649209Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-12-17T23:33:54.8649657Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-12-17T23:33:54.8707600Z shell: /usr/bin/bash -e {0} 2024-12-17T23:33:54.8707899Z env: 2024-12-17T23:33:54.8708452Z GITHUB_TOKEN: *** 2024-12-17T23:33:54.8708663Z ISSUE_NUMBER: 5132 2024-12-17T23:33:54.8708886Z TRIGGERING_ACTOR: malfet 2024-12-17T23:33:54.8709129Z ISSUE_OWNER: 2024-12-17T23:33:54.8709316Z CHECK_EXPERIMENTS: 2024-12-17T23:33:54.8709580Z PR_NUMBER: 2024-12-17T23:33:54.8709824Z ##[endgroup] 2024-12-17T23:33:57.1772903Z Defaulting to user installation because normal site-packages is not writeable 2024-12-17T23:33:58.3025346Z Collecting urllib3==1.26.18 2024-12-17T23:33:58.3562725Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2024-12-17T23:33:58.3900801Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 KB 6.3 MB/s eta 0:00:00 2024-12-17T23:33:58.4176916Z Collecting PyGithub==2.3.0 2024-12-17T23:33:58.4250882Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2024-12-17T23:33:58.4587612Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 KB 11.2 MB/s eta 0:00:00 2024-12-17T23:33:58.5204846Z Collecting pynacl>=1.4.0 2024-12-17T23:33:58.5304532Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2024-12-17T23:33:58.5862657Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 KB 15.8 MB/s eta 0:00:00 2024-12-17T23:33:58.6192450Z Collecting pyjwt[crypto]>=2.4.0 2024-12-17T23:33:58.6264612Z Downloading PyJWT-2.10.1-py3-none-any.whl (22 kB) 2024-12-17T23:33:58.6301068Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.25.1) 2024-12-17T23:33:58.6551959Z Collecting Deprecated 2024-12-17T23:33:58.6686247Z Downloading Deprecated-1.2.15-py2.py3-none-any.whl (9.9 kB) 2024-12-17T23:33:58.7039092Z Collecting typing-extensions>=4.0.0 2024-12-17T23:33:58.7111478Z Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) 2024-12-17T23:33:58.7252447Z Requirement already satisfied: cryptography>=3.4.0 in /usr/lib/python3/dist-packages (from pyjwt[crypto]>=2.4.0->PyGithub==2.3.0) (3.4.8) 2024-12-17T23:33:58.9552599Z Collecting cffi>=1.4.1 2024-12-17T23:33:58.9868856Z Downloading cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446 kB) 2024-12-17T23:33:59.0084438Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446.2/446.2 KB 22.5 MB/s eta 0:00:00 2024-12-17T23:33:59.2098916Z Collecting wrapt<2,>=1.10 2024-12-17T23:33:59.2226870Z Downloading wrapt-1.17.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (82 kB) 2024-12-17T23:33:59.2270453Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.7/82.7 KB 29.2 MB/s eta 0:00:00 2024-12-17T23:33:59.2490027Z Collecting pycparser 2024-12-17T23:33:59.2581782Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2024-12-17T23:33:59.2638790Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 KB 29.6 MB/s eta 0:00:00 2024-12-17T23:33:59.6885428Z Installing collected packages: wrapt, urllib3, typing-extensions, pyjwt, pycparser, Deprecated, cffi, pynacl, PyGithub 2024-12-17T23:34:00.1570562Z Successfully installed Deprecated-1.2.15 PyGithub-2.3.0 cffi-1.17.1 pycparser-2.22 pyjwt-2.10.1 pynacl-1.5.0 typing-extensions-4.12.2 urllib3-1.26.18 wrapt-1.17.0 2024-12-17T23:34:00.2305316Z ##[group]Run curr_branch="release/2.6" 2024-12-17T23:34:00.2305928Z curr_branch="release/2.6" 2024-12-17T23:34:00.2306280Z curr_ref_type="branch" 2024-12-17T23:34:00.2306630Z echo "Current branch is '$curr_branch'" 2024-12-17T23:34:00.2307048Z  2024-12-17T23:34:00.2307317Z python3 runner_determinator.py \ 2024-12-17T23:34:00.2307693Z  --github-token "$GITHUB_TOKEN" \ 2024-12-17T23:34:00.2308123Z  --github-issue "$ISSUE_NUMBER" \ 2024-12-17T23:34:00.2308493Z  --github-branch "$curr_branch" \ 2024-12-17T23:34:00.2308860Z  --github-actor "$TRIGGERING_ACTOR" \ 2024-12-17T23:34:00.2309344Z  --github-issue-owner "$ISSUE_OWNER" \ 2024-12-17T23:34:00.2309723Z  --github-ref-type "$curr_ref_type" \ 2024-12-17T23:34:00.2310097Z  --github-repo "$GITHUB_REPOSITORY" \ 2024-12-17T23:34:00.2310584Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2024-12-17T23:34:00.2311035Z  --pr-number "${PR_NUMBER}" 2024-12-17T23:34:00.2369214Z shell: /usr/bin/bash -e {0} 2024-12-17T23:34:00.2369543Z env: 2024-12-17T23:34:00.2370547Z GITHUB_TOKEN: *** 2024-12-17T23:34:00.2370822Z ISSUE_NUMBER: 5132 2024-12-17T23:34:00.2371117Z TRIGGERING_ACTOR: malfet 2024-12-17T23:34:00.2371516Z ISSUE_OWNER: 2024-12-17T23:34:00.2371756Z CHECK_EXPERIMENTS: 2024-12-17T23:34:00.2372040Z PR_NUMBER: 2024-12-17T23:34:00.2372385Z ##[endgroup] 2024-12-17T23:34:00.2450213Z Current branch is 'release/2.6' 2024-12-17T23:34:01.6558494Z INFO : Based on rollout percentage of 95%, enabling experiment lf. 2024-12-17T23:34:01.6559459Z INFO : Skipping experiment 'awsa100', as it is not a default experiment 2024-12-17T23:34:01.6560275Z INFO : Setting output: label-type='lf.' 2024-12-17T23:34:01.6842477Z Evaluate and set job outputs 2024-12-17T23:34:01.6849447Z Set output 'label-type' 2024-12-17T23:34:01.6851819Z Cleaning up orphan processes