class_docstr: Manager that fetches ray cluster resources info. This class should only be used within a ray cluster.
class_docstr_tok: ["Manager","that","fetches","ray","cluster","resources","info",".","This","class","should","only","be","used","within","a","ray","cluster","."]
docstr: Initialize ray runtime if not already initialized. Will force the existence of a cluster already being spinned up
docstr_tok: ["Initialize","ray","runtime","if","not","already","initialized",".","Will","force","the","existence","of","a","cluster","already","being","spinned","up"]
code: def _init_ray():
      """Initialize ray runtime if not already initialized. Will force the existence of a cluster already being spinned up"""
      try_import_ray()
      import ray
  
      if not ray.is_initialized():
          ray.init(
              address="auto",  # Force ray to connect to an existing cluster. There should be one. Otherwise, something went wrong
              log_to_driver=False,
              logging_level=logging.ERROR,
          )
  
imports: import logging
  import multiprocessing
  import os
  import shutil
  import subprocess
  from typing import Union
  from autogluon.common.utils.try_import import try_import_ray
  from .distribute_utils import DistributedContext
  from .lite import disable_if_lite_mode
  from .utils import bytes_to_mega_bytes
label_desc: Use image node_id 1 for calling the RayResourceManager obj's underlying member method code with example usage: obj._init_ray() without return types