You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/docarray-v2.md
+93-10
Original file line number
Diff line number
Diff line change
@@ -92,9 +92,99 @@ If there is no `request_schema` and `response_schema`, the type hint is used to
92
92
and `response_schema` will be used.
93
93
94
94
95
+
## Serve one Executor in a Deployment
96
+
97
+
Once you have defined the Executor with the New Executor API, you can easily serve and scale it as a Deployment with `gRPC`, `HTTP` or any combination of these
98
+
protocols.
99
+
100
+
101
+
```{code-block} python
102
+
from jina import Deployment
103
+
104
+
with Deployment(uses=MyExec, protocol='grpc', replicas=2) as dep:
105
+
dep.block()
106
+
```
107
+
108
+
109
+
## Chain Executors in Flow with different schemas
110
+
111
+
With the new API, when building a Flow you should ensure that the Document types used as input of an Executor match the schema
112
+
of the output of its incoming previous Flow.
113
+
114
+
For instance, this Flow will fail to start because the Document types are wrongly chained.
In the client, you similarly specify the schema that you expect the Flow to return. You can pass the return type by using the `return_type` parameter in the `client.post` method:
187
+
Similarly, In the client, you specify the schema that you expect the Deployment or Flow to return. You can pass the return type by using the `return_type` parameter in the `client.post` method:
98
188
99
189
```{code-block} python
100
190
---
@@ -117,20 +207,13 @@ with Deployment(uses=MyExec) as dep:
117
207
118
208
Jina is working to offer full compatibility with the new DocArray version.
119
209
120
-
At present, these features are supported if you use the APIs described in the previous sections.
121
-
122
-
- All the features offered by {ref}`Deployment <deployment>` where a single Executor is served and {ref}`scaled <scale-out>`. This includes both
123
-
HTTP and gRPC protocols, and both of them at the same type.
124
-
125
-
- When combining multiple Deployments in a pipeline using a {ref}`Flow <flow-cookbook>`, there are currently several limitations:
210
+
However, there are currently some limitations to consider.
126
211
127
-
- Only gRPC protocol is supported.
128
-
- Only linear Flows are supported, no topologies using bifurcations can be used at the moment.
129
212
130
213
````{admonition} Note
131
214
:class: note
132
215
133
-
With DocArray 0.30 support, Jina introduced the concept of input/output schema at the Executor level. In order to chain multiple Executor into a Flow you always need to make sure that the output schema of an Executor is the same as the Input of the Executor that follows him in the Flow
216
+
With DocArray 0.30 support, Jina introduced the concept of input/output schema at the Executor level. To chain multiple Executors into a Flow you need to ensure that the output schema of an Executor is the same as the input of the Executor that follows it in the Flow
0 commit comments