Commit 0aa57c6
authored
feat(sdk): allow users to serve Tesseracts using multiple worker processes (#135)
#### Relevant issue or PR
n/a
#### Description of changes
Adds `num_workers` argument to `$ tesseract-runtime serve`,
`Tesseract.from_image`, and `engine.serve`. This allows users to serve
using multiple processes, handling requests in parallel (at the expense
of higher resource usage). The default is unchanged (1).
#### Testing done
CI, new test
#### License
- [x] By submitting this pull request, I confirm that my contribution is
made under the terms of the [Apache 2.0
license](https://pasteurlabs.github.io/tesseract/LICENSE).
- [x] I sign the Developer Certificate of Origin below by adding my name
and email address to the `Signed-off-by` line.
<details>
<summary><b>Developer Certificate of Origin</b></summary>
```text
Developer Certificate of Origin
Version 1.1
Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
Everyone is permitted to copy and distribute verbatim copies of this
license document, but changing it is not allowed.
Developer's Certificate of Origin 1.1
By making a contribution to this project, I certify that:
(a) The contribution was created in whole or in part by me and I
have the right to submit it under the open source license
indicated in the file; or
(b) The contribution is based upon previous work that, to the best
of my knowledge, is covered under an appropriate open source
license and I have the right under that license to submit that
work with modifications, whether created in whole or in part
by me, under the same open source license (unless I am
permitted to submit under a different license), as indicated
in the file; or
(c) The contribution was provided directly to me by some other
person who certified (a), (b) or (c) and I have not modified
it.
(d) I understand and agree that this project and the contribution
are public and that a record of the contribution (including all
personal information I submit with it, including my sign-off) is
maintained indefinitely and may be redistributed consistent with
this project or the open source license(s) involved.
```
</details>
Signed-off-by: Dion Häfner <dion.haefner@simulation.science>1 parent 7513d1d commit 0aa57c6
File tree
5 files changed
+131
-54
lines changed- tesseract_core/sdk
- templates
- tests
- runtime_tests
- sdk_tests
5 files changed
+131
-54
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
496 | 496 | | |
497 | 497 | | |
498 | 498 | | |
| 499 | + | |
499 | 500 | | |
500 | 501 | | |
501 | 502 | | |
| |||
507 | 508 | | |
508 | 509 | | |
509 | 510 | | |
| 511 | + | |
510 | 512 | | |
511 | 513 | | |
512 | 514 | | |
| |||
527 | 529 | | |
528 | 530 | | |
529 | 531 | | |
530 | | - | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
531 | 535 | | |
532 | 536 | | |
533 | 537 | | |
| |||
548 | 552 | | |
549 | 553 | | |
550 | 554 | | |
| 555 | + | |
551 | 556 | | |
552 | 557 | | |
553 | 558 | | |
| |||
576 | 581 | | |
577 | 582 | | |
578 | 583 | | |
579 | | - | |
| 584 | + | |
580 | 585 | | |
581 | 586 | | |
582 | 587 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 27 | + | |
35 | 28 | | |
36 | 29 | | |
37 | 30 | | |
38 | 31 | | |
| 32 | + | |
39 | 33 | | |
40 | 34 | | |
41 | 35 | | |
| |||
92 | 86 | | |
93 | 87 | | |
94 | 88 | | |
| 89 | + | |
95 | 90 | | |
96 | 91 | | |
97 | 92 | | |
| |||
108 | 103 | | |
109 | 104 | | |
110 | 105 | | |
111 | | - | |
112 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
113 | 111 | | |
114 | 112 | | |
115 | 113 | | |
| |||
119 | 117 | | |
120 | 118 | | |
121 | 119 | | |
| 120 | + | |
122 | 121 | | |
123 | 122 | | |
124 | 123 | | |
| |||
222 | 221 | | |
223 | 222 | | |
224 | 223 | | |
| 224 | + | |
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| |||
261 | 261 | | |
262 | 262 | | |
263 | 263 | | |
| 264 | + | |
264 | 265 | | |
265 | 266 | | |
266 | 267 | | |
267 | 268 | | |
268 | 269 | | |
269 | 270 | | |
270 | 271 | | |
271 | | - | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
272 | 278 | | |
273 | 279 | | |
274 | 280 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4 | 4 | | |
5 | 5 | | |
6 | 6 | | |
| 7 | + | |
7 | 8 | | |
8 | 9 | | |
9 | 10 | | |
| 11 | + | |
| 12 | + | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
| |||
23 | 26 | | |
24 | 27 | | |
25 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
26 | 35 | | |
27 | 36 | | |
28 | 37 | | |
| |||
42 | 51 | | |
43 | 52 | | |
44 | 53 | | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
45 | 95 | | |
46 | 96 | | |
47 | 97 | | |
| |||
157 | 207 | | |
158 | 208 | | |
159 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
160 | 214 | | |
161 | 215 | | |
162 | 216 | | |
| |||
178 | 232 | | |
179 | 233 | | |
180 | 234 | | |
181 | | - | |
182 | | - | |
183 | | - | |
184 | 235 | | |
185 | 236 | | |
186 | 237 | | |
| |||
191 | 242 | | |
192 | 243 | | |
193 | 244 | | |
194 | | - | |
195 | | - | |
196 | | - | |
197 | | - | |
198 | | - | |
199 | | - | |
200 | | - | |
201 | | - | |
202 | | - | |
203 | | - | |
204 | | - | |
205 | | - | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
206 | 248 | | |
207 | | - | |
208 | | - | |
209 | | - | |
210 | | - | |
211 | | - | |
212 | | - | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | 249 | | |
218 | | - | |
219 | | - | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
220 | 261 | | |
221 | | - | |
222 | | - | |
| 262 | + | |
| 263 | + | |
223 | 264 | | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
| 265 | + | |
| 266 | + | |
228 | 267 | | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
235 | 296 | | |
236 | 297 | | |
237 | 298 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
110 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
111 | 116 | | |
112 | 117 | | |
113 | 118 | | |
| |||
0 commit comments