class_docstr: A process for syncing files and running init commands on a node.
  
  Arguments:
      node_id: the Node ID
      provider_config: Provider section of autoscaler yaml
      provider: NodeProvider Class
      auth_config: Auth section of autoscaler yaml
      cluster_name: the name of the cluster.
      file_mounts: Map of remote to local paths
      initialization_commands: Commands run before container launch
      setup_commands: Commands run before ray starts
      ray_start_commands: Commands to start ray
      runtime_hash: Used to check for config changes
      file_mounts_contents_hash: Used to check for changes to file mounts
      is_head_node: Whether to use head start/setup commands
      rsync_options: Extra options related to the rsync command.
      process_runner: the module to use to run the commands
          in the CommandRunner. E.g., subprocess.
      use_internal_ip: Wwhether the node_id belongs to an internal ip
          or external ip.
      docker_config: Docker section of autoscaler yaml
      restart_only: Whether to skip setup commands & just restart ray
      for_recovery: True if updater is for a recovering node. Only used for
          metric tracking.
class_docstr_tok: ["A","process","for","syncing","files","and","running","init","commands","on","a","node",".","Arguments",":","node_id",":","the","Node","ID","provider_config",":","Provider","section","of","autoscaler","yaml","provider",":","NodeProvider","Class","auth_config",":","Auth","section","of","autoscaler","yaml","cluster_name",":","the","name","of","the","cluster",".","file_mounts",":","Map","of","remote","to","local","paths","initialization_commands",":","Commands","run","before","container","launch","setup_commands",":","Commands","run","before","ray","starts","ray_start_commands",":","Commands","to","start","ray","runtime_hash",":","Used","to","check","for","config","changes","file_mounts_contents_hash",":","Used","to","check","for","changes","to","file","mounts","is_head_node",":","Whether","to","use","head","start\/setup","commands","rsync_options",":","Extra","options","related","to","the","rsync","command",".","process_runner",":","the","module","to","use","to","run","the","commands","in","the","CommandRunner",".","E.g.",",","subprocess",".","use_internal_ip",":","Wwhether","the","node_id","belongs","to","an","internal","ip","or","external","ip",".","docker_config",":","Docker","section","of","autoscaler","yaml","restart_only",":","Whether","to","skip","setup","commands","&","just","restart","ray","for_recovery",":","True","if","updater","is","for","a","recovering","node",".","Only","used","for","metric","tracking","."]
code: def run(self):
      update_start_time = time.time()
      if (
          cmd_output_util.does_allow_interactive()
          and cmd_output_util.is_output_redirected()
      ):
          # this is most probably a bug since the user has no control
          # over these settings
          msg = (
              "Output was redirected for an interactive command. "
              "Either do not pass `--redirect-command-output` "
              "or also pass in `--use-normal-shells`."
          )
          cli_logger.abort(msg)
  
      try:
          with LogTimer(
              self.log_prefix
              + "Applied config {}".format(self.runtime_hash)
          ):
              self.do_update()
      except Exception as e:
          self.provider.set_node_tags(
              self.node_id, {TAG_RAY_NODE_STATUS: STATUS_UPDATE_FAILED}
          )
          cli_logger.error(
              "New status: {}", cf.bold(STATUS_UPDATE_FAILED)
          )
  
          cli_logger.error("!!!")
          if hasattr(e, "cmd"):
              stderr_output = getattr(
                  e, "stderr", "No stderr available"
              )
              cli_logger.error(
                  "Setup command `{}` failed with exit code {}. stderr: {}",
                  cf.bold(e.cmd),
                  e.returncode,
                  stderr_output,
              )
          else:
              cli_logger.verbose_error(
                  "Exception details: {}", str(vars(e))
              )
              full_traceback = traceback.format_exc()
              cli_logger.error("Full traceback: {}", full_traceback)
              # todo: handle this better somehow?
              cli_logger.error("Error message: {}", str(e))
          cli_logger.error("!!!")
          cli_logger.newline()
  
          if isinstance(e, click.ClickException):
              # todo: why do we ignore this here
              return
          raise
  
      tags_to_set = {
          TAG_RAY_NODE_STATUS: STATUS_UP_TO_DATE,
          TAG_RAY_RUNTIME_CONFIG: self.runtime_hash,
      }
      if self.file_mounts_contents_hash is not None:
          tags_to_set[
              TAG_RAY_FILE_MOUNTS_CONTENTS
          ] = self.file_mounts_contents_hash
  
      self.provider.set_node_tags(self.node_id, tags_to_set)
      cli_logger.labeled_value("New status", STATUS_UP_TO_DATE)
  
      self.update_time = time.time() - update_start_time
      self.exitcode = 0
  
imports: import logging
  import os
  import subprocess
  import time
  import traceback
  from threading import Thread
  import click
  from ray._private.usage import usage_constants, usage_lib
  from ray.autoscaler._private import subprocess_output_util
  from ray.autoscaler._private.cli_logger import cf, cli_logger
  from ray.autoscaler._private.command_runner import AUTOSCALER_NODE_START_WAIT_S, ProcessRunnerError
  from ray.autoscaler._private.constants import LABELS_ENVIRONMENT_VARIABLE, RESOURCES_ENVIRONMENT_VARIABLE
  from ray.autoscaler._private.event_system import CreateClusterEvent, global_event_system
  from ray.autoscaler._private.log_timer import LogTimer
  from ray.autoscaler.tags import STATUS_SETTING_UP, STATUS_SYNCING_FILES, STATUS_UP_TO_DATE, STATUS_UPDATE_FAILED, STATUS_WAITING_FOR_SSH, TAG_RAY_FILE_MOUNTS_CONTENTS, TAG_RAY_NODE_STATUS, TAG_RAY_RUNTIME_CONFIG
label_desc: Use image node_id 2 for calling the NodeUpdater obj's underlying member method code with example usage: obj.run() without return types