2024-12-17T23:33:59.0047834Z Current runner version: '2.321.0' 2024-12-17T23:33:59.0073156Z ##[group]Operating System 2024-12-17T23:33:59.0073902Z Ubuntu 2024-12-17T23:33:59.0074479Z 22.04.5 2024-12-17T23:33:59.0075004Z LTS 2024-12-17T23:33:59.0075443Z ##[endgroup] 2024-12-17T23:33:59.0076012Z ##[group]Runner Image 2024-12-17T23:33:59.0076614Z Image: ubuntu-22.04 2024-12-17T23:33:59.0077088Z Version: 20241211.1.0 2024-12-17T23:33:59.0078185Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241211.1/images/ubuntu/Ubuntu2204-Readme.md 2024-12-17T23:33:59.0079602Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241211.1 2024-12-17T23:33:59.0080470Z ##[endgroup] 2024-12-17T23:33:59.0081100Z ##[group]Runner Image Provisioner 2024-12-17T23:33:59.0081711Z 2.0.404.1 2024-12-17T23:33:59.0082181Z ##[endgroup] 2024-12-17T23:33:59.0083281Z ##[group]GITHUB_TOKEN Permissions 2024-12-17T23:33:59.0085010Z Contents: read 2024-12-17T23:33:59.0085569Z Metadata: read 2024-12-17T23:33:59.0086366Z ##[endgroup] 2024-12-17T23:33:59.0089780Z Secret source: Actions 2024-12-17T23:33:59.0090754Z Prepare workflow directory 2024-12-17T23:33:59.0576487Z Prepare all required actions 2024-12-17T23:33:59.0631379Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/release/2.6 (0cdf8b1d09254cfda66191d1bd01e3041c3c76f7) 2024-12-17T23:33:59.0636765Z ##[group] Inputs 2024-12-17T23:33:59.0637484Z check_experiments: 2024-12-17T23:33:59.0638101Z triggering_actor: malfet 2024-12-17T23:33:59.0638638Z issue_owner: 2024-12-17T23:33:59.0639210Z curr_branch: release/2.6 2024-12-17T23:33:59.0639811Z curr_ref_type: branch 2024-12-17T23:33:59.0640309Z issue_number: 5132 2024-12-17T23:33:59.0640883Z ##[endgroup] 2024-12-17T23:33:59.0641575Z Complete job name: before-test / get-label-type / runner-determinator 2024-12-17T23:33:59.6561824Z ##[group]Run cat < runner_determinator.py 2024-12-17T23:33:59.6564301Z cat < runner_determinator.py 2024-12-17T23:33:59.6565096Z # flake8: noqa: G004 2024-12-17T23:33:59.6565753Z  2024-12-17T23:33:59.6566545Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-12-17T23:33:59.6567735Z # must be kept in sync. You can do it easily by running the following command: 2024-12-17T23:33:59.6568759Z # python .github/scripts/update_runner_determinator.py 2024-12-17T23:33:59.6569510Z  2024-12-17T23:33:59.6569996Z """ 2024-12-17T23:33:59.6570815Z This runner determinator is used to determine which set of runners to run a 2024-12-17T23:33:59.6571887Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-12-17T23:33:59.6573131Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-12-17T23:33:59.6574151Z of which runners should be used to run which job. 2024-12-17T23:33:59.6575441Z  2024-12-17T23:33:59.6576234Z The configuration has two parts, the settings and a list of opted-in users, 2024-12-17T23:33:59.6577368Z separated by a line containing "---". If the line is not present, the 2024-12-17T23:33:59.6578539Z settings are considered to be empty with only the second part, the user 2024-12-17T23:33:59.6579409Z list, defined. 2024-12-17T23:33:59.6579965Z  2024-12-17T23:33:59.6580772Z The first part is a YAML block that defines the rollout settings. This can be 2024-12-17T23:33:59.6581934Z used to define any settings that are needed to determine which runners to use. 2024-12-17T23:33:59.6582952Z It's fields are defined by the RolloutSettings class below. 2024-12-17T23:33:59.6583793Z  2024-12-17T23:33:59.6584558Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-12-17T23:33:59.6585611Z The user list is also a comma separated list of additional features or 2024-12-17T23:33:59.6586938Z experiments which the user could be opted in to. 2024-12-17T23:33:59.6587692Z  2024-12-17T23:33:59.6588225Z The user list has the following rules: 2024-12-17T23:33:59.6588946Z  2024-12-17T23:33:59.6589678Z - Users are GitHub usernames, which must start with the @ prefix 2024-12-17T23:33:59.6590731Z - Each user is also a comma-separated list of features/experiments to enable 2024-12-17T23:33:59.6592161Z - A "#" prefix opts the user out of all experiments 2024-12-17T23:33:59.6592935Z  2024-12-17T23:33:59.6593597Z Example config: 2024-12-17T23:33:59.6594298Z  # A list of experiments that can be opted into. 2024-12-17T23:33:59.6595198Z  # This defines the behavior they'll induce when opted into. 2024-12-17T23:33:59.6596023Z  # Expected syntax is: 2024-12-17T23:33:59.6596951Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-12-17T23:33:59.6598128Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-12-17T23:33:59.6599083Z  2024-12-17T23:33:59.6599661Z  experiments: 2024-12-17T23:33:59.6600202Z  lf: 2024-12-17T23:33:59.6600793Z  rollout_percent: 25 2024-12-17T23:33:59.6601532Z  all_branches: false 2024-12-17T23:33:59.6602142Z  default: true 2024-12-17T23:33:59.6602757Z  --- 2024-12-17T23:33:59.6603353Z  2024-12-17T23:33:59.6603843Z  # Opt-ins: 2024-12-17T23:33:59.6604651Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2024-12-17T23:33:59.6605995Z  # and specifying experiments to enable in a comma-separated list. 2024-12-17T23:33:59.6607001Z  # To always opt out of an experiment, prefix it with a "-". 2024-12-17T23:33:59.6607864Z  # Experiments should be from the above list. 2024-12-17T23:33:59.6608669Z  2024-12-17T23:33:59.6609152Z  @User1,-lf,split_build 2024-12-17T23:33:59.6609791Z  @User2,lf 2024-12-17T23:33:59.6610456Z  @User3,split_build 2024-12-17T23:33:59.6611045Z """ 2024-12-17T23:33:59.6611543Z  2024-12-17T23:33:59.6612128Z import json 2024-12-17T23:33:59.6612648Z import logging 2024-12-17T23:33:59.6613226Z import os 2024-12-17T23:33:59.6613858Z import random 2024-12-17T23:33:59.6614648Z import re 2024-12-17T23:33:59.6615217Z import sys 2024-12-17T23:33:59.6615935Z from argparse import ArgumentParser 2024-12-17T23:33:59.6616626Z from functools import lru_cache 2024-12-17T23:33:59.6617342Z from logging import LogRecord 2024-12-17T23:33:59.6618348Z from typing import Any, Dict, FrozenSet, Iterable, List, NamedTuple, Set, Tuple 2024-12-17T23:33:59.6619350Z from urllib.request import Request, urlopen 2024-12-17T23:33:59.6620033Z  2024-12-17T23:33:59.6620602Z import yaml 2024-12-17T23:33:59.6621200Z from github import Auth, Github 2024-12-17T23:33:59.6621872Z from github.Issue import Issue 2024-12-17T23:33:59.6622592Z  2024-12-17T23:33:59.6623082Z  2024-12-17T23:33:59.6623652Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-12-17T23:33:59.6624639Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-12-17T23:33:59.6625731Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-12-17T23:33:59.6626602Z  2024-12-17T23:33:59.6627270Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-12-17T23:33:59.6628061Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-12-17T23:33:59.6628753Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-12-17T23:33:59.6629603Z OPT_OUT_LABEL = "no-runner-experiments" 2024-12-17T23:33:59.6630539Z  2024-12-17T23:33:59.6631058Z SETTING_EXPERIMENTS = "experiments" 2024-12-17T23:33:59.6631816Z  2024-12-17T23:33:59.6632364Z LF_FLEET_EXPERIMENT = "lf" 2024-12-17T23:33:59.6632974Z CANARY_FLEET_SUFFIX = ".c" 2024-12-17T23:33:59.6633671Z  2024-12-17T23:33:59.6634185Z  2024-12-17T23:33:59.6634671Z class Experiment(NamedTuple): 2024-12-17T23:33:59.6635425Z  rollout_perc: float = ( 2024-12-17T23:33:59.6636315Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2024-12-17T23:33:59.6637169Z  ) 2024-12-17T23:33:59.6637778Z  all_branches: bool = ( 2024-12-17T23:33:59.6638646Z  False # If True, the experiment is also enabled on the exception branches 2024-12-17T23:33:59.6639488Z  ) 2024-12-17T23:33:59.6640157Z  default: bool = ( 2024-12-17T23:33:59.6640944Z  True # If True, the experiment is enabled by default for all queries 2024-12-17T23:33:59.6641753Z  ) 2024-12-17T23:33:59.6642374Z  2024-12-17T23:33:59.6642864Z  # Add more fields as needed 2024-12-17T23:33:59.6643491Z  2024-12-17T23:33:59.6644069Z  2024-12-17T23:33:59.6644560Z class Settings(NamedTuple): 2024-12-17T23:33:59.6645196Z  """ 2024-12-17T23:33:59.6645928Z  Settings for the experiments that can be opted into. 2024-12-17T23:33:59.6646657Z  """ 2024-12-17T23:33:59.6647175Z  2024-12-17T23:33:59.6647822Z  experiments: Dict[str, Experiment] = {} 2024-12-17T23:33:59.6648473Z  2024-12-17T23:33:59.6648960Z  2024-12-17T23:33:59.6649801Z class ColorFormatter(logging.Formatter): 2024-12-17T23:33:59.6650660Z  """Color codes the log messages based on the log level""" 2024-12-17T23:33:59.6651413Z  2024-12-17T23:33:59.6652003Z  COLORS = { 2024-12-17T23:33:59.6652591Z  "WARNING": "\033[33m", # Yellow 2024-12-17T23:33:59.6653268Z  "ERROR": "\033[31m", # Red 2024-12-17T23:33:59.6654038Z  "CRITICAL": "\033[31m", # Red 2024-12-17T23:33:59.6655109Z  "INFO": "\033[0m", # Reset 2024-12-17T23:33:59.6655825Z  "DEBUG": "\033[0m", # Reset 2024-12-17T23:33:59.6656616Z  } 2024-12-17T23:33:59.6657114Z  2024-12-17T23:33:59.6657680Z  def format(self, record: LogRecord) -> str: 2024-12-17T23:33:59.6658764Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-12-17T23:33:59.6659760Z  record.msg = f"{log_color}{record.msg}\033[0m" 2024-12-17T23:33:59.6660494Z  return super().format(record) 2024-12-17T23:33:59.6661310Z  2024-12-17T23:33:59.6661798Z  2024-12-17T23:33:59.6662293Z handler = logging.StreamHandler() 2024-12-17T23:33:59.6663381Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-12-17T23:33:59.6664298Z  2024-12-17T23:33:59.6664874Z log = logging.getLogger(os.path.basename(__file__)) 2024-12-17T23:33:59.6665766Z log.addHandler(handler) 2024-12-17T23:33:59.6666416Z log.setLevel(logging.INFO) 2024-12-17T23:33:59.6667003Z  2024-12-17T23:33:59.6667595Z  2024-12-17T23:33:59.6668221Z def set_github_output(key: str, value: str) -> None: 2024-12-17T23:33:59.6668931Z  """ 2024-12-17T23:33:59.6669740Z  Defines outputs of the github action that invokes this script 2024-12-17T23:33:59.6670565Z  """ 2024-12-17T23:33:59.6671062Z  if not GITHUB_OUTPUT: 2024-12-17T23:33:59.6672496Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-12-17T23:33:59.6674025Z  log.warning( 2024-12-17T23:33:59.6675195Z  "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:59.6676295Z  ) 2024-12-17T23:33:59.6676938Z  print(f"::set-output name={key}::{value}") 2024-12-17T23:33:59.6677721Z  return 2024-12-17T23:33:59.6678264Z  2024-12-17T23:33:59.6678855Z  with open(GITHUB_OUTPUT, "a") as f: 2024-12-17T23:33:59.6679691Z  log.info(f"Setting output: {key}='{value}'") 2024-12-17T23:33:59.6680433Z  f.write(f"{key}={value}\n") 2024-12-17T23:33:59.6681119Z  2024-12-17T23:33:59.6681683Z  2024-12-17T23:33:59.6682358Z def _str_comma_separated_to_set(value: str) -> FrozenSet[str]: 2024-12-17T23:33:59.6683212Z  return frozenset( 2024-12-17T23:33:59.6684101Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2024-12-17T23:33:59.6684999Z  ) 2024-12-17T23:33:59.6685485Z  2024-12-17T23:33:59.6686029Z  2024-12-17T23:33:59.6686593Z def parse_args() -> Any: 2024-12-17T23:33:59.6687333Z  parser = ArgumentParser("Get dynamic rollout settings") 2024-12-17T23:33:59.6688468Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-12-17T23:33:59.6689458Z  parser.add_argument( 2024-12-17T23:33:59.6690080Z  "--github-issue-repo", 2024-12-17T23:33:59.6690788Z  type=str, 2024-12-17T23:33:59.6691423Z  required=False, 2024-12-17T23:33:59.6692194Z  default="pytorch/test-infra", 2024-12-17T23:33:59.6693021Z  help="GitHub repo to get the issue", 2024-12-17T23:33:59.6693756Z  ) 2024-12-17T23:33:59.6694269Z  parser.add_argument( 2024-12-17T23:33:59.6695146Z  "--github-repo", 2024-12-17T23:33:59.6695808Z  type=str, 2024-12-17T23:33:59.6696380Z  required=True, 2024-12-17T23:33:59.6697126Z  help="GitHub repo where CI is running", 2024-12-17T23:33:59.6697837Z  ) 2024-12-17T23:33:59.6698346Z  parser.add_argument( 2024-12-17T23:33:59.6699244Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2024-12-17T23:33:59.6700131Z  ) 2024-12-17T23:33:59.6700688Z  parser.add_argument( 2024-12-17T23:33:59.6701559Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-12-17T23:33:59.6702451Z  ) 2024-12-17T23:33:59.6703020Z  parser.add_argument( 2024-12-17T23:33:59.6703909Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-12-17T23:33:59.6704809Z  ) 2024-12-17T23:33:59.6705366Z  parser.add_argument( 2024-12-17T23:33:59.6706268Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-12-17T23:33:59.6707189Z  ) 2024-12-17T23:33:59.6707746Z  parser.add_argument( 2024-12-17T23:33:59.6708404Z  "--github-ref-type", 2024-12-17T23:33:59.6709073Z  type=str, 2024-12-17T23:33:59.6709686Z  required=True, 2024-12-17T23:33:59.6710400Z  help="Current GitHub ref type, branch or tag", 2024-12-17T23:33:59.6711161Z  ) 2024-12-17T23:33:59.6711713Z  parser.add_argument( 2024-12-17T23:33:59.6712383Z  "--eligible-experiments", 2024-12-17T23:33:59.6713139Z  type=_str_comma_separated_to_set, 2024-12-17T23:33:59.6713837Z  required=False, 2024-12-17T23:33:59.6714516Z  default="", 2024-12-17T23:33:59.6715773Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2024-12-17T23:33:59.6716897Z  ) 2024-12-17T23:33:59.6717526Z  parser.add_argument( 2024-12-17T23:33:59.6718124Z  "--pr-number", 2024-12-17T23:33:59.6718738Z  type=str, 2024-12-17T23:33:59.6719427Z  required=False, 2024-12-17T23:33:59.6720016Z  default="", 2024-12-17T23:33:59.6720716Z  help="the optional PR number where this is run", 2024-12-17T23:33:59.6721543Z  ) 2024-12-17T23:33:59.6722021Z  2024-12-17T23:33:59.6722552Z  return parser.parse_args() 2024-12-17T23:33:59.6723308Z  2024-12-17T23:33:59.6723781Z  2024-12-17T23:33:59.6724393Z def get_gh_client(github_token: str) -> Github: 2024-12-17T23:33:59.6725256Z  auth = Auth.Token(github_token) 2024-12-17T23:33:59.6725917Z  return Github(auth=auth) 2024-12-17T23:33:59.6726554Z  2024-12-17T23:33:59.6727130Z  2024-12-17T23:33:59.6727777Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-12-17T23:33:59.6728649Z  repo = gh.get_repo(repo) 2024-12-17T23:33:59.6729428Z  return repo.get_issue(number=issue_num) 2024-12-17T23:33:59.6730096Z  2024-12-17T23:33:59.6730600Z  2024-12-17T23:33:59.6731301Z def get_potential_pr_author( 2024-12-17T23:33:59.6732182Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-12-17T23:33:59.6733036Z ) -> str: 2024-12-17T23:33:59.6733840Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2024-12-17T23:33:59.6735485Z  # Fetch the actual username from the original PR. The PR number is 2024-12-17T23:33:59.6736507Z  # embedded in the tag name: ciflow// 2024-12-17T23:33:59.6737379Z  2024-12-17T23:33:59.6737902Z  gh = get_gh_client(github_token) 2024-12-17T23:33:59.6738567Z  2024-12-17T23:33:59.6739300Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-12-17T23:33:59.6740090Z  split_tag = ref_name.split("/") 2024-12-17T23:33:59.6740752Z  if ( 2024-12-17T23:33:59.6741419Z  len(split_tag) == 3 2024-12-17T23:33:59.6742063Z  and split_tag[0] == "ciflow" 2024-12-17T23:33:59.6742765Z  and split_tag[2].isnumeric() 2024-12-17T23:33:59.6743537Z  ): 2024-12-17T23:33:59.6744082Z  pr_number = split_tag[2] 2024-12-17T23:33:59.6744754Z  try: 2024-12-17T23:33:59.6745494Z  repository = gh.get_repo(repo) 2024-12-17T23:33:59.6746282Z  pull = repository.get_pull(number=int(pr_number)) 2024-12-17T23:33:59.6747075Z  except Exception as e: 2024-12-17T23:33:59.6747904Z  raise Exception( # noqa: TRY002 2024-12-17T23:33:59.6748782Z  f"issue with pull request {pr_number} from repo {repository}" 2024-12-17T23:33:59.6749558Z  ) from e 2024-12-17T23:33:59.6750315Z  return pull.user.login 2024-12-17T23:33:59.6751105Z  # In all other cases, return the original input username 2024-12-17T23:33:59.6751832Z  return username 2024-12-17T23:33:59.6752518Z  2024-12-17T23:33:59.6753017Z  2024-12-17T23:33:59.6753562Z def is_exception_branch(branch: str) -> bool: 2024-12-17T23:33:59.6754365Z  """ 2024-12-17T23:33:59.6755245Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-12-17T23:33:59.6756184Z  """ 2024-12-17T23:33:59.6757013Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-12-17T23:33:59.6758064Z  2024-12-17T23:33:59.6758506Z  2024-12-17T23:33:59.6759149Z def load_yaml(yaml_text: str) -> Any: 2024-12-17T23:33:59.6759838Z  try: 2024-12-17T23:33:59.6760356Z  data = yaml.safe_load(yaml_text) 2024-12-17T23:33:59.6761173Z  return data 2024-12-17T23:33:59.6761822Z  except yaml.YAMLError: 2024-12-17T23:33:59.6762575Z  log.exception("Error loading YAML") 2024-12-17T23:33:59.6763245Z  raise 2024-12-17T23:33:59.6763807Z  2024-12-17T23:33:59.6764329Z  2024-12-17T23:33:59.6765107Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-12-17T23:33:59.6766070Z  """ 2024-12-17T23:33:59.6766951Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-12-17T23:33:59.6767890Z  2024-12-17T23:33:59.6768610Z  If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:59.6769642Z  and the text below is the list of opted in users. 2024-12-17T23:33:59.6770381Z  2024-12-17T23:33:59.6771143Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-12-17T23:33:59.6772082Z  """ 2024-12-17T23:33:59.6772716Z  rollout_state_parts = rollout_state.split("---") 2024-12-17T23:33:59.6773493Z  if len(rollout_state_parts) >= 2: 2024-12-17T23:33:59.6774351Z  return rollout_state_parts[0], rollout_state_parts[1] 2024-12-17T23:33:59.6775513Z  else: 2024-12-17T23:33:59.6776229Z  return "", rollout_state 2024-12-17T23:33:59.6777000Z  2024-12-17T23:33:59.6777514Z  2024-12-17T23:33:59.6778030Z class UserOptins(Dict[str, List[str]]): 2024-12-17T23:33:59.6778800Z  """ 2024-12-17T23:33:59.6779557Z  Dictionary of users with a list of features they have opted into 2024-12-17T23:33:59.6780342Z  """ 2024-12-17T23:33:59.6780918Z  2024-12-17T23:33:59.6781431Z  2024-12-17T23:33:59.6782106Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-12-17T23:33:59.6783019Z  """ 2024-12-17T23:33:59.6783964Z  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:59.6784965Z  2024-12-17T23:33:59.6786007Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-12-17T23:33:59.6787257Z  - Example line: "@User1,lf,split_build" 2024-12-17T23:33:59.6788148Z  - A "#" prefix indicates the user is opted out of all experiments 2024-12-17T23:33:59.6788985Z  2024-12-17T23:33:59.6789504Z  2024-12-17T23:33:59.6789999Z  """ 2024-12-17T23:33:59.6790556Z  optins = UserOptins() 2024-12-17T23:33:59.6791286Z  for user in user_optin_text.split("\n"): 2024-12-17T23:33:59.6792052Z  user = user.strip("\r\n\t -") 2024-12-17T23:33:59.6792809Z  if not user or not user.startswith("@"): 2024-12-17T23:33:59.6793580Z  # Not a valid user. Skip 2024-12-17T23:33:59.6794241Z  continue 2024-12-17T23:33:59.6794834Z  2024-12-17T23:33:59.6795362Z  if user: 2024-12-17T23:33:59.6795999Z  usr_name = user.split(",")[0].strip("@") 2024-12-17T23:33:59.6796915Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-12-17T23:33:59.6797796Z  2024-12-17T23:33:59.6798297Z  return optins 2024-12-17T23:33:59.6798883Z  2024-12-17T23:33:59.6799582Z  2024-12-17T23:33:59.6800260Z def is_valid_experiment_name(experiment_name: str) -> bool: 2024-12-17T23:33:59.6801078Z  """ 2024-12-17T23:33:59.6801785Z  Check if the experiment name is valid. 2024-12-17T23:33:59.6802647Z  A valid name: 2024-12-17T23:33:59.6803583Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2024-12-17T23:33:59.6804777Z  - The special characters "_" & "-" shouldn't be the first or last characters 2024-12-17T23:33:59.6805668Z  - Cannot contain spaces 2024-12-17T23:33:59.6806425Z  """ 2024-12-17T23:33:59.6806902Z  2024-12-17T23:33:59.6807533Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2024-12-17T23:33:59.6808534Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2024-12-17T23:33:59.6809275Z  2024-12-17T23:33:59.6809786Z  if valid: 2024-12-17T23:33:59.6810432Z  return True 2024-12-17T23:33:59.6810973Z  2024-12-17T23:33:59.6811485Z  log.error( 2024-12-17T23:33:59.6813252Z  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:59.6815580Z  ) 2024-12-17T23:33:59.6816100Z  return False 2024-12-17T23:33:59.6816773Z  2024-12-17T23:33:59.6817223Z  2024-12-17T23:33:59.6817929Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-12-17T23:33:59.6818807Z  """ 2024-12-17T23:33:59.6819804Z  Parse the experiments from the issue body into a list of ExperimentSettings 2024-12-17T23:33:59.6820691Z  """ 2024-12-17T23:33:59.6821285Z  try: 2024-12-17T23:33:59.6821850Z  if settings_text: 2024-12-17T23:33:59.6822784Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-12-17T23:33:59.6823834Z  # for easy reading 2024-12-17T23:33:59.6824869Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-12-17T23:33:59.6825932Z  # the backtick character in shell commands. 2024-12-17T23:33:59.6826818Z  backtick = chr(96) # backtick character 2024-12-17T23:33:59.6827715Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-12-17T23:33:59.6828567Z  settings = load_yaml(settings_text) 2024-12-17T23:33:59.6829312Z  2024-12-17T23:33:59.6830099Z  # For now we just load experiments. We can expand this if/when we add more settings 2024-12-17T23:33:59.6831020Z  experiments = {} 2024-12-17T23:33:59.6831724Z  2024-12-17T23:33:59.6832462Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-12-17T23:33:59.6833414Z  if not is_valid_experiment_name(exp_name): 2024-12-17T23:33:59.6834848Z  # 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:59.6836056Z  continue 2024-12-17T23:33:59.6836672Z  2024-12-17T23:33:59.6837304Z  valid_settings = {} 2024-12-17T23:33:59.6837978Z  for setting in exp_settings: 2024-12-17T23:33:59.6838725Z  if setting not in Experiment._fields: 2024-12-17T23:33:59.6839569Z  log.warning( 2024-12-17T23:33:59.6840459Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-12-17T23:33:59.6841966Z  ) 2024-12-17T23:33:59.6842682Z  else: 2024-12-17T23:33:59.6843426Z  valid_settings[setting] = exp_settings[setting] 2024-12-17T23:33:59.6844154Z  2024-12-17T23:33:59.6844878Z  experiments[exp_name] = Experiment(**valid_settings) 2024-12-17T23:33:59.6845731Z  return Settings(experiments) 2024-12-17T23:33:59.6846346Z  2024-12-17T23:33:59.6846951Z  except Exception: 2024-12-17T23:33:59.6847663Z  log.exception("Failed to parse settings") 2024-12-17T23:33:59.6848318Z  2024-12-17T23:33:59.6848912Z  return Settings() 2024-12-17T23:33:59.6849531Z  2024-12-17T23:33:59.6849956Z  2024-12-17T23:33:59.6850678Z def parse_settings(rollout_state: str) -> Settings: 2024-12-17T23:33:59.6851459Z  """ 2024-12-17T23:33:59.6852041Z  Parse settings, if any, from the rollout state. 2024-12-17T23:33:59.6852848Z  2024-12-17T23:33:59.6853607Z  If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:59.6854816Z  and the text below is the list of opted in users. 2024-12-17T23:33:59.6855751Z  2024-12-17T23:33:59.6856532Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2024-12-17T23:33:59.6857504Z  """ 2024-12-17T23:33:59.6858263Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:59.6859242Z  return parse_settings_from_text(settings_text) 2024-12-17T23:33:59.6860017Z  2024-12-17T23:33:59.6860681Z  2024-12-17T23:33:59.6861371Z def parse_users(rollout_state: str) -> UserOptins: 2024-12-17T23:33:59.6862217Z  """ 2024-12-17T23:33:59.6862811Z  Parse users from the rollout state. 2024-12-17T23:33:59.6863490Z  2024-12-17T23:33:59.6864038Z  """ 2024-12-17T23:33:59.6864755Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:59.6865702Z  return parse_user_opt_in_from_text(users_text) 2024-12-17T23:33:59.6866485Z  2024-12-17T23:33:59.6866952Z  2024-12-17T23:33:59.6867763Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:59.6868757Z  """ 2024-12-17T23:33:59.6869353Z  Check if a user is opted into an experiment 2024-12-17T23:33:59.6870060Z  """ 2024-12-17T23:33:59.6870786Z  return experiment_name in user_optins.get(user, []) 2024-12-17T23:33:59.6871551Z  2024-12-17T23:33:59.6872054Z  2024-12-17T23:33:59.6872906Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:59.6873890Z  """ 2024-12-17T23:33:59.6874526Z  Check if a user explicitly opted out of an experiment 2024-12-17T23:33:59.6875335Z  """ 2024-12-17T23:33:59.6876063Z  # if the experiment is prefixed with a "-", then it's an opt-out 2024-12-17T23:33:59.6876938Z  experiment_optout = "-" + experiment_name 2024-12-17T23:33:59.6877850Z  if experiment_optout not in user_optins.get(user, []): 2024-12-17T23:33:59.6878656Z  return False 2024-12-17T23:33:59.6879214Z  2024-12-17T23:33:59.6879980Z  if is_user_opted_in(user, user_optins, experiment_name): 2024-12-17T23:33:59.6880815Z  log.warning( 2024-12-17T23:33:59.6881802Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2024-12-17T23:33:59.6882916Z  ) 2024-12-17T23:33:59.6883471Z  2024-12-17T23:33:59.6884152Z  return True 2024-12-17T23:33:59.6884789Z  2024-12-17T23:33:59.6885313Z  2024-12-17T23:33:59.6885785Z def get_runner_prefix( 2024-12-17T23:33:59.6886477Z  rollout_state: str, 2024-12-17T23:33:59.6887182Z  workflow_requestors: Iterable[str], 2024-12-17T23:33:59.6887864Z  branch: str, 2024-12-17T23:33:59.6888602Z  eligible_experiments: FrozenSet[str] = frozenset(), 2024-12-17T23:33:59.6889421Z  is_canary: bool = False, 2024-12-17T23:33:59.6890052Z ) -> str: 2024-12-17T23:33:59.6890683Z  settings = parse_settings(rollout_state) 2024-12-17T23:33:59.6891479Z  user_optins = parse_users(rollout_state) 2024-12-17T23:33:59.6892179Z  2024-12-17T23:33:59.6892714Z  fleet_prefix = "" 2024-12-17T23:33:59.6893343Z  prefixes = [] 2024-12-17T23:33:59.6894187Z  for experiment_name, experiment_settings in settings.experiments.items(): 2024-12-17T23:33:59.6895957Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2024-12-17T23:33:59.6896883Z  log.info( 2024-12-17T23:33:59.6897807Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-12-17T23:33:59.6898803Z  ) 2024-12-17T23:33:59.6899329Z  continue 2024-12-17T23:33:59.6899913Z  2024-12-17T23:33:59.6900504Z  if eligible_experiments: 2024-12-17T23:33:59.6901230Z  if experiment_name not in eligible_experiments: 2024-12-17T23:33:59.6902074Z  exp_list = ", ".join(eligible_experiments) 2024-12-17T23:33:59.6903027Z  log.info( 2024-12-17T23:33:59.6904037Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2024-12-17T23:33:59.6905102Z  ) 2024-12-17T23:33:59.6905770Z  continue 2024-12-17T23:33:59.6906430Z  elif not experiment_settings.default: 2024-12-17T23:33:59.6907136Z  log.info( 2024-12-17T23:33:59.6908078Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2024-12-17T23:33:59.6909001Z  ) 2024-12-17T23:33:59.6909521Z  continue 2024-12-17T23:33:59.6910153Z  2024-12-17T23:33:59.6910806Z  # Is any workflow_requestor opted out to this experiment? 2024-12-17T23:33:59.6911569Z  opted_out_users = [ 2024-12-17T23:33:59.6912274Z  requestor 2024-12-17T23:33:59.6912977Z  for requestor in workflow_requestors 2024-12-17T23:33:59.6913813Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2024-12-17T23:33:59.6914721Z  ] 2024-12-17T23:33:59.6915262Z  2024-12-17T23:33:59.6915736Z  if opted_out_users: 2024-12-17T23:33:59.6916447Z  log.info( 2024-12-17T23:33:59.6917292Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2024-12-17T23:33:59.6918140Z  ) 2024-12-17T23:33:59.6918782Z  continue 2024-12-17T23:33:59.6919364Z  2024-12-17T23:33:59.6919964Z  # Is any workflow_requestor opted in to this experiment? 2024-12-17T23:33:59.6920841Z  opted_in_users = [ 2024-12-17T23:33:59.6921473Z  requestor 2024-12-17T23:33:59.6922098Z  for requestor in workflow_requestors 2024-12-17T23:33:59.6923053Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2024-12-17T23:33:59.6923865Z  ] 2024-12-17T23:33:59.6924389Z  2024-12-17T23:33:59.6925124Z  enabled = False 2024-12-17T23:33:59.6925756Z  if opted_in_users: 2024-12-17T23:33:59.6926381Z  log.info( 2024-12-17T23:33:59.6927250Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-12-17T23:33:59.6928111Z  ) 2024-12-17T23:33:59.6928684Z  enabled = True 2024-12-17T23:33:59.6929349Z  2024-12-17T23:33:59.6929928Z  elif experiment_settings.rollout_perc: 2024-12-17T23:33:59.6930969Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-12-17T23:33:59.6932259Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-12-17T23:33:59.6933109Z  log.info( 2024-12-17T23:33:59.6934246Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-12-17T23:33:59.6935780Z  ) 2024-12-17T23:33:59.6936358Z  enabled = True 2024-12-17T23:33:59.6937088Z  2024-12-17T23:33:59.6937639Z  if enabled: 2024-12-17T23:33:59.6938238Z  label = experiment_name 2024-12-17T23:33:59.6939056Z  if experiment_name == LF_FLEET_EXPERIMENT: 2024-12-17T23:33:59.6940141Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-12-17T23:33:59.6941182Z  # - If it's enabled, then we always list it's prefix first 2024-12-17T23:33:59.6942362Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-12-17T23:33:59.6943285Z  if is_canary: 2024-12-17T23:33:59.6943978Z  label += CANARY_FLEET_SUFFIX 2024-12-17T23:33:59.6944729Z  fleet_prefix = label 2024-12-17T23:33:59.6945431Z  else: 2024-12-17T23:33:59.6946054Z  prefixes.append(label) 2024-12-17T23:33:59.6946744Z  2024-12-17T23:33:59.6947287Z  if len(prefixes) > 1: 2024-12-17T23:33:59.6947916Z  log.error( 2024-12-17T23:33:59.6949224Z  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:59.6950557Z  ) 2024-12-17T23:33:59.6951112Z  prefixes = prefixes[:1] 2024-12-17T23:33:59.6951858Z  2024-12-17T23:33:59.6952345Z  # Fleet always comes first 2024-12-17T23:33:59.6953018Z  if fleet_prefix: 2024-12-17T23:33:59.6953745Z  prefixes.insert(0, fleet_prefix) 2024-12-17T23:33:59.6954394Z  2024-12-17T23:33:59.6955018Z  return ".".join(prefixes) + "." if prefixes else "" 2024-12-17T23:33:59.6955825Z  2024-12-17T23:33:59.6956276Z  2024-12-17T23:33:59.6957106Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-12-17T23:33:59.6958133Z  """ 2024-12-17T23:33:59.6958915Z  Gets the first comment of the issue, which contains the desired rollout state. 2024-12-17T23:33:59.6959819Z  2024-12-17T23:33:59.6960658Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-12-17T23:33:59.6961569Z  """ 2024-12-17T23:33:59.6962153Z  gh = get_gh_client(github_token) 2024-12-17T23:33:59.6962952Z  issue = get_issue(gh, repo, issue_num) 2024-12-17T23:33:59.6963769Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-12-17T23:33:59.6964552Z  2024-12-17T23:33:59.6965100Z  2024-12-17T23:33:59.6965877Z def download_json(url: str, headers: Dict[str, str], num_retries: int = 3) -> Any: 2024-12-17T23:33:59.6966971Z  for _ in range(num_retries): 2024-12-17T23:33:59.6967705Z  try: 2024-12-17T23:33:59.6968336Z  req = Request(url=url, headers=headers) 2024-12-17T23:33:59.6969159Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2024-12-17T23:33:59.6970076Z  return json.loads(content) 2024-12-17T23:33:59.6970779Z  except Exception as e: 2024-12-17T23:33:59.6971486Z  log.warning(f"Could not download {url}: {e}") 2024-12-17T23:33:59.6972284Z  2024-12-17T23:33:59.6973028Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2024-12-17T23:33:59.6973888Z  return {} 2024-12-17T23:33:59.6974752Z  2024-12-17T23:33:59.6975270Z  2024-12-17T23:33:59.6975734Z @lru_cache(maxsize=None) 2024-12-17T23:33:59.6976790Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> Dict[str, Any]: 2024-12-17T23:33:59.6977726Z  """ 2024-12-17T23:33:59.6978302Z  Dynamically get PR information 2024-12-17T23:33:59.6979023Z  """ 2024-12-17T23:33:59.6979708Z  github_api = f"https://api.github.com/repos/{github_repo}" 2024-12-17T23:33:59.6980505Z  headers = { 2024-12-17T23:33:59.6981195Z  "Accept": "application/vnd.github.v3+json", 2024-12-17T23:33:59.6981989Z  "Authorization": f"token {github_token}", 2024-12-17T23:33:59.6982683Z  } 2024-12-17T23:33:59.6983349Z  json_response: Dict[str, Any] = download_json( 2024-12-17T23:33:59.6984308Z  url=f"{github_api}/issues/{pr_number}", 2024-12-17T23:33:59.6985040Z  headers=headers, 2024-12-17T23:33:59.6985714Z  ) 2024-12-17T23:33:59.6986246Z  2024-12-17T23:33:59.6986749Z  if not json_response: 2024-12-17T23:33:59.6987573Z  log.warning(f"Failed to get the labels for #{pr_number}") 2024-12-17T23:33:59.6988388Z  return {} 2024-12-17T23:33:59.6988940Z  2024-12-17T23:33:59.6989482Z  return json_response 2024-12-17T23:33:59.6990105Z  2024-12-17T23:33:59.6990566Z  2024-12-17T23:33:59.6991411Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> Set[str]: 2024-12-17T23:33:59.6992350Z  """ 2024-12-17T23:33:59.6993048Z  Dynamically get the latest list of labels from the pull request 2024-12-17T23:33:59.6993971Z  """ 2024-12-17T23:33:59.6994623Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2024-12-17T23:33:59.6995386Z  return { 2024-12-17T23:33:59.6996265Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2024-12-17T23:33:59.6997103Z  } 2024-12-17T23:33:59.6997590Z  2024-12-17T23:33:59.6998157Z  2024-12-17T23:33:59.6998618Z def main() -> None: 2024-12-17T23:33:59.6999201Z  args = parse_args() 2024-12-17T23:33:59.6999903Z  2024-12-17T23:33:59.7000439Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-12-17T23:33:59.7001117Z  2024-12-17T23:33:59.7001735Z  # Check if the PR is opt-out 2024-12-17T23:33:59.7002378Z  if args.pr_number: 2024-12-17T23:33:59.7003224Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2024-12-17T23:33:59.7004245Z  if OPT_OUT_LABEL in labels: 2024-12-17T23:33:59.7004877Z  log.info( 2024-12-17T23:33:59.7005776Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2024-12-17T23:33:59.7006843Z  ) 2024-12-17T23:33:59.7007744Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:59.7008603Z  sys.exit() 2024-12-17T23:33:59.7009296Z  2024-12-17T23:33:59.7009786Z  try: 2024-12-17T23:33:59.7010361Z  rollout_state = get_rollout_state_from_issue( 2024-12-17T23:33:59.7011367Z  args.github_token, args.github_issue_repo, args.github_issue 2024-12-17T23:33:59.7012197Z  ) 2024-12-17T23:33:59.7012668Z  2024-12-17T23:33:59.7013294Z  username = get_potential_pr_author( 2024-12-17T23:33:59.7014011Z  args.github_token, 2024-12-17T23:33:59.7014925Z  args.github_repo, 2024-12-17T23:33:59.7015725Z  args.github_actor, 2024-12-17T23:33:59.7016432Z  args.github_ref_type, 2024-12-17T23:33:59.7017078Z  args.github_branch, 2024-12-17T23:33:59.7017813Z  ) 2024-12-17T23:33:59.7018348Z  2024-12-17T23:33:59.7018940Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-12-17T23:33:59.7019812Z  2024-12-17T23:33:59.7020392Z  runner_label_prefix = get_runner_prefix( 2024-12-17T23:33:59.7021058Z  rollout_state, 2024-12-17T23:33:59.7021839Z  (args.github_issue_owner, username), 2024-12-17T23:33:59.7022547Z  args.github_branch, 2024-12-17T23:33:59.7023391Z  args.eligible_experiments, 2024-12-17T23:33:59.7024068Z  is_canary, 2024-12-17T23:33:59.7024653Z  ) 2024-12-17T23:33:59.7025218Z  2024-12-17T23:33:59.7025727Z  except Exception as e: 2024-12-17T23:33:59.7026527Z  log.error( 2024-12-17T23:33:59.7027537Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-12-17T23:33:59.7028466Z  ) 2024-12-17T23:33:59.7028991Z  2024-12-17T23:33:59.7029737Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:59.7030542Z  2024-12-17T23:33:59.7031024Z  2024-12-17T23:33:59.7031578Z if __name__ == "__main__": 2024-12-17T23:33:59.7032176Z  main() 2024-12-17T23:33:59.7032695Z  2024-12-17T23:33:59.7033239Z EOF 2024-12-17T23:33:59.7033709Z  2024-12-17T23:33:59.7034227Z cat runner_determinator.py 2024-12-17T23:33:59.7379628Z shell: /usr/bin/bash -e {0} 2024-12-17T23:33:59.7380612Z env: 2024-12-17T23:33:59.7381596Z GITHUB_TOKEN: *** 2024-12-17T23:33:59.7382142Z ISSUE_NUMBER: 5132 2024-12-17T23:33:59.7382726Z TRIGGERING_ACTOR: malfet 2024-12-17T23:33:59.7383405Z ISSUE_OWNER: 2024-12-17T23:33:59.7383914Z CHECK_EXPERIMENTS: 2024-12-17T23:33:59.7384486Z PR_NUMBER: 2024-12-17T23:33:59.7385059Z ##[endgroup] 2024-12-17T23:33:59.7617766Z # flake8: noqa: G004 2024-12-17T23:33:59.7618196Z 2024-12-17T23:33:59.7618792Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-12-17T23:33:59.7619951Z # must be kept in sync. You can do it easily by running the following command: 2024-12-17T23:33:59.7620846Z # python .github/scripts/update_runner_determinator.py 2024-12-17T23:33:59.7621353Z 2024-12-17T23:33:59.7621626Z """ 2024-12-17T23:33:59.7622357Z This runner determinator is used to determine which set of runners to run a 2024-12-17T23:33:59.7623375Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-12-17T23:33:59.7624447Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-12-17T23:33:59.7625466Z of which runners should be used to run which job. 2024-12-17T23:33:59.7625914Z 2024-12-17T23:33:59.7626388Z The configuration has two parts, the settings and a list of opted-in users, 2024-12-17T23:33:59.7627440Z separated by a line containing "---". If the line is not present, the 2024-12-17T23:33:59.7628743Z settings are considered to be empty with only the second part, the user 2024-12-17T23:33:59.7629576Z list, defined. 2024-12-17T23:33:59.7629836Z 2024-12-17T23:33:59.7630363Z The first part is a YAML block that defines the rollout settings. This can be 2024-12-17T23:33:59.7631470Z used to define any settings that are needed to determine which runners to use. 2024-12-17T23:33:59.7632424Z It's fields are defined by the RolloutSettings class below. 2024-12-17T23:33:59.7632903Z 2024-12-17T23:33:59.7633450Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-12-17T23:33:59.7634424Z The user list is also a comma separated list of additional features or 2024-12-17T23:33:59.7635284Z experiments which the user could be opted in to. 2024-12-17T23:33:59.7635724Z 2024-12-17T23:33:59.7636099Z The user list has the following rules: 2024-12-17T23:33:59.7636502Z 2024-12-17T23:33:59.7636856Z - Users are GitHub usernames, which must start with the @ prefix 2024-12-17T23:33:59.7637875Z - Each user is also a comma-separated list of features/experiments to enable 2024-12-17T23:33:59.7638873Z - A "#" prefix opts the user out of all experiments 2024-12-17T23:33:59.7639324Z 2024-12-17T23:33:59.7639532Z Example config: 2024-12-17T23:33:59.7640119Z # A list of experiments that can be opted into. 2024-12-17T23:33:59.7641003Z # This defines the behavior they'll induce when opted into. 2024-12-17T23:33:59.7641719Z # Expected syntax is: 2024-12-17T23:33:59.7642503Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-12-17T23:33:59.7643686Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-12-17T23:33:59.7644350Z 2024-12-17T23:33:59.7644772Z experiments: 2024-12-17T23:33:59.7645267Z lf: 2024-12-17T23:33:59.7645914Z rollout_percent: 25 2024-12-17T23:33:59.7646513Z all_branches: false 2024-12-17T23:33:59.7647056Z default: true 2024-12-17T23:33:59.7647667Z --- 2024-12-17T23:33:59.7647914Z 2024-12-17T23:33:59.7648178Z # Opt-ins: 2024-12-17T23:33:59.7648858Z # Users can opt into the LF fleet by adding their GitHub username to this list 2024-12-17T23:33:59.7649925Z # and specifying experiments to enable in a comma-separated list. 2024-12-17T23:33:59.7650841Z # To always opt out of an experiment, prefix it with a "-". 2024-12-17T23:33:59.7651573Z # Experiments should be from the above list. 2024-12-17T23:33:59.7652089Z 2024-12-17T23:33:59.7652323Z @User1,-lf,split_build 2024-12-17T23:33:59.7652894Z @User2,lf 2024-12-17T23:33:59.7653356Z @User3,split_build 2024-12-17T23:33:59.7653950Z """ 2024-12-17T23:33:59.7654198Z 2024-12-17T23:33:59.7654723Z import json 2024-12-17T23:33:59.7655230Z import logging 2024-12-17T23:33:59.7655844Z import os 2024-12-17T23:33:59.7656332Z import random 2024-12-17T23:33:59.7656802Z import re 2024-12-17T23:33:59.7657364Z import sys 2024-12-17T23:33:59.7657871Z from argparse import ArgumentParser 2024-12-17T23:33:59.7658484Z from functools import lru_cache 2024-12-17T23:33:59.7659178Z from logging import LogRecord 2024-12-17T23:33:59.7659996Z from typing import Any, Dict, FrozenSet, Iterable, List, NamedTuple, Set, Tuple 2024-12-17T23:33:59.7660873Z from urllib.request import Request, urlopen 2024-12-17T23:33:59.7661391Z 2024-12-17T23:33:59.7661606Z import yaml 2024-12-17T23:33:59.7662096Z from github import Auth, Github 2024-12-17T23:33:59.7662660Z from github.Issue import Issue 2024-12-17T23:33:59.7663107Z 2024-12-17T23:33:59.7663114Z 2024-12-17T23:33:59.7663381Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-12-17T23:33:59.7664238Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-12-17T23:33:59.7665212Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-12-17T23:33:59.7665931Z 2024-12-17T23:33:59.7666215Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-12-17T23:33:59.7667142Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-12-17T23:33:59.7667771Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-12-17T23:33:59.7668518Z OPT_OUT_LABEL = "no-runner-experiments" 2024-12-17T23:33:59.7668954Z 2024-12-17T23:33:59.7669187Z SETTING_EXPERIMENTS = "experiments" 2024-12-17T23:33:59.7669586Z 2024-12-17T23:33:59.7669822Z LF_FLEET_EXPERIMENT = "lf" 2024-12-17T23:33:59.7670436Z CANARY_FLEET_SUFFIX = ".c" 2024-12-17T23:33:59.7670803Z 2024-12-17T23:33:59.7670810Z 2024-12-17T23:33:59.7671051Z class Experiment(NamedTuple): 2024-12-17T23:33:59.7671628Z rollout_perc: float = ( 2024-12-17T23:33:59.7672433Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2024-12-17T23:33:59.7673264Z ) 2024-12-17T23:33:59.7673724Z all_branches: bool = ( 2024-12-17T23:33:59.7674532Z False # If True, the experiment is also enabled on the exception branches 2024-12-17T23:33:59.7675341Z ) 2024-12-17T23:33:59.7675792Z default: bool = ( 2024-12-17T23:33:59.7676533Z True # If True, the experiment is enabled by default for all queries 2024-12-17T23:33:59.7677313Z ) 2024-12-17T23:33:59.7677550Z 2024-12-17T23:33:59.7677795Z # Add more fields as needed 2024-12-17T23:33:59.7678221Z 2024-12-17T23:33:59.7678228Z 2024-12-17T23:33:59.7678526Z class Settings(NamedTuple): 2024-12-17T23:33:59.7679061Z """ 2024-12-17T23:33:59.7679614Z Settings for the experiments that can be opted into. 2024-12-17T23:33:59.7680395Z """ 2024-12-17T23:33:59.7680648Z 2024-12-17T23:33:59.7680893Z experiments: Dict[str, Experiment] = {} 2024-12-17T23:33:59.7681341Z 2024-12-17T23:33:59.7681347Z 2024-12-17T23:33:59.7681579Z class ColorFormatter(logging.Formatter): 2024-12-17T23:33:59.7682418Z """Color codes the log messages based on the log level""" 2024-12-17T23:33:59.7683065Z 2024-12-17T23:33:59.7683290Z COLORS = { 2024-12-17T23:33:59.7683791Z "WARNING": "\033[33m", # Yellow 2024-12-17T23:33:59.7684525Z "ERROR": "\033[31m", # Red 2024-12-17T23:33:59.7685118Z "CRITICAL": "\033[31m", # Red 2024-12-17T23:33:59.7685710Z "INFO": "\033[0m", # Reset 2024-12-17T23:33:59.7686402Z "DEBUG": "\033[0m", # Reset 2024-12-17T23:33:59.7686951Z } 2024-12-17T23:33:59.7687221Z 2024-12-17T23:33:59.7687485Z def format(self, record: LogRecord) -> str: 2024-12-17T23:33:59.7688465Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-12-17T23:33:59.7689327Z record.msg = f"{log_color}{record.msg}\033[0m" 2024-12-17T23:33:59.7690029Z return super().format(record) 2024-12-17T23:33:59.7690525Z 2024-12-17T23:33:59.7690535Z 2024-12-17T23:33:59.7690765Z handler = logging.StreamHandler() 2024-12-17T23:33:59.7691647Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-12-17T23:33:59.7692278Z 2024-12-17T23:33:59.7692559Z log = logging.getLogger(os.path.basename(__file__)) 2024-12-17T23:33:59.7693353Z log.addHandler(handler) 2024-12-17T23:33:59.7693943Z log.setLevel(logging.INFO) 2024-12-17T23:33:59.7694284Z 2024-12-17T23:33:59.7694291Z 2024-12-17T23:33:59.7694953Z def set_github_output(key: str, value: str) -> None: 2024-12-17T23:33:59.7695774Z """ 2024-12-17T23:33:59.7696421Z Defines outputs of the github action that invokes this script 2024-12-17T23:33:59.7697114Z """ 2024-12-17T23:33:59.7697708Z if not GITHUB_OUTPUT: 2024-12-17T23:33:59.7698933Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-12-17T23:33:59.7700140Z log.warning( 2024-12-17T23:33:59.7701210Z "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:59.7702284Z ) 2024-12-17T23:33:59.7712408Z print(f"::set-output name={key}::{value}") 2024-12-17T23:33:59.7713151Z return 2024-12-17T23:33:59.7713465Z 2024-12-17T23:33:59.7713726Z with open(GITHUB_OUTPUT, "a") as f: 2024-12-17T23:33:59.7714740Z log.info(f"Setting output: {key}='{value}'") 2024-12-17T23:33:59.7715435Z f.write(f"{key}={value}\n") 2024-12-17T23:33:59.7715867Z 2024-12-17T23:33:59.7715874Z 2024-12-17T23:33:59.7716228Z def _str_comma_separated_to_set(value: str) -> FrozenSet[str]: 2024-12-17T23:33:59.7717054Z return frozenset( 2024-12-17T23:33:59.7717776Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2024-12-17T23:33:59.7718597Z ) 2024-12-17T23:33:59.7718836Z 2024-12-17T23:33:59.7718843Z 2024-12-17T23:33:59.7719152Z def parse_args() -> Any: 2024-12-17T23:33:59.7719802Z parser = ArgumentParser("Get dynamic rollout settings") 2024-12-17T23:33:59.7720819Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-12-17T23:33:59.7721813Z parser.add_argument( 2024-12-17T23:33:59.7722407Z "--github-issue-repo", 2024-12-17T23:33:59.7723006Z type=str, 2024-12-17T23:33:59.7723911Z required=False, 2024-12-17T23:33:59.7724530Z default="pytorch/test-infra", 2024-12-17T23:33:59.7725220Z help="GitHub repo to get the issue", 2024-12-17T23:33:59.7725931Z ) 2024-12-17T23:33:59.7726400Z parser.add_argument( 2024-12-17T23:33:59.7726984Z "--github-repo", 2024-12-17T23:33:59.7727576Z type=str, 2024-12-17T23:33:59.7728068Z required=True, 2024-12-17T23:33:59.7728672Z help="GitHub repo where CI is running", 2024-12-17T23:33:59.7729362Z ) 2024-12-17T23:33:59.7729815Z parser.add_argument( 2024-12-17T23:33:59.7730565Z "--github-issue", type=int, required=True, help="GitHub issue number" 2024-12-17T23:33:59.7731396Z ) 2024-12-17T23:33:59.7731857Z parser.add_argument( 2024-12-17T23:33:59.7732819Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-12-17T23:33:59.7733736Z ) 2024-12-17T23:33:59.7734223Z parser.add_argument( 2024-12-17T23:33:59.7735337Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-12-17T23:33:59.7736266Z ) 2024-12-17T23:33:59.7736745Z parser.add_argument( 2024-12-17T23:33:59.7737529Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-12-17T23:33:59.7738425Z ) 2024-12-17T23:33:59.7738904Z parser.add_argument( 2024-12-17T23:33:59.7739465Z "--github-ref-type", 2024-12-17T23:33:59.7740087Z type=str, 2024-12-17T23:33:59.7740600Z required=True, 2024-12-17T23:33:59.7741215Z help="Current GitHub ref type, branch or tag", 2024-12-17T23:33:59.7741930Z ) 2024-12-17T23:33:59.7742406Z parser.add_argument( 2024-12-17T23:33:59.7742970Z "--eligible-experiments", 2024-12-17T23:33:59.7743660Z type=_str_comma_separated_to_set, 2024-12-17T23:33:59.7744283Z required=False, 2024-12-17T23:33:59.7744813Z default="", 2024-12-17T23:33:59.7745854Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2024-12-17T23:33:59.7746906Z ) 2024-12-17T23:33:59.7747383Z parser.add_argument( 2024-12-17T23:33:59.7748015Z "--pr-number", 2024-12-17T23:33:59.7748526Z type=str, 2024-12-17T23:33:59.7749047Z required=False, 2024-12-17T23:33:59.7749640Z default="", 2024-12-17T23:33:59.7750198Z help="the optional PR number where this is run", 2024-12-17T23:33:59.7750873Z ) 2024-12-17T23:33:59.7751122Z 2024-12-17T23:33:59.7751435Z return parser.parse_args() 2024-12-17T23:33:59.7751802Z 2024-12-17T23:33:59.7751809Z 2024-12-17T23:33:59.7752118Z def get_gh_client(github_token: str) -> Github: 2024-12-17T23:33:59.7752800Z auth = Auth.Token(github_token) 2024-12-17T23:33:59.7753478Z return Github(auth=auth) 2024-12-17T23:33:59.7753839Z 2024-12-17T23:33:59.7753846Z 2024-12-17T23:33:59.7754223Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-12-17T23:33:59.7754946Z repo = gh.get_repo(repo) 2024-12-17T23:33:59.7755821Z return repo.get_issue(number=issue_num) 2024-12-17T23:33:59.7756268Z 2024-12-17T23:33:59.7756277Z 2024-12-17T23:33:59.7756561Z def get_potential_pr_author( 2024-12-17T23:33:59.7757283Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-12-17T23:33:59.7758130Z ) -> str: 2024-12-17T23:33:59.7758805Z # If the trigger was a new tag added by a bot, this is a ciflow case 2024-12-17T23:33:59.7759705Z # Fetch the actual username from the original PR. The PR number is 2024-12-17T23:33:59.7760619Z # embedded in the tag name: ciflow// 2024-12-17T23:33:59.7761159Z 2024-12-17T23:33:59.7761387Z gh = get_gh_client(github_token) 2024-12-17T23:33:59.7761769Z 2024-12-17T23:33:59.7762128Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-12-17T23:33:59.7762881Z split_tag = ref_name.split("/") 2024-12-17T23:33:59.7763540Z if ( 2024-12-17T23:33:59.7764087Z len(split_tag) == 3 2024-12-17T23:33:59.7764743Z and split_tag[0] == "ciflow" 2024-12-17T23:33:59.7765436Z and split_tag[2].isnumeric() 2024-12-17T23:33:59.7766044Z ): 2024-12-17T23:33:59.7766543Z pr_number = split_tag[2] 2024-12-17T23:33:59.7767174Z try: 2024-12-17T23:33:59.7767708Z repository = gh.get_repo(repo) 2024-12-17T23:33:59.7768449Z pull = repository.get_pull(number=int(pr_number)) 2024-12-17T23:33:59.7769202Z except Exception as e: 2024-12-17T23:33:59.7769831Z raise Exception( # noqa: TRY002 2024-12-17T23:33:59.7770647Z f"issue with pull request {pr_number} from repo {repository}" 2024-12-17T23:33:59.7771424Z ) from e 2024-12-17T23:33:59.7771976Z return pull.user.login 2024-12-17T23:33:59.7772871Z # In all other cases, return the original input username 2024-12-17T23:33:59.7773627Z return username 2024-12-17T23:33:59.7773916Z 2024-12-17T23:33:59.7773930Z 2024-12-17T23:33:59.7774250Z def is_exception_branch(branch: str) -> bool: 2024-12-17T23:33:59.7775347Z """ 2024-12-17T23:33:59.7776170Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-12-17T23:33:59.7777089Z """ 2024-12-17T23:33:59.7777898Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-12-17T23:33:59.7778547Z 2024-12-17T23:33:59.7778554Z 2024-12-17T23:33:59.7778796Z def load_yaml(yaml_text: str) -> Any: 2024-12-17T23:33:59.7779423Z try: 2024-12-17T23:33:59.7779930Z data = yaml.safe_load(yaml_text) 2024-12-17T23:33:59.7780586Z return data 2024-12-17T23:33:59.7781133Z except yaml.YAMLError: 2024-12-17T23:33:59.7781751Z log.exception("Error loading YAML") 2024-12-17T23:33:59.7782410Z raise 2024-12-17T23:33:59.7782689Z 2024-12-17T23:33:59.7782734Z 2024-12-17T23:33:59.7783198Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-12-17T23:33:59.7784156Z """ 2024-12-17T23:33:59.7784884Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-12-17T23:33:59.7785565Z 2024-12-17T23:33:59.7785958Z If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:59.7786897Z and the text below is the list of opted in users. 2024-12-17T23:33:59.7787356Z 2024-12-17T23:33:59.7787791Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-12-17T23:33:59.7788630Z """ 2024-12-17T23:33:59.7789241Z rollout_state_parts = rollout_state.split("---") 2024-12-17T23:33:59.7789932Z if len(rollout_state_parts) >= 2: 2024-12-17T23:33:59.7790662Z return rollout_state_parts[0], rollout_state_parts[1] 2024-12-17T23:33:59.7791451Z else: 2024-12-17T23:33:59.7791932Z return "", rollout_state 2024-12-17T23:33:59.7792323Z 2024-12-17T23:33:59.7792330Z 2024-12-17T23:33:59.7792569Z class UserOptins(Dict[str, List[str]]): 2024-12-17T23:33:59.7793483Z """ 2024-12-17T23:33:59.7794124Z Dictionary of users with a list of features they have opted into 2024-12-17T23:33:59.7794842Z """ 2024-12-17T23:33:59.7795180Z 2024-12-17T23:33:59.7795187Z 2024-12-17T23:33:59.7795583Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-12-17T23:33:59.7796358Z """ 2024-12-17T23:33:59.7797152Z 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:59.7797991Z 2024-12-17T23:33:59.7798689Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-12-17T23:33:59.7799824Z - Example line: "@User1,lf,split_build" 2024-12-17T23:33:59.7800624Z - A "#" prefix indicates the user is opted out of all experiments 2024-12-17T23:33:59.7801256Z 2024-12-17T23:33:59.7801266Z 2024-12-17T23:33:59.7801480Z """ 2024-12-17T23:33:59.7801965Z optins = UserOptins() 2024-12-17T23:33:59.7802701Z for user in user_optin_text.split("\n"): 2024-12-17T23:33:59.7803525Z user = user.strip("\r\n\t -") 2024-12-17T23:33:59.7804205Z if not user or not user.startswith("@"): 2024-12-17T23:33:59.7804881Z # Not a valid user. Skip 2024-12-17T23:33:59.7805542Z continue 2024-12-17T23:33:59.7805870Z 2024-12-17T23:33:59.7806070Z if user: 2024-12-17T23:33:59.7806616Z usr_name = user.split(",")[0].strip("@") 2024-12-17T23:33:59.7807479Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-12-17T23:33:59.7808069Z 2024-12-17T23:33:59.7808286Z return optins 2024-12-17T23:33:59.7808581Z 2024-12-17T23:33:59.7808588Z 2024-12-17T23:33:59.7808938Z def is_valid_experiment_name(experiment_name: str) -> bool: 2024-12-17T23:33:59.7809881Z """ 2024-12-17T23:33:59.7810431Z Check if the experiment name is valid. 2024-12-17T23:33:59.7811054Z A valid name: 2024-12-17T23:33:59.7811862Z - Contains only alphanumeric characters and the special characters "_" & "-" 2024-12-17T23:33:59.7812964Z - The special characters "_" & "-" shouldn't be the first or last characters 2024-12-17T23:33:59.7813782Z - Cannot contain spaces 2024-12-17T23:33:59.7814649Z """ 2024-12-17T23:33:59.7815014Z 2024-12-17T23:33:59.7815334Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2024-12-17T23:33:59.7816159Z valid = bool(re.match(valid_char_regex, experiment_name)) 2024-12-17T23:33:59.7816737Z 2024-12-17T23:33:59.7817015Z if valid: 2024-12-17T23:33:59.7817488Z return True 2024-12-17T23:33:59.7817832Z 2024-12-17T23:33:59.7818017Z log.error( 2024-12-17T23:33:59.7819710Z 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:59.7821371Z ) 2024-12-17T23:33:59.7821825Z return False 2024-12-17T23:33:59.7822177Z 2024-12-17T23:33:59.7822184Z 2024-12-17T23:33:59.7822610Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-12-17T23:33:59.7823345Z """ 2024-12-17T23:33:59.7824032Z Parse the experiments from the issue body into a list of ExperimentSettings 2024-12-17T23:33:59.7824975Z """ 2024-12-17T23:33:59.7825400Z try: 2024-12-17T23:33:59.7825864Z if settings_text: 2024-12-17T23:33:59.7826829Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-12-17T23:33:59.7827708Z # for easy reading 2024-12-17T23:33:59.7828626Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-12-17T23:33:59.7829750Z # the backtick character in shell commands. 2024-12-17T23:33:59.7830478Z backtick = chr(96) # backtick character 2024-12-17T23:33:59.7831228Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-12-17T23:33:59.7832303Z settings = load_yaml(settings_text) 2024-12-17T23:33:59.7832734Z 2024-12-17T23:33:59.7833245Z # For now we just load experiments. We can expand this if/when we add more settings 2024-12-17T23:33:59.7834073Z experiments = {} 2024-12-17T23:33:59.7834535Z 2024-12-17T23:33:59.7834935Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-12-17T23:33:59.7835829Z if not is_valid_experiment_name(exp_name): 2024-12-17T23:33:59.7837141Z # 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:59.7838317Z continue 2024-12-17T23:33:59.7838706Z 2024-12-17T23:33:59.7838933Z valid_settings = {} 2024-12-17T23:33:59.7839623Z for setting in exp_settings: 2024-12-17T23:33:59.7840298Z if setting not in Experiment._fields: 2024-12-17T23:33:59.7840997Z log.warning( 2024-12-17T23:33:59.7841874Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-12-17T23:33:59.7842710Z ) 2024-12-17T23:33:59.7843265Z else: 2024-12-17T23:33:59.7843941Z valid_settings[setting] = exp_settings[setting] 2024-12-17T23:33:59.7844435Z 2024-12-17T23:33:59.7844749Z experiments[exp_name] = Experiment(**valid_settings) 2024-12-17T23:33:59.7845516Z return Settings(experiments) 2024-12-17T23:33:59.7845908Z 2024-12-17T23:33:59.7846210Z except Exception: 2024-12-17T23:33:59.7846804Z log.exception("Failed to parse settings") 2024-12-17T23:33:59.7847278Z 2024-12-17T23:33:59.7847639Z return Settings() 2024-12-17T23:33:59.7847976Z 2024-12-17T23:33:59.7847982Z 2024-12-17T23:33:59.7848362Z def parse_settings(rollout_state: str) -> Settings: 2024-12-17T23:33:59.7849110Z """ 2024-12-17T23:33:59.7849609Z Parse settings, if any, from the rollout state. 2024-12-17T23:33:59.7850104Z 2024-12-17T23:33:59.7850573Z If the issue body contains "---" then the text above that is the settings 2024-12-17T23:33:59.7851500Z and the text below is the list of opted in users. 2024-12-17T23:33:59.7851958Z 2024-12-17T23:33:59.7852420Z If it doesn't contain "---" then the settings are empty and the default values are used. 2024-12-17T23:33:59.7853346Z """ 2024-12-17T23:33:59.7854069Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:59.7855097Z return parse_settings_from_text(settings_text) 2024-12-17T23:33:59.7855593Z 2024-12-17T23:33:59.7855601Z 2024-12-17T23:33:59.7855997Z def parse_users(rollout_state: str) -> UserOptins: 2024-12-17T23:33:59.7856708Z """ 2024-12-17T23:33:59.7857206Z Parse users from the rollout state. 2024-12-17T23:33:59.7857611Z 2024-12-17T23:33:59.7857879Z """ 2024-12-17T23:33:59.7858549Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-12-17T23:33:59.7859425Z return parse_user_opt_in_from_text(users_text) 2024-12-17T23:33:59.7859860Z 2024-12-17T23:33:59.7859867Z 2024-12-17T23:33:59.7860401Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:59.7861297Z """ 2024-12-17T23:33:59.7861835Z Check if a user is opted into an experiment 2024-12-17T23:33:59.7862499Z """ 2024-12-17T23:33:59.7863084Z return experiment_name in user_optins.get(user, []) 2024-12-17T23:33:59.7863554Z 2024-12-17T23:33:59.7863561Z 2024-12-17T23:33:59.7864127Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-12-17T23:33:59.7865079Z """ 2024-12-17T23:33:59.7865633Z Check if a user explicitly opted out of an experiment 2024-12-17T23:33:59.7866352Z """ 2024-12-17T23:33:59.7867166Z # if the experiment is prefixed with a "-", then it's an opt-out 2024-12-17T23:33:59.7868184Z experiment_optout = "-" + experiment_name 2024-12-17T23:33:59.7868953Z if experiment_optout not in user_optins.get(user, []): 2024-12-17T23:33:59.7869750Z return False 2024-12-17T23:33:59.7870068Z 2024-12-17T23:33:59.7870385Z if is_user_opted_in(user, user_optins, experiment_name): 2024-12-17T23:33:59.7871105Z log.warning( 2024-12-17T23:33:59.7872093Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2024-12-17T23:33:59.7873094Z ) 2024-12-17T23:33:59.7873387Z 2024-12-17T23:33:59.7873593Z return True 2024-12-17T23:33:59.7873851Z 2024-12-17T23:33:59.7873859Z 2024-12-17T23:33:59.7874202Z def get_runner_prefix( 2024-12-17T23:33:59.7874725Z rollout_state: str, 2024-12-17T23:33:59.7875307Z workflow_requestors: Iterable[str], 2024-12-17T23:33:59.7876031Z branch: str, 2024-12-17T23:33:59.7876609Z eligible_experiments: FrozenSet[str] = frozenset(), 2024-12-17T23:33:59.7877331Z is_canary: bool = False, 2024-12-17T23:33:59.7877982Z ) -> str: 2024-12-17T23:33:59.7878477Z settings = parse_settings(rollout_state) 2024-12-17T23:33:59.7879187Z user_optins = parse_users(rollout_state) 2024-12-17T23:33:59.7879595Z 2024-12-17T23:33:59.7879940Z fleet_prefix = "" 2024-12-17T23:33:59.7880446Z prefixes = [] 2024-12-17T23:33:59.7881211Z for experiment_name, experiment_settings in settings.experiments.items(): 2024-12-17T23:33:59.7882381Z if not experiment_settings.all_branches and is_exception_branch(branch): 2024-12-17T23:33:59.7883226Z log.info( 2024-12-17T23:33:59.7883979Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-12-17T23:33:59.7884950Z ) 2024-12-17T23:33:59.7885608Z continue 2024-12-17T23:33:59.7885936Z 2024-12-17T23:33:59.7886167Z if eligible_experiments: 2024-12-17T23:33:59.7886914Z if experiment_name not in eligible_experiments: 2024-12-17T23:33:59.7887686Z exp_list = ", ".join(eligible_experiments) 2024-12-17T23:33:59.7888346Z log.info( 2024-12-17T23:33:59.7889328Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2024-12-17T23:33:59.7890328Z ) 2024-12-17T23:33:59.7890798Z continue 2024-12-17T23:33:59.7891449Z elif not experiment_settings.default: 2024-12-17T23:33:59.7892112Z log.info( 2024-12-17T23:33:59.7892849Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2024-12-17T23:33:59.7893771Z ) 2024-12-17T23:33:59.7894276Z continue 2024-12-17T23:33:59.7894733Z 2024-12-17T23:33:59.7895073Z # Is any workflow_requestor opted out to this experiment? 2024-12-17T23:33:59.7895912Z opted_out_users = [ 2024-12-17T23:33:59.7896502Z requestor 2024-12-17T23:33:59.7897029Z for requestor in workflow_requestors 2024-12-17T23:33:59.7897899Z if is_user_opted_out(requestor, user_optins, experiment_name) 2024-12-17T23:33:59.7898677Z ] 2024-12-17T23:33:59.7898918Z 2024-12-17T23:33:59.7899133Z if opted_out_users: 2024-12-17T23:33:59.7899769Z log.info( 2024-12-17T23:33:59.7900526Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2024-12-17T23:33:59.7901305Z ) 2024-12-17T23:33:59.7901882Z continue 2024-12-17T23:33:59.7902172Z 2024-12-17T23:33:59.7902521Z # Is any workflow_requestor opted in to this experiment? 2024-12-17T23:33:59.7903244Z opted_in_users = [ 2024-12-17T23:33:59.7903873Z requestor 2024-12-17T23:33:59.7904446Z for requestor in workflow_requestors 2024-12-17T23:33:59.7905228Z if is_user_opted_in(requestor, user_optins, experiment_name) 2024-12-17T23:33:59.7906055Z ] 2024-12-17T23:33:59.7906344Z 2024-12-17T23:33:59.7906746Z enabled = False 2024-12-17T23:33:59.7907310Z if opted_in_users: 2024-12-17T23:33:59.7907927Z log.info( 2024-12-17T23:33:59.7908659Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-12-17T23:33:59.7909465Z ) 2024-12-17T23:33:59.7910010Z enabled = True 2024-12-17T23:33:59.7910368Z 2024-12-17T23:33:59.7910625Z elif experiment_settings.rollout_perc: 2024-12-17T23:33:59.7911578Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-12-17T23:33:59.7912691Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-12-17T23:33:59.7913461Z log.info( 2024-12-17T23:33:59.7914475Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-12-17T23:33:59.7915605Z ) 2024-12-17T23:33:59.7916128Z enabled = True 2024-12-17T23:33:59.7916647Z 2024-12-17T23:33:59.7916895Z if enabled: 2024-12-17T23:33:59.7917387Z label = experiment_name 2024-12-17T23:33:59.7918064Z if experiment_name == LF_FLEET_EXPERIMENT: 2024-12-17T23:33:59.7919087Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-12-17T23:33:59.7920105Z # - If it's enabled, then we always list it's prefix first 2024-12-17T23:33:59.7920953Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-12-17T23:33:59.7921803Z if is_canary: 2024-12-17T23:33:59.7922425Z label += CANARY_FLEET_SUFFIX 2024-12-17T23:33:59.7923050Z fleet_prefix = label 2024-12-17T23:33:59.7923894Z else: 2024-12-17T23:33:59.7924485Z prefixes.append(label) 2024-12-17T23:33:59.7924881Z 2024-12-17T23:33:59.7925098Z if len(prefixes) > 1: 2024-12-17T23:33:59.7925769Z log.error( 2024-12-17T23:33:59.7926945Z 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:59.7928197Z ) 2024-12-17T23:33:59.7928801Z prefixes = prefixes[:1] 2024-12-17T23:33:59.7929168Z 2024-12-17T23:33:59.7929432Z # Fleet always comes first 2024-12-17T23:33:59.7929990Z if fleet_prefix: 2024-12-17T23:33:59.7930647Z prefixes.insert(0, fleet_prefix) 2024-12-17T23:33:59.7931058Z 2024-12-17T23:33:59.7931384Z return ".".join(prefixes) + "." if prefixes else "" 2024-12-17T23:33:59.7931848Z 2024-12-17T23:33:59.7931855Z 2024-12-17T23:33:59.7932383Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-12-17T23:33:59.7933367Z """ 2024-12-17T23:33:59.7934076Z Gets the first comment of the issue, which contains the desired rollout state. 2024-12-17T23:33:59.7935298Z 2024-12-17T23:33:59.7935870Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-12-17T23:33:59.7936824Z """ 2024-12-17T23:33:59.7937330Z gh = get_gh_client(github_token) 2024-12-17T23:33:59.7938010Z issue = get_issue(gh, repo, issue_num) 2024-12-17T23:33:59.7938816Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-12-17T23:33:59.7939353Z 2024-12-17T23:33:59.7939361Z 2024-12-17T23:33:59.7939809Z def download_json(url: str, headers: Dict[str, str], num_retries: int = 3) -> Any: 2024-12-17T23:33:59.7940686Z for _ in range(num_retries): 2024-12-17T23:33:59.7941354Z try: 2024-12-17T23:33:59.7941854Z req = Request(url=url, headers=headers) 2024-12-17T23:33:59.7942649Z content = urlopen(req, timeout=5).read().decode("utf-8") 2024-12-17T23:33:59.7943496Z return json.loads(content) 2024-12-17T23:33:59.7944112Z except Exception as e: 2024-12-17T23:33:59.7944768Z log.warning(f"Could not download {url}: {e}") 2024-12-17T23:33:59.7945492Z 2024-12-17T23:33:59.7945977Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2024-12-17T23:33:59.7946799Z return {} 2024-12-17T23:33:59.7947094Z 2024-12-17T23:33:59.7947103Z 2024-12-17T23:33:59.7947307Z @lru_cache(maxsize=None) 2024-12-17T23:33:59.7948210Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> Dict[str, Any]: 2024-12-17T23:33:59.7949077Z """ 2024-12-17T23:33:59.7949562Z Dynamically get PR information 2024-12-17T23:33:59.7950262Z """ 2024-12-17T23:33:59.7950864Z github_api = f"https://api.github.com/repos/{github_repo}" 2024-12-17T23:33:59.7951593Z headers = { 2024-12-17T23:33:59.7952267Z "Accept": "application/vnd.github.v3+json", 2024-12-17T23:33:59.7952966Z "Authorization": f"token {github_token}", 2024-12-17T23:33:59.7953623Z } 2024-12-17T23:33:59.7954258Z json_response: Dict[str, Any] = download_json( 2024-12-17T23:33:59.7954940Z url=f"{github_api}/issues/{pr_number}", 2024-12-17T23:33:59.7955598Z headers=headers, 2024-12-17T23:33:59.7956234Z ) 2024-12-17T23:33:59.7956475Z 2024-12-17T23:33:59.7956696Z if not json_response: 2024-12-17T23:33:59.7957374Z log.warning(f"Failed to get the labels for #{pr_number}") 2024-12-17T23:33:59.7958229Z return {} 2024-12-17T23:33:59.7958524Z 2024-12-17T23:33:59.7958747Z return json_response 2024-12-17T23:33:59.7959104Z 2024-12-17T23:33:59.7959111Z 2024-12-17T23:33:59.7959538Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> Set[str]: 2024-12-17T23:33:59.7960480Z """ 2024-12-17T23:33:59.7961122Z Dynamically get the latest list of labels from the pull request 2024-12-17T23:33:59.7961840Z """ 2024-12-17T23:33:59.7962685Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2024-12-17T23:33:59.7963439Z return { 2024-12-17T23:33:59.7964142Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2024-12-17T23:33:59.7965066Z } 2024-12-17T23:33:59.7965312Z 2024-12-17T23:33:59.7965318Z 2024-12-17T23:33:59.7965561Z def main() -> None: 2024-12-17T23:33:59.7966053Z args = parse_args() 2024-12-17T23:33:59.7966496Z 2024-12-17T23:33:59.7966764Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-12-17T23:33:59.7967203Z 2024-12-17T23:33:59.7967483Z # Check if the PR is opt-out 2024-12-17T23:33:59.7968033Z if args.pr_number: 2024-12-17T23:33:59.7968903Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2024-12-17T23:33:59.7969797Z if OPT_OUT_LABEL in labels: 2024-12-17T23:33:59.7970351Z log.info( 2024-12-17T23:33:59.7971239Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2024-12-17T23:33:59.7972153Z ) 2024-12-17T23:33:59.7972768Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:59.7973648Z sys.exit() 2024-12-17T23:33:59.7974009Z 2024-12-17T23:33:59.7974209Z try: 2024-12-17T23:33:59.7974991Z rollout_state = get_rollout_state_from_issue( 2024-12-17T23:33:59.7975829Z args.github_token, args.github_issue_repo, args.github_issue 2024-12-17T23:33:59.7976611Z ) 2024-12-17T23:33:59.7976855Z 2024-12-17T23:33:59.7977186Z username = get_potential_pr_author( 2024-12-17T23:33:59.7977826Z args.github_token, 2024-12-17T23:33:59.7978434Z args.github_repo, 2024-12-17T23:33:59.7979068Z args.github_actor, 2024-12-17T23:33:59.7979666Z args.github_ref_type, 2024-12-17T23:33:59.7980268Z args.github_branch, 2024-12-17T23:33:59.7980879Z ) 2024-12-17T23:33:59.7981146Z 2024-12-17T23:33:59.7981499Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-12-17T23:33:59.7982039Z 2024-12-17T23:33:59.7982292Z runner_label_prefix = get_runner_prefix( 2024-12-17T23:33:59.7983018Z rollout_state, 2024-12-17T23:33:59.7983829Z (args.github_issue_owner, username), 2024-12-17T23:33:59.7984504Z args.github_branch, 2024-12-17T23:33:59.7985192Z args.eligible_experiments, 2024-12-17T23:33:59.7985823Z is_canary, 2024-12-17T23:33:59.7986355Z ) 2024-12-17T23:33:59.7986601Z 2024-12-17T23:33:59.7986923Z except Exception as e: 2024-12-17T23:33:59.7987479Z log.error( 2024-12-17T23:33:59.7988269Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-12-17T23:33:59.7989228Z ) 2024-12-17T23:33:59.7989489Z 2024-12-17T23:33:59.7989870Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-12-17T23:33:59.7990449Z 2024-12-17T23:33:59.7990455Z 2024-12-17T23:33:59.7990670Z if __name__ == "__main__": 2024-12-17T23:33:59.7991312Z main() 2024-12-17T23:33:59.7991586Z 2024-12-17T23:33:59.8087709Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-12-17T23:33:59.8088818Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-12-17T23:33:59.8147816Z shell: /usr/bin/bash -e {0} 2024-12-17T23:33:59.8148434Z env: 2024-12-17T23:33:59.8149327Z GITHUB_TOKEN: *** 2024-12-17T23:33:59.8149858Z ISSUE_NUMBER: 5132 2024-12-17T23:33:59.8150392Z TRIGGERING_ACTOR: malfet 2024-12-17T23:33:59.8151050Z ISSUE_OWNER: 2024-12-17T23:33:59.8151527Z CHECK_EXPERIMENTS: 2024-12-17T23:33:59.8152054Z PR_NUMBER: 2024-12-17T23:33:59.8152578Z ##[endgroup] 2024-12-17T23:34:00.2510339Z Defaulting to user installation because normal site-packages is not writeable 2024-12-17T23:34:00.6269210Z Collecting urllib3==1.26.18 2024-12-17T23:34:00.6838164Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2024-12-17T23:34:00.7222761Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 KB 6.6 MB/s eta 0:00:00 2024-12-17T23:34:00.7474404Z Collecting PyGithub==2.3.0 2024-12-17T23:34:00.7548600Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2024-12-17T23:34:00.7871123Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 KB 11.8 MB/s eta 0:00:00 2024-12-17T23:34:00.8371700Z Collecting pyjwt[crypto]>=2.4.0 2024-12-17T23:34:00.8444903Z Downloading PyJWT-2.10.1-py3-none-any.whl (22 kB) 2024-12-17T23:34:00.8888311Z Collecting Deprecated 2024-12-17T23:34:00.8967763Z Downloading Deprecated-1.2.15-py2.py3-none-any.whl (9.9 kB) 2024-12-17T23:34:00.9587212Z Collecting typing-extensions>=4.0.0 2024-12-17T23:34:00.9667772Z Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) 2024-12-17T23:34:00.9715931Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.25.1) 2024-12-17T23:34:01.0163915Z Collecting pynacl>=1.4.0 2024-12-17T23:34:01.0240154Z 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:34:01.0756855Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 KB 17.2 MB/s eta 0:00:00 2024-12-17T23:34:01.0885828Z 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:34:01.3466429Z Collecting cffi>=1.4.1 2024-12-17T23:34:01.3544053Z Downloading cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446 kB) 2024-12-17T23:34:01.3755721Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446.2/446.2 KB 22.9 MB/s eta 0:00:00 2024-12-17T23:34:01.5761240Z Collecting wrapt<2,>=1.10 2024-12-17T23:34:01.5837124Z 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:34:01.5902439Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.7/82.7 KB 15.7 MB/s eta 0:00:00 2024-12-17T23:34:01.6113940Z Collecting pycparser 2024-12-17T23:34:01.6189936Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2024-12-17T23:34:01.6252869Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 KB 26.4 MB/s eta 0:00:00 2024-12-17T23:34:01.8037729Z Installing collected packages: wrapt, urllib3, typing-extensions, pyjwt, pycparser, Deprecated, cffi, pynacl, PyGithub 2024-12-17T23:34:02.2869726Z 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:02.3648387Z ##[group]Run curr_branch="release/2.6" 2024-12-17T23:34:02.3648951Z curr_branch="release/2.6" 2024-12-17T23:34:02.3649309Z curr_ref_type="branch" 2024-12-17T23:34:02.3649785Z echo "Current branch is '$curr_branch'" 2024-12-17T23:34:02.3650203Z  2024-12-17T23:34:02.3650500Z python3 runner_determinator.py \ 2024-12-17T23:34:02.3651005Z  --github-token "$GITHUB_TOKEN" \ 2024-12-17T23:34:02.3651494Z  --github-issue "$ISSUE_NUMBER" \ 2024-12-17T23:34:02.3651872Z  --github-branch "$curr_branch" \ 2024-12-17T23:34:02.3652391Z  --github-actor "$TRIGGERING_ACTOR" \ 2024-12-17T23:34:02.3652854Z  --github-issue-owner "$ISSUE_OWNER" \ 2024-12-17T23:34:02.3653317Z  --github-ref-type "$curr_ref_type" \ 2024-12-17T23:34:02.3653765Z  --github-repo "$GITHUB_REPOSITORY" \ 2024-12-17T23:34:02.3654232Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2024-12-17T23:34:02.3655082Z  --pr-number "${PR_NUMBER}" 2024-12-17T23:34:02.3714800Z shell: /usr/bin/bash -e {0} 2024-12-17T23:34:02.3715285Z env: 2024-12-17T23:34:02.3716131Z GITHUB_TOKEN: *** 2024-12-17T23:34:02.3716564Z ISSUE_NUMBER: 5132 2024-12-17T23:34:02.3716963Z TRIGGERING_ACTOR: malfet 2024-12-17T23:34:02.3717336Z ISSUE_OWNER: 2024-12-17T23:34:02.3717674Z CHECK_EXPERIMENTS: 2024-12-17T23:34:02.3718175Z PR_NUMBER: 2024-12-17T23:34:02.3718522Z ##[endgroup] 2024-12-17T23:34:02.3803340Z Current branch is 'release/2.6' 2024-12-17T23:34:03.7692948Z INFO : Based on rollout percentage of 95%, enabling experiment lf. 2024-12-17T23:34:03.7694046Z INFO : Skipping experiment 'awsa100', as it is not a default experiment 2024-12-17T23:34:03.7695438Z INFO : Setting output: label-type='lf.' 2024-12-17T23:34:03.7989481Z Evaluate and set job outputs 2024-12-17T23:34:03.7996413Z Set output 'label-type' 2024-12-17T23:34:03.7998497Z Cleaning up orphan processes