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] Replace ClassNode and FunctionNode with Application in top-level Serve APIs #34627

Merged
merged 11 commits into from
Apr 24, 2023

Conversation

edoakes
Copy link
Contributor

@edoakes edoakes commented Apr 20, 2023

Why are these changes needed?

A bit of renaming to streamline the concepts in the API:

  • Instead of bind() returning ClassNode or FunctionNode (which are very in the weeds), it returns an Application object.
  • This required renaming the output of serve.build, which I've renamed to BuiltApplication (checks out conceptually - serve.build(app) -> built_app.
  • From now on, we should never make mention of "nodes" or "graphs" in user-facing docs/docstrings except for where we are explicitly talking about the call graph API (with InputNode: ...). I will update the docs accordingly.
  • We should also type annotate our documentation examples where possible to make the concepts very clear.

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

Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
Signed-off-by: Edward Oakes <[email protected]>
@edoakes edoakes changed the title [WIP] App class [serve] Replace ClassNode and FunctionNode with Application in top-level Serve APIs Apr 21, 2023
# If the ingress deployment is a function and it is bound to other deployments,
# reject.
if isinstance(serve_root_dag, DeploymentFunctionNode) and len(deployments) != 1:
raise ValueError(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is just pushed down into the DAG code instead of in the top-level API

@@ -23,7 +23,7 @@ def __setitem__(self, *args):


@DeveloperAPI
class Application:
class BuiltApplication:
Copy link
Contributor

Choose a reason for hiding this comment

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

FYI, I think you need to manually insert these classes into Sphinx now or else they won't get rendered.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

going to clean up API ref & add this in a separate PR

@edoakes
Copy link
Contributor Author

edoakes commented Apr 24, 2023

ping @sihanwang41

@edoakes edoakes merged commit 136c740 into ray-project:master Apr 24, 2023
ProjectsByJackHe pushed a commit to ProjectsByJackHe/ray that referenced this pull request May 4, 2023
…top-level Serve APIs (ray-project#34627)

A bit of renaming to streamline the concepts in the API:

- Instead of bind() returning ClassNode or FunctionNode (which are very in the weeds), it returns an Application object.
- This required renaming the output of serve.build, which I've renamed to BuiltApplication (checks out conceptually - serve.build(app) -> built_app.
- From now on, we should never make mention of "nodes" or "graphs" in user-facing docs/docstrings except for where we are explicitly talking about the call graph API (with InputNode: ...). I will update the docs accordingly.
- We should also type annotate our documentation examples where possible to make the concepts very clear.

Signed-off-by: Jack He <[email protected]>
architkulkarni pushed a commit to architkulkarni/ray that referenced this pull request May 16, 2023
…top-level Serve APIs (ray-project#34627)

A bit of renaming to streamline the concepts in the API:

- Instead of bind() returning ClassNode or FunctionNode (which are very in the weeds), it returns an Application object.
- This required renaming the output of serve.build, which I've renamed to BuiltApplication (checks out conceptually - serve.build(app) -> built_app.
- From now on, we should never make mention of "nodes" or "graphs" in user-facing docs/docstrings except for where we are explicitly talking about the call graph API (with InputNode: ...). I will update the docs accordingly.
- We should also type annotate our documentation examples where possible to make the concepts very clear.
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.

5 participants