def start_monitor(self) -> None: ray_head_pod_ip = commands.get_head_node_ip(self.config_path) # TODO: Add support for user-specified redis port and password redis_address = services.address(ray_head_pod_ip, ray_constants.DEFAULT_PORT) self.mtr = monitor.Monitor( redis_address=redis_address, autoscaling_config=self.config_path, redis_password=ray_constants.REDIS_DEFAULT_PASSWORD, prefix_cluster_info=True) self.mtr.run()
def start_monitor(self) -> None: ray_head_pod_ip = commands.get_head_node_ip(self.config_path) port = operator_utils.infer_head_port(self.config) redis_address = services.address(ray_head_pod_ip, port) self.mtr = monitor.Monitor( redis_address=redis_address, autoscaling_config=self.config_path, redis_password=ray_constants.REDIS_DEFAULT_PASSWORD, prefix_cluster_info=True, stop_event=self.monitor_stop_event) self.mtr.run()
def get_head_node_ip(cluster_config: Union[dict, str]) -> str: """Returns head node IP for given configuration file if exists. Args: cluster_config (Union[str, dict]): Either the config dict of the cluster, or a path pointing to a file containing the config. Returns: The ip address of the cluster head node. Raises: RuntimeError if the cluster is not found. """ return commands.get_head_node_ip(_as_config_file(cluster_config))
def get_head_ip(cluster_config_file, cluster_name): """Return the head node IP of a Ray cluster.""" click.echo(get_head_node_ip(cluster_config_file, cluster_name))