Skip to content

Commit

Permalink
[k8s] Show all kubernetes clusters in optimizer table (#4013)
Browse files Browse the repository at this point in the history
* Show all kubernetes clusters in optimizer table

* format

* Add comment
  • Loading branch information
Michaelvll authored Oct 29, 2024
1 parent d3be8ed commit 1a6e2f6
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions sky/optimizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -831,13 +831,17 @@ def format_number(x):
return row

def _get_resource_group_hash(resources: 'resources_lib.Resources'):
return json.dumps(
{
'cloud': f'{resources.cloud}',
'accelerators': f'{resources.accelerators}',
'use_spot': resources.use_spot
},
sort_keys=True)
resource_key_dict = {
'cloud': f'{resources.cloud}',
'accelerators': f'{resources.accelerators}',
'use_spot': resources.use_spot
}
if isinstance(resources.cloud, clouds.Kubernetes):
# Region for Kubernetes is the context name, i.e. different
# Kubernetes clusters. We add region to the key to show all the
# Kubernetes clusters in the optimizer table for better UX.
resource_key_dict['region'] = resources.region
return json.dumps(resource_key_dict, sort_keys=True)

# Print the list of resouces that the optimizer considered.
resource_fields = [
Expand Down

0 comments on commit 1a6e2f6

Please sign in to comment.