Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[autoscaler] Enable creating multiple clusters in one resource group … #22997

Closed
Closed
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
24 changes: 20 additions & 4 deletions python/ray/autoscaler/_private/_azure/node_provider.py
Expand Up @@ -70,11 +70,27 @@ def __init__(self, provider_config, cluster_name):

@synchronized
def _get_filtered_nodes(self, tag_filters):
"""In addition to tag_filters, here add an extra filter tag: TAG_RAY_CLUSTER_NAME
to filter some specific cluster. """

update_tag_filters = [
{
TAG_RAY_CLUSTER_NAME: self.cluster_name,
},
]
for key, value in tag_filters.items():
update_tag_filters.append(
{
key: value
}
)
HongW2019 marked this conversation as resolved.
Show resolved Hide resolved

def match_tags(vm):
for k, v in tag_filters.items():
if vm.tags.get(k) != v:
return False
return True
for each_tag_filter in update_tag_filters:
for k, v in each_tag_filter.items():
if vm.tags.get(k) != v:
return False
return True
HongW2019 marked this conversation as resolved.
Show resolved Hide resolved

vms = self.compute_client.virtual_machines.list(
resource_group_name=self.provider_config["resource_group"]
Expand Down