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] Prevent mixing single/multi-app config deployment #33340

Merged
merged 6 commits into from
Mar 17, 2023

Conversation

zcin
Copy link
Contributor

@zcin zcin commented Mar 15, 2023

Why are these changes needed?

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (ServeApplicationSchema) first then switch to deploying a multi-app config (ServeDeploySchema), or vice versa.

Eventually we want to deprecate deploying using ServeApplicationSchema, so this also encourages users to migrate.

If users mix single-app and multi-app:

  • we will raise an error in controller.deploy_apps
  • the REST api will also return a 400 Response with the error message

Related issue number

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 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 zcin marked this pull request as ready for review March 15, 2023 22:07
Copy link
Contributor

@shrekris-anyscale shrekris-anyscale left a comment

Choose a reason for hiding this comment

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

Nice work! I left a couple comments.

dashboard/modules/serve/serve_agent.py Show resolved Hide resolved
# fields to support single-app mode, but in multi-app mode the host and port
# fields at the top-level deploy config is used instead. Eventually, after
# migration, we should remove these fields from ServeApplicationSchema.
host, port = config.host, config.port
Copy link
Contributor

Choose a reason for hiding this comment

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

Could we raise an error here if the user specifies an app-level host or port? This log is nice, but it doesn't get propagated back to the client.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, if we want to prevent users from deploying it at all, perhaps we should just add a validator to check this in ServeDeploySchema.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah, that would be more general. If it doesn't impede any other behavior, then I'd prefer that.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Agreed! I've added it here

Copy link
Contributor

@shrekris-anyscale shrekris-anyscale left a comment

Choose a reason for hiding this comment

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

Nice work!

python/ray/serve/schema.py Outdated Show resolved Hide resolved
python/ray/serve/schema.py Outdated Show resolved Hide resolved
Signed-off-by: Cindy Zhang <[email protected]>
Signed-off-by: Cindy Zhang <[email protected]>
@zcin zcin changed the title [serve] Prevent users from switching between deploying single-app and multi-app configs [serve] Config deployment improvements Mar 16, 2023
@zcin
Copy link
Contributor Author

zcin commented Mar 16, 2023

@sihanwang41 @edoakes PTAL! This PR blocks users from switching between config formats like we discussed. It also improves ServeDeploySchema with http options validation.

Signed-off-by: Cindy Zhang <[email protected]>
f"Port {app_config_dict['port']} is set in the config for "
f"application `{app_config.name}`. This will be ignored, as "
f"the port {port} from the top level deploy config is used."
)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Removed the warnings here, as in a separate PR I will add validation in the schema itself.

@zcin zcin changed the title [serve] Config deployment improvements [serve] Prevent mixing single/multi-app config deployment Mar 16, 2023
@edoakes edoakes merged commit 65d6137 into ray-project:master Mar 17, 2023
@zcin zcin deleted the deploy-mode branch March 20, 2023 16:04
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request Mar 21, 2023
…t#33340)

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (`ServeApplicationSchema`) first then switch to deploying a multi-app config (`ServeDeploySchema`), or vice versa.

Eventually we want to deprecate deploying using `ServeApplicationSchema`, so this also encourages users to migrate.

If users mix single-app and multi-app:
- we will raise an error in `controller.deploy_apps`
- the REST api will also return a `400 Response` with the error message

Signed-off-by: Jack He <[email protected]>
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…t#33340)

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (`ServeApplicationSchema`) first then switch to deploying a multi-app config (`ServeDeploySchema`), or vice versa.

Eventually we want to deprecate deploying using `ServeApplicationSchema`, so this also encourages users to migrate.

If users mix single-app and multi-app:
- we will raise an error in `controller.deploy_apps`
- the REST api will also return a `400 Response` with the error message

Signed-off-by: Edward Oakes <[email protected]>
chaowanggg pushed a commit to chaowanggg/ray-dev that referenced this pull request Apr 4, 2023
…t#33340)

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (`ServeApplicationSchema`) first then switch to deploying a multi-app config (`ServeDeploySchema`), or vice versa.

Eventually we want to deprecate deploying using `ServeApplicationSchema`, so this also encourages users to migrate.

If users mix single-app and multi-app:
- we will raise an error in `controller.deploy_apps`
- the REST api will also return a `400 Response` with the error message

Signed-off-by: chaowang <[email protected]>
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…t#33340)

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (`ServeApplicationSchema`) first then switch to deploying a multi-app config (`ServeDeploySchema`), or vice versa.

Eventually we want to deprecate deploying using `ServeApplicationSchema`, so this also encourages users to migrate.

If users mix single-app and multi-app:
- we will raise an error in `controller.deploy_apps`
- the REST api will also return a `400 Response` with the error message

Signed-off-by: elliottower <[email protected]>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…t#33340)

To simplify execution and not have to worry about covering all possible conflicts, we want to prevent users from deploying a single-app config (`ServeApplicationSchema`) first then switch to deploying a multi-app config (`ServeDeploySchema`), or vice versa.

Eventually we want to deprecate deploying using `ServeApplicationSchema`, so this also encourages users to migrate.

If users mix single-app and multi-app:
- we will raise an error in `controller.deploy_apps`
- the REST api will also return a `400 Response` with the error message

Signed-off-by: Jack He <[email protected]>
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.

4 participants