2025-06-26T07:45:25.7211513Z Current runner version: '2.325.0' 2025-06-26T07:45:25.7240954Z ##[group]Operating System 2025-06-26T07:45:25.7241673Z Ubuntu 2025-06-26T07:45:25.7242258Z 24.04.2 2025-06-26T07:45:25.7242700Z LTS 2025-06-26T07:45:25.7243157Z ##[endgroup] 2025-06-26T07:45:25.7243904Z ##[group]Runner Image 2025-06-26T07:45:25.7244474Z Image: ubuntu-24.04 2025-06-26T07:45:25.7244981Z Version: 20250622.1.0 2025-06-26T07:45:25.7246043Z Included Software: https://github.com/actions/runner-images/blob/ubuntu24/20250622.1/images/ubuntu/Ubuntu2404-Readme.md 2025-06-26T07:45:25.7247403Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu24%2F20250622.1 2025-06-26T07:45:25.7248247Z ##[endgroup] 2025-06-26T07:45:25.7248809Z ##[group]Runner Image Provisioner 2025-06-26T07:45:25.7249411Z 2.0.437.1 2025-06-26T07:45:25.7249824Z ##[endgroup] 2025-06-26T07:45:25.7252146Z ##[group]GITHUB_TOKEN Permissions 2025-06-26T07:45:25.7254555Z Actions: read 2025-06-26T07:45:25.7255313Z Attestations: read 2025-06-26T07:45:25.7255897Z Checks: read 2025-06-26T07:45:25.7256394Z Contents: read 2025-06-26T07:45:25.7256909Z Deployments: read 2025-06-26T07:45:25.7257407Z Discussions: read 2025-06-26T07:45:25.7258037Z Issues: read 2025-06-26T07:45:25.7258601Z Metadata: read 2025-06-26T07:45:25.7259037Z Models: read 2025-06-26T07:45:25.7259546Z Packages: read 2025-06-26T07:45:25.7260004Z Pages: read 2025-06-26T07:45:25.7260508Z PullRequests: read 2025-06-26T07:45:25.7260970Z RepositoryProjects: read 2025-06-26T07:45:25.7261576Z SecurityEvents: read 2025-06-26T07:45:25.7262047Z Statuses: read 2025-06-26T07:45:25.7262517Z ##[endgroup] 2025-06-26T07:45:25.7264808Z Secret source: Actions 2025-06-26T07:45:25.7265857Z Prepare workflow directory 2025-06-26T07:45:25.7788382Z Prepare all required actions 2025-06-26T07:45:25.7843151Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/heads/main (455dfd258980294f0745bd90aee12a323e37224d) 2025-06-26T07:45:25.7848283Z ##[group] Inputs 2025-06-26T07:45:25.7848833Z check_experiments: 2025-06-26T07:45:25.7849501Z opt_out_experiments: 2025-06-26T07:45:25.7850013Z triggering_actor: nautsimon 2025-06-26T07:45:25.7850563Z issue_owner: nautsimon 2025-06-26T07:45:25.7851163Z curr_branch: gh/nautsimon/7/head 2025-06-26T07:45:25.7851807Z curr_ref_type: branch 2025-06-26T07:45:25.7852302Z issue_number: 5132 2025-06-26T07:45:25.7852864Z ##[endgroup] 2025-06-26T07:45:25.7853645Z Complete job name: get-label-type / runner-determinator 2025-06-26T07:45:25.8469716Z ##[group]Run cat < runner_determinator.py 2025-06-26T07:45:25.8471992Z cat < runner_determinator.py 2025-06-26T07:45:25.8472615Z # flake8: noqa: G004 2025-06-26T07:45:25.8473205Z  2025-06-26T07:45:25.8474281Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-06-26T07:45:25.8475287Z # must be kept in sync. You can do it easily by running the following command: 2025-06-26T07:45:25.8476307Z # python .github/scripts/update_runner_determinator.py 2025-06-26T07:45:25.8476993Z  2025-06-26T07:45:25.8477423Z """ 2025-06-26T07:45:25.8478165Z This runner determinator is used to determine which set of runners to run a 2025-06-26T07:45:25.8479114Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-06-26T07:45:25.8480342Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-06-26T07:45:25.8481268Z of which runners should be used to run which job. 2025-06-26T07:45:25.8481926Z  2025-06-26T07:45:25.8482599Z The configuration has two parts, the settings and a list of opted-in users, 2025-06-26T07:45:25.8483785Z separated by a line containing "---". If the line is not present, the 2025-06-26T07:45:25.8484776Z settings are considered to be empty with only the second part, the user 2025-06-26T07:45:25.8485566Z list, defined. 2025-06-26T07:45:25.8486365Z  2025-06-26T07:45:25.8486985Z The first part is a YAML block that defines the rollout settings. This can be 2025-06-26T07:45:25.8488131Z used to define any settings that are needed to determine which runners to use. 2025-06-26T07:45:25.8489047Z It's fields are defined by the RolloutSettings class below. 2025-06-26T07:45:25.8489741Z  2025-06-26T07:45:25.8490516Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-06-26T07:45:25.8491469Z The user list is also a comma separated list of additional features or 2025-06-26T07:45:25.8492323Z experiments which the user could be opted in to. 2025-06-26T07:45:25.8492970Z  2025-06-26T07:45:25.8493785Z The user list has the following rules: 2025-06-26T07:45:25.8494443Z  2025-06-26T07:45:25.8495115Z - Users are GitHub usernames, which must start with the @ prefix 2025-06-26T07:45:25.8496099Z - Each user is also a comma-separated list of features/experiments to enable 2025-06-26T07:45:25.8496950Z - A "#" prefix opts the user out of all experiments 2025-06-26T07:45:25.8497636Z  2025-06-26T07:45:25.8498046Z Example config: 2025-06-26T07:45:25.8498640Z  # A list of experiments that can be opted into. 2025-06-26T07:45:25.8499500Z  # This defines the behavior they'll induce when opted into. 2025-06-26T07:45:25.8500193Z  # Expected syntax is: 2025-06-26T07:45:25.8500966Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-06-26T07:45:25.8502028Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-06-26T07:45:25.8502877Z  2025-06-26T07:45:25.8503313Z  experiments: 2025-06-26T07:45:25.8575801Z  lf: 2025-06-26T07:45:25.8576339Z  rollout_percent: 25 2025-06-26T07:45:25.8576868Z  all_branches: false 2025-06-26T07:45:25.8577351Z  default: true 2025-06-26T07:45:25.8577798Z  --- 2025-06-26T07:45:25.8578174Z  2025-06-26T07:45:25.8578528Z  # Opt-ins: 2025-06-26T07:45:25.8579181Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2025-06-26T07:45:25.8580305Z  # and specifying experiments to enable in a comma-separated list. 2025-06-26T07:45:25.8581135Z  # To always opt out of an experiment, prefix it with a "-". 2025-06-26T07:45:25.8581882Z  # Experiments should be from the above list. 2025-06-26T07:45:25.8582426Z  2025-06-26T07:45:25.8582803Z  @User1,-lf,split_build 2025-06-26T07:45:25.8583272Z  @User2,lf 2025-06-26T07:45:25.8583846Z  @User3,split_build 2025-06-26T07:45:25.8584287Z """ 2025-06-26T07:45:25.8584654Z  2025-06-26T07:45:25.8584993Z import json 2025-06-26T07:45:25.8585396Z import logging 2025-06-26T07:45:25.8585799Z import os 2025-06-26T07:45:25.8586184Z import random 2025-06-26T07:45:25.8586578Z import re 2025-06-26T07:45:25.8586954Z import sys 2025-06-26T07:45:25.8587443Z from argparse import ArgumentParser 2025-06-26T07:45:25.8587996Z from collections.abc import Iterable 2025-06-26T07:45:25.8588540Z from functools import cache 2025-06-26T07:45:25.8589030Z from logging import LogRecord 2025-06-26T07:45:25.8589553Z from typing import Any, NamedTuple 2025-06-26T07:45:25.8590122Z from urllib.request import Request, urlopen 2025-06-26T07:45:25.8590662Z  2025-06-26T07:45:25.8591011Z import yaml 2025-06-26T07:45:25.8591438Z from github import Auth, Github 2025-06-26T07:45:25.8591966Z from github.Issue import Issue 2025-06-26T07:45:25.8592439Z  2025-06-26T07:45:25.8592952Z  2025-06-26T07:45:25.8593561Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-06-26T07:45:25.8594354Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-06-26T07:45:25.8595229Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-06-26T07:45:25.8595929Z  2025-06-26T07:45:25.8596365Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-06-26T07:45:25.8596945Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-06-26T07:45:25.8597495Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-06-26T07:45:25.8598067Z OPT_OUT_LABEL = "no-runner-experiments" 2025-06-26T07:45:25.8598579Z  2025-06-26T07:45:25.8598962Z SETTING_EXPERIMENTS = "experiments" 2025-06-26T07:45:25.8599468Z  2025-06-26T07:45:25.8599833Z LF_FLEET_EXPERIMENT = "lf" 2025-06-26T07:45:25.8600325Z CANARY_FLEET_SUFFIX = ".c" 2025-06-26T07:45:25.8600781Z  2025-06-26T07:45:25.8601114Z  2025-06-26T07:45:25.8601478Z class Experiment(NamedTuple): 2025-06-26T07:45:25.8601980Z  rollout_perc: float = ( 2025-06-26T07:45:25.8602666Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2025-06-26T07:45:25.8603331Z  ) 2025-06-26T07:45:25.8603869Z  all_branches: bool = ( 2025-06-26T07:45:25.8604545Z  False # If True, the experiment is also enabled on the exception branches 2025-06-26T07:45:25.8605202Z  ) 2025-06-26T07:45:25.8605574Z  default: bool = ( 2025-06-26T07:45:25.8606181Z  True # If True, the experiment is enabled by default for all queries 2025-06-26T07:45:25.8606815Z  ) 2025-06-26T07:45:25.8607165Z  2025-06-26T07:45:25.8607531Z  # Add more fields as needed 2025-06-26T07:45:25.8607998Z  2025-06-26T07:45:25.8608332Z  2025-06-26T07:45:25.8608700Z class Settings(NamedTuple): 2025-06-26T07:45:25.8609159Z  """ 2025-06-26T07:45:25.8609648Z  Settings for the experiments that can be opted into. 2025-06-26T07:45:25.8610217Z  """ 2025-06-26T07:45:25.8610569Z  2025-06-26T07:45:25.8610960Z  experiments: dict[str, Experiment] = {} 2025-06-26T07:45:25.8611469Z  2025-06-26T07:45:25.8611947Z  2025-06-26T07:45:25.8612362Z class ColorFormatter(logging.Formatter): 2025-06-26T07:45:25.8613015Z  """Color codes the log messages based on the log level""" 2025-06-26T07:45:25.8613872Z  2025-06-26T07:45:25.8614221Z  COLORS = { 2025-06-26T07:45:25.8614661Z  "WARNING": "\033[33m", # Yellow 2025-06-26T07:45:25.8615192Z  "ERROR": "\033[31m", # Red 2025-06-26T07:45:25.8615705Z  "CRITICAL": "\033[31m", # Red 2025-06-26T07:45:25.8616218Z  "INFO": "\033[0m", # Reset 2025-06-26T07:45:25.8616733Z  "DEBUG": "\033[0m", # Reset 2025-06-26T07:45:25.8617212Z  } 2025-06-26T07:45:25.8617562Z  2025-06-26T07:45:25.8617972Z  def format(self, record: LogRecord) -> str: 2025-06-26T07:45:25.8618734Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-06-26T07:45:25.8619503Z  record.msg = f"{log_color}{record.msg}\033[0m" 2025-06-26T07:45:25.8620095Z  return super().format(record) 2025-06-26T07:45:25.8620585Z  2025-06-26T07:45:25.8620920Z  2025-06-26T07:45:25.8621300Z handler = logging.StreamHandler() 2025-06-26T07:45:25.8622042Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-06-26T07:45:25.8622747Z  2025-06-26T07:45:25.8623193Z log = logging.getLogger(os.path.basename(__file__)) 2025-06-26T07:45:25.8624057Z log.addHandler(handler) 2025-06-26T07:45:25.8624694Z log.setLevel(logging.INFO) 2025-06-26T07:45:25.8625159Z  2025-06-26T07:45:25.8625487Z  2025-06-26T07:45:25.8625945Z def set_github_output(key: str, value: str) -> None: 2025-06-26T07:45:25.8626515Z  """ 2025-06-26T07:45:25.8627044Z  Defines outputs of the github action that invokes this script 2025-06-26T07:45:25.8627683Z  """ 2025-06-26T07:45:25.8628062Z  if not GITHUB_OUTPUT: 2025-06-26T07:45:25.8629150Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-06-26T07:45:25.8630223Z  log.warning( 2025-06-26T07:45:25.8631118Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-06-26T07:45:25.8632014Z  ) 2025-06-26T07:45:25.8632463Z  print(f"::set-output name={key}::{value}") 2025-06-26T07:45:25.8633013Z  return 2025-06-26T07:45:25.8633615Z  2025-06-26T07:45:25.8634014Z  with open(GITHUB_OUTPUT, "a") as f: 2025-06-26T07:45:25.8634601Z  log.info(f"Setting output: {key}='{value}'") 2025-06-26T07:45:25.8635179Z  f.write(f"{key}={value}\n") 2025-06-26T07:45:25.8635656Z  2025-06-26T07:45:25.8635997Z  2025-06-26T07:45:25.8636500Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-06-26T07:45:25.8637150Z  return frozenset( 2025-06-26T07:45:25.8637789Z  filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-06-26T07:45:25.8638449Z  ) 2025-06-26T07:45:25.8638802Z  2025-06-26T07:45:25.8639133Z  2025-06-26T07:45:25.8639483Z def parse_args() -> Any: 2025-06-26T07:45:25.8640086Z  parser = ArgumentParser("Get dynamic rollout settings") 2025-06-26T07:45:25.8640958Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-06-26T07:45:25.8641714Z  parser.add_argument( 2025-06-26T07:45:25.8642196Z  "--github-issue-repo", 2025-06-26T07:45:25.8642684Z  type=str, 2025-06-26T07:45:25.8643111Z  required=False, 2025-06-26T07:45:25.8643861Z  default="pytorch/test-infra", 2025-06-26T07:45:25.8644441Z  help="GitHub repo to get the issue", 2025-06-26T07:45:25.8644950Z  ) 2025-06-26T07:45:25.8645334Z  parser.add_argument( 2025-06-26T07:45:25.8645800Z  "--github-repo", 2025-06-26T07:45:25.8646257Z  type=str, 2025-06-26T07:45:25.8646685Z  required=True, 2025-06-26T07:45:25.8647186Z  help="GitHub repo where CI is running", 2025-06-26T07:45:25.8647701Z  ) 2025-06-26T07:45:25.8648082Z  parser.add_argument( 2025-06-26T07:45:25.8648726Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2025-06-26T07:45:25.8649389Z  ) 2025-06-26T07:45:25.8649763Z  parser.add_argument( 2025-06-26T07:45:25.8650421Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-06-26T07:45:25.8651089Z  ) 2025-06-26T07:45:25.8651466Z  parser.add_argument( 2025-06-26T07:45:25.8652135Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-06-26T07:45:25.8652805Z  ) 2025-06-26T07:45:25.8653189Z  parser.add_argument( 2025-06-26T07:45:25.8654145Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-06-26T07:45:25.8654849Z  ) 2025-06-26T07:45:25.8655221Z  parser.add_argument( 2025-06-26T07:45:25.8655838Z  "--github-ref-type", 2025-06-26T07:45:25.8656309Z  type=str, 2025-06-26T07:45:25.8656742Z  required=True, 2025-06-26T07:45:25.8657274Z  help="Current GitHub ref type, branch or tag", 2025-06-26T07:45:25.8657808Z  ) 2025-06-26T07:45:25.8658188Z  parser.add_argument( 2025-06-26T07:45:25.8658671Z  "--eligible-experiments", 2025-06-26T07:45:25.8659215Z  type=_str_comma_separated_to_set, 2025-06-26T07:45:25.8659731Z  required=False, 2025-06-26T07:45:25.8660187Z  default="", 2025-06-26T07:45:25.8661062Z  help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-06-26T07:45:25.8661949Z  ) 2025-06-26T07:45:25.8662323Z  parser.add_argument( 2025-06-26T07:45:25.8662801Z  "--opt-out-experiments", 2025-06-26T07:45:25.8663453Z  type=_str_comma_separated_to_set, 2025-06-26T07:45:25.8663970Z  required=False, 2025-06-26T07:45:25.8664419Z  default="", 2025-06-26T07:45:25.8664844Z  help=( 2025-06-26T07:45:25.8665534Z  "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-06-26T07:45:25.8666643Z  "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-06-26T07:45:25.8667473Z  ), 2025-06-26T07:45:25.8667850Z  ) 2025-06-26T07:45:25.8668228Z  parser.add_argument( 2025-06-26T07:45:25.8668696Z  "--pr-number", 2025-06-26T07:45:25.8669141Z  type=str, 2025-06-26T07:45:25.8669563Z  required=False, 2025-06-26T07:45:25.8670011Z  default="", 2025-06-26T07:45:25.8670520Z  help="the optional PR number where this is run", 2025-06-26T07:45:25.8671084Z  ) 2025-06-26T07:45:25.8671432Z  2025-06-26T07:45:25.8671803Z  return parser.parse_args() 2025-06-26T07:45:25.8672279Z  2025-06-26T07:45:25.8672613Z  2025-06-26T07:45:25.8673214Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-06-26T07:45:25.8674323Z  auth = Auth.Token(github_token) 2025-06-26T07:45:25.8674861Z  return Github(auth=auth) 2025-06-26T07:45:25.8675318Z  2025-06-26T07:45:25.8675653Z  2025-06-26T07:45:25.8676325Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-06-26T07:45:25.8677117Z  repo = gh.get_repo(repo) 2025-06-26T07:45:25.8677648Z  return repo.get_issue(number=issue_num) 2025-06-26T07:45:25.8678157Z  2025-06-26T07:45:25.8678489Z  2025-06-26T07:45:25.8678851Z def get_potential_pr_author( 2025-06-26T07:45:25.8679532Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-06-26T07:45:25.8680197Z ) -> str: 2025-06-26T07:45:25.8680859Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2025-06-26T07:45:25.8681674Z  # Fetch the actual username from the original PR. The PR number is 2025-06-26T07:45:25.8682436Z  # embedded in the tag name: ciflow// 2025-06-26T07:45:25.8683003Z  2025-06-26T07:45:25.8683488Z  gh = get_gh_client(github_token) 2025-06-26T07:45:25.8683982Z  2025-06-26T07:45:25.8684442Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-06-26T07:45:25.8685079Z  split_tag = ref_name.split("/") 2025-06-26T07:45:25.8685587Z  if ( 2025-06-26T07:45:25.8685994Z  len(split_tag) == 3 2025-06-26T07:45:25.8686505Z  and split_tag[0] == "ciflow" 2025-06-26T07:45:25.8687197Z  and split_tag[2].isnumeric() 2025-06-26T07:45:25.8687695Z  ): 2025-06-26T07:45:25.8688111Z  pr_number = split_tag[2] 2025-06-26T07:45:25.8688602Z  try: 2025-06-26T07:45:25.8689069Z  repository = gh.get_repo(repo) 2025-06-26T07:45:25.8689698Z  pull = repository.get_pull(number=int(pr_number)) 2025-06-26T07:45:25.8690313Z  except Exception as e: 2025-06-26T07:45:25.8690847Z  raise Exception( # noqa: TRY002 2025-06-26T07:45:25.8691517Z  f"issue with pull request {pr_number} from repo {repository}" 2025-06-26T07:45:25.8692148Z  ) from e 2025-06-26T07:45:25.8692724Z  return pull.user.login # type: ignore[no-any-return] 2025-06-26T07:45:25.8693665Z  # In all other cases, return the original input username 2025-06-26T07:45:25.8694312Z  return username 2025-06-26T07:45:25.8694729Z  2025-06-26T07:45:25.8695054Z  2025-06-26T07:45:25.8695474Z def is_exception_branch(branch: str) -> bool: 2025-06-26T07:45:25.8696006Z  """ 2025-06-26T07:45:25.8696673Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-06-26T07:45:25.8697429Z  """ 2025-06-26T07:45:25.8697991Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-06-26T07:45:25.8698641Z  2025-06-26T07:45:25.8698967Z  2025-06-26T07:45:25.8699344Z def load_yaml(yaml_text: str) -> Any: 2025-06-26T07:45:25.8699835Z  try: 2025-06-26T07:45:25.8700254Z  data = yaml.safe_load(yaml_text) 2025-06-26T07:45:25.8700760Z  return data 2025-06-26T07:45:25.8701212Z  except yaml.YAMLError: 2025-06-26T07:45:25.8701730Z  log.exception("Error loading YAML") 2025-06-26T07:45:25.8702241Z  raise 2025-06-26T07:45:25.8702630Z  2025-06-26T07:45:25.8703043Z  2025-06-26T07:45:25.8704230Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-06-26T07:45:25.8704964Z  """ 2025-06-26T07:45:25.8705745Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-06-26T07:45:25.8706479Z  2025-06-26T07:45:25.8707019Z  If the issue body contains "---" then the text above that is the settings 2025-06-26T07:45:25.8707773Z  and the text below is the list of opted in users. 2025-06-26T07:45:25.8708310Z  2025-06-26T07:45:25.8708871Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-06-26T07:45:25.8709542Z  """ 2025-06-26T07:45:25.8710007Z  rollout_state_parts = rollout_state.split("---") 2025-06-26T07:45:25.8710596Z  if len(rollout_state_parts) >= 2: 2025-06-26T07:45:25.8711214Z  return rollout_state_parts[0], rollout_state_parts[1] 2025-06-26T07:45:25.8711796Z  else: 2025-06-26T07:45:25.8712181Z  return "", rollout_state 2025-06-26T07:45:25.8712641Z  2025-06-26T07:45:25.8712958Z  2025-06-26T07:45:25.8713506Z class UserOptins(dict[str, list[str]]): 2025-06-26T07:45:25.8714070Z  """ 2025-06-26T07:45:25.8714602Z  Dictionary of users with a list of features they have opted into 2025-06-26T07:45:25.8715216Z  """ 2025-06-26T07:45:25.8715555Z  2025-06-26T07:45:25.8715897Z  2025-06-26T07:45:25.8716445Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-06-26T07:45:25.8717081Z  """ 2025-06-26T07:45:25.8717803Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-06-26T07:45:25.8718755Z  2025-06-26T07:45:25.8719548Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-06-26T07:45:25.8720518Z  - Example line: "@User1,lf,split_build" 2025-06-26T07:45:25.8721205Z  - A "#" prefix indicates the user is opted out of all experiments 2025-06-26T07:45:25.8721808Z  2025-06-26T07:45:25.8722130Z  2025-06-26T07:45:25.8722449Z  """ 2025-06-26T07:45:25.8722877Z  optins = UserOptins() 2025-06-26T07:45:25.8723505Z  for user in user_optin_text.split("\n"): 2025-06-26T07:45:25.8724065Z  user = user.strip("\r\n\t -") 2025-06-26T07:45:25.8724619Z  if not user or not user.startswith("@"): 2025-06-26T07:45:25.8725176Z  # Not a valid user. Skip 2025-06-26T07:45:25.8725670Z  continue 2025-06-26T07:45:25.8726075Z  2025-06-26T07:45:25.8726415Z  if user: 2025-06-26T07:45:25.8726878Z  usr_name = user.split(",")[0].strip("@") 2025-06-26T07:45:25.8727559Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-06-26T07:45:25.8728170Z  2025-06-26T07:45:25.8728514Z  return optins 2025-06-26T07:45:25.8728919Z  2025-06-26T07:45:25.8729237Z  2025-06-26T07:45:25.8729726Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-06-26T07:45:25.8730321Z  """ 2025-06-26T07:45:25.8730729Z  Check if the experiment name is valid. 2025-06-26T07:45:25.8731246Z  A valid name: 2025-06-26T07:45:25.8731914Z  - Contains only alphanumeric characters and the special characters "_" & "-" 2025-06-26T07:45:25.8732844Z  - The special characters "_" & "-" shouldn't be the first or last characters 2025-06-26T07:45:25.8733819Z  - Cannot contain spaces 2025-06-26T07:45:25.8734298Z  """ 2025-06-26T07:45:25.8734643Z  2025-06-26T07:45:25.8735096Z  valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-06-26T07:45:25.8735801Z  valid = bool(re.match(valid_char_regex, experiment_name)) 2025-06-26T07:45:25.8736522Z  2025-06-26T07:45:25.8736868Z  if valid: 2025-06-26T07:45:25.8737257Z  return True 2025-06-26T07:45:25.8737659Z  2025-06-26T07:45:25.8737992Z  log.error( 2025-06-26T07:45:25.8739402Z  f"Invalid experiment name: {experiment_name}. Experiment names should only contain alphanumeric characters, '_', and '-'. They cannot contain spaces, and the special characters '_' and '-' cannot be the first or last characters." 2025-06-26T07:45:25.8741159Z  ) 2025-06-26T07:45:25.8741520Z  return False 2025-06-26T07:45:25.8741919Z  2025-06-26T07:45:25.8742242Z  2025-06-26T07:45:25.8742747Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-06-26T07:45:25.8743475Z  """ 2025-06-26T07:45:25.8744077Z  Parse the experiments from the issue body into a list of ExperimentSettings 2025-06-26T07:45:25.8744754Z  """ 2025-06-26T07:45:25.8745110Z  try: 2025-06-26T07:45:25.8745485Z  if settings_text: 2025-06-26T07:45:25.8746226Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-06-26T07:45:25.8746985Z  # for easy reading 2025-06-26T07:45:25.8747781Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-06-26T07:45:25.8748656Z  # the backtick character in shell commands. 2025-06-26T07:45:25.8749426Z  backtick = chr(96) # backtick character 2025-06-26T07:45:25.8750089Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-06-26T07:45:25.8750744Z  settings = load_yaml(settings_text) 2025-06-26T07:45:25.8751240Z  2025-06-26T07:45:25.8751826Z  # For now we just load experiments. We can expand this if/when we add more settings 2025-06-26T07:45:25.8752549Z  experiments = {} 2025-06-26T07:45:25.8753001Z  2025-06-26T07:45:25.8753756Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-06-26T07:45:25.8754513Z  if not is_valid_experiment_name(exp_name): 2025-06-26T07:45:25.8755582Z  # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2025-06-26T07:45:25.8756570Z  continue 2025-06-26T07:45:25.8757009Z  2025-06-26T07:45:25.8757370Z  valid_settings = {} 2025-06-26T07:45:25.8757890Z  for setting in exp_settings: 2025-06-26T07:45:25.8758466Z  if setting not in Experiment._fields: 2025-06-26T07:45:25.8759016Z  log.warning( 2025-06-26T07:45:25.8759728Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-06-26T07:45:25.8760420Z  ) 2025-06-26T07:45:25.8760851Z  else: 2025-06-26T07:45:25.8761403Z  valid_settings[setting] = exp_settings[setting] 2025-06-26T07:45:25.8761958Z  2025-06-26T07:45:25.8762419Z  experiments[exp_name] = Experiment(**valid_settings) 2025-06-26T07:45:25.8763048Z  return Settings(experiments) 2025-06-26T07:45:25.8763646Z  2025-06-26T07:45:25.8763988Z  except Exception: 2025-06-26T07:45:25.8764496Z  log.exception("Failed to parse settings") 2025-06-26T07:45:25.8765011Z  2025-06-26T07:45:25.8765344Z  return Settings() 2025-06-26T07:45:25.8765758Z  2025-06-26T07:45:25.8766071Z  2025-06-26T07:45:25.8766646Z def parse_settings(rollout_state: str) -> Settings: 2025-06-26T07:45:25.8767234Z  """ 2025-06-26T07:45:25.8767687Z  Parse settings, if any, from the rollout state. 2025-06-26T07:45:25.8768216Z  2025-06-26T07:45:25.8768750Z  If the issue body contains "---" then the text above that is the settings 2025-06-26T07:45:25.8769495Z  and the text below is the list of opted in users. 2025-06-26T07:45:25.8770029Z  2025-06-26T07:45:25.8770622Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2025-06-26T07:45:25.8771324Z  """ 2025-06-26T07:45:25.8771891Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-06-26T07:45:25.8772647Z  return parse_settings_from_text(settings_text) 2025-06-26T07:45:25.8773174Z  2025-06-26T07:45:25.8773757Z  2025-06-26T07:45:25.8774212Z def parse_users(rollout_state: str) -> UserOptins: 2025-06-26T07:45:25.8774763Z  """ 2025-06-26T07:45:25.8775162Z  Parse users from the rollout state. 2025-06-26T07:45:25.8775657Z  2025-06-26T07:45:25.8775973Z  """ 2025-06-26T07:45:25.8776523Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-06-26T07:45:25.8777257Z  return parse_user_opt_in_from_text(users_text) 2025-06-26T07:45:25.8777781Z  2025-06-26T07:45:25.8778107Z  2025-06-26T07:45:25.8778710Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-06-26T07:45:25.8779575Z  """ 2025-06-26T07:45:25.8780005Z  Check if a user is opted into an experiment 2025-06-26T07:45:25.8780523Z  """ 2025-06-26T07:45:25.8780994Z  return experiment_name in user_optins.get(user, []) 2025-06-26T07:45:25.8781555Z  2025-06-26T07:45:25.8781876Z  2025-06-26T07:45:25.8782485Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-06-26T07:45:25.8783209Z  """ 2025-06-26T07:45:25.8783819Z  Check if a user explicitly opted out of an experiment 2025-06-26T07:45:25.8784382Z  """ 2025-06-26T07:45:25.8784901Z  # if the experiment is prefixed with a "-", then it's an opt-out 2025-06-26T07:45:25.8785585Z  experiment_optout = "-" + experiment_name 2025-06-26T07:45:25.8786228Z  if experiment_optout not in user_optins.get(user, []): 2025-06-26T07:45:25.8786818Z  return False 2025-06-26T07:45:25.8787225Z  2025-06-26T07:45:25.8787676Z  if is_user_opted_in(user, user_optins, experiment_name): 2025-06-26T07:45:25.8788264Z  log.warning( 2025-06-26T07:45:25.8789075Z  f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-06-26T07:45:25.8789908Z  ) 2025-06-26T07:45:25.8790263Z  2025-06-26T07:45:25.8790594Z  return True 2025-06-26T07:45:25.8790999Z  2025-06-26T07:45:25.8791315Z  2025-06-26T07:45:25.8791668Z def get_runner_prefix( 2025-06-26T07:45:25.8792118Z  rollout_state: str, 2025-06-26T07:45:25.8792615Z  workflow_requestors: Iterable[str], 2025-06-26T07:45:25.8793115Z  branch: str, 2025-06-26T07:45:25.8793860Z  eligible_experiments: frozenset[str] = frozenset(), 2025-06-26T07:45:25.8794554Z  opt_out_experiments: frozenset[str] = frozenset(), 2025-06-26T07:45:25.8795124Z  is_canary: bool = False, 2025-06-26T07:45:25.8795583Z ) -> str: 2025-06-26T07:45:25.8796018Z  settings = parse_settings(rollout_state) 2025-06-26T07:45:25.8796597Z  user_optins = parse_users(rollout_state) 2025-06-26T07:45:25.8797095Z  2025-06-26T07:45:25.8797564Z  fleet_prefix = "" 2025-06-26T07:45:25.8798006Z  prefixes = [] 2025-06-26T07:45:25.8798653Z  for experiment_name, experiment_settings in settings.experiments.items(): 2025-06-26T07:45:25.8799583Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2025-06-26T07:45:25.8800265Z  log.info( 2025-06-26T07:45:25.8800962Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-06-26T07:45:25.8801680Z  ) 2025-06-26T07:45:25.8802074Z  continue 2025-06-26T07:45:25.8802481Z  2025-06-26T07:45:25.8802840Z  if opt_out_experiments: 2025-06-26T07:45:25.8803498Z  if experiment_name in opt_out_experiments: 2025-06-26T07:45:25.8804132Z  opt_out_exp_list = ", ".join(opt_out_experiments) 2025-06-26T07:45:25.8804708Z  log.info( 2025-06-26T07:45:25.8805625Z  f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-06-26T07:45:25.8806545Z  ) 2025-06-26T07:45:25.8806962Z  continue 2025-06-26T07:45:25.8807388Z  2025-06-26T07:45:25.8807751Z  if eligible_experiments: 2025-06-26T07:45:25.8808320Z  if experiment_name not in eligible_experiments: 2025-06-26T07:45:25.8809070Z  exp_list = ", ".join(eligible_experiments) 2025-06-26T07:45:25.8809609Z  log.info( 2025-06-26T07:45:25.8810397Z  f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-06-26T07:45:25.8811187Z  ) 2025-06-26T07:45:25.8811599Z  continue 2025-06-26T07:45:25.8812107Z  elif not experiment_settings.default: 2025-06-26T07:45:25.8812619Z  log.info( 2025-06-26T07:45:25.8813303Z  f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-06-26T07:45:25.8814286Z  ) 2025-06-26T07:45:25.8814681Z  continue 2025-06-26T07:45:25.8815092Z  2025-06-26T07:45:25.8815555Z  # Is any workflow_requestor opted out to this experiment? 2025-06-26T07:45:25.8816158Z  opted_out_users = [ 2025-06-26T07:45:25.8816625Z  requestor 2025-06-26T07:45:25.8817121Z  for requestor in workflow_requestors 2025-06-26T07:45:25.8817805Z  if is_user_opted_out(requestor, user_optins, experiment_name) 2025-06-26T07:45:25.8818416Z  ] 2025-06-26T07:45:25.8818778Z  2025-06-26T07:45:25.8819125Z  if opted_out_users: 2025-06-26T07:45:25.8819601Z  log.info( 2025-06-26T07:45:25.8820248Z  f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-06-26T07:45:25.8820921Z  ) 2025-06-26T07:45:25.8821305Z  continue 2025-06-26T07:45:25.8821711Z  2025-06-26T07:45:25.8822170Z  # Is any workflow_requestor opted in to this experiment? 2025-06-26T07:45:25.8822764Z  opted_in_users = [ 2025-06-26T07:45:25.8823223Z  requestor 2025-06-26T07:45:25.8823819Z  for requestor in workflow_requestors 2025-06-26T07:45:25.8824479Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2025-06-26T07:45:25.8825070Z  ] 2025-06-26T07:45:25.8825435Z  2025-06-26T07:45:25.8825778Z  enabled = False 2025-06-26T07:45:25.8826223Z  if opted_in_users: 2025-06-26T07:45:25.8826810Z  log.info( 2025-06-26T07:45:25.8827439Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-06-26T07:45:25.8828095Z  ) 2025-06-26T07:45:25.8828487Z  enabled = True 2025-06-26T07:45:25.8828928Z  2025-06-26T07:45:25.8829325Z  elif experiment_settings.rollout_perc: 2025-06-26T07:45:25.8830138Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-06-26T07:45:25.8831049Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-06-26T07:45:25.8831677Z  log.info( 2025-06-26T07:45:25.8832548Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-06-26T07:45:25.8833616Z  ) 2025-06-26T07:45:25.8834072Z  enabled = True 2025-06-26T07:45:25.8834525Z  2025-06-26T07:45:25.8834864Z  if enabled: 2025-06-26T07:45:25.8835318Z  label = experiment_name 2025-06-26T07:45:25.8835868Z  if experiment_name == LF_FLEET_EXPERIMENT: 2025-06-26T07:45:25.8836675Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-06-26T07:45:25.8837519Z  # - If it's enabled, then we always list it's prefix first 2025-06-26T07:45:25.8838426Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-06-26T07:45:25.8839076Z  if is_canary: 2025-06-26T07:45:25.8839584Z  label += CANARY_FLEET_SUFFIX 2025-06-26T07:45:25.8840125Z  fleet_prefix = label 2025-06-26T07:45:25.8840612Z  else: 2025-06-26T07:45:25.8841067Z  prefixes.append(label) 2025-06-26T07:45:25.8841565Z  2025-06-26T07:45:25.8841910Z  if len(prefixes) > 1: 2025-06-26T07:45:25.8842370Z  log.error( 2025-06-26T07:45:25.8843504Z  f"Only a fleet and one other experiment can be enabled for a job at any time. Enabling {prefixes[0]} and ignoring the rest, which are {', '.join(prefixes[1:])}" 2025-06-26T07:45:25.8844550Z  ) 2025-06-26T07:45:25.8844946Z  prefixes = prefixes[:1] 2025-06-26T07:45:25.8845415Z  2025-06-26T07:45:25.8845779Z  # Fleet always comes first 2025-06-26T07:45:25.8846259Z  if fleet_prefix: 2025-06-26T07:45:25.8846728Z  prefixes.insert(0, fleet_prefix) 2025-06-26T07:45:25.8847220Z  2025-06-26T07:45:25.8847660Z  return ".".join(prefixes) + "." if prefixes else "" 2025-06-26T07:45:25.8848220Z  2025-06-26T07:45:25.8848540Z  2025-06-26T07:45:25.8849158Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-06-26T07:45:25.8849908Z  """ 2025-06-26T07:45:25.8850495Z  Gets the first comment of the issue, which contains the desired rollout state. 2025-06-26T07:45:25.8851168Z  2025-06-26T07:45:25.8851733Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-06-26T07:45:25.8852405Z  """ 2025-06-26T07:45:25.8852802Z  gh = get_gh_client(github_token) 2025-06-26T07:45:25.8853591Z  issue = get_issue(gh, repo, issue_num) 2025-06-26T07:45:25.8854300Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-06-26T07:45:25.8854873Z  2025-06-26T07:45:25.8855184Z  2025-06-26T07:45:25.8855769Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-06-26T07:45:25.8856641Z  for _ in range(num_retries): 2025-06-26T07:45:25.8857123Z  try: 2025-06-26T07:45:25.8857563Z  req = Request(url=url, headers=headers) 2025-06-26T07:45:25.8858212Z  content = urlopen(req, timeout=5).read().decode("utf-8") 2025-06-26T07:45:25.8858835Z  return json.loads(content) 2025-06-26T07:45:25.8859353Z  except Exception as e: 2025-06-26T07:45:25.8859906Z  log.warning(f"Could not download {url}: {e}") 2025-06-26T07:45:25.8860432Z  2025-06-26T07:45:25.8861002Z  log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-06-26T07:45:25.8861687Z  return {} 2025-06-26T07:45:25.8862072Z  2025-06-26T07:45:25.8862400Z  2025-06-26T07:45:25.8862718Z @cache 2025-06-26T07:45:25.8863457Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-06-26T07:45:25.8864191Z  """ 2025-06-26T07:45:25.8864594Z  Dynamically get PR information 2025-06-26T07:45:25.8865073Z  """ 2025-06-26T07:45:25.8865581Z  github_api = f"https://api.github.com/repos/{github_repo}" 2025-06-26T07:45:25.8866183Z  headers = { 2025-06-26T07:45:25.8866663Z  "Accept": "application/vnd.github.v3+json", 2025-06-26T07:45:25.8867292Z  "Authorization": f"token {github_token}", 2025-06-26T07:45:25.8867801Z  } 2025-06-26T07:45:25.8868239Z  json_response: dict[str, Any] = download_json( 2025-06-26T07:45:25.8868962Z  url=f"{github_api}/issues/{pr_number}", 2025-06-26T07:45:25.8869494Z  headers=headers, 2025-06-26T07:45:25.8869920Z  ) 2025-06-26T07:45:25.8870263Z  2025-06-26T07:45:25.8870608Z  if not json_response: 2025-06-26T07:45:25.8871198Z  log.warning(f"Failed to get the labels for #{pr_number}") 2025-06-26T07:45:25.8871810Z  return {} 2025-06-26T07:45:25.8872204Z  2025-06-26T07:45:25.8872554Z  return json_response 2025-06-26T07:45:25.8872979Z  2025-06-26T07:45:25.8873306Z  2025-06-26T07:45:25.8874094Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-06-26T07:45:25.8874803Z  """ 2025-06-26T07:45:25.8875344Z  Dynamically get the latest list of labels from the pull request 2025-06-26T07:45:25.8875967Z  """ 2025-06-26T07:45:25.8876473Z  pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-06-26T07:45:25.8877061Z  return { 2025-06-26T07:45:25.8877652Z  label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-06-26T07:45:25.8878314Z  } 2025-06-26T07:45:25.8878663Z  2025-06-26T07:45:25.8878983Z  2025-06-26T07:45:25.8879326Z def main() -> None: 2025-06-26T07:45:25.8879766Z  args = parse_args() 2025-06-26T07:45:25.8880195Z  2025-06-26T07:45:25.8880604Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-06-26T07:45:25.8881279Z  2025-06-26T07:45:25.8881650Z  # Check if the PR is opt-out 2025-06-26T07:45:25.8882132Z  if args.pr_number: 2025-06-26T07:45:25.8882807Z  labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-06-26T07:45:25.8883645Z  if OPT_OUT_LABEL in labels: 2025-06-26T07:45:25.8884137Z  log.info( 2025-06-26T07:45:25.8884850Z  f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-06-26T07:45:25.8885583Z  ) 2025-06-26T07:45:25.8886160Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-06-26T07:45:25.8886808Z  sys.exit() 2025-06-26T07:45:25.8887371Z  2025-06-26T07:45:25.8887710Z  try: 2025-06-26T07:45:25.8888154Z  rollout_state = get_rollout_state_from_issue( 2025-06-26T07:45:25.8888863Z  args.github_token, args.github_issue_repo, args.github_issue 2025-06-26T07:45:25.8889472Z  ) 2025-06-26T07:45:25.8889837Z  2025-06-26T07:45:25.8890216Z  username = get_potential_pr_author( 2025-06-26T07:45:25.8890749Z  args.github_token, 2025-06-26T07:45:25.8891237Z  args.github_repo, 2025-06-26T07:45:25.8891724Z  args.github_actor, 2025-06-26T07:45:25.8892227Z  args.github_ref_type, 2025-06-26T07:45:25.8892731Z  args.github_branch, 2025-06-26T07:45:25.8893192Z  ) 2025-06-26T07:45:25.8893805Z  2025-06-26T07:45:25.8894290Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-06-26T07:45:25.8894870Z  2025-06-26T07:45:25.8895269Z  runner_label_prefix = get_runner_prefix( 2025-06-26T07:45:25.8895805Z  rollout_state, 2025-06-26T07:45:25.8896312Z  (args.github_issue_owner, username), 2025-06-26T07:45:25.8896854Z  args.github_branch, 2025-06-26T07:45:25.8897362Z  args.eligible_experiments, 2025-06-26T07:45:25.8897910Z  args.opt_out_experiments, 2025-06-26T07:45:25.8898406Z  is_canary, 2025-06-26T07:45:25.8898967Z  ) 2025-06-26T07:45:25.8899322Z  2025-06-26T07:45:25.8899679Z  except Exception as e: 2025-06-26T07:45:25.8900139Z  log.error( 2025-06-26T07:45:25.8900822Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-06-26T07:45:25.8901543Z  ) 2025-06-26T07:45:25.8901903Z  2025-06-26T07:45:25.8902413Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-06-26T07:45:25.8903034Z  2025-06-26T07:45:25.8903463Z  2025-06-26T07:45:25.8903806Z if __name__ == "__main__": 2025-06-26T07:45:25.8904249Z  main() 2025-06-26T07:45:25.8904611Z  2025-06-26T07:45:25.8904931Z EOF 2025-06-26T07:45:25.8905270Z  2025-06-26T07:45:25.8905619Z cat runner_determinator.py 2025-06-26T07:45:25.9560480Z shell: /usr/bin/bash -e {0} 2025-06-26T07:45:25.9561689Z env: 2025-06-26T07:45:25.9562668Z GITHUB_TOKEN: *** 2025-06-26T07:45:25.9563319Z ISSUE_NUMBER: 5132 2025-06-26T07:45:25.9564185Z TRIGGERING_ACTOR: nautsimon 2025-06-26T07:45:25.9564927Z ISSUE_OWNER: nautsimon 2025-06-26T07:45:25.9565624Z CHECK_EXPERIMENTS: 2025-06-26T07:45:25.9566314Z OPT_OUT_EXPERIMENTS: 2025-06-26T07:45:25.9567061Z PR_NUMBER: 156936 2025-06-26T07:45:25.9567659Z ##[endgroup] 2025-06-26T07:45:25.9866928Z # flake8: noqa: G004 2025-06-26T07:45:25.9867440Z 2025-06-26T07:45:25.9868167Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2025-06-26T07:45:25.9869784Z # must be kept in sync. You can do it easily by running the following command: 2025-06-26T07:45:25.9871203Z # python .github/scripts/update_runner_determinator.py 2025-06-26T07:45:25.9871999Z 2025-06-26T07:45:25.9872264Z """ 2025-06-26T07:45:25.9873238Z This runner determinator is used to determine which set of runners to run a 2025-06-26T07:45:25.9875008Z GitHub job on. It uses the first comment of a GitHub issue (by default 2025-06-26T07:45:25.9876565Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2025-06-26T07:45:25.9877977Z of which runners should be used to run which job. 2025-06-26T07:45:25.9878668Z 2025-06-26T07:45:25.9879380Z The configuration has two parts, the settings and a list of opted-in users, 2025-06-26T07:45:25.9881149Z separated by a line containing "---". If the line is not present, the 2025-06-26T07:45:25.9882657Z settings are considered to be empty with only the second part, the user 2025-06-26T07:45:25.9884049Z list, defined. 2025-06-26T07:45:25.9884433Z 2025-06-26T07:45:25.9885019Z The first part is a YAML block that defines the rollout settings. This can be 2025-06-26T07:45:25.9886531Z used to define any settings that are needed to determine which runners to use. 2025-06-26T07:45:25.9887903Z It's fields are defined by the RolloutSettings class below. 2025-06-26T07:45:25.9888646Z 2025-06-26T07:45:25.9889290Z The second part is a list of users who are explicitly opted in to the LF fleet. 2025-06-26T07:45:25.9890804Z The user list is also a comma separated list of additional features or 2025-06-26T07:45:25.9892060Z experiments which the user could be opted in to. 2025-06-26T07:45:25.9892762Z 2025-06-26T07:45:25.9893103Z The user list has the following rules: 2025-06-26T07:45:25.9894002Z 2025-06-26T07:45:25.9894557Z - Users are GitHub usernames, which must start with the @ prefix 2025-06-26T07:45:25.9895994Z - Each user is also a comma-separated list of features/experiments to enable 2025-06-26T07:45:25.9897280Z - A "#" prefix opts the user out of all experiments 2025-06-26T07:45:25.9897945Z 2025-06-26T07:45:25.9898229Z Example config: 2025-06-26T07:45:25.9898971Z # A list of experiments that can be opted into. 2025-06-26T07:45:25.9900133Z # This defines the behavior they'll induce when opted into. 2025-06-26T07:45:25.9901208Z # Expected syntax is: 2025-06-26T07:45:25.9902317Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2025-06-26T07:45:25.9905182Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2025-06-26T07:45:25.9906270Z 2025-06-26T07:45:25.9906556Z experiments: 2025-06-26T07:45:25.9907221Z lf: 2025-06-26T07:45:25.9907815Z rollout_percent: 25 2025-06-26T07:45:25.9908550Z all_branches: false 2025-06-26T07:45:25.9909271Z default: true 2025-06-26T07:45:25.9909921Z --- 2025-06-26T07:45:25.9910252Z 2025-06-26T07:45:25.9910505Z # Opt-ins: 2025-06-26T07:45:25.9911841Z # Users can opt into the LF fleet by adding their GitHub username to this list 2025-06-26T07:45:25.9913574Z # and specifying experiments to enable in a comma-separated list. 2025-06-26T07:45:25.9914953Z # To always opt out of an experiment, prefix it with a "-". 2025-06-26T07:45:25.9916085Z # Experiments should be from the above list. 2025-06-26T07:45:25.9916721Z 2025-06-26T07:45:25.9917024Z @User1,-lf,split_build 2025-06-26T07:45:25.9917752Z @User2,lf 2025-06-26T07:45:25.9918400Z @User3,split_build 2025-06-26T07:45:25.9919079Z """ 2025-06-26T07:45:25.9919420Z 2025-06-26T07:45:25.9919689Z import json 2025-06-26T07:45:25.9920309Z import logging 2025-06-26T07:45:25.9920919Z import os 2025-06-26T07:45:25.9921515Z import random 2025-06-26T07:45:25.9922124Z import re 2025-06-26T07:45:25.9922710Z import sys 2025-06-26T07:45:25.9923610Z from argparse import ArgumentParser 2025-06-26T07:45:25.9924514Z from collections.abc import Iterable 2025-06-26T07:45:25.9925355Z from functools import cache 2025-06-26T07:45:25.9926116Z from logging import LogRecord 2025-06-26T07:45:25.9926898Z from typing import Any, NamedTuple 2025-06-26T07:45:25.9927762Z from urllib.request import Request, urlopen 2025-06-26T07:45:25.9928385Z 2025-06-26T07:45:25.9928646Z import yaml 2025-06-26T07:45:25.9929255Z from github import Auth, Github 2025-06-26T07:45:25.9930089Z from github.Issue import Issue 2025-06-26T07:45:25.9930640Z 2025-06-26T07:45:25.9930652Z 2025-06-26T07:45:25.9931036Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2025-06-26T07:45:25.9932204Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2025-06-26T07:45:25.9933898Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2025-06-26T07:45:25.9934862Z 2025-06-26T07:45:25.9935222Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2025-06-26T07:45:25.9936382Z GH_OUTPUT_KEY_AMI = "runner-ami" 2025-06-26T07:45:25.9937237Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2025-06-26T07:45:25.9938118Z OPT_OUT_LABEL = "no-runner-experiments" 2025-06-26T07:45:25.9938691Z 2025-06-26T07:45:25.9939007Z SETTING_EXPERIMENTS = "experiments" 2025-06-26T07:45:25.9939544Z 2025-06-26T07:45:25.9939825Z LF_FLEET_EXPERIMENT = "lf" 2025-06-26T07:45:25.9940557Z CANARY_FLEET_SUFFIX = ".c" 2025-06-26T07:45:25.9941026Z 2025-06-26T07:45:25.9941035Z 2025-06-26T07:45:25.9941324Z class Experiment(NamedTuple): 2025-06-26T07:45:25.9942098Z rollout_perc: float = ( 2025-06-26T07:45:25.9943126Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2025-06-26T07:45:25.9944549Z ) 2025-06-26T07:45:25.9945168Z all_branches: bool = ( 2025-06-26T07:45:25.9946697Z False # If True, the experiment is also enabled on the exception branches 2025-06-26T07:45:25.9947925Z ) 2025-06-26T07:45:25.9948604Z default: bool = ( 2025-06-26T07:45:25.9949584Z True # If True, the experiment is enabled by default for all queries 2025-06-26T07:45:25.9950687Z ) 2025-06-26T07:45:25.9951022Z 2025-06-26T07:45:25.9951307Z # Add more fields as needed 2025-06-26T07:45:25.9951796Z 2025-06-26T07:45:25.9951808Z 2025-06-26T07:45:25.9952116Z class Settings(NamedTuple): 2025-06-26T07:45:25.9952812Z """ 2025-06-26T07:45:25.9953801Z Settings for the experiments that can be opted into. 2025-06-26T07:45:25.9954779Z """ 2025-06-26T07:45:25.9955125Z 2025-06-26T07:45:25.9955478Z experiments: dict[str, Experiment] = {} 2025-06-26T07:45:25.9956400Z 2025-06-26T07:45:25.9956414Z 2025-06-26T07:45:25.9956754Z class ColorFormatter(logging.Formatter): 2025-06-26T07:45:25.9957787Z """Color codes the log messages based on the log level""" 2025-06-26T07:45:25.9958507Z 2025-06-26T07:45:25.9958769Z COLORS = { 2025-06-26T07:45:25.9959420Z "WARNING": "\033[33m", # Yellow 2025-06-26T07:45:25.9960291Z "ERROR": "\033[31m", # Red 2025-06-26T07:45:25.9961131Z "CRITICAL": "\033[31m", # Red 2025-06-26T07:45:25.9961996Z "INFO": "\033[0m", # Reset 2025-06-26T07:45:25.9962869Z "DEBUG": "\033[0m", # Reset 2025-06-26T07:45:25.9963905Z } 2025-06-26T07:45:25.9964246Z 2025-06-26T07:45:25.9964606Z def format(self, record: LogRecord) -> str: 2025-06-26T07:45:25.9965875Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2025-06-26T07:45:25.9967162Z record.msg = f"{log_color}{record.msg}\033[0m" 2025-06-26T07:45:26.0036110Z return super().format(record) 2025-06-26T07:45:26.0036770Z 2025-06-26T07:45:26.0036787Z 2025-06-26T07:45:26.0037142Z handler = logging.StreamHandler() 2025-06-26T07:45:26.0038368Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2025-06-26T07:45:26.0039335Z 2025-06-26T07:45:26.0039743Z log = logging.getLogger(os.path.basename(__file__)) 2025-06-26T07:45:26.0040735Z log.addHandler(handler) 2025-06-26T07:45:26.0041471Z log.setLevel(logging.INFO) 2025-06-26T07:45:26.0041951Z 2025-06-26T07:45:26.0041962Z 2025-06-26T07:45:26.0042372Z def set_github_output(key: str, value: str) -> None: 2025-06-26T07:45:26.0043573Z """ 2025-06-26T07:45:26.0044423Z Defines outputs of the github action that invokes this script 2025-06-26T07:45:26.0045460Z """ 2025-06-26T07:45:26.0046083Z if not GITHUB_OUTPUT: 2025-06-26T07:45:26.0047974Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2025-06-26T07:45:26.0050008Z log.warning( 2025-06-26T07:45:26.0051493Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2025-06-26T07:45:26.0053055Z ) 2025-06-26T07:45:26.0068578Z print(f"::set-output name={key}::{value}") 2025-06-26T07:45:26.0069528Z return 2025-06-26T07:45:26.0069926Z 2025-06-26T07:45:26.0070502Z with open(GITHUB_OUTPUT, "a") as f: 2025-06-26T07:45:26.0071538Z log.info(f"Setting output: {key}='{value}'") 2025-06-26T07:45:26.0072495Z f.write(f"{key}={value}\n") 2025-06-26T07:45:26.0073045Z 2025-06-26T07:45:26.0073056Z 2025-06-26T07:45:26.0073785Z def _str_comma_separated_to_set(value: str) -> frozenset[str]: 2025-06-26T07:45:26.0074818Z return frozenset( 2025-06-26T07:45:26.0075822Z filter(lambda itm: itm != "", map(str.strip, value.strip(" \n\t").split(","))) 2025-06-26T07:45:26.0076939Z ) 2025-06-26T07:45:26.0077259Z 2025-06-26T07:45:26.0077285Z 2025-06-26T07:45:26.0077565Z def parse_args() -> Any: 2025-06-26T07:45:26.0078444Z parser = ArgumentParser("Get dynamic rollout settings") 2025-06-26T07:45:26.0079917Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2025-06-26T07:45:26.0081230Z parser.add_argument( 2025-06-26T07:45:26.0081947Z "--github-issue-repo", 2025-06-26T07:45:26.0082690Z type=str, 2025-06-26T07:45:26.0083328Z required=False, 2025-06-26T07:45:26.0084283Z default="pytorch/test-infra", 2025-06-26T07:45:26.0085201Z help="GitHub repo to get the issue", 2025-06-26T07:45:26.0086127Z ) 2025-06-26T07:45:26.0086720Z parser.add_argument( 2025-06-26T07:45:26.0087487Z "--github-repo", 2025-06-26T07:45:26.0088164Z type=str, 2025-06-26T07:45:26.0088809Z required=True, 2025-06-26T07:45:26.0089586Z help="GitHub repo where CI is running", 2025-06-26T07:45:26.0090473Z ) 2025-06-26T07:45:26.0091110Z parser.add_argument( 2025-06-26T07:45:26.0092392Z "--github-issue", type=int, required=True, help="GitHub issue number" 2025-06-26T07:45:26.0093701Z ) 2025-06-26T07:45:26.0094295Z parser.add_argument( 2025-06-26T07:45:26.0095323Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2025-06-26T07:45:26.0096476Z ) 2025-06-26T07:45:26.0097078Z parser.add_argument( 2025-06-26T07:45:26.0098244Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2025-06-26T07:45:26.0099432Z ) 2025-06-26T07:45:26.0100024Z parser.add_argument( 2025-06-26T07:45:26.0101084Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2025-06-26T07:45:26.0102242Z ) 2025-06-26T07:45:26.0102818Z parser.add_argument( 2025-06-26T07:45:26.0103733Z "--github-ref-type", 2025-06-26T07:45:26.0104464Z type=str, 2025-06-26T07:45:26.0105092Z required=True, 2025-06-26T07:45:26.0105869Z help="Current GitHub ref type, branch or tag", 2025-06-26T07:45:26.0106829Z ) 2025-06-26T07:45:26.0107467Z parser.add_argument( 2025-06-26T07:45:26.0108228Z "--eligible-experiments", 2025-06-26T07:45:26.0109132Z type=_str_comma_separated_to_set, 2025-06-26T07:45:26.0110030Z required=False, 2025-06-26T07:45:26.0110745Z default="", 2025-06-26T07:45:26.0112213Z help="comma separated list of experiments to check, if omitted all experiments marked with default=True are checked", 2025-06-26T07:45:26.0114046Z ) 2025-06-26T07:45:26.0114658Z parser.add_argument( 2025-06-26T07:45:26.0115381Z "--opt-out-experiments", 2025-06-26T07:45:26.0116191Z type=_str_comma_separated_to_set, 2025-06-26T07:45:26.0117023Z required=False, 2025-06-26T07:45:26.0117715Z default="", 2025-06-26T07:45:26.0118311Z help=( 2025-06-26T07:45:26.0119411Z "comma separated list of experiments to opt-out of. If unset, no opt-outs will occur. " 2025-06-26T07:45:26.0121396Z "If the same experiment is listed both here and in '--eligible-experiments' opt-out will take priority." 2025-06-26T07:45:26.0122858Z ), 2025-06-26T07:45:26.0123677Z ) 2025-06-26T07:45:26.0124300Z parser.add_argument( 2025-06-26T07:45:26.0125050Z "--pr-number", 2025-06-26T07:45:26.0125742Z type=str, 2025-06-26T07:45:26.0126383Z required=False, 2025-06-26T07:45:26.0127038Z default="", 2025-06-26T07:45:26.0127994Z help="the optional PR number where this is run", 2025-06-26T07:45:26.0128935Z ) 2025-06-26T07:45:26.0129260Z 2025-06-26T07:45:26.0129548Z return parser.parse_args() 2025-06-26T07:45:26.0130041Z 2025-06-26T07:45:26.0130051Z 2025-06-26T07:45:26.0130708Z def get_gh_client(github_token: str) -> Github: # type: ignore[no-any-unimported] 2025-06-26T07:45:26.0131929Z auth = Auth.Token(github_token) 2025-06-26T07:45:26.0132752Z return Github(auth=auth) 2025-06-26T07:45:26.0133229Z 2025-06-26T07:45:26.0133240Z 2025-06-26T07:45:26.0134270Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: # type: ignore[no-any-unimported] 2025-06-26T07:45:26.0135677Z repo = gh.get_repo(repo) 2025-06-26T07:45:26.0136527Z return repo.get_issue(number=issue_num) 2025-06-26T07:45:26.0137142Z 2025-06-26T07:45:26.0137152Z 2025-06-26T07:45:26.0137454Z def get_potential_pr_author( 2025-06-26T07:45:26.0138573Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2025-06-26T07:45:26.0139759Z ) -> str: 2025-06-26T07:45:26.0140633Z # If the trigger was a new tag added by a bot, this is a ciflow case 2025-06-26T07:45:26.0141999Z # Fetch the actual username from the original PR. The PR number is 2025-06-26T07:45:26.0143243Z # embedded in the tag name: ciflow// 2025-06-26T07:45:26.0144194Z 2025-06-26T07:45:26.0144531Z gh = get_gh_client(github_token) 2025-06-26T07:45:26.0145123Z 2025-06-26T07:45:26.0145557Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2025-06-26T07:45:26.0146857Z split_tag = ref_name.split("/") 2025-06-26T07:45:26.0147666Z if ( 2025-06-26T07:45:26.0148281Z len(split_tag) == 3 2025-06-26T07:45:26.0149060Z and split_tag[0] == "ciflow" 2025-06-26T07:45:26.0149963Z and split_tag[2].isnumeric() 2025-06-26T07:45:26.0150789Z ): 2025-06-26T07:45:26.0151420Z pr_number = split_tag[2] 2025-06-26T07:45:26.0152244Z try: 2025-06-26T07:45:26.0152917Z repository = gh.get_repo(repo) 2025-06-26T07:45:26.0154136Z pull = repository.get_pull(number=int(pr_number)) 2025-06-26T07:45:26.0155130Z except Exception as e: 2025-06-26T07:45:26.0155982Z raise Exception( # noqa: TRY002 2025-06-26T07:45:26.0157084Z f"issue with pull request {pr_number} from repo {repository}" 2025-06-26T07:45:26.0158133Z ) from e 2025-06-26T07:45:26.0158967Z return pull.user.login # type: ignore[no-any-return] 2025-06-26T07:45:26.0160137Z # In all other cases, return the original input username 2025-06-26T07:45:26.0161103Z return username 2025-06-26T07:45:26.0161478Z 2025-06-26T07:45:26.0161487Z 2025-06-26T07:45:26.0161834Z def is_exception_branch(branch: str) -> bool: 2025-06-26T07:45:26.0162680Z """ 2025-06-26T07:45:26.0163918Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2025-06-26T07:45:26.0165193Z """ 2025-06-26T07:45:26.0166072Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2025-06-26T07:45:26.0166945Z 2025-06-26T07:45:26.0166955Z 2025-06-26T07:45:26.0167262Z def load_yaml(yaml_text: str) -> Any: 2025-06-26T07:45:26.0168071Z try: 2025-06-26T07:45:26.0168666Z data = yaml.safe_load(yaml_text) 2025-06-26T07:45:26.0169512Z return data 2025-06-26T07:45:26.0170206Z except yaml.YAMLError: 2025-06-26T07:45:26.0171011Z log.exception("Error loading YAML") 2025-06-26T07:45:26.0171911Z raise 2025-06-26T07:45:26.0172295Z 2025-06-26T07:45:26.0172306Z 2025-06-26T07:45:26.0173008Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> tuple[str, str]: 2025-06-26T07:45:26.0174520Z """ 2025-06-26T07:45:26.0175542Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2025-06-26T07:45:26.0176573Z 2025-06-26T07:45:26.0177373Z If the issue body contains "---" then the text above that is the settings 2025-06-26T07:45:26.0178686Z and the text below is the list of opted in users. 2025-06-26T07:45:26.0179442Z 2025-06-26T07:45:26.0180060Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2025-06-26T07:45:26.0181219Z """ 2025-06-26T07:45:26.0181948Z rollout_state_parts = rollout_state.split("---") 2025-06-26T07:45:26.0182982Z if len(rollout_state_parts) >= 2: 2025-06-26T07:45:26.0184192Z return rollout_state_parts[0], rollout_state_parts[1] 2025-06-26T07:45:26.0185203Z else: 2025-06-26T07:45:26.0185834Z return "", rollout_state 2025-06-26T07:45:26.0186356Z 2025-06-26T07:45:26.0186366Z 2025-06-26T07:45:26.0186702Z class UserOptins(dict[str, list[str]]): 2025-06-26T07:45:26.0187555Z """ 2025-06-26T07:45:26.0188427Z Dictionary of users with a list of features they have opted into 2025-06-26T07:45:26.0189481Z """ 2025-06-26T07:45:26.0189795Z 2025-06-26T07:45:26.0189808Z 2025-06-26T07:45:26.0190370Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2025-06-26T07:45:26.0191440Z """ 2025-06-26T07:45:26.0192583Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2025-06-26T07:45:26.0193981Z 2025-06-26T07:45:26.0195059Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2025-06-26T07:45:26.0196847Z - Example line: "@User1,lf,split_build" 2025-06-26T07:45:26.0197988Z - A "#" prefix indicates the user is opted out of all experiments 2025-06-26T07:45:26.0199087Z 2025-06-26T07:45:26.0199096Z 2025-06-26T07:45:26.0199356Z """ 2025-06-26T07:45:26.0199948Z optins = UserOptins() 2025-06-26T07:45:26.0200730Z for user in user_optin_text.split("\n"): 2025-06-26T07:45:26.0201635Z user = user.strip("\r\n\t -") 2025-06-26T07:45:26.0202517Z if not user or not user.startswith("@"): 2025-06-26T07:45:26.0203664Z # Not a valid user. Skip 2025-06-26T07:45:26.0204511Z continue 2025-06-26T07:45:26.0204904Z 2025-06-26T07:45:26.0205152Z if user: 2025-06-26T07:45:26.0205839Z usr_name = user.split(",")[0].strip("@") 2025-06-26T07:45:26.0206964Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2025-06-26T07:45:26.0207854Z 2025-06-26T07:45:26.0208121Z return optins 2025-06-26T07:45:26.0208505Z 2025-06-26T07:45:26.0208525Z 2025-06-26T07:45:26.0208968Z def is_valid_experiment_name(experiment_name: str) -> bool: 2025-06-26T07:45:26.0209946Z """ 2025-06-26T07:45:26.0210574Z Check if the experiment name is valid. 2025-06-26T07:45:26.0211390Z A valid name: 2025-06-26T07:45:26.0212393Z - Contains only alphanumeric characters and the special characters "_" & "-" 2025-06-26T07:45:26.0214653Z - The special characters "_" & "-" shouldn't be the first or last characters 2025-06-26T07:45:26.0215852Z - Cannot contain spaces 2025-06-26T07:45:26.0216597Z """ 2025-06-26T07:45:26.0216945Z 2025-06-26T07:45:26.0217378Z valid_char_regex = r"^[a-zA-Z0-9]([\w-]*[a-zA-Z0-9])?$" 2025-06-26T07:45:26.0218565Z valid = bool(re.match(valid_char_regex, experiment_name)) 2025-06-26T07:45:26.0219331Z 2025-06-26T07:45:26.0219597Z if valid: 2025-06-26T07:45:26.0220225Z return True 2025-06-26T07:45:26.0220607Z 2025-06-26T07:45:26.0220862Z log.error( 2025-06-26T07:45:26.0223280Z f"Invalid experiment name: {experiment_name}. Experiment names should only contain alphanumeric characters, '_', and '-'. They cannot contain spaces, and the special characters '_' and '-' cannot be the first or last characters." 2025-06-26T07:45:26.0226150Z ) 2025-06-26T07:45:26.0226713Z return False 2025-06-26T07:45:26.0227090Z 2025-06-26T07:45:26.0227101Z 2025-06-26T07:45:26.0227591Z def parse_settings_from_text(settings_text: str) -> Settings: 2025-06-26T07:45:26.0228627Z """ 2025-06-26T07:45:26.0229840Z Parse the experiments from the issue body into a list of ExperimentSettings 2025-06-26T07:45:26.0231104Z """ 2025-06-26T07:45:26.0231666Z try: 2025-06-26T07:45:26.0232260Z if settings_text: 2025-06-26T07:45:26.0233697Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2025-06-26T07:45:26.0235092Z # for easy reading 2025-06-26T07:45:26.0236435Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2025-06-26T07:45:26.0237972Z # the backtick character in shell commands. 2025-06-26T07:45:26.0239050Z backtick = chr(96) # backtick character 2025-06-26T07:45:26.0240175Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2025-06-26T07:45:26.0241283Z settings = load_yaml(settings_text) 2025-06-26T07:45:26.0241908Z 2025-06-26T07:45:26.0242637Z # For now we just load experiments. We can expand this if/when we add more settings 2025-06-26T07:45:26.0244198Z experiments = {} 2025-06-26T07:45:26.0244713Z 2025-06-26T07:45:26.0245340Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2025-06-26T07:45:26.0246605Z if not is_valid_experiment_name(exp_name): 2025-06-26T07:45:26.0248476Z # Exclude invalid experiments from the list. We log an error, but don't raise an exception so that other experiments can still be processed. 2025-06-26T07:45:26.0250288Z continue 2025-06-26T07:45:26.0251087Z 2025-06-26T07:45:26.0251371Z valid_settings = {} 2025-06-26T07:45:26.0252182Z for setting in exp_settings: 2025-06-26T07:45:26.0253095Z if setting not in Experiment._fields: 2025-06-26T07:45:26.0254239Z log.warning( 2025-06-26T07:45:26.0255778Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2025-06-26T07:45:26.0256981Z ) 2025-06-26T07:45:26.0257666Z else: 2025-06-26T07:45:26.0258519Z valid_settings[setting] = exp_settings[setting] 2025-06-26T07:45:26.0259210Z 2025-06-26T07:45:26.0259660Z experiments[exp_name] = Experiment(**valid_settings) 2025-06-26T07:45:26.0260686Z return Settings(experiments) 2025-06-26T07:45:26.0261268Z 2025-06-26T07:45:26.0261554Z except Exception: 2025-06-26T07:45:26.0262840Z log.exception("Failed to parse settings") 2025-06-26T07:45:26.0264018Z 2025-06-26T07:45:26.0264301Z return Settings() 2025-06-26T07:45:26.0264727Z 2025-06-26T07:45:26.0264736Z 2025-06-26T07:45:26.0265144Z def parse_settings(rollout_state: str) -> Settings: 2025-06-26T07:45:26.0266078Z """ 2025-06-26T07:45:26.0266789Z Parse settings, if any, from the rollout state. 2025-06-26T07:45:26.0267478Z 2025-06-26T07:45:26.0268056Z If the issue body contains "---" then the text above that is the settings 2025-06-26T07:45:26.0269386Z and the text below is the list of opted in users. 2025-06-26T07:45:26.0270069Z 2025-06-26T07:45:26.0270733Z If it doesn't contain "---" then the settings are empty and the default values are used. 2025-06-26T07:45:26.0271953Z """ 2025-06-26T07:45:26.0272861Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2025-06-26T07:45:26.0274338Z return parse_settings_from_text(settings_text) 2025-06-26T07:45:26.0275009Z 2025-06-26T07:45:26.0275019Z 2025-06-26T07:45:26.0275430Z def parse_users(rollout_state: str) -> UserOptins: 2025-06-26T07:45:26.0276355Z """ 2025-06-26T07:45:26.0276964Z Parse users from the rollout state. 2025-06-26T07:45:26.0277539Z 2025-06-26T07:45:26.0277784Z """ 2025-06-26T07:45:26.0278655Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2025-06-26T07:45:26.0279917Z return parse_user_opt_in_from_text(users_text) 2025-06-26T07:45:26.0280595Z 2025-06-26T07:45:26.0280609Z 2025-06-26T07:45:26.0281541Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-06-26T07:45:26.0282862Z """ 2025-06-26T07:45:26.0283729Z Check if a user is opted into an experiment 2025-06-26T07:45:26.0284639Z """ 2025-06-26T07:45:26.0285381Z return experiment_name in user_optins.get(user, []) 2025-06-26T07:45:26.0286104Z 2025-06-26T07:45:26.0286114Z 2025-06-26T07:45:26.0286825Z def is_user_opted_out(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2025-06-26T07:45:26.0288032Z """ 2025-06-26T07:45:26.0288755Z Check if a user explicitly opted out of an experiment 2025-06-26T07:45:26.0289670Z """ 2025-06-26T07:45:26.0290429Z # if the experiment is prefixed with a "-", then it's an opt-out 2025-06-26T07:45:26.0291512Z experiment_optout = "-" + experiment_name 2025-06-26T07:45:26.0292551Z if experiment_optout not in user_optins.get(user, []): 2025-06-26T07:45:26.0293750Z return False 2025-06-26T07:45:26.0294141Z 2025-06-26T07:45:26.0294559Z if is_user_opted_in(user, user_optins, experiment_name): 2025-06-26T07:45:26.0295513Z log.warning( 2025-06-26T07:45:26.0296790Z f"User {user} is opted into experiment {experiment_name}, but also opted out of it. Defaulting to opting out" 2025-06-26T07:45:26.0298181Z ) 2025-06-26T07:45:26.0298495Z 2025-06-26T07:45:26.0298753Z return True 2025-06-26T07:45:26.0299116Z 2025-06-26T07:45:26.0299125Z 2025-06-26T07:45:26.0299389Z def get_runner_prefix( 2025-06-26T07:45:26.0300062Z rollout_state: str, 2025-06-26T07:45:26.0301045Z workflow_requestors: Iterable[str], 2025-06-26T07:45:26.0301903Z branch: str, 2025-06-26T07:45:26.0302650Z eligible_experiments: frozenset[str] = frozenset(), 2025-06-26T07:45:26.0303933Z opt_out_experiments: frozenset[str] = frozenset(), 2025-06-26T07:45:26.0304879Z is_canary: bool = False, 2025-06-26T07:45:26.0305566Z ) -> str: 2025-06-26T07:45:26.0306244Z settings = parse_settings(rollout_state) 2025-06-26T07:45:26.0307204Z user_optins = parse_users(rollout_state) 2025-06-26T07:45:26.0307827Z 2025-06-26T07:45:26.0308101Z fleet_prefix = "" 2025-06-26T07:45:26.0308778Z prefixes = [] 2025-06-26T07:45:26.0309825Z for experiment_name, experiment_settings in settings.experiments.items(): 2025-06-26T07:45:26.0311385Z if not experiment_settings.all_branches and is_exception_branch(branch): 2025-06-26T07:45:26.0312535Z log.info( 2025-06-26T07:45:26.0313854Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2025-06-26T07:45:26.0315165Z ) 2025-06-26T07:45:26.0315786Z continue 2025-06-26T07:45:26.0316203Z 2025-06-26T07:45:26.0316512Z if opt_out_experiments: 2025-06-26T07:45:26.0317391Z if experiment_name in opt_out_experiments: 2025-06-26T07:45:26.0318419Z opt_out_exp_list = ", ".join(opt_out_experiments) 2025-06-26T07:45:26.0319335Z log.info( 2025-06-26T07:45:26.0320868Z f"Skipping experiment '{experiment_name}', as this workflow has opted-out (opted out experiments are: {opt_out_exp_list})" 2025-06-26T07:45:26.0322475Z ) 2025-06-26T07:45:26.0323082Z continue 2025-06-26T07:45:26.0323772Z 2025-06-26T07:45:26.0324075Z if eligible_experiments: 2025-06-26T07:45:26.0324949Z if experiment_name not in eligible_experiments: 2025-06-26T07:45:26.0325943Z exp_list = ", ".join(eligible_experiments) 2025-06-26T07:45:26.0326819Z log.info( 2025-06-26T07:45:26.0328149Z f"Skipping experiment '{experiment_name}', as it is not in the eligible_experiments list: {exp_list}" 2025-06-26T07:45:26.0329596Z ) 2025-06-26T07:45:26.0330220Z continue 2025-06-26T07:45:26.0330964Z elif not experiment_settings.default: 2025-06-26T07:45:26.0331822Z log.info( 2025-06-26T07:45:26.0333144Z f"Skipping experiment '{experiment_name}', as it is not a default experiment" 2025-06-26T07:45:26.0334685Z ) 2025-06-26T07:45:26.0335343Z continue 2025-06-26T07:45:26.0335758Z 2025-06-26T07:45:26.0336214Z # Is any workflow_requestor opted out to this experiment? 2025-06-26T07:45:26.0337251Z opted_out_users = [ 2025-06-26T07:45:26.0338005Z requestor 2025-06-26T07:45:26.0338767Z for requestor in workflow_requestors 2025-06-26T07:45:26.0339893Z if is_user_opted_out(requestor, user_optins, experiment_name) 2025-06-26T07:45:26.0340984Z ] 2025-06-26T07:45:26.0341326Z 2025-06-26T07:45:26.0341599Z if opted_out_users: 2025-06-26T07:45:26.0342296Z log.info( 2025-06-26T07:45:26.0343265Z f"{', '.join(opted_out_users)} have opted out of experiment {experiment_name}." 2025-06-26T07:45:26.0344596Z ) 2025-06-26T07:45:26.0345194Z continue 2025-06-26T07:45:26.0345573Z 2025-06-26T07:45:26.0346000Z # Is any workflow_requestor opted in to this experiment? 2025-06-26T07:45:26.0346975Z opted_in_users = [ 2025-06-26T07:45:26.0347648Z requestor 2025-06-26T07:45:26.0348339Z for requestor in workflow_requestors 2025-06-26T07:45:26.0349403Z if is_user_opted_in(requestor, user_optins, experiment_name) 2025-06-26T07:45:26.0350395Z ] 2025-06-26T07:45:26.0350717Z 2025-06-26T07:45:26.0350997Z enabled = False 2025-06-26T07:45:26.0351714Z if opted_in_users: 2025-06-26T07:45:26.0352449Z log.info( 2025-06-26T07:45:26.0353961Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2025-06-26T07:45:26.0355151Z ) 2025-06-26T07:45:26.0355790Z enabled = True 2025-06-26T07:45:26.0356277Z 2025-06-26T07:45:26.0356628Z elif experiment_settings.rollout_perc: 2025-06-26T07:45:26.0358046Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2025-06-26T07:45:26.0359598Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2025-06-26T07:45:26.0360650Z log.info( 2025-06-26T07:45:26.0362063Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2025-06-26T07:45:26.0363953Z ) 2025-06-26T07:45:26.0364643Z enabled = True 2025-06-26T07:45:26.0365163Z 2025-06-26T07:45:26.0365432Z if enabled: 2025-06-26T07:45:26.0366111Z label = experiment_name 2025-06-26T07:45:26.0367015Z if experiment_name == LF_FLEET_EXPERIMENT: 2025-06-26T07:45:26.0368350Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2025-06-26T07:45:26.0369785Z # - If it's enabled, then we always list it's prefix first 2025-06-26T07:45:26.0371076Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2025-06-26T07:45:26.0372212Z if is_canary: 2025-06-26T07:45:26.0373038Z label += CANARY_FLEET_SUFFIX 2025-06-26T07:45:26.0374165Z fleet_prefix = label 2025-06-26T07:45:26.0375018Z else: 2025-06-26T07:45:26.0375716Z prefixes.append(label) 2025-06-26T07:45:26.0376327Z 2025-06-26T07:45:26.0376620Z if len(prefixes) > 1: 2025-06-26T07:45:26.0377315Z log.error( 2025-06-26T07:45:26.0379015Z f"Only a fleet and one other experiment can be enabled for a job at any time. Enabling {prefixes[0]} and ignoring the rest, which are {', '.join(prefixes[1:])}" 2025-06-26T07:45:26.0381080Z ) 2025-06-26T07:45:26.0381717Z prefixes = prefixes[:1] 2025-06-26T07:45:26.0382222Z 2025-06-26T07:45:26.0382522Z # Fleet always comes first 2025-06-26T07:45:26.0383297Z if fleet_prefix: 2025-06-26T07:45:26.0384242Z prefixes.insert(0, fleet_prefix) 2025-06-26T07:45:26.0384858Z 2025-06-26T07:45:26.0385498Z return ".".join(prefixes) + "." if prefixes else "" 2025-06-26T07:45:26.0386229Z 2025-06-26T07:45:26.0386240Z 2025-06-26T07:45:26.0386972Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2025-06-26T07:45:26.0388217Z """ 2025-06-26T07:45:26.0389170Z Gets the first comment of the issue, which contains the desired rollout state. 2025-06-26T07:45:26.0390134Z 2025-06-26T07:45:26.0390754Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2025-06-26T07:45:26.0391895Z """ 2025-06-26T07:45:26.0392539Z gh = get_gh_client(github_token) 2025-06-26T07:45:26.0393667Z issue = get_issue(gh, repo, issue_num) 2025-06-26T07:45:26.0394749Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2025-06-26T07:45:26.0395519Z 2025-06-26T07:45:26.0395531Z 2025-06-26T07:45:26.0396204Z def download_json(url: str, headers: dict[str, str], num_retries: int = 3) -> Any: 2025-06-26T07:45:26.0397499Z for _ in range(num_retries): 2025-06-26T07:45:26.0398297Z try: 2025-06-26T07:45:26.0399016Z req = Request(url=url, headers=headers) 2025-06-26T07:45:26.0400135Z content = urlopen(req, timeout=5).read().decode("utf-8") 2025-06-26T07:45:26.0401175Z return json.loads(content) 2025-06-26T07:45:26.0401996Z except Exception as e: 2025-06-26T07:45:26.0402849Z log.warning(f"Could not download {url}: {e}") 2025-06-26T07:45:26.0403781Z 2025-06-26T07:45:26.0404398Z log.warning(f"All {num_retries} retries exhausted, downloading {url} failed") 2025-06-26T07:45:26.0405776Z return {} 2025-06-26T07:45:26.0406117Z 2025-06-26T07:45:26.0406127Z 2025-06-26T07:45:26.0406368Z @cache 2025-06-26T07:45:26.0407337Z def get_pr_info(github_repo: str, github_token: str, pr_number: int) -> dict[str, Any]: 2025-06-26T07:45:26.0408559Z """ 2025-06-26T07:45:26.0409169Z Dynamically get PR information 2025-06-26T07:45:26.0409956Z """ 2025-06-26T07:45:26.0410744Z github_api = f"https://api.github.com/repos/{github_repo}" 2025-06-26T07:45:26.0411760Z headers = { 2025-06-26T07:45:26.0412433Z "Accept": "application/vnd.github.v3+json", 2025-06-26T07:45:26.0413872Z "Authorization": f"token {github_token}", 2025-06-26T07:45:26.0414687Z } 2025-06-26T07:45:26.0415344Z json_response: dict[str, Any] = download_json( 2025-06-26T07:45:26.0416305Z url=f"{github_api}/issues/{pr_number}", 2025-06-26T07:45:26.0417155Z headers=headers, 2025-06-26T07:45:26.0417803Z ) 2025-06-26T07:45:26.0418108Z 2025-06-26T07:45:26.0418396Z if not json_response: 2025-06-26T07:45:26.0419281Z log.warning(f"Failed to get the labels for #{pr_number}") 2025-06-26T07:45:26.0420519Z return {} 2025-06-26T07:45:26.0420909Z 2025-06-26T07:45:26.0421185Z return json_response 2025-06-26T07:45:26.0421615Z 2025-06-26T07:45:26.0421624Z 2025-06-26T07:45:26.0422448Z def get_labels(github_repo: str, github_token: str, pr_number: int) -> set[str]: 2025-06-26T07:45:26.0423807Z """ 2025-06-26T07:45:26.0424713Z Dynamically get the latest list of labels from the pull request 2025-06-26T07:45:26.0425745Z """ 2025-06-26T07:45:26.0426479Z pr_info = get_pr_info(github_repo, github_token, pr_number) 2025-06-26T07:45:26.0427438Z return { 2025-06-26T07:45:26.0428409Z label.get("name") for label in pr_info.get("labels", []) if label.get("name") 2025-06-26T07:45:26.0429538Z } 2025-06-26T07:45:26.0429864Z 2025-06-26T07:45:26.0429872Z 2025-06-26T07:45:26.0430141Z def main() -> None: 2025-06-26T07:45:26.0430792Z args = parse_args() 2025-06-26T07:45:26.0431193Z 2025-06-26T07:45:26.0431514Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2025-06-26T07:45:26.0432100Z 2025-06-26T07:45:26.0432395Z # Check if the PR is opt-out 2025-06-26T07:45:26.0433187Z if args.pr_number: 2025-06-26T07:45:26.0434469Z labels = get_labels(args.github_repo, args.github_token, int(args.pr_number)) 2025-06-26T07:45:26.0435934Z if OPT_OUT_LABEL in labels: 2025-06-26T07:45:26.0436778Z log.info( 2025-06-26T07:45:26.0437924Z f"Opt-out runner determinator because #{args.pr_number} has {OPT_OUT_LABEL} label" 2025-06-26T07:45:26.0439267Z ) 2025-06-26T07:45:26.0440187Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-06-26T07:45:26.0441324Z sys.exit() 2025-06-26T07:45:26.0441788Z 2025-06-26T07:45:26.0442054Z try: 2025-06-26T07:45:26.0442744Z rollout_state = get_rollout_state_from_issue( 2025-06-26T07:45:26.0444564Z args.github_token, args.github_issue_repo, args.github_issue 2025-06-26T07:45:26.0445392Z ) 2025-06-26T07:45:26.0445649Z 2025-06-26T07:45:26.0445894Z username = get_potential_pr_author( 2025-06-26T07:45:26.0446542Z args.github_token, 2025-06-26T07:45:26.0447101Z args.github_repo, 2025-06-26T07:45:26.0447659Z args.github_actor, 2025-06-26T07:45:26.0448239Z args.github_ref_type, 2025-06-26T07:45:26.0448828Z args.github_branch, 2025-06-26T07:45:26.0449353Z ) 2025-06-26T07:45:26.0449595Z 2025-06-26T07:45:26.0449935Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2025-06-26T07:45:26.0450503Z 2025-06-26T07:45:26.0450760Z runner_label_prefix = get_runner_prefix( 2025-06-26T07:45:26.0451405Z rollout_state, 2025-06-26T07:45:26.0451971Z (args.github_issue_owner, username), 2025-06-26T07:45:26.0452613Z args.github_branch, 2025-06-26T07:45:26.0453192Z args.eligible_experiments, 2025-06-26T07:45:26.0454422Z args.opt_out_experiments, 2025-06-26T07:45:26.0454986Z is_canary, 2025-06-26T07:45:26.0455426Z ) 2025-06-26T07:45:26.0455653Z 2025-06-26T07:45:26.0455848Z except Exception as e: 2025-06-26T07:45:26.0456333Z log.error( 2025-06-26T07:45:26.0457079Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2025-06-26T07:45:26.0457947Z ) 2025-06-26T07:45:26.0458165Z 2025-06-26T07:45:26.0458528Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2025-06-26T07:45:26.0459098Z 2025-06-26T07:45:26.0459105Z 2025-06-26T07:45:26.0459293Z if __name__ == "__main__": 2025-06-26T07:45:26.0459758Z main() 2025-06-26T07:45:26.0459984Z 2025-06-26T07:45:26.0549104Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-06-26T07:45:26.0549906Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2025-06-26T07:45:26.0606764Z shell: /usr/bin/bash -e {0} 2025-06-26T07:45:26.0607202Z env: 2025-06-26T07:45:26.0607746Z GITHUB_TOKEN: *** 2025-06-26T07:45:26.0608133Z ISSUE_NUMBER: 5132 2025-06-26T07:45:26.0608533Z TRIGGERING_ACTOR: nautsimon 2025-06-26T07:45:26.0608965Z ISSUE_OWNER: nautsimon 2025-06-26T07:45:26.0609356Z CHECK_EXPERIMENTS: 2025-06-26T07:45:26.0609748Z OPT_OUT_EXPERIMENTS: 2025-06-26T07:45:26.0610128Z PR_NUMBER: 156936 2025-06-26T07:45:26.0610479Z ##[endgroup] 2025-06-26T07:45:29.5503625Z Defaulting to user installation because normal site-packages is not writeable 2025-06-26T07:45:31.6861952Z Collecting urllib3==1.26.18 2025-06-26T07:45:31.7683257Z Downloading urllib3-1.26.18-py2.py3-none-any.whl.metadata (48 kB) 2025-06-26T07:45:31.8031261Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.9/48.9 kB 1.9 MB/s eta 0:00:00 2025-06-26T07:45:31.8235064Z Collecting PyGithub==2.3.0 2025-06-26T07:45:31.8430275Z Downloading PyGithub-2.3.0-py3-none-any.whl.metadata (3.8 kB) 2025-06-26T07:45:31.8860671Z Collecting pynacl>=1.4.0 (from PyGithub==2.3.0) 2025-06-26T07:45:31.9060045Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl.metadata (8.6 kB) 2025-06-26T07:45:31.9115775Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.31.0) 2025-06-26T07:45:31.9131604Z Requirement already satisfied: pyjwt>=2.4.0 in /usr/lib/python3/dist-packages (from pyjwt[crypto]>=2.4.0->PyGithub==2.3.0) (2.7.0) 2025-06-26T07:45:31.9146031Z Requirement already satisfied: typing-extensions>=4.0.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (4.10.0) 2025-06-26T07:45:31.9385158Z Collecting Deprecated (from PyGithub==2.3.0) 2025-06-26T07:45:31.9581055Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl.metadata (5.7 kB) 2025-06-26T07:45:31.9806280Z Requirement already satisfied: cryptography>=3.4.0 in /usr/lib/python3/dist-packages (from pyjwt[crypto]>=2.4.0->PyGithub==2.3.0) (41.0.7) 2025-06-26T07:45:32.0941874Z Collecting cffi>=1.4.1 (from pynacl>=1.4.0->PyGithub==2.3.0) 2025-06-26T07:45:32.1137892Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (1.5 kB) 2025-06-26T07:45:32.2141433Z Collecting wrapt<2,>=1.10 (from Deprecated->PyGithub==2.3.0) 2025-06-26T07:45:32.2339737Z Downloading wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.4 kB) 2025-06-26T07:45:32.2538655Z Collecting pycparser (from cffi>=1.4.1->pynacl>=1.4.0->PyGithub==2.3.0) 2025-06-26T07:45:32.2734102Z Downloading pycparser-2.22-py3-none-any.whl.metadata (943 bytes) 2025-06-26T07:45:32.3132572Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2025-06-26T07:45:32.3387282Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 kB 5.7 MB/s eta 0:00:00 2025-06-26T07:45:32.3584908Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2025-06-26T07:45:32.3823281Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 kB 15.5 MB/s eta 0:00:00 2025-06-26T07:45:32.4020745Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2025-06-26T07:45:32.4271226Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 kB 36.2 MB/s eta 0:00:00 2025-06-26T07:45:32.4466049Z Downloading Deprecated-1.2.18-py2.py3-none-any.whl (10.0 kB) 2025-06-26T07:45:32.4690750Z Downloading cffi-1.17.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (479 kB) 2025-06-26T07:45:32.4760618Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 479.4/479.4 kB 88.4 MB/s eta 0:00:00 2025-06-26T07:45:32.4958105Z Downloading wrapt-1.17.2-cp312-cp312-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (89 kB) 2025-06-26T07:45:32.5011083Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.2/89.2 kB 25.8 MB/s eta 0:00:00 2025-06-26T07:45:32.5209096Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2025-06-26T07:45:32.5259962Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 kB 34.1 MB/s eta 0:00:00 2025-06-26T07:45:32.8506287Z Installing collected packages: wrapt, urllib3, pycparser, Deprecated, cffi, pynacl, PyGithub 2025-06-26T07:45:33.3729530Z Successfully installed Deprecated-1.2.18 PyGithub-2.3.0 cffi-1.17.1 pycparser-2.22 pynacl-1.5.0 urllib3-1.26.18 wrapt-1.17.2 2025-06-26T07:45:33.4469811Z ##[group]Run curr_branch="gh/nautsimon/7/head" 2025-06-26T07:45:33.4470187Z curr_branch="gh/nautsimon/7/head" 2025-06-26T07:45:33.4470462Z curr_ref_type="branch" 2025-06-26T07:45:33.4470713Z echo "Current branch is '$curr_branch'" 2025-06-26T07:45:33.4470965Z  2025-06-26T07:45:33.4471145Z python3 runner_determinator.py \ 2025-06-26T07:45:33.4471438Z  --github-token "$GITHUB_TOKEN" \ 2025-06-26T07:45:33.4471703Z  --github-issue "$ISSUE_NUMBER" \ 2025-06-26T07:45:33.4471954Z  --github-branch "$curr_branch" \ 2025-06-26T07:45:33.4472220Z  --github-actor "$TRIGGERING_ACTOR" \ 2025-06-26T07:45:33.4472519Z  --github-issue-owner "$ISSUE_OWNER" \ 2025-06-26T07:45:33.4472812Z  --github-ref-type "$curr_ref_type" \ 2025-06-26T07:45:33.4473078Z  --github-repo "$GITHUB_REPOSITORY" \ 2025-06-26T07:45:33.4473577Z  --eligible-experiments "$CHECK_EXPERIMENTS" \ 2025-06-26T07:45:33.4473906Z  --opt-out-experiments "$OPT_OUT_EXPERIMENTS" \ 2025-06-26T07:45:33.4474193Z  --pr-number "${PR_NUMBER}" 2025-06-26T07:45:33.4532342Z shell: /usr/bin/bash -e {0} 2025-06-26T07:45:33.4532562Z env: 2025-06-26T07:45:33.4533148Z GITHUB_TOKEN: *** 2025-06-26T07:45:33.4533700Z ISSUE_NUMBER: 5132 2025-06-26T07:45:33.4533918Z TRIGGERING_ACTOR: nautsimon 2025-06-26T07:45:33.4534131Z ISSUE_OWNER: nautsimon 2025-06-26T07:45:33.4534346Z CHECK_EXPERIMENTS: 2025-06-26T07:45:33.4534530Z OPT_OUT_EXPERIMENTS: 2025-06-26T07:45:33.4534723Z PR_NUMBER: 156936 2025-06-26T07:45:33.4534930Z ##[endgroup] 2025-06-26T07:45:33.4607918Z Current branch is 'gh/nautsimon/7/head' 2025-06-26T07:45:35.7249376Z INFO : Setting output: label-type='' 2025-06-26T07:45:35.7561917Z Evaluate and set job outputs 2025-06-26T07:45:35.7568894Z Cleaning up orphan processes