Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Cluster launcher] [Azure] Make cluster termination and networking mo…
…re configurable and robust (ray-project#44100) This PR addresses a few issues when launching clusters with Azure: Any changes made to subnets of the deployed virtual network(s) are bashed upon redeployment. Any service endpoints, route tables, or delegations are removed when redeploying (which happens on any of the ray CLI calls) due to this open Azure issue. This PR provides a workaround for the issue by copying the existing subnet configuration into the deployment template if a subnet already exists with the cluster unique id within the same resource group. VM termination is extremely lengthy and does not clean up all dependencies. When VMs are provisioned, dependencies such as disks, NICs, and public IP addresses are also provisioned. However, because the termination process does not wait for the VM to be deleted and the dependent resources cannot be deleted at the same time as the VM, these dependencies are often left in the resource group after termination. This can cause issues with quotas (i.e., reaching a limit of public IP addresses or disks) and wastes resources. This PR moves node termination into a pool of threads so that node deletion can be parallelized (since waiting for each node to be deleted takes a long time) and all dependencies can be correctly deleted once their VMs no longer exist. VMs can have status code ProvisioningState/failed/RetryableError, causing an unpacking error. This line throws an exception when the provisioning state is the string above, resulting in incorrect provisioning/termination of the node. This PR addresses that issue by slicing the list of status strings and only using the first two. The default quota for public IP addresses in Azure is only 100, which can result in quota limits being hit for larger clusters. This PR adds an option (use_external_head_ip) for only provisioning a public IP address for the head node (instead of all nodes or no nodes). This allows a user to still communicate with the head node via a public IP address without running into quota limits on public IP addresses. This option works in tandem with use_internal_ips - if both are set to True, then a public IP address will only be provisioned for the head node. If use_external_head_ip is omitted, the behavior is unchanged from the current behavior (i.e., public IPs will be provisioned for all nodes if use_internal_ips is False, otherwise no public IPs will be provisioned). I've tested all of these fixes using ray up/ray dashboard/ray down on Azure clusters of 4-32 nodes to make sure the start up/teardown works correctly and the correct amount of resources are provisioned. Related issue number Node termination times are discussed in ray-project#25971 --------- Signed-off-by: Mike Danielczuk <[email protected]> Signed-off-by: Mike Danielczuk <[email protected]> Co-authored-by: Scott Graham <[email protected]>
- Loading branch information