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] Change API to use ServeDeploySchema to replace ServeApplicationSchema #32285

Merged
merged 26 commits into from
Feb 15, 2023

Conversation

zcin
Copy link
Contributor

@zcin zcin commented Feb 7, 2023

Signed-off-by: Cindy Zhang cindyzyx9@gmail.com

Why are these changes needed?

This changes the controller to deploy config files of the format ServeDeploySchema instead of ServeApplicationSchema. This prepares the backend python API to support the new, multi-app compatible REST API.

  • deploy_app --> deploy_apps
  • [single-app compatibility] controller.deploy_apps still takes ServeApplicationSchema but converts it to a ServeDeploySchema with a single application (and takes name "" if no name is provided).
  • If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update. We don't have the versioning support for this yet, this should be added in the future.
  • [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using get_app_config, the app name prefix is removed.
  • [multi-app mode] Applying a ServeDeploySchema config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.

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 :(

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.

lgtm!

python/ray/serve/schema.py Outdated Show resolved Hide resolved
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>
@zcin zcin changed the title [Serve] Change API to use ServeDeploySchema to replace ServeApplicationSchema [WIP][Serve] Change API to use ServeDeploySchema to replace ServeApplicationSchema Feb 10, 2023
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin changed the title [WIP][Serve] Change API to use ServeDeploySchema to replace ServeApplicationSchema [Serve] Change API to use ServeDeploySchema to replace ServeApplicationSchema Feb 10, 2023
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin
Copy link
Contributor Author

zcin commented Feb 10, 2023

@sihanwang41 Added some changes, could you do another pass?
@shrekris-anyscale @edoakes Ping for review!

@sihanwang41
Copy link
Contributor

Hi @zcin , the pr has unit tests failures and lint issue, can you take a look?

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>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin
Copy link
Contributor Author

zcin commented Feb 14, 2023

@sihanwang41 @shrekris-anyscale Tests fixed by moving to a new file. I also addressed comments, please take another look when you get the chance, ty!

@sihanwang41
Copy link
Contributor

@sihanwang41 @shrekris-anyscale Tests fixed by moving to a new file. I also addressed comments, please take another look when you get the chance, ty!

thanks! Do we know why we have to move to a new file?

@zcin
Copy link
Contributor Author

zcin commented Feb 14, 2023

Do we know why we have to move to a new file?

I'm not completely sure, but after adding the new tests for this PR the original test class TestDeployApp that was in test_standalone2.py became pretty big so it also seemed reasonable to move to a new file.

It's possible that test_standalone2.py became too big? I also ran into problems with the new test file test_deploy_app.py when I labeled it as "medium", and the problems were fixed when I changed it to "large".

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

zcin commented Feb 14, 2023

Synced with @sihanwang41, looking into why keeping the tests in the same file causes failures.

Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin zcin force-pushed the serve-deploy-schema branch 2 times, most recently from ac87ca7 to a978b38 Compare February 15, 2023 01:02
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
@zcin
Copy link
Contributor Author

zcin commented Feb 15, 2023

Tests re-added to test_standalone2.py and are passing! I modified the test fixture used for TestDeployApp, I think it helps with state-sharing problems.

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

LGTM

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, the changes look good to me! Once we add the warning, this change should be ready to merge.

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

zcin commented Feb 15, 2023

@edoakes Should be ready to merge!

@edoakes edoakes merged commit b742538 into ray-project:master Feb 15, 2023
@zcin zcin deleted the serve-deploy-schema branch February 16, 2023 00:43
zcin added a commit to zcin/ray that referenced this pull request Mar 2, 2023
Signed-off-by: Cindy Zhang <cindyzyx9@gmail.com>
cadedaniel pushed a commit to cadedaniel/ray that referenced this pull request Mar 22, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.
edoakes pushed a commit to edoakes/ray that referenced this pull request Mar 22, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.

Signed-off-by: Edward Oakes <ed.nmi.oakes@gmail.com>
peytondmurray pushed a commit to peytondmurray/ray that referenced this pull request Mar 22, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.
scottsun94 pushed a commit to scottsun94/ray that referenced this pull request Mar 28, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.
cassidylaidlaw pushed a commit to cassidylaidlaw/ray that referenced this pull request Mar 28, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.
elliottower pushed a commit to elliottower/ray that referenced this pull request Apr 22, 2023
…onSchema (ray-project#32285)

This changes the controller to deploy config files of the format `ServeDeploySchema` instead of `ServeApplicationSchema`.   This prepares the backend python API to support the new, multi-app compatible REST API.

- `deploy_app` --> `deploy_apps`
- [single-app compatibility] `controller.deploy_apps` still takes `ServeApplicationSchema` but converts it to a `ServeDeploySchema` with a single application (and takes name "" if no name is provided).
- ~~If an application is redeployed (i.e. an app with same name already exists) and the dictionary of deployment versions is unchanged, its deployment timestamp does not update.~~ We don't have the versioning support for this yet, this should be added in the future.
- [multi-app config] Given a deployed config file, each application's deployments will have the app name prepended to the deployment name (so there is no gap between the names of a deployment when it is actually deployed vs the names in the config file), and if user fetches the config using `get_app_config`, the app name prefix is removed.
- [multi-app mode] Applying a `ServeDeploySchema` config file will set that as the goal state; it will deploy the apps listed in the config file and remove any that are not listed.

Signed-off-by: elliottower <elliot@elliottower.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