-
Notifications
You must be signed in to change notification settings - Fork 5.8k
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] Java documentation #26321
[Serve] Java documentation #26321
Conversation
Great start. Here's my recommendation: Location
Content:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like the code is duplicated. You can use the literalinclude directive to embed the file without copying them https://myst-parser.readthedocs.io/en/latest/faq/index.html?highlight=literalinclude#include-a-file-from-outside-the-docs-folder-like-readme-md
Signed-off-by: chuhan.ly <[email protected]>
@dmatrix can you take another look? here's the rendering of the two added pages: |
Java is one of the mainstream programming languages for production services. Ray Serve natively supports Java API for creating, updating, and managing deployments. You can create Ray Serve deployments using Java and call them via Python, or vice versa. | ||
|
||
This section should help you: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This section helps you to:
## Creating a Deployment | ||
|
||
By specifying the full name of the class, we can create and deploy a deployment of the class. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By specifying the full name of the class as an argument to Serve.deployment()
method, as shown in the code below, we can create and deploy our deployment of the class.
## Querying a Deployment | ||
|
||
A deployed deployment can be found by its name. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The subheading seems a bit confusing. You are not querying per se. Rather, you are fetching an instance of the deployment. Perhaps, it ought to read: "Accessing your Deployment."
|
||
## Querying a Deployment | ||
|
||
A deployed deployment can be found by its name. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Read awkward.
Once a deployment is deployed, you can fetch its instance by name.
``` | ||
|
||
## Configuring a Deployment | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a sentence here:
There are a couple of deployment configuration Serve supports:
- ability to scale out by increasing number of deployment replicas
- ability to assign resources such as CPU and GPUs.
The next two sections describe how to configure your deployments.
# Java Tutorial | ||
|
||
First of all, using Java Ray Serve needs the following dependency in you `pom.xml`: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
To use Java Ray Serve, you need the following dependency in your pom.xml.
``` | ||
|
||
> NOTE: After installing Ray, the Java jar of Ray Serve has been included locally. The `provided` scope could ensure the Java code using Ray Serve can be compiled and will not cause version conflicts when deployed on the cluster. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
After installing Ray, the Java jar of Ray Serve is included locally.
doc/source/serve/tutorials/java.md
Outdated
:start-after: docs-deploy-start | ||
``` | ||
|
||
The `Deployment.create` makes a `Deployment` object named "strategy". After executing `Deployment.deploy`, this "strategy" deployment is deployed in the instance of Ray Serve with 4 replicas, and we can access it for distributed parallel computing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The Deployment.create
makes a Deployment
object named "strategy."
doc/source/serve/tutorials/java.md
Outdated
:start-after: docs-deploy-start | ||
``` | ||
|
||
The `Deployment.create` makes a `Deployment` object named "strategy". After executing `Deployment.deploy`, this "strategy" deployment is deployed in the instance of Ray Serve with 4 replicas, and we can access it for distributed parallel computing. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
4 replicas --> four replicas
``` | ||
|
||
At present, the calculation of each bank's each indicator is still in series, and just sended to Ray for execution. We can make the calculation concurrent, which not only improves the calculation efficiency, but also solves the bottleneck of single machine. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what does "is still in series," mean? Might want to clarify. Do you mean serial?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just sended to Ray --> sent to Ray
## Calling Ray Serve Deployment with HTTP | ||
|
||
Another way to call a deployment is through the HTTP request. But there are now two limitations for the Java deployments: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Another way to test or call a deployment is ...
``` | ||
|
||
Now, the complete usage of `HttpStrategyCalcOnRayServe` is like this: | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Finally, the complete usage ....
Signed-off-by: simon-mo <[email protected]>
Signed-off-by: simon-mo <[email protected]>
@dmatrix addressed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
suggested minor nit otherwise LGTM
``` | ||
|
||
At present, the calculation of each bank's each indicator is still in series, and just sended to Ray for execution. We can make the calculation concurrent, which not only improves the calculation efficiency, but also solves the bottleneck of single machine. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
just sended to Ray --> sent to Ray
Signed-off-by: simon-mo <[email protected]>
Need Java code owner here as well. @WangTaoTheTonic, @kfstorm or @jovany-wang can you please approve? |
Signed-off-by: Stefan van der Kleij <[email protected]>
Why are these changes needed?
Now we have commit Ray Serve Java API. Users can use Java to deploy and access Ray Serve Deployment end-to-end. But there is no relevant documents. This PR will commit the documents about Ray Serve Java user case.
Related issue number
#22726
Closes #27580
Checks
scripts/format.sh
to lint the changes in this PR.