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

[serve] Don't change deployment status when autoscaling #36520

Merged
merged 6 commits into from
Jun 22, 2023

Conversation

zcin
Copy link
Contributor

@zcin zcin commented Jun 16, 2023

Why are these changes needed?

The deployment state UPDATING should only be used during redeployment. Right now the state is updating during autoscaling, which can be confusing for users. This PR makes it so that the state doesn't change during autoscaling. This usually means that a deployment's status will remain HEALTHY while it's autoscaling.

Related issue number

Closes #35948

Checks

  • I've signed off every commit(by using the -s flag, i.e., git commit -s) in this PR.
  • I've run scripts/format.sh to lint the changes in this PR.
  • I've included any doc changes needed for https://docs.ray.io/en/master/.
    • I've added any new APIs to the API Reference. For example, if I added a
      method in Tune, I've added it in doc/source/tune/api/ under the
      corresponding .rst file.
  • I've made sure the tests are passing. Note that there might be a few flaky tests, see the recent failures at https://flakey-tests.ray.io/
  • Testing Strategy
    • Unit tests
    • Release tests
    • This PR is not tested :(

zcin added 2 commits June 16, 2023 15:33
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin marked this pull request as ready for review June 20, 2023 06:20
@zcin zcin requested a review from a team June 20, 2023 14:28
@zcin zcin self-assigned this Jun 20, 2023
@@ -1289,6 +1289,19 @@ def _set_target_state(self, target_info: DeploymentInfo) -> None:

logger.info(f"Deploying new version of deployment {self._name}.")

def _set_target_state_autoscaling(self, num_replicas: int) -> None:
"""Update the target number of replicas based on an autoscaling decision."""
Copy link
Contributor

Choose a reason for hiding this comment

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

please update this comment to indicate why we need a separate codepath and what is different from _set_target_state

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added comments!

def wait_for_condition_raise(
condition_predictor, timeout=10, retry_interval_ms=100, **kwargs: Any
):
"""Wait until a condition is met. If exception occurs, raise it."""
Copy link
Contributor

Choose a reason for hiding this comment

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

can you just make this behavior a flag passed to existing wait_for_condition? would reduce the likelihood of someone else rewriting this themselves in the future

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Good point, I've added this as a parameter to wait_for_condition

zcin added 4 commits June 20, 2023 16:17
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Copy link
Contributor

@sihanwang41 sihanwang41 left a comment

Choose a reason for hiding this comment

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

sync offline, one change needed to always set version (new_info.version = self._target_state.version.code_version) . approval for unblocking! LGTM

@zcin
Copy link
Contributor Author

zcin commented Jun 21, 2023

Thanks @sihanwang41, I've addressed your comment!

@edoakes Tests are passing, should be ready to merge!

@edoakes edoakes merged commit 648c4aa into ray-project:master Jun 22, 2023
@zcin zcin deleted the autoscale-status branch August 25, 2023 17:35
arvind-chandra pushed a commit to lmco/ray that referenced this pull request Aug 31, 2023
…36520)

The deployment state UPDATING should only be used during redeployment. Right now the state is updating during autoscaling, which can be confusing for users. This PR makes it so that the state doesn't change during autoscaling. This usually means that a deployment's status will remain HEALTHY while it's autoscaling.

Signed-off-by: e428265 <arvind.chandramouli@lmco.com>
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.

[Serve] Introduce new deployment state in the deployment for autoscaling.
3 participants