From 79e117d3dc90382fd1afdfa89625c09c817192fb Mon Sep 17 00:00:00 2001 From: Zhanghao Wu Date: Tue, 2 Jul 2024 04:21:44 +0000 Subject: [PATCH] address comments --- sky/skylet/providers/azure/config.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/sky/skylet/providers/azure/config.py b/sky/skylet/providers/azure/config.py index 1223fd38624..4c6322f00e5 100644 --- a/sky/skylet/providers/azure/config.py +++ b/sky/skylet/providers/azure/config.py @@ -18,7 +18,7 @@ UNIQUE_ID_LEN = 4 _WAIT_NSG_CREATION_NUM_TIMEOUT_SECONDS = 600 -_WAIT_FOR_RESOURCE_GROUP_DELETION_TIMEOUT = 480 # 8 minutes +_WAIT_FOR_RESOURCE_GROUP_DELETION_TIMEOUT_SECONDS = 480 # 8 minutes logger = logging.getLogger(__name__) @@ -84,7 +84,10 @@ def _configure_resource_group(config): ) rg_creation_start = time.time() retry = 0 - while time.time() - rg_creation_start < _WAIT_FOR_RESOURCE_GROUP_DELETION_TIMEOUT: + while ( + time.time() - rg_creation_start + < _WAIT_FOR_RESOURCE_GROUP_DELETION_TIMEOUT_SECONDS + ): try: rg_create_or_update(resource_group_name=resource_group, parameters=params) break @@ -95,9 +98,10 @@ def _configure_resource_group(config): # UX, which will be achieved after we move Azure to use # SkyPilot provisioner. logger.warning( - f"Azure resource group {resource_group} is being deleted. " - "It can only be provisioned after it is fully deleted. " - "Waiting..." + f"Azure resource group {resource_group} of a recent " + "terminated cluster {config['cluster_name']} is being " + "deleted. It can only be provisioned after it is fully" + "deleted. Waiting..." ) time.sleep(1) retry += 1