Skip to content

[Serve] Make controller cloud choose from replica resources if it is not up #3231

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

Merged
merged 3 commits into from
Mar 25, 2024

Conversation

cblmemo
Copy link
Collaborator

@cblmemo cblmemo commented Feb 26, 2024

Tested (run the relevant ones):

  • Code formatting: bash format.sh
  • Any manual or new tests for this PR (please specify below)

Tested with the following YAML and print out controller resources to make sure two cloud is chosen

service:
  readiness_probe: /v1/models
  replicas: 1

resources:
  ports: 8080
  any_of:
    - cloud: aws
    - cloud: gcp
  • All smoke tests: pytest tests/test_smoke.py
  • Relevant individual smoke tests: pytest tests/test_smoke.py::test_fill_in_the_name
  • Backward compatibility tests: bash tests/backward_comaptibility_tests.sh

@cblmemo cblmemo changed the title [Serve] Make controller choose from replica resources if it is not up [Serve] Make controller cloud choose from replica resources if it is not up Feb 26, 2024
@cblmemo cblmemo requested review from Michaelvll and MaoZiming March 19, 2024 08:03
Copy link
Member

@MaoZiming MaoZiming left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

controller_resources_in_config.cloud is None):
controller_clouds = requested_clouds
else:
controller_clouds = {controller_resources_in_config.cloud}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If controller_exist and controller_resources_in_config.cloud is None, the controller_clouds will still be set to None?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, because if the controller exists, we don't want to trigger a resources not match error for the controller. For example, the controller exists and it is on AWS, and no controller resources in config is found; while now I try to sky serve up a service w/ replica on GCP. In such case, we want to directly use the controller, instead of setting controller cloud to GCP and causing a resources not match on controller.

@cblmemo cblmemo merged commit 9d6bf82 into master Mar 25, 2024
@cblmemo cblmemo deleted the serve-multicloud-controller branch March 25, 2024 04:55
Comment on lines 63 to 66
# If the controller and all replicas are from the same cloud, it should
# provide better connectivity. We will let the controller choose from
# any cloud in the resources if the controller does not exist.
requested_clouds: Set['clouds.Cloud'] = set()
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Respecting cloud is good, but we should also consider respecting the regions/zones specified for the resources as well, e.g. we may want to priortize the regions requested by the service.

How about we have a TODO here and file an issue for it?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

requested_clouds: Set['clouds.Cloud'] = set()
for resources in task.resources:
if resources.cloud is not None:
requested_clouds.add(resources.cloud)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

resources.cloud is an object and will not be able to be distinguished by set.

Comment on lines +177 to +181
if (not controller_exist and
controller_resources_in_config.cloud is None):
controller_clouds = requested_clouds
else:
controller_clouds = {controller_resources_in_config.cloud}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we consider moving these logics into controller_utils and have it shared by serve and spot controller?

@cblmemo
Copy link
Collaborator Author

cblmemo commented Mar 25, 2024

@Michaelvll Thanks for the suggestion! Fixed in #3363.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants