2024-10-08T19:58:16.1411953Z Current runner version: '2.320.0' 2024-10-08T19:58:16.1438659Z ##[group]Operating System 2024-10-08T19:58:16.1439384Z Ubuntu 2024-10-08T19:58:16.1439734Z 22.04.5 2024-10-08T19:58:16.1440115Z LTS 2024-10-08T19:58:16.1440469Z ##[endgroup] 2024-10-08T19:58:16.1440860Z ##[group]Runner Image 2024-10-08T19:58:16.1441355Z Image: ubuntu-22.04 2024-10-08T19:58:16.1441781Z Version: 20241006.1.0 2024-10-08T19:58:16.1442780Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20241006.1/images/ubuntu/Ubuntu2204-Readme.md 2024-10-08T19:58:16.1444841Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20241006.1 2024-10-08T19:58:16.1445745Z ##[endgroup] 2024-10-08T19:58:16.1446178Z ##[group]Runner Image Provisioner 2024-10-08T19:58:16.1446706Z 2.0.384.1 2024-10-08T19:58:16.1447070Z ##[endgroup] 2024-10-08T19:58:16.1463117Z ##[group]GITHUB_TOKEN Permissions 2024-10-08T19:58:16.1465011Z Contents: read 2024-10-08T19:58:16.1465596Z Metadata: read 2024-10-08T19:58:16.1466222Z ##[endgroup] 2024-10-08T19:58:16.1469601Z Secret source: Actions 2024-10-08T19:58:16.1470252Z Prepare workflow directory 2024-10-08T19:58:16.2398059Z Prepare all required actions 2024-10-08T19:58:16.2563344Z Uses: pytorch/pytorch/.github/workflows/_runner-determinator.yml@refs/tags/ciflow/trunk/134247 (47952c0a8001fd60c9ffe52b121d022d440bef8b) 2024-10-08T19:58:16.2568964Z ##[group] Inputs 2024-10-08T19:58:16.2569596Z triggering_actor: pytorch-bot[bot] 2024-10-08T19:58:16.2570138Z issue_owner: 2024-10-08T19:58:16.2570575Z curr_branch: ciflow/trunk/134247 2024-10-08T19:58:16.2571140Z curr_ref_type: tag 2024-10-08T19:58:16.2571550Z issue_number: 5132 2024-10-08T19:58:16.2571994Z ##[endgroup] 2024-10-08T19:58:16.2572956Z Complete job name: before-test / get-label-type / runner-determinator 2024-10-08T19:58:16.8010896Z ##[group]Run cat < runner_determinator.py 2024-10-08T19:58:16.8012809Z cat < runner_determinator.py 2024-10-08T19:58:16.8013535Z # flake8: noqa: G004 2024-10-08T19:58:16.8014073Z  2024-10-08T19:58:16.8014833Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-10-08T19:58:16.8016237Z # must be kept in sync. You can do it easily by running the following command: 2024-10-08T19:58:16.8017361Z # python .github/scripts/update_runner_determinator.py 2024-10-08T19:58:16.8018074Z  2024-10-08T19:58:16.8018516Z """ 2024-10-08T19:58:16.8019283Z This runner determinator is used to determine which set of runners to run a 2024-10-08T19:58:16.8020480Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-10-08T19:58:16.8021863Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-10-08T19:58:16.8022920Z of which runners should be used to run which job. 2024-10-08T19:58:16.8023653Z  2024-10-08T19:58:16.8024381Z The configuration has two parts, the settings and a list of opted-in users, 2024-10-08T19:58:16.8025578Z separated by a line containing "---". If the line is not present, the 2024-10-08T19:58:16.8026829Z settings are considered to be empty with only the second part, the user 2024-10-08T19:58:16.8027670Z list, defined. 2024-10-08T19:58:16.8028137Z  2024-10-08T19:58:16.8028927Z The first part is a YAML block that defines the rollout settings. This can be 2024-10-08T19:58:16.8030165Z used to define any settings that are needed to determine which runners to use. 2024-10-08T19:58:16.8031291Z It's fields are defined by the RolloutSettings class below. 2024-10-08T19:58:16.8032134Z  2024-10-08T19:58:16.8032837Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-10-08T19:58:16.8034039Z The user list is also a comma separated list of additional features or 2024-10-08T19:58:16.8035111Z experiments which the user could be opted in to. 2024-10-08T19:58:16.8036079Z  2024-10-08T19:58:16.8036511Z The user list has the following rules: 2024-10-08T19:58:16.8037196Z  2024-10-08T19:58:16.8037861Z - Users are GitHub usernames, which must start with the @ prefix 2024-10-08T19:58:16.8039009Z - Each user is also a comma-separated list of features/experiments to enable 2024-10-08T19:58:16.8040134Z - A "#" prefix opts the user out of all experiments 2024-10-08T19:58:16.8040816Z  2024-10-08T19:58:16.8041294Z Example config: 2024-10-08T19:58:16.8041980Z  # A list of experiments that can be opted into. 2024-10-08T19:58:16.8042887Z  # This defines the behavior they'll induce when opted into. 2024-10-08T19:58:16.8043880Z  # Expected syntax is: 2024-10-08T19:58:16.8044820Z  # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-10-08T19:58:16.8046189Z  # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-10-08T19:58:16.8047176Z  2024-10-08T19:58:16.8047589Z  experiments: 2024-10-08T19:58:16.8048072Z  lf: 2024-10-08T19:58:16.8048513Z  rollout_percent: 25 2024-10-08T19:58:16.8049090Z  2024-10-08T19:58:16.8049469Z  --- 2024-10-08T19:58:16.8049858Z  2024-10-08T19:58:16.8050263Z  # Opt-ins: 2024-10-08T19:58:16.8051075Z  # Users can opt into the LF fleet by adding their GitHub username to this list 2024-10-08T19:58:16.8052243Z  # and specifying experiments to enable in a comma-separated list. 2024-10-08T19:58:16.8053481Z  # Experiments should be from the above list. 2024-10-08T19:58:16.8054133Z  2024-10-08T19:58:16.8054525Z  @User1,lf,split_build 2024-10-08T19:58:16.8055149Z  @User2,lf 2024-10-08T19:58:16.8055586Z  @User3,split_build 2024-10-08T19:58:16.8056110Z """ 2024-10-08T19:58:16.8056567Z  2024-10-08T19:58:16.8056915Z import logging 2024-10-08T19:58:16.8057381Z import os 2024-10-08T19:58:16.8057883Z import random 2024-10-08T19:58:16.8058370Z from argparse import ArgumentParser 2024-10-08T19:58:16.8059024Z from logging import LogRecord 2024-10-08T19:58:16.8059886Z from typing import Any, Dict, Iterable, List, NamedTuple, Tuple 2024-10-08T19:58:16.8060639Z  2024-10-08T19:58:16.8061022Z import yaml 2024-10-08T19:58:16.8061572Z from github import Auth, Github 2024-10-08T19:58:16.8062160Z from github.Issue import Issue 2024-10-08T19:58:16.8062758Z  2024-10-08T19:58:16.8063185Z  2024-10-08T19:58:16.8063637Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-10-08T19:58:16.8064558Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-10-08T19:58:16.8065793Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-10-08T19:58:16.8066644Z  2024-10-08T19:58:16.8067155Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-10-08T19:58:16.8067946Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-10-08T19:58:16.8068584Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-10-08T19:58:16.8069236Z  2024-10-08T19:58:16.8069673Z  2024-10-08T19:58:16.8070088Z SETTING_EXPERIMENTS = "experiments" 2024-10-08T19:58:16.8070697Z  2024-10-08T19:58:16.8071162Z LF_FLEET_EXPERIMENT = "lf" 2024-10-08T19:58:16.8071710Z CANARY_FLEET_SUFFIX = ".c" 2024-10-08T19:58:16.8072244Z  2024-10-08T19:58:16.8072677Z  2024-10-08T19:58:16.8073065Z class Experiment(NamedTuple): 2024-10-08T19:58:16.8073655Z  rollout_perc: float = ( 2024-10-08T19:58:16.8074589Z  0 # Percentage of workflows to experiment on when user is not opted-in. 2024-10-08T19:58:16.8075643Z  ) 2024-10-08T19:58:16.8076028Z  all_branches: bool = ( 2024-10-08T19:58:16.8076981Z  False # If True, the experiment is also enabled on the exception branches 2024-10-08T19:58:16.8077859Z  ) 2024-10-08T19:58:16.8078209Z  2024-10-08T19:58:16.8078703Z  # Add more fields as needed 2024-10-08T19:58:16.8079264Z  2024-10-08T19:58:16.8079580Z  2024-10-08T19:58:16.8080048Z class Settings(NamedTuple): 2024-10-08T19:58:16.8080587Z  """ 2024-10-08T19:58:16.8081151Z  Settings for the experiments that can be opted into. 2024-10-08T19:58:16.8081989Z  """ 2024-10-08T19:58:16.8082382Z  2024-10-08T19:58:16.8082928Z  experiments: Dict[str, Experiment] = {} 2024-10-08T19:58:16.8083528Z  2024-10-08T19:58:16.8084179Z  2024-10-08T19:58:16.8084763Z class ColorFormatter(logging.Formatter): 2024-10-08T19:58:16.8085559Z  """Color codes the log messages based on the log level""" 2024-10-08T19:58:16.8086298Z  2024-10-08T19:58:16.8086750Z  COLORS = { 2024-10-08T19:58:16.8087226Z  "WARNING": "\033[33m", # Yellow 2024-10-08T19:58:16.8087878Z  "ERROR": "\033[31m", # Red 2024-10-08T19:58:16.8088564Z  "CRITICAL": "\033[31m", # Red 2024-10-08T19:58:16.8089165Z  "INFO": "\033[0m", # Reset 2024-10-08T19:58:16.8089809Z  "DEBUG": "\033[0m", # Reset 2024-10-08T19:58:16.8090439Z  } 2024-10-08T19:58:16.8090796Z  2024-10-08T19:58:16.8091489Z  def format(self, record: LogRecord) -> str: 2024-10-08T19:58:16.8092576Z  log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-10-08T19:58:16.8093591Z  record.msg = f"{log_color}{record.msg}\033[0m" 2024-10-08T19:58:16.8094356Z  return super().format(record) 2024-10-08T19:58:16.8095002Z  2024-10-08T19:58:16.8095377Z  2024-10-08T19:58:16.8095776Z handler = logging.StreamHandler() 2024-10-08T19:58:16.8096754Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-10-08T19:58:16.8097641Z  2024-10-08T19:58:16.8098141Z log = logging.getLogger(os.path.basename(__file__)) 2024-10-08T19:58:16.8098938Z log.addHandler(handler) 2024-10-08T19:58:16.8099526Z log.setLevel(logging.INFO) 2024-10-08T19:58:16.8100025Z  2024-10-08T19:58:16.8100442Z  2024-10-08T19:58:16.8100993Z def set_github_output(key: str, value: str) -> None: 2024-10-08T19:58:16.8101660Z  """ 2024-10-08T19:58:16.8102388Z  Defines outputs of the github action that invokes this script 2024-10-08T19:58:16.8103183Z  """ 2024-10-08T19:58:16.8103580Z  if not GITHUB_OUTPUT: 2024-10-08T19:58:16.8105130Z  # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-10-08T19:58:16.8106624Z  log.warning( 2024-10-08T19:58:16.8107792Z  "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2024-10-08T19:58:16.8109053Z  ) 2024-10-08T19:58:16.8109614Z  print(f"::set-output name={key}::{value}") 2024-10-08T19:58:16.8110281Z  return 2024-10-08T19:58:16.8110765Z  2024-10-08T19:58:16.8111214Z  with open(GITHUB_OUTPUT, "a") as f: 2024-10-08T19:58:16.8111980Z  log.info(f"Setting output: {key}='{value}'") 2024-10-08T19:58:16.8112730Z  f.write(f"{key}={value}\n") 2024-10-08T19:58:16.8113300Z  2024-10-08T19:58:16.8113831Z  2024-10-08T19:58:16.8114256Z def parse_args() -> Any: 2024-10-08T19:58:16.8114987Z  parser = ArgumentParser("Get dynamic rollout settings") 2024-10-08T19:58:16.8116158Z  parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-10-08T19:58:16.8117186Z  parser.add_argument( 2024-10-08T19:58:16.8117758Z  "--github-issue-repo", 2024-10-08T19:58:16.8118348Z  type=str, 2024-10-08T19:58:16.8118869Z  required=False, 2024-10-08T19:58:16.8119473Z  default="pytorch/test-infra", 2024-10-08T19:58:16.8120177Z  help="GitHub repo to get the issue", 2024-10-08T19:58:16.8120862Z  ) 2024-10-08T19:58:16.8121276Z  parser.add_argument( 2024-10-08T19:58:16.8121821Z  "--github-repo", 2024-10-08T19:58:16.8122407Z  type=str, 2024-10-08T19:58:16.8122872Z  required=True, 2024-10-08T19:58:16.8123486Z  help="GitHub repo where CI is running", 2024-10-08T19:58:16.8124348Z  ) 2024-10-08T19:58:16.8124753Z  parser.add_argument( 2024-10-08T19:58:16.8125562Z  "--github-issue", type=int, required=True, help="GitHub issue number" 2024-10-08T19:58:16.8126492Z  ) 2024-10-08T19:58:16.8126879Z  parser.add_argument( 2024-10-08T19:58:16.8127718Z  "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-10-08T19:58:16.8128691Z  ) 2024-10-08T19:58:16.8129070Z  parser.add_argument( 2024-10-08T19:58:16.8129913Z  "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-10-08T19:58:16.8131024Z  ) 2024-10-08T19:58:16.8131421Z  parser.add_argument( 2024-10-08T19:58:16.8132345Z  "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-10-08T19:58:16.8133342Z  ) 2024-10-08T19:58:16.8133761Z  parser.add_argument( 2024-10-08T19:58:16.8134300Z  "--github-ref-type", 2024-10-08T19:58:16.8134913Z  type=str, 2024-10-08T19:58:16.8135399Z  required=True, 2024-10-08T19:58:16.8136030Z  help="Current GitHub ref type, branch or tag", 2024-10-08T19:58:16.8136773Z  ) 2024-10-08T19:58:16.8137167Z  2024-10-08T19:58:16.8137561Z  return parser.parse_args() 2024-10-08T19:58:16.8138175Z  2024-10-08T19:58:16.8138550Z  2024-10-08T19:58:16.8139037Z def get_gh_client(github_token: str) -> Github: 2024-10-08T19:58:16.8139860Z  auth = Auth.Token(github_token) 2024-10-08T19:58:16.8140494Z  return Github(auth=auth) 2024-10-08T19:58:16.8140992Z  2024-10-08T19:58:16.8141411Z  2024-10-08T19:58:16.8142020Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-10-08T19:58:16.8142803Z  repo = gh.get_repo(repo) 2024-10-08T19:58:16.8143508Z  return repo.get_issue(number=issue_num) 2024-10-08T19:58:16.8144143Z  2024-10-08T19:58:16.8144462Z  2024-10-08T19:58:16.8144922Z def get_potential_pr_author( 2024-10-08T19:58:16.8145810Z  github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-10-08T19:58:16.8146627Z ) -> str: 2024-10-08T19:58:16.8147379Z  # If the trigger was a new tag added by a bot, this is a ciflow case 2024-10-08T19:58:16.8148492Z  # Fetch the actual username from the original PR. The PR number is 2024-10-08T19:58:16.8149496Z  # embedded in the tag name: ciflow// 2024-10-08T19:58:16.8150247Z  2024-10-08T19:58:16.8150671Z  gh = get_gh_client(github_token) 2024-10-08T19:58:16.8151247Z  2024-10-08T19:58:16.8152048Z  if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-10-08T19:58:16.8152856Z  split_tag = ref_name.split("/") 2024-10-08T19:58:16.8153478Z  if ( 2024-10-08T19:58:16.8153976Z  len(split_tag) == 3 2024-10-08T19:58:16.8154616Z  and split_tag[0] == "ciflow" 2024-10-08T19:58:16.8155306Z  and split_tag[2].isnumeric() 2024-10-08T19:58:16.8155943Z  ): 2024-10-08T19:58:16.8156417Z  pr_number = split_tag[2] 2024-10-08T19:58:16.8157015Z  try: 2024-10-08T19:58:16.8157595Z  repository = gh.get_repo(repo) 2024-10-08T19:58:16.8158404Z  pull = repository.get_pull(number=int(pr_number)) 2024-10-08T19:58:16.8159193Z  except Exception as e: 2024-10-08T19:58:16.8159940Z  raise Exception( # noqa: TRY002 2024-10-08T19:58:16.8160794Z  f"issue with pull request {pr_number} from repo {repository}" 2024-10-08T19:58:16.8161632Z  ) from e 2024-10-08T19:58:16.8162279Z  return pull.user.login 2024-10-08T19:58:16.8163020Z  # In all other cases, return the original input username 2024-10-08T19:58:16.8164087Z  return username 2024-10-08T19:58:16.8164652Z  2024-10-08T19:58:16.8164992Z  2024-10-08T19:58:16.8165482Z def is_exception_branch(branch: str) -> bool: 2024-10-08T19:58:16.8166216Z  """ 2024-10-08T19:58:16.8167042Z  Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-10-08T19:58:16.8168024Z  """ 2024-10-08T19:58:16.8168990Z  return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-10-08T19:58:16.8169868Z  2024-10-08T19:58:16.8170296Z  2024-10-08T19:58:16.8170736Z def load_yaml(yaml_text: str) -> Any: 2024-10-08T19:58:16.8171343Z  try: 2024-10-08T19:58:16.8171888Z  data = yaml.safe_load(yaml_text) 2024-10-08T19:58:16.8172490Z  return data 2024-10-08T19:58:16.8173040Z  except yaml.YAMLError as exc: 2024-10-08T19:58:16.8173776Z  log.exception("Error loading YAML") 2024-10-08T19:58:16.8174394Z  raise 2024-10-08T19:58:16.8174823Z  2024-10-08T19:58:16.8175256Z  2024-10-08T19:58:16.8175973Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-10-08T19:58:16.8176897Z  """ 2024-10-08T19:58:16.8177832Z  Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-10-08T19:58:16.8178805Z  2024-10-08T19:58:16.8179444Z  If the issue body contains "---" then the text above that is the settings 2024-10-08T19:58:16.8180545Z  and the text below is the list of opted in users. 2024-10-08T19:58:16.8181241Z  2024-10-08T19:58:16.8181929Z  If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-10-08T19:58:16.8182915Z  """ 2024-10-08T19:58:16.8183471Z  rollout_state_parts = rollout_state.split("---") 2024-10-08T19:58:16.8184191Z  if len(rollout_state_parts) >= 2: 2024-10-08T19:58:16.8185049Z  return rollout_state_parts[0], rollout_state_parts[1] 2024-10-08T19:58:16.8185776Z  else: 2024-10-08T19:58:16.8186195Z  return "", rollout_state 2024-10-08T19:58:16.8186848Z  2024-10-08T19:58:16.8187210Z  2024-10-08T19:58:16.8187641Z class UserOptins(Dict[str, List[str]]): 2024-10-08T19:58:16.8188329Z  """ 2024-10-08T19:58:16.8188994Z  Dictionary of users with a list of features they have opted into 2024-10-08T19:58:16.8189788Z  """ 2024-10-08T19:58:16.8190401Z  2024-10-08T19:58:16.8190773Z  2024-10-08T19:58:16.8191377Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-10-08T19:58:16.8192273Z  """ 2024-10-08T19:58:16.8193261Z  Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2024-10-08T19:58:16.8194385Z  2024-10-08T19:58:16.8195453Z  Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-10-08T19:58:16.8196804Z  - Example line: "@User1,lf,split_build" 2024-10-08T19:58:16.8197700Z  - A "#" prefix indicates the user is opted out of all experiments 2024-10-08T19:58:16.8198527Z  2024-10-08T19:58:16.8198911Z  2024-10-08T19:58:16.8199275Z  """ 2024-10-08T19:58:16.8199727Z  optins = UserOptins() 2024-10-08T19:58:16.8200388Z  for user in user_optin_text.split("\n"): 2024-10-08T19:58:16.8201079Z  user = user.strip("\r\n\t -") 2024-10-08T19:58:16.8201822Z  if not user or not user.startswith("@"): 2024-10-08T19:58:16.8202547Z  # Not a valid user. Skip 2024-10-08T19:58:16.8203166Z  continue 2024-10-08T19:58:16.8203836Z  2024-10-08T19:58:16.8204188Z  if user: 2024-10-08T19:58:16.8204766Z  usr_name = user.split(",")[0].strip("@") 2024-10-08T19:58:16.8205770Z  optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-10-08T19:58:16.8206542Z  2024-10-08T19:58:16.8206923Z  return optins 2024-10-08T19:58:16.8207618Z  2024-10-08T19:58:16.8207959Z  2024-10-08T19:58:16.8208578Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-10-08T19:58:16.8209412Z  """ 2024-10-08T19:58:16.8210141Z  Parse the experiments from the issue body into a list of ExperimentSettings 2024-10-08T19:58:16.8211082Z  """ 2024-10-08T19:58:16.8211542Z  try: 2024-10-08T19:58:16.8211937Z  if settings_text: 2024-10-08T19:58:16.8212950Z  # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-10-08T19:58:16.8214072Z  # for easy reading 2024-10-08T19:58:16.8215175Z  # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-10-08T19:58:16.8216364Z  # the backtick character in shell commands. 2024-10-08T19:58:16.8217248Z  backtick = chr(96) # backtick character 2024-10-08T19:58:16.8218144Z  settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-10-08T19:58:16.8218976Z  settings = load_yaml(settings_text) 2024-10-08T19:58:16.8219682Z  2024-10-08T19:58:16.8220484Z  # For now we just load experiments. We can expand this if/when we add more settings 2024-10-08T19:58:16.8221420Z  experiments = {} 2024-10-08T19:58:16.8222020Z  2024-10-08T19:58:16.8222733Z  for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-10-08T19:58:16.8223665Z  valid_settings = {} 2024-10-08T19:58:16.8224348Z  for setting in exp_settings: 2024-10-08T19:58:16.8225102Z  if setting not in Experiment._fields: 2024-10-08T19:58:16.8225815Z  log.warning( 2024-10-08T19:58:16.8226781Z  f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-10-08T19:58:16.8227697Z  ) 2024-10-08T19:58:16.8228215Z  else: 2024-10-08T19:58:16.8229161Z  valid_settings[setting] = exp_settings[setting] 2024-10-08T19:58:16.8229892Z  2024-10-08T19:58:16.8230446Z  experiments[exp_name] = Experiment(**valid_settings) 2024-10-08T19:58:16.8231346Z  return Settings(experiments) 2024-10-08T19:58:16.8231919Z  2024-10-08T19:58:16.8232332Z  except Exception: 2024-10-08T19:58:16.8233029Z  log.exception("Failed to parse settings") 2024-10-08T19:58:16.8233656Z  2024-10-08T19:58:16.8234056Z  return Settings() 2024-10-08T19:58:16.8234598Z  2024-10-08T19:58:16.8234918Z  2024-10-08T19:58:16.8235466Z def parse_settings(rollout_state: str) -> Settings: 2024-10-08T19:58:16.8236238Z  """ 2024-10-08T19:58:16.8236754Z  Parse settings, if any, from the rollout state. 2024-10-08T19:58:16.8237446Z  2024-10-08T19:58:16.8238198Z  If the issue body contains "---" then the text above that is the settings 2024-10-08T19:58:16.8239182Z  and the text below is the list of opted in users. 2024-10-08T19:58:16.8239886Z  2024-10-08T19:58:16.8240716Z  If it doesn't contain "---" then the settings are empty and the default values are used. 2024-10-08T19:58:16.8241630Z  """ 2024-10-08T19:58:16.8242332Z  settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-10-08T19:58:16.8243378Z  return parse_settings_from_text(settings_text) 2024-10-08T19:58:16.8244271Z  2024-10-08T19:58:16.8244597Z  2024-10-08T19:58:16.8245218Z def parse_users(rollout_state: str) -> UserOptins: 2024-10-08T19:58:16.8246076Z  """ 2024-10-08T19:58:16.8246533Z  Parse users from the rollout state. 2024-10-08T19:58:16.8247231Z  2024-10-08T19:58:16.8247592Z  """ 2024-10-08T19:58:16.8248236Z  _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-10-08T19:58:16.8249295Z  return parse_user_opt_in_from_text(users_text) 2024-10-08T19:58:16.8249955Z  2024-10-08T19:58:16.8250275Z  2024-10-08T19:58:16.8251125Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-10-08T19:58:16.8252073Z  """ 2024-10-08T19:58:16.8252565Z  Check if a user is opted into an experiment 2024-10-08T19:58:16.8253320Z  """ 2024-10-08T19:58:16.8253895Z  return experiment_name in user_optins.get(user, []) 2024-10-08T19:58:16.8254563Z  2024-10-08T19:58:16.8254999Z  2024-10-08T19:58:16.8255398Z def get_runner_prefix( 2024-10-08T19:58:16.8255893Z  rollout_state: str, 2024-10-08T19:58:16.8256561Z  workflow_requestors: Iterable[str], 2024-10-08T19:58:16.8257187Z  branch: str, 2024-10-08T19:58:16.8257667Z  is_canary: bool = False, 2024-10-08T19:58:16.8258271Z ) -> str: 2024-10-08T19:58:16.8258786Z  settings = parse_settings(rollout_state) 2024-10-08T19:58:16.8259520Z  user_optins = parse_users(rollout_state) 2024-10-08T19:58:16.8260204Z  2024-10-08T19:58:16.8260590Z  fleet_prefix = "" 2024-10-08T19:58:16.8261083Z  prefixes = [] 2024-10-08T19:58:16.8261959Z  for experiment_name, experiment_settings in settings.experiments.items(): 2024-10-08T19:58:16.8262875Z  enabled = False 2024-10-08T19:58:16.8263459Z  2024-10-08T19:58:16.8264118Z  if not experiment_settings.all_branches and is_exception_branch(branch): 2024-10-08T19:58:16.8265037Z  log.info( 2024-10-08T19:58:16.8266007Z  f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-10-08T19:58:16.8267112Z  ) 2024-10-08T19:58:16.8267576Z  continue 2024-10-08T19:58:16.8268145Z  2024-10-08T19:58:16.8268681Z  # Is any workflow_requestor opted in to this experiment? 2024-10-08T19:58:16.8269511Z  opted_in_users = [ 2024-10-08T19:58:16.8270129Z  requestor 2024-10-08T19:58:16.8270694Z  for requestor in workflow_requestors 2024-10-08T19:58:16.8271590Z  if is_user_opted_in(requestor, user_optins, experiment_name) 2024-10-08T19:58:16.8272439Z  ] 2024-10-08T19:58:16.8272822Z  2024-10-08T19:58:16.8273210Z  if opted_in_users: 2024-10-08T19:58:16.8273804Z  log.info( 2024-10-08T19:58:16.8274639Z  f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-10-08T19:58:16.8275497Z  ) 2024-10-08T19:58:16.8276011Z  enabled = True 2024-10-08T19:58:16.8276672Z  elif experiment_settings.rollout_perc: 2024-10-08T19:58:16.8277766Z  # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-10-08T19:58:16.8279119Z  if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-10-08T19:58:16.8279954Z  log.info( 2024-10-08T19:58:16.8281093Z  f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-10-08T19:58:16.8282296Z  ) 2024-10-08T19:58:16.8282787Z  enabled = True 2024-10-08T19:58:16.8283332Z  2024-10-08T19:58:16.8284731Z  if enabled: 2024-10-08T19:58:16.8285355Z  label = experiment_name 2024-10-08T19:58:16.8286130Z  if experiment_name == LF_FLEET_EXPERIMENT: 2024-10-08T19:58:16.8287321Z  # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-10-08T19:58:16.8288531Z  # - If it's enabled, then we always list it's prefix first 2024-10-08T19:58:16.8289611Z  # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-10-08T19:58:16.8290549Z  if is_canary: 2024-10-08T19:58:16.8291154Z  label += CANARY_FLEET_SUFFIX 2024-10-08T19:58:16.8291857Z  fleet_prefix = label 2024-10-08T19:58:16.8292507Z  else: 2024-10-08T19:58:16.8293001Z  prefixes.append(label) 2024-10-08T19:58:16.8293616Z  2024-10-08T19:58:16.8294079Z  if len(prefixes) > 1: 2024-10-08T19:58:16.8294610Z  log.error( 2024-10-08T19:58:16.8296062Z  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-10-08T19:58:16.8297631Z  ) 2024-10-08T19:58:16.8298068Z  prefixes = prefixes[:1] 2024-10-08T19:58:16.8298645Z  2024-10-08T19:58:16.8299112Z  # Fleet always comes first 2024-10-08T19:58:16.8299666Z  if fleet_prefix: 2024-10-08T19:58:16.8300247Z  prefixes.insert(0, fleet_prefix) 2024-10-08T19:58:16.8300926Z  2024-10-08T19:58:16.8301473Z  return ".".join(prefixes) + "." if prefixes else "" 2024-10-08T19:58:16.8302135Z  2024-10-08T19:58:16.8302554Z  2024-10-08T19:58:16.8303366Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-10-08T19:58:16.8304279Z  """ 2024-10-08T19:58:16.8305105Z  Gets the first comment of the issue, which contains the desired rollout state. 2024-10-08T19:58:16.8306021Z  2024-10-08T19:58:16.8306861Z  The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-10-08T19:58:16.8307860Z  """ 2024-10-08T19:58:16.8308327Z  gh = get_gh_client(github_token) 2024-10-08T19:58:16.8308971Z  issue = get_issue(gh, repo, issue_num) 2024-10-08T19:58:16.8309872Z  return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-10-08T19:58:16.8310603Z  2024-10-08T19:58:16.8310921Z  2024-10-08T19:58:16.8311396Z def main() -> None: 2024-10-08T19:58:16.8311901Z  args = parse_args() 2024-10-08T19:58:16.8312369Z  2024-10-08T19:58:16.8312932Z  runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-10-08T19:58:16.8313580Z  2024-10-08T19:58:16.8313917Z  try: 2024-10-08T19:58:16.8314529Z  rollout_state = get_rollout_state_from_issue( 2024-10-08T19:58:16.8315456Z  args.github_token, args.github_issue_repo, args.github_issue 2024-10-08T19:58:16.8316272Z  ) 2024-10-08T19:58:16.8316716Z  2024-10-08T19:58:16.8317171Z  username = get_potential_pr_author( 2024-10-08T19:58:16.8317849Z  args.github_token, 2024-10-08T19:58:16.8318489Z  args.github_repo, 2024-10-08T19:58:16.8319066Z  args.github_actor, 2024-10-08T19:58:16.8319681Z  args.github_ref_type, 2024-10-08T19:58:16.8320331Z  args.github_branch, 2024-10-08T19:58:16.8320902Z  ) 2024-10-08T19:58:16.8321303Z  2024-10-08T19:58:16.8321913Z  is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-10-08T19:58:16.8322804Z  2024-10-08T19:58:16.8323293Z  runner_label_prefix = get_runner_prefix( 2024-10-08T19:58:16.8324154Z  rollout_state, 2024-10-08T19:58:16.8324810Z  (args.github_issue_owner, username), 2024-10-08T19:58:16.8325516Z  args.github_branch, 2024-10-08T19:58:16.8326127Z  is_canary, 2024-10-08T19:58:16.8326644Z  ) 2024-10-08T19:58:16.8327045Z  2024-10-08T19:58:16.8327488Z  except Exception as e: 2024-10-08T19:58:16.8328033Z  log.error( 2024-10-08T19:58:16.8328929Z  f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-10-08T19:58:16.8329945Z  ) 2024-10-08T19:58:16.8330353Z  2024-10-08T19:58:16.8330982Z  set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-10-08T19:58:16.8331872Z  2024-10-08T19:58:16.8332203Z  2024-10-08T19:58:16.8332606Z if __name__ == "__main__": 2024-10-08T19:58:16.8333178Z  main() 2024-10-08T19:58:16.8333587Z  2024-10-08T19:58:16.8333961Z EOF 2024-10-08T19:58:16.8334376Z  2024-10-08T19:58:16.8334777Z cat runner_determinator.py 2024-10-08T19:58:16.8961342Z shell: /usr/bin/bash -e {0} 2024-10-08T19:58:16.8961938Z env: 2024-10-08T19:58:16.8962680Z GITHUB_TOKEN: *** 2024-10-08T19:58:16.8963224Z ISSUE_NUMBER: 5132 2024-10-08T19:58:16.8964055Z TRIGGERING_ACTOR: pytorch-bot[bot] 2024-10-08T19:58:16.8964683Z ISSUE_OWNER: 2024-10-08T19:58:16.8965181Z ##[endgroup] 2024-10-08T19:58:16.9376462Z # flake8: noqa: G004 2024-10-08T19:58:16.9376822Z 2024-10-08T19:58:16.9378608Z # Note: Copies of this script in runner_determinator.py and _runner-determinator.yml 2024-10-08T19:58:16.9379822Z # must be kept in sync. You can do it easily by running the following command: 2024-10-08T19:58:16.9380826Z # python .github/scripts/update_runner_determinator.py 2024-10-08T19:58:16.9381338Z 2024-10-08T19:58:16.9381598Z """ 2024-10-08T19:58:16.9382213Z This runner determinator is used to determine which set of runners to run a 2024-10-08T19:58:16.9383593Z GitHub job on. It uses the first comment of a GitHub issue (by default 2024-10-08T19:58:16.9384901Z https://github.com/pytorch/test-infra/issues/5132) to define the configuration 2024-10-08T19:58:16.9385819Z of which runners should be used to run which job. 2024-10-08T19:58:16.9386305Z 2024-10-08T19:58:16.9386808Z The configuration has two parts, the settings and a list of opted-in users, 2024-10-08T19:58:16.9388009Z separated by a line containing "---". If the line is not present, the 2024-10-08T19:58:16.9389045Z settings are considered to be empty with only the second part, the user 2024-10-08T19:58:16.9389821Z list, defined. 2024-10-08T19:58:16.9390145Z 2024-10-08T19:58:16.9390575Z The first part is a YAML block that defines the rollout settings. This can be 2024-10-08T19:58:16.9391710Z used to define any settings that are needed to determine which runners to use. 2024-10-08T19:58:16.9392741Z It's fields are defined by the RolloutSettings class below. 2024-10-08T19:58:16.9393365Z 2024-10-08T19:58:16.9393828Z The second part is a list of users who are explicitly opted in to the LF fleet. 2024-10-08T19:58:16.9394898Z The user list is also a comma separated list of additional features or 2024-10-08T19:58:16.9395772Z experiments which the user could be opted in to. 2024-10-08T19:58:16.9396328Z 2024-10-08T19:58:16.9396525Z The user list has the following rules: 2024-10-08T19:58:16.9396931Z 2024-10-08T19:58:16.9397347Z - Users are GitHub usernames, which must start with the @ prefix 2024-10-08T19:58:16.9398419Z - Each user is also a comma-separated list of features/experiments to enable 2024-10-08T19:58:16.9399415Z - A "#" prefix opts the user out of all experiments 2024-10-08T19:58:16.9399899Z 2024-10-08T19:58:16.9400060Z Example config: 2024-10-08T19:58:16.9400716Z # A list of experiments that can be opted into. 2024-10-08T19:58:16.9401614Z # This defines the behavior they'll induce when opted into. 2024-10-08T19:58:16.9402345Z # Expected syntax is: 2024-10-08T19:58:16.9403079Z # [experiment_name]: # Name of the experiment. Also used for the label prefix. 2024-10-08T19:58:16.9404650Z # rollout_perc: [int] # % of workflows to run with this experiment when users are not opted in. 2024-10-08T19:58:16.9405498Z 2024-10-08T19:58:16.9405646Z experiments: 2024-10-08T19:58:16.9406046Z lf: 2024-10-08T19:58:16.9406487Z rollout_percent: 25 2024-10-08T19:58:16.9406825Z 2024-10-08T19:58:16.9406997Z --- 2024-10-08T19:58:16.9407217Z 2024-10-08T19:58:16.9407381Z # Opt-ins: 2024-10-08T19:58:16.9408162Z # Users can opt into the LF fleet by adding their GitHub username to this list 2024-10-08T19:58:16.9409228Z # and specifying experiments to enable in a comma-separated list. 2024-10-08T19:58:16.9410166Z # Experiments should be from the above list. 2024-10-08T19:58:16.9410707Z 2024-10-08T19:58:16.9410914Z @User1,lf,split_build 2024-10-08T19:58:16.9411328Z @User2,lf 2024-10-08T19:58:16.9411729Z @User3,split_build 2024-10-08T19:58:16.9412258Z """ 2024-10-08T19:58:16.9412435Z 2024-10-08T19:58:16.9412581Z import logging 2024-10-08T19:58:16.9412982Z import os 2024-10-08T19:58:16.9413423Z import random 2024-10-08T19:58:16.9413808Z from argparse import ArgumentParser 2024-10-08T19:58:16.9414387Z from logging import LogRecord 2024-10-08T19:58:16.9415129Z from typing import Any, Dict, Iterable, List, NamedTuple, Tuple 2024-10-08T19:58:16.9415687Z 2024-10-08T19:58:16.9415826Z import yaml 2024-10-08T19:58:16.9416243Z from github import Auth, Github 2024-10-08T19:58:16.9416830Z from github.Issue import Issue 2024-10-08T19:58:16.9417150Z 2024-10-08T19:58:16.9417155Z 2024-10-08T19:58:16.9417365Z DEFAULT_LABEL_PREFIX = "" # use meta runners 2024-10-08T19:58:16.9418174Z WORKFLOW_LABEL_LF = "lf." # use runners from the linux foundation 2024-10-08T19:58:16.9419279Z WORKFLOW_LABEL_LF_CANARY = "lf.c." # use canary runners from the linux foundation 2024-10-08T19:58:16.9419944Z 2024-10-08T19:58:16.9420164Z GITHUB_OUTPUT = os.getenv("GITHUB_OUTPUT", "") 2024-10-08T19:58:16.9421056Z GH_OUTPUT_KEY_AMI = "runner-ami" 2024-10-08T19:58:16.9421732Z GH_OUTPUT_KEY_LABEL_TYPE = "label-type" 2024-10-08T19:58:16.9422133Z 2024-10-08T19:58:16.9422139Z 2024-10-08T19:58:16.9422352Z SETTING_EXPERIMENTS = "experiments" 2024-10-08T19:58:16.9422709Z 2024-10-08T19:58:16.9422873Z LF_FLEET_EXPERIMENT = "lf" 2024-10-08T19:58:16.9423426Z CANARY_FLEET_SUFFIX = ".c" 2024-10-08T19:58:16.9423730Z 2024-10-08T19:58:16.9423734Z 2024-10-08T19:58:16.9423944Z class Experiment(NamedTuple): 2024-10-08T19:58:16.9424413Z rollout_perc: float = ( 2024-10-08T19:58:16.9425293Z 0 # Percentage of workflows to experiment on when user is not opted-in. 2024-10-08T19:58:16.9426079Z ) 2024-10-08T19:58:16.9426415Z all_branches: bool = ( 2024-10-08T19:58:16.9427259Z False # If True, the experiment is also enabled on the exception branches 2024-10-08T19:58:16.9428056Z ) 2024-10-08T19:58:16.9428242Z 2024-10-08T19:58:16.9428407Z # Add more fields as needed 2024-10-08T19:58:16.9428863Z 2024-10-08T19:58:16.9428869Z 2024-10-08T19:58:16.9429036Z class Settings(NamedTuple): 2024-10-08T19:58:16.9429502Z """ 2024-10-08T19:58:16.9429995Z Settings for the experiments that can be opted into. 2024-10-08T19:58:16.9430730Z """ 2024-10-08T19:58:16.9430910Z 2024-10-08T19:58:16.9431150Z experiments: Dict[str, Experiment] = {} 2024-10-08T19:58:16.9431556Z 2024-10-08T19:58:16.9431561Z 2024-10-08T19:58:16.9431880Z class ColorFormatter(logging.Formatter): 2024-10-08T19:58:16.9432552Z """Color codes the log messages based on the log level""" 2024-10-08T19:58:16.9433078Z 2024-10-08T19:58:16.9433218Z COLORS = { 2024-10-08T19:58:16.9433734Z "WARNING": "\033[33m", # Yellow 2024-10-08T19:58:16.9434257Z "ERROR": "\033[31m", # Red 2024-10-08T19:58:16.9434945Z "CRITICAL": "\033[31m", # Red 2024-10-08T19:58:16.9435582Z "INFO": "\033[0m", # Reset 2024-10-08T19:58:16.9436071Z "DEBUG": "\033[0m", # Reset 2024-10-08T19:58:16.9436573Z } 2024-10-08T19:58:16.9436776Z 2024-10-08T19:58:16.9437155Z def format(self, record: LogRecord) -> str: 2024-10-08T19:58:16.9437998Z log_color = self.COLORS.get(record.levelname, "\033[0m") # Default to reset 2024-10-08T19:58:16.9438936Z record.msg = f"{log_color}{record.msg}\033[0m" 2024-10-08T19:58:16.9439646Z return super().format(record) 2024-10-08T19:58:16.9440006Z 2024-10-08T19:58:16.9440011Z 2024-10-08T19:58:16.9440190Z handler = logging.StreamHandler() 2024-10-08T19:58:16.9441059Z handler.setFormatter(ColorFormatter(fmt="%(levelname)-8s: %(message)s")) 2024-10-08T19:58:16.9441743Z 2024-10-08T19:58:16.9442058Z log = logging.getLogger(os.path.basename(__file__)) 2024-10-08T19:58:16.9442712Z log.addHandler(handler) 2024-10-08T19:58:16.9443164Z log.setLevel(logging.INFO) 2024-10-08T19:58:16.9443495Z 2024-10-08T19:58:16.9443500Z 2024-10-08T19:58:16.9444276Z def set_github_output(key: str, value: str) -> None: 2024-10-08T19:58:16.9445155Z """ 2024-10-08T19:58:16.9445709Z Defines outputs of the github action that invokes this script 2024-10-08T19:58:16.9446505Z """ 2024-10-08T19:58:16.9446892Z if not GITHUB_OUTPUT: 2024-10-08T19:58:16.9448310Z # See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ for deprecation notice 2024-10-08T19:58:16.9449790Z log.warning( 2024-10-08T19:58:16.9450846Z "No env var found for GITHUB_OUTPUT, you must be running this code locally. Falling back to the deprecated print method." 2024-10-08T19:58:16.9451941Z ) 2024-10-08T19:58:16.9475148Z print(f"::set-output name={key}::{value}") 2024-10-08T19:58:16.9475859Z return 2024-10-08T19:58:16.9476091Z 2024-10-08T19:58:16.9476328Z with open(GITHUB_OUTPUT, "a") as f: 2024-10-08T19:58:16.9477082Z log.info(f"Setting output: {key}='{value}'") 2024-10-08T19:58:16.9477743Z f.write(f"{key}={value}\n") 2024-10-08T19:58:16.9478122Z 2024-10-08T19:58:16.9478128Z 2024-10-08T19:58:16.9478552Z def parse_args() -> Any: 2024-10-08T19:58:16.9479314Z parser = ArgumentParser("Get dynamic rollout settings") 2024-10-08T19:58:16.9480353Z parser.add_argument("--github-token", type=str, required=True, help="GitHub token") 2024-10-08T19:58:16.9481238Z parser.add_argument( 2024-10-08T19:58:16.9481842Z "--github-issue-repo", 2024-10-08T19:58:16.9482339Z type=str, 2024-10-08T19:58:16.9482763Z required=False, 2024-10-08T19:58:16.9483344Z default="pytorch/test-infra", 2024-10-08T19:58:16.9484257Z help="GitHub repo to get the issue", 2024-10-08T19:58:16.9484857Z ) 2024-10-08T19:58:16.9485316Z parser.add_argument( 2024-10-08T19:58:16.9485802Z "--github-repo", 2024-10-08T19:58:16.9486258Z type=str, 2024-10-08T19:58:16.9486733Z required=True, 2024-10-08T19:58:16.9487195Z help="GitHub repo where CI is running", 2024-10-08T19:58:16.9487788Z ) 2024-10-08T19:58:16.9488228Z parser.add_argument( 2024-10-08T19:58:16.9488970Z "--github-issue", type=int, required=True, help="GitHub issue number" 2024-10-08T19:58:16.9489741Z ) 2024-10-08T19:58:16.9490182Z parser.add_argument( 2024-10-08T19:58:16.9490906Z "--github-actor", type=str, required=True, help="GitHub triggering_actor" 2024-10-08T19:58:16.9491702Z ) 2024-10-08T19:58:16.9492136Z parser.add_argument( 2024-10-08T19:58:16.9492888Z "--github-issue-owner", type=str, required=True, help="GitHub issue owner" 2024-10-08T19:58:16.9493683Z ) 2024-10-08T19:58:16.9494113Z parser.add_argument( 2024-10-08T19:58:16.9494899Z "--github-branch", type=str, required=True, help="Current GitHub branch or tag" 2024-10-08T19:58:16.9495726Z ) 2024-10-08T19:58:16.9496156Z parser.add_argument( 2024-10-08T19:58:16.9496832Z "--github-ref-type", 2024-10-08T19:58:16.9497328Z type=str, 2024-10-08T19:58:16.9497822Z required=True, 2024-10-08T19:58:16.9498311Z help="Current GitHub ref type, branch or tag", 2024-10-08T19:58:16.9498940Z ) 2024-10-08T19:58:16.9499121Z 2024-10-08T19:58:16.9499420Z return parser.parse_args() 2024-10-08T19:58:16.9499755Z 2024-10-08T19:58:16.9499761Z 2024-10-08T19:58:16.9500048Z def get_gh_client(github_token: str) -> Github: 2024-10-08T19:58:16.9500689Z auth = Auth.Token(github_token) 2024-10-08T19:58:16.9501319Z return Github(auth=auth) 2024-10-08T19:58:16.9501623Z 2024-10-08T19:58:16.9501628Z 2024-10-08T19:58:16.9502005Z def get_issue(gh: Github, repo: str, issue_num: int) -> Issue: 2024-10-08T19:58:16.9502740Z repo = gh.get_repo(repo) 2024-10-08T19:58:16.9503413Z return repo.get_issue(number=issue_num) 2024-10-08T19:58:16.9503817Z 2024-10-08T19:58:16.9503822Z 2024-10-08T19:58:16.9504026Z def get_potential_pr_author( 2024-10-08T19:58:16.9504725Z github_token: str, repo: str, username: str, ref_type: str, ref_name: str 2024-10-08T19:58:16.9505626Z ) -> str: 2024-10-08T19:58:16.9506216Z # If the trigger was a new tag added by a bot, this is a ciflow case 2024-10-08T19:58:16.9507178Z # Fetch the actual username from the original PR. The PR number is 2024-10-08T19:58:16.9508165Z # embedded in the tag name: ciflow// 2024-10-08T19:58:16.9508645Z 2024-10-08T19:58:16.9508854Z gh = get_gh_client(github_token) 2024-10-08T19:58:16.9509214Z 2024-10-08T19:58:16.9509561Z if username == "pytorch-bot[bot]" and ref_type == "tag": 2024-10-08T19:58:16.9510336Z split_tag = ref_name.split("/") 2024-10-08T19:58:16.9510880Z if ( 2024-10-08T19:58:16.9511253Z len(split_tag) == 3 2024-10-08T19:58:16.9511857Z and split_tag[0] == "ciflow" 2024-10-08T19:58:16.9512432Z and split_tag[2].isnumeric() 2024-10-08T19:58:16.9512945Z ): 2024-10-08T19:58:16.9513407Z pr_number = split_tag[2] 2024-10-08T19:58:16.9513945Z try: 2024-10-08T19:58:16.9514361Z repository = gh.get_repo(repo) 2024-10-08T19:58:16.9515123Z pull = repository.get_pull(number=int(pr_number)) 2024-10-08T19:58:16.9515997Z except Exception as e: 2024-10-08T19:58:16.9516532Z raise Exception( # noqa: TRY002 2024-10-08T19:58:16.9517385Z f"issue with pull request {pr_number} from repo {repository}" 2024-10-08T19:58:16.9518153Z ) from e 2024-10-08T19:58:16.9518578Z return pull.user.login 2024-10-08T19:58:16.9519307Z # In all other cases, return the original input username 2024-10-08T19:58:16.9519993Z return username 2024-10-08T19:58:16.9520235Z 2024-10-08T19:58:16.9520240Z 2024-10-08T19:58:16.9520543Z def is_exception_branch(branch: str) -> bool: 2024-10-08T19:58:16.9521172Z """ 2024-10-08T19:58:16.9521983Z Branches that get opted out of experiments by default, until they're explicitly enabled. 2024-10-08T19:58:16.9522892Z """ 2024-10-08T19:58:16.9523556Z return branch.split("/")[0] in {"main", "nightly", "release", "landchecks"} 2024-10-08T19:58:16.9524713Z 2024-10-08T19:58:16.9524733Z 2024-10-08T19:58:16.9524982Z def load_yaml(yaml_text: str) -> Any: 2024-10-08T19:58:16.9525525Z try: 2024-10-08T19:58:16.9526002Z data = yaml.safe_load(yaml_text) 2024-10-08T19:58:16.9526548Z return data 2024-10-08T19:58:16.9527004Z except yaml.YAMLError as exc: 2024-10-08T19:58:16.9527618Z log.exception("Error loading YAML") 2024-10-08T19:58:16.9528185Z raise 2024-10-08T19:58:16.9528393Z 2024-10-08T19:58:16.9528398Z 2024-10-08T19:58:16.9528967Z def extract_settings_user_opt_in_from_text(rollout_state: str) -> Tuple[str, str]: 2024-10-08T19:58:16.9529877Z """ 2024-10-08T19:58:16.9530595Z Extracts the text with settings, if any, and the opted in users from the rollout state. 2024-10-08T19:58:16.9531330Z 2024-10-08T19:58:16.9532010Z If the issue body contains "---" then the text above that is the settings 2024-10-08T19:58:16.9533017Z and the text below is the list of opted in users. 2024-10-08T19:58:16.9533481Z 2024-10-08T19:58:16.9533996Z If it doesn't contain "---" then the settings are empty and the rest is the users. 2024-10-08T19:58:16.9534843Z """ 2024-10-08T19:58:16.9535407Z rollout_state_parts = rollout_state.split("---") 2024-10-08T19:58:16.9536038Z if len(rollout_state_parts) >= 2: 2024-10-08T19:58:16.9536739Z return rollout_state_parts[0], rollout_state_parts[1] 2024-10-08T19:58:16.9537454Z else: 2024-10-08T19:58:16.9537817Z return "", rollout_state 2024-10-08T19:58:16.9538178Z 2024-10-08T19:58:16.9538183Z 2024-10-08T19:58:16.9538367Z class UserOptins(Dict[str, List[str]]): 2024-10-08T19:58:16.9538988Z """ 2024-10-08T19:58:16.9539531Z Dictionary of users with a list of features they have opted into 2024-10-08T19:58:16.9540262Z """ 2024-10-08T19:58:16.9540508Z 2024-10-08T19:58:16.9540521Z 2024-10-08T19:58:16.9540982Z def parse_user_opt_in_from_text(user_optin_text: str) -> UserOptins: 2024-10-08T19:58:16.9541707Z """ 2024-10-08T19:58:16.9542646Z Parse the user opt-in text into a key value pair of username and the list of features they have opted into 2024-10-08T19:58:16.9543625Z 2024-10-08T19:58:16.9544481Z Users are GitHub usernames with the @ prefix. Each user is also a comma-separated list of features/experiments to enable. 2024-10-08T19:58:16.9545782Z - Example line: "@User1,lf,split_build" 2024-10-08T19:58:16.9546578Z - A "#" prefix indicates the user is opted out of all experiments 2024-10-08T19:58:16.9547238Z 2024-10-08T19:58:16.9547243Z 2024-10-08T19:58:16.9547394Z """ 2024-10-08T19:58:16.9547772Z optins = UserOptins() 2024-10-08T19:58:16.9548256Z for user in user_optin_text.split("\n"): 2024-10-08T19:58:16.9549019Z user = user.strip("\r\n\t -") 2024-10-08T19:58:16.9549626Z if not user or not user.startswith("@"): 2024-10-08T19:58:16.9550214Z # Not a valid user. Skip 2024-10-08T19:58:16.9550824Z continue 2024-10-08T19:58:16.9551064Z 2024-10-08T19:58:16.9551239Z if user: 2024-10-08T19:58:16.9551840Z usr_name = user.split(",")[0].strip("@") 2024-10-08T19:58:16.9552749Z optins[usr_name] = [exp.strip(" ") for exp in user.split(",")[1:]] 2024-10-08T19:58:16.9553382Z 2024-10-08T19:58:16.9553531Z return optins 2024-10-08T19:58:16.9553763Z 2024-10-08T19:58:16.9553769Z 2024-10-08T19:58:16.9554267Z def parse_settings_from_text(settings_text: str) -> Settings: 2024-10-08T19:58:16.9554941Z """ 2024-10-08T19:58:16.9555593Z Parse the experiments from the issue body into a list of ExperimentSettings 2024-10-08T19:58:16.9556485Z """ 2024-10-08T19:58:16.9556798Z try: 2024-10-08T19:58:16.9557168Z if settings_text: 2024-10-08T19:58:16.9558109Z # Escape the backtick as well so that we can have the settings in a code block on the GH issue 2024-10-08T19:58:16.9559034Z # for easy reading 2024-10-08T19:58:16.9560069Z # Note: Using ascii for the backtick so that the cat step in _runner-determinator.yml doesn't choke on 2024-10-08T19:58:16.9561266Z # the backtick character in shell commands. 2024-10-08T19:58:16.9561962Z backtick = chr(96) # backtick character 2024-10-08T19:58:16.9562740Z settings_text = settings_text.strip(f"\r\n\t{backtick} ") 2024-10-08T19:58:16.9563554Z settings = load_yaml(settings_text) 2024-10-08T19:58:16.9564234Z 2024-10-08T19:58:16.9564725Z # For now we just load experiments. We can expand this if/when we add more settings 2024-10-08T19:58:16.9565647Z experiments = {} 2024-10-08T19:58:16.9565984Z 2024-10-08T19:58:16.9566470Z for exp_name, exp_settings in settings.get(SETTING_EXPERIMENTS).items(): 2024-10-08T19:58:16.9567301Z valid_settings = {} 2024-10-08T19:58:16.9568017Z for setting in exp_settings: 2024-10-08T19:58:16.9568770Z if setting not in Experiment._fields: 2024-10-08T19:58:16.9569420Z log.warning( 2024-10-08T19:58:16.9570199Z f"Unexpected setting in experiment: {setting} = {exp_settings[setting]}" 2024-10-08T19:58:16.9571090Z ) 2024-10-08T19:58:16.9571573Z else: 2024-10-08T19:58:16.9572095Z valid_settings[setting] = exp_settings[setting] 2024-10-08T19:58:16.9572619Z 2024-10-08T19:58:16.9572962Z experiments[exp_name] = Experiment(**valid_settings) 2024-10-08T19:58:16.9573693Z return Settings(experiments) 2024-10-08T19:58:16.9574073Z 2024-10-08T19:58:16.9574225Z except Exception: 2024-10-08T19:58:16.9574797Z log.exception("Failed to parse settings") 2024-10-08T19:58:16.9575282Z 2024-10-08T19:58:16.9575432Z return Settings() 2024-10-08T19:58:16.9575686Z 2024-10-08T19:58:16.9575699Z 2024-10-08T19:58:16.9576047Z def parse_settings(rollout_state: str) -> Settings: 2024-10-08T19:58:16.9576708Z """ 2024-10-08T19:58:16.9577173Z Parse settings, if any, from the rollout state. 2024-10-08T19:58:16.9577631Z 2024-10-08T19:58:16.9578122Z If the issue body contains "---" then the text above that is the settings 2024-10-08T19:58:16.9579084Z and the text below is the list of opted in users. 2024-10-08T19:58:16.9579583Z 2024-10-08T19:58:16.9580133Z If it doesn't contain "---" then the settings are empty and the default values are used. 2024-10-08T19:58:16.9581053Z """ 2024-10-08T19:58:16.9581700Z settings_text, _ = extract_settings_user_opt_in_from_text(rollout_state) 2024-10-08T19:58:16.9582560Z return parse_settings_from_text(settings_text) 2024-10-08T19:58:16.9583036Z 2024-10-08T19:58:16.9583041Z 2024-10-08T19:58:16.9583339Z def parse_users(rollout_state: str) -> UserOptins: 2024-10-08T19:58:16.9584023Z """ 2024-10-08T19:58:16.9584393Z Parse users from the rollout state. 2024-10-08T19:58:16.9584806Z 2024-10-08T19:58:16.9584953Z """ 2024-10-08T19:58:16.9585589Z _, users_text = extract_settings_user_opt_in_from_text(rollout_state) 2024-10-08T19:58:16.9586556Z return parse_user_opt_in_from_text(users_text) 2024-10-08T19:58:16.9587045Z 2024-10-08T19:58:16.9587050Z 2024-10-08T19:58:16.9587628Z def is_user_opted_in(user: str, user_optins: UserOptins, experiment_name: str) -> bool: 2024-10-08T19:58:16.9588587Z """ 2024-10-08T19:58:16.9588983Z Check if a user is opted into an experiment 2024-10-08T19:58:16.9589583Z """ 2024-10-08T19:58:16.9590118Z return experiment_name in user_optins.get(user, []) 2024-10-08T19:58:16.9590593Z 2024-10-08T19:58:16.9590598Z 2024-10-08T19:58:16.9590802Z def get_runner_prefix( 2024-10-08T19:58:16.9591222Z rollout_state: str, 2024-10-08T19:58:16.9591762Z workflow_requestors: Iterable[str], 2024-10-08T19:58:16.9592294Z branch: str, 2024-10-08T19:58:16.9592710Z is_canary: bool = False, 2024-10-08T19:58:16.9593289Z ) -> str: 2024-10-08T19:58:16.9593705Z settings = parse_settings(rollout_state) 2024-10-08T19:58:16.9594372Z user_optins = parse_users(rollout_state) 2024-10-08T19:58:16.9594874Z 2024-10-08T19:58:16.9595037Z fleet_prefix = "" 2024-10-08T19:58:16.9595483Z prefixes = [] 2024-10-08T19:58:16.9596143Z for experiment_name, experiment_settings in settings.experiments.items(): 2024-10-08T19:58:16.9597052Z enabled = False 2024-10-08T19:58:16.9597317Z 2024-10-08T19:58:16.9597765Z if not experiment_settings.all_branches and is_exception_branch(branch): 2024-10-08T19:58:16.9598537Z log.info( 2024-10-08T19:58:16.9599392Z f"Branch {branch} is an exception branch. Not enabling experiment {experiment_name}." 2024-10-08T19:58:16.9600284Z ) 2024-10-08T19:58:16.9600623Z continue 2024-10-08T19:58:16.9600970Z 2024-10-08T19:58:16.9601263Z # Is any workflow_requestor opted in to this experiment? 2024-10-08T19:58:16.9602109Z opted_in_users = [ 2024-10-08T19:58:16.9602552Z requestor 2024-10-08T19:58:16.9603128Z for requestor in workflow_requestors 2024-10-08T19:58:16.9604140Z if is_user_opted_in(requestor, user_optins, experiment_name) 2024-10-08T19:58:16.9604863Z ] 2024-10-08T19:58:16.9605176Z 2024-10-08T19:58:16.9605335Z if opted_in_users: 2024-10-08T19:58:16.9605795Z log.info( 2024-10-08T19:58:16.9606544Z f"{', '.join(opted_in_users)} have opted into experiment {experiment_name}." 2024-10-08T19:58:16.9607413Z ) 2024-10-08T19:58:16.9607800Z enabled = True 2024-10-08T19:58:16.9608300Z elif experiment_settings.rollout_perc: 2024-10-08T19:58:16.9609383Z # If no user is opted in, then we randomly enable the experiment based on the rollout percentage 2024-10-08T19:58:16.9610555Z if random.uniform(0, 100) <= experiment_settings.rollout_perc: 2024-10-08T19:58:16.9611377Z log.info( 2024-10-08T19:58:16.9612338Z f"Based on rollout percentage of {experiment_settings.rollout_perc}%, enabling experiment {experiment_name}." 2024-10-08T19:58:16.9613435Z ) 2024-10-08T19:58:16.9613913Z enabled = True 2024-10-08T19:58:16.9614220Z 2024-10-08T19:58:16.9614366Z if enabled: 2024-10-08T19:58:16.9614814Z label = experiment_name 2024-10-08T19:58:16.9615489Z if experiment_name == LF_FLEET_EXPERIMENT: 2024-10-08T19:58:16.9616451Z # We give some special treatment to the "lf" experiment since determines the fleet we use 2024-10-08T19:58:16.9617603Z # - If it's enabled, then we always list it's prefix first 2024-10-08T19:58:16.9618659Z # - If we're in the canary branch, then we append ".c" to the lf prefix 2024-10-08T19:58:16.9619422Z if is_canary: 2024-10-08T19:58:16.9619980Z label += CANARY_FLEET_SUFFIX 2024-10-08T19:58:16.9620650Z fleet_prefix = label 2024-10-08T19:58:16.9621133Z else: 2024-10-08T19:58:16.9621583Z prefixes.append(label) 2024-10-08T19:58:16.9621952Z 2024-10-08T19:58:16.9622392Z if len(prefixes) > 1: 2024-10-08T19:58:16.9622841Z log.error( 2024-10-08T19:58:16.9624267Z 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-10-08T19:58:16.9625765Z ) 2024-10-08T19:58:16.9626174Z prefixes = prefixes[:1] 2024-10-08T19:58:16.9626507Z 2024-10-08T19:58:16.9626670Z # Fleet always comes first 2024-10-08T19:58:16.9627223Z if fleet_prefix: 2024-10-08T19:58:16.9627726Z prefixes.insert(0, fleet_prefix) 2024-10-08T19:58:16.9628110Z 2024-10-08T19:58:16.9628366Z return ".".join(prefixes) + "." if prefixes else "" 2024-10-08T19:58:16.9628866Z 2024-10-08T19:58:16.9628872Z 2024-10-08T19:58:16.9629509Z def get_rollout_state_from_issue(github_token: str, repo: str, issue_num: int) -> str: 2024-10-08T19:58:16.9630440Z """ 2024-10-08T19:58:16.9631065Z Gets the first comment of the issue, which contains the desired rollout state. 2024-10-08T19:58:16.9631773Z 2024-10-08T19:58:16.9632372Z The default issue we use - https://github.com/pytorch/test-infra/issues/5132 2024-10-08T19:58:16.9633201Z """ 2024-10-08T19:58:16.9633546Z gh = get_gh_client(github_token) 2024-10-08T19:58:16.9634231Z issue = get_issue(gh, repo, issue_num) 2024-10-08T19:58:16.9634937Z return str(issue.get_comments()[0].body.strip("\n\t ")) 2024-10-08T19:58:16.9635452Z 2024-10-08T19:58:16.9635457Z 2024-10-08T19:58:16.9635671Z def main() -> None: 2024-10-08T19:58:16.9636150Z args = parse_args() 2024-10-08T19:58:16.9636479Z 2024-10-08T19:58:16.9636694Z runner_label_prefix = DEFAULT_LABEL_PREFIX 2024-10-08T19:58:16.9637112Z 2024-10-08T19:58:16.9637297Z try: 2024-10-08T19:58:16.9637958Z rollout_state = get_rollout_state_from_issue( 2024-10-08T19:58:16.9638798Z args.github_token, args.github_issue_repo, args.github_issue 2024-10-08T19:58:16.9639533Z ) 2024-10-08T19:58:16.9639727Z 2024-10-08T19:58:16.9640000Z username = get_potential_pr_author( 2024-10-08T19:58:16.9640598Z args.github_token, 2024-10-08T19:58:16.9641115Z args.github_repo, 2024-10-08T19:58:16.9641632Z args.github_actor, 2024-10-08T19:58:16.9642133Z args.github_ref_type, 2024-10-08T19:58:16.9642666Z args.github_branch, 2024-10-08T19:58:16.9643189Z ) 2024-10-08T19:58:16.9643417Z 2024-10-08T19:58:16.9644986Z is_canary = args.github_repo == "pytorch/pytorch-canary" 2024-10-08T19:58:16.9645598Z 2024-10-08T19:58:16.9645857Z runner_label_prefix = get_runner_prefix( 2024-10-08T19:58:16.9646530Z rollout_state, 2024-10-08T19:58:16.9647069Z (args.github_issue_owner, username), 2024-10-08T19:58:16.9647683Z args.github_branch, 2024-10-08T19:58:16.9648204Z is_canary, 2024-10-08T19:58:16.9648640Z ) 2024-10-08T19:58:16.9648830Z 2024-10-08T19:58:16.9649029Z except Exception as e: 2024-10-08T19:58:16.9649528Z log.error( 2024-10-08T19:58:16.9650319Z f"Failed to get issue. Defaulting to Meta runners and no experiments. Exception: {e}" 2024-10-08T19:58:16.9651207Z ) 2024-10-08T19:58:16.9651398Z 2024-10-08T19:58:16.9651888Z set_github_output(GH_OUTPUT_KEY_LABEL_TYPE, runner_label_prefix) 2024-10-08T19:58:16.9652457Z 2024-10-08T19:58:16.9652462Z 2024-10-08T19:58:16.9652619Z if __name__ == "__main__": 2024-10-08T19:58:16.9653062Z main() 2024-10-08T19:58:16.9653256Z 2024-10-08T19:58:16.9831397Z ##[group]Run python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-10-08T19:58:16.9832558Z python3 -m pip install urllib3==1.26.18 PyGithub==2.3.0 2024-10-08T19:58:16.9890725Z shell: /usr/bin/bash -e {0} 2024-10-08T19:58:16.9891330Z env: 2024-10-08T19:58:16.9891990Z GITHUB_TOKEN: *** 2024-10-08T19:58:16.9892443Z ISSUE_NUMBER: 5132 2024-10-08T19:58:16.9892974Z TRIGGERING_ACTOR: pytorch-bot[bot] 2024-10-08T19:58:16.9893524Z ISSUE_OWNER: 2024-10-08T19:58:16.9894114Z ##[endgroup] 2024-10-08T19:58:19.4164971Z Defaulting to user installation because normal site-packages is not writeable 2024-10-08T19:58:20.6921964Z Collecting urllib3==1.26.18 2024-10-08T19:58:20.7404617Z Downloading urllib3-1.26.18-py2.py3-none-any.whl (143 kB) 2024-10-08T19:58:20.7626221Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 143.8/143.8 KB 6.9 MB/s eta 0:00:00 2024-10-08T19:58:20.7988161Z Collecting PyGithub==2.3.0 2024-10-08T19:58:20.8061557Z Downloading PyGithub-2.3.0-py3-none-any.whl (354 kB) 2024-10-08T19:58:20.8320548Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 354.4/354.4 KB 14.4 MB/s eta 0:00:00 2024-10-08T19:58:20.8897168Z Collecting pynacl>=1.4.0 2024-10-08T19:58:20.8980837Z Downloading PyNaCl-1.5.0-cp36-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl (856 kB) 2024-10-08T19:58:20.9479273Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 856.7/856.7 KB 17.7 MB/s eta 0:00:00 2024-10-08T19:58:20.9505264Z Requirement already satisfied: requests>=2.14.0 in /usr/lib/python3/dist-packages (from PyGithub==2.3.0) (2.25.1) 2024-10-08T19:58:20.9747954Z Collecting Deprecated 2024-10-08T19:58:20.9821932Z Downloading Deprecated-1.2.14-py2.py3-none-any.whl (9.6 kB) 2024-10-08T19:58:21.0138695Z Collecting typing-extensions>=4.0.0 2024-10-08T19:58:21.0214770Z Downloading typing_extensions-4.12.2-py3-none-any.whl (37 kB) 2024-10-08T19:58:21.0579626Z Collecting pyjwt[crypto]>=2.4.0 2024-10-08T19:58:21.0658808Z Downloading PyJWT-2.9.0-py3-none-any.whl (22 kB) 2024-10-08T19:58:21.0806274Z 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-10-08T19:58:21.3078935Z Collecting cffi>=1.4.1 2024-10-08T19:58:21.3160335Z Downloading cffi-1.17.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (446 kB) 2024-10-08T19:58:21.3379622Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 446.2/446.2 KB 22.1 MB/s eta 0:00:00 2024-10-08T19:58:21.5148456Z Collecting wrapt<2,>=1.10 2024-10-08T19:58:21.5261016Z Downloading wrapt-1.16.0-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_17_x86_64.manylinux2014_x86_64.whl (80 kB) 2024-10-08T19:58:21.5299788Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 80.3/80.3 KB 32.3 MB/s eta 0:00:00 2024-10-08T19:58:21.5499698Z Collecting pycparser 2024-10-08T19:58:21.5577241Z Downloading pycparser-2.22-py3-none-any.whl (117 kB) 2024-10-08T19:58:21.5634068Z ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 117.6/117.6 KB 29.1 MB/s eta 0:00:00 2024-10-08T19:58:21.9174099Z Installing collected packages: wrapt, urllib3, typing-extensions, pyjwt, pycparser, Deprecated, cffi, pynacl, PyGithub 2024-10-08T19:58:22.3900962Z Successfully installed Deprecated-1.2.14 PyGithub-2.3.0 cffi-1.17.1 pycparser-2.22 pyjwt-2.9.0 pynacl-1.5.0 typing-extensions-4.12.2 urllib3-1.26.18 wrapt-1.16.0 2024-10-08T19:58:22.4681513Z ##[group]Run curr_branch="ciflow/trunk/134247" 2024-10-08T19:58:22.4682082Z curr_branch="ciflow/trunk/134247" 2024-10-08T19:58:22.4682501Z curr_ref_type="tag" 2024-10-08T19:58:22.4683078Z echo "Current branch is '$curr_branch'" 2024-10-08T19:58:22.4683526Z  2024-10-08T19:58:22.4684137Z python3 runner_determinator.py \ 2024-10-08T19:58:22.4684724Z  --github-token "$GITHUB_TOKEN" \ 2024-10-08T19:58:22.4685205Z  --github-issue "$ISSUE_NUMBER" \ 2024-10-08T19:58:22.4685643Z  --github-branch "$curr_branch" \ 2024-10-08T19:58:22.4686199Z  --github-actor "$TRIGGERING_ACTOR" \ 2024-10-08T19:58:22.4686686Z  --github-issue-owner "$ISSUE_OWNER" \ 2024-10-08T19:58:22.4687156Z  --github-ref-type "$curr_ref_type" \ 2024-10-08T19:58:22.4687703Z  --github-repo "$GITHUB_REPOSITORY" 2024-10-08T19:58:22.4744277Z shell: /usr/bin/bash -e {0} 2024-10-08T19:58:22.4744771Z env: 2024-10-08T19:58:22.4745510Z GITHUB_TOKEN: *** 2024-10-08T19:58:22.4745893Z ISSUE_NUMBER: 5132 2024-10-08T19:58:22.4746284Z TRIGGERING_ACTOR: pytorch-bot[bot] 2024-10-08T19:58:22.4746970Z ISSUE_OWNER: 2024-10-08T19:58:22.4747287Z ##[endgroup] 2024-10-08T19:58:22.4828178Z Current branch is 'ciflow/trunk/134247' 2024-10-08T19:58:24.5140845Z INFO : Setting output: label-type='' 2024-10-08T19:58:24.5536499Z Evaluate and set job outputs 2024-10-08T19:58:24.5547597Z Cleaning up orphan processes