cluster_info.py 326 B

123456789101112
  1. from functools import lru_cache
  2. from pathlib import Path
  3. @lru_cache()
  4. def _is_ray_cluster():
  5. """Checks if the bootstrap config file exists.
  6. This will always exist if using an autoscaling cluster/started
  7. with the ray cluster launcher.
  8. """
  9. return Path("~/ray_bootstrap_config.yaml").expanduser().exists()