Skip to content

Commit

Permalink
[Spot/Serve] Fix controller resources fetching (#3468)
Browse files Browse the repository at this point in the history
* Fix controller resources fetching

* use the existing resource for controller
  • Loading branch information
Michaelvll authored Apr 23, 2024
1 parent 99408b3 commit e7b812c
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions sky/utils/controller_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -336,9 +336,14 @@ def get_controller_resources(
controller_resources_to_use: resources.Resources = list(
controller_resources)[0]

controller_exist = (global_user_state.get_cluster_from_name(
controller.value.name) is not None)
if controller_exist or controller_resources_to_use.cloud is not None:
controller_record = global_user_state.get_cluster_from_name(
controller.value.cluster_name)
if controller_record is not None:
handle = controller_record.get('handle', None)
if handle is not None:
controller_resources_to_use = handle.launched_resources

if controller_resources_to_use.cloud is not None:
return {controller_resources_to_use}

# If the controller and replicas are from the same cloud, it should
Expand Down

0 comments on commit e7b812c

Please sign in to comment.