docstr: Initialize the DashboardAgent object.
docstr_tok: ["Initialize","the","DashboardAgent","object","."]
code: def __init__(
      self,
      node_ip_address,
      dashboard_agent_port,
      gcs_address,
      minimal,
      metrics_export_port=None,
      node_manager_port=None,
      listen_port=ray_constants.DEFAULT_DASHBOARD_AGENT_LISTEN_PORT,
      disable_metrics_collection: bool = False,
      *,  # the following are required kwargs
      object_store_name: str,
      raylet_name: str,
      log_dir: str,
      temp_dir: str,
      session_dir: str,
      logging_params: dict,
      agent_id: int,
      session_name: str,
  ):
      """Initialize the DashboardAgent object."""
      # Public attributes are accessible for all agent modules.
      self.ip = node_ip_address
      self.minimal = minimal
  
      assert gcs_address is not None
      self.gcs_address = gcs_address
  
      self.temp_dir = temp_dir
      self.session_dir = session_dir
      self.log_dir = log_dir
      self.dashboard_agent_port = dashboard_agent_port
      self.metrics_export_port = metrics_export_port
      self.node_manager_port = node_manager_port
      self.listen_port = listen_port
      self.object_store_name = object_store_name
      self.raylet_name = raylet_name
      self.logging_params = logging_params
      self.node_id = os.environ["RAY_NODE_ID"]
      self.metrics_collection_disabled = disable_metrics_collection
      self.agent_id = agent_id
      self.session_name = session_name
  
      # grpc server is None in mininal.
      self.server = None
      # http_server is None in minimal.
      self.http_server = None
  
      # Used by the agent and sub-modules.
      self.gcs_aio_client = GcsAioClient(
          address=self.gcs_address,
          nums_reconnect_retry=ray._config.gcs_rpc_server_reconnect_timeout_s(),
      )
  
      if not self.minimal:
          self._init_non_minimal()
  
imports: import argparse
  import asyncio
  import json
  import logging
  import logging.handlers
  import os
  import pathlib
  import sys
  import signal
  import ray
  import ray._private.ray_constants
  import ray._private.services
  import ray._private.utils
  import ray.dashboard.consts
  import ray.dashboard.utils
  from ray._private.process_watcher import create_check_raylet_task
  from ray._private.gcs_utils import GcsAioClient
  from ray._private.ray_logging import setup_component_logger, configure_log_file
  from ray._private.ray_constants import AGENT_GRPC_MAX_MESSAGE_LENGTH
label_desc: Use image node_id 1 to create a new DashboardAgent object  with example: obj = DashboardAgent(node_ip_address, dashboard_agent_port, gcs_address, minimal, metrics_export_port, node_manager_port, listen_port, disable_metrics_collection)