From 16bd2371f2f6da29fc06d13f1756338a9b65f726 Mon Sep 17 00:00:00 2001 From: Sasha Belousov <141743480+BelSasha@users.noreply.github.com> Date: Thu, 5 Sep 2024 16:55:49 +0300 Subject: [PATCH] print cloud info in cluster status (#1209) Co-authored-by: Alexandra Belousov --- runhouse/main.py | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/runhouse/main.py b/runhouse/main.py index 3e5738ad4..6ad19c216 100644 --- a/runhouse/main.py +++ b/runhouse/main.py @@ -455,6 +455,26 @@ def _get_resource_link_in_den_ui(cluster_name: str, api_server_url: str): return link_to_den_dashboard +def _print_cloud_properties(cluster_config: dict): + cloud_properties = cluster_config.get("launched_properties", None) + if not cloud_properties: + return + cloud = cloud_properties.get("cloud") + instance_type = cloud_properties.get("instance_type") + region = cloud_properties.get("region") + cost_per_hour = cloud_properties.get("cost_per_hour") + + has_cuda = cluster_config.get("has_cuda", False) + cost_emoji = "💰" if has_cuda else "💸" + + num_of_instances = len(cluster_config.get("ips")) + num_of_instances_str = f"{num_of_instances}x " if num_of_instances > 1 else "" + + print( + f"🤖 {num_of_instances_str}{cloud} {instance_type} cluster | 🌍 {region} | {cost_emoji} ${cost_per_hour}/hr" + ) + + def _print_status(status_data: dict, current_cluster: Cluster) -> None: """Prints the status of the cluster to the console""" cluster_config = status_data.get("cluster_config")