-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
Extending the Ray Serve integration to allow attributes for Serve deployments #2918
Extending the Ray Serve integration to allow attributes for Serve deployments #2918
Conversation
…loyments This closes deepset-ai#2917 We should be able to set Ray Serve attributes for the nodes of pipelines, like amount of GPU to use, max_concurrent_queries, etc. Now this is possible from the pipeline yaml file for each node of the pipeline.
Python 3.8 was generating a different schema than Python 3.7 is creating in the CI. You MUST use Python 3.7 to generate the schemas, otherwise the CIs will fail.
Hey @zoltan-fedor! Thank you for this PR. I will review it shortly 🙂 |
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.
There are a couple of catches here.
The core issue is that you added the deployment_kwargs
block to the general pipeline schema, without restricting it to Ray pipelines. This needs two actions to be fixed:
- We need a pipeline test that verifies that Ray attributes cannot be added to base pipelines. It could be something as simple as adding the following test in
tests/pipelines/test_pipeline.yaml.py
, approx line 996:
def test_load_yaml_ray_args_in_pipeline(tmp_path):
with pytest.raises(PipelineConfigError) as e:
pipeline = Pipeline.load_from_yaml(
SAMPLES_PATH / "pipeline" / "ray.haystack-pipeline.yml", pipeline_name="ray_query_pipeline",
)
- We need to restrict this argument to Ray pipelines. This is rather easy, you just need to add
deployment_kwargs
alongsidereplicas
in this part of the schema:haystack/haystack/nodes/_json_schema.py
Lines 312 to 321 in b78db1c
"oneOf": [ { "not": {"required": ["extras"]}, "properties": { "pipelines": { "title": "Pipelines", "items": {"properties": {"nodes": {"items": {"not": {"required": ["replicas"]}}}}}, } }, },
I hope it's all clear! Let me know if there's any question 🙂
One last thing: how about renaming the new param to serve_deployment_kwargs
? Just to clarify it's related to Ray Serve. Otherwise deployment_kwargs
sounds very generic.
This was generated by the JSON generator, but based on @ZanSara's instructions, I am removing it.
HI @ZanSara , I have also added
But that will not make the exception tested in the test to be thrown, so this test will fail:
Any recommendations? |
You're right about the test! We should add a check in the pipeline loading for the |
Ok that's not very easy to explain 😅 I'll add a commit myself to do that 👍 |
Let me finish the removal of the |
I have made the |
Sorry! I haven't seen this. I'm done anyway, I'll be back in a while to see how the tests look like. |
…-fedor/haystack into feature-ray-serve-deployment-args
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.
Great work, thanks for it! 😊 I have no remarks.
Related Issue(s): closes #2917
We should be able to set Ray Serve attributes for the nodes of pipelines, like amount of GPU to use, max_concurrent_queries, etc.
Now this is possible from the pipeline yaml file for each node of the pipeline.
Proposed changes:
num_concurrent_queries
and so on. See full list of attributes for theray.serve.deployment()
method in the Ray Serve API documentationPre-flight checklist