Skip to content

[serve] Improve single-app and multi-app differentiation#33490

Merged
edoakes merged 11 commits into
ray-project:masterfrom
zcin:deploy-mode-cli
Mar 23, 2023
Merged

[serve] Improve single-app and multi-app differentiation#33490
edoakes merged 11 commits into
ray-project:masterfrom
zcin:deploy-mode-cli

Conversation

@zcin
Copy link
Copy Markdown
Contributor

@zcin zcin commented Mar 21, 2023

Why are these changes needed?

  • Disallow empty string application names in ServeDeploySchema
  • Disallow specifying an app name if user is directly deploying a single-app config ServeApplicationSchema
    • Otherwise, GET /api/serve/deployments/status and GET /api/serve/deployments/config would not get the correct status and config. We could try to fix it, but there's no reason to allow users to specify the name of their application, so it's better to disallow it.
  • Add a field deploy_mode in ServeInstanceDetails so that we can automatically detect what config(s) to show and REMOVE --multi-app flag in serve config
  • Remove trailing space for serve config and serve status

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 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 March 20, 2023 17:20
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
zcin added 3 commits March 20, 2023 20:24
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin changed the title [serve] Improve serve config [serve] Multi-app general improvements Mar 21, 2023
@zcin zcin changed the title [serve] Multi-app general improvements [serve] Improve single-app and multi-app differentiation Mar 21, 2023
Comment on lines +169 to +170
if "name" in config.dict(exclude_unset=True):
return Response(
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

please add a logger.warning message as well for both of these

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added!

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin
Copy link
Copy Markdown
Contributor Author

zcin commented Mar 21, 2023

Please see updated description + code.

If we are OK with adding a field deploy_mode in ServeInstanceDetails, we can track whether a single-app or multi-app config has been deployed in the backend, and thus automatically decide what to show for serve config. So, I've removed the --multi-app flag in serve config.

zcin added 3 commits March 21, 2023 15:07
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin force-pushed the deploy-mode-cli branch from c537a9d to 233d73a Compare March 21, 2023 23:10
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin force-pushed the deploy-mode-cli branch from 233d73a to 9614a2a Compare March 21, 2023 23:19
Copy link
Copy Markdown
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.

please add test cases for name set in ServeApplicationSchema. Make sure the exception can be raised in serve_agent and deploy_apps.

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin force-pushed the deploy-mode-cli branch from baa9b3a to 5a851cf Compare March 22, 2023 21:06
@zcin
Copy link
Copy Markdown
Contributor Author

zcin commented Mar 23, 2023

please add test cases for name set in ServeApplicationSchema. Make sure the exception can be raised in serve_agent and deploy_apps.

Added! @edoakes ping for review/merge

@edoakes edoakes merged commit ffa71ce into ray-project:master Mar 23, 2023
@zcin zcin mentioned this pull request Mar 24, 2023
8 tasks
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…#33490)

- Disallow empty string application names in `ServeDeploySchema`
- Disallow specifying an app name if user is directly deploying a single-app config `ServeApplicationSchema`
  - Otherwise, `GET /api/serve/deployments/status` and `GET /api/serve/deployments/config` would not get the correct status and config. We could try to fix it, but there's no reason to allow users to specify the name of their application, so it's better to disallow it.
- Add a field `deploy_mode` in `ServeInstanceDetails` so that we can automatically detect what config(s) to show and ***REMOVE `--multi-app` flag in `serve config`***
- Remove trailing space for `serve config` and `serve status`

Signed-off-by: elliottower <elliot@elliottower.com>
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…#33490)

- Disallow empty string application names in `ServeDeploySchema`
- Disallow specifying an app name if user is directly deploying a single-app config `ServeApplicationSchema`
  - Otherwise, `GET /api/serve/deployments/status` and `GET /api/serve/deployments/config` would not get the correct status and config. We could try to fix it, but there's no reason to allow users to specify the name of their application, so it's better to disallow it.
- Add a field `deploy_mode` in `ServeInstanceDetails` so that we can automatically detect what config(s) to show and ***REMOVE `--multi-app` flag in `serve config`***
- Remove trailing space for `serve config` and `serve status`

Signed-off-by: Jack He <jackhe2345@gmail.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.

4 participants