Thank you very much for the excellent effort and time you have invested in Jina!
Describe the bug
I ran the example from the documentation for joining the different branches and noticed that an error occurs:
from jina import Executor, requests, Flow
from docarray import DocList
from docarray.documents import TextDoc
class FooExecutor(Executor):
@requests
async def foo(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
docs.append(TextDoc(text=f'foo was here and got {len(docs)} document'))
class BarExecutor(Executor):
@requests
async def bar(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
docs.append(TextDoc(text=f'bar was here and got {len(docs)} document'))
class BazExecutor(Executor):
@requests
async def baz(self, docs: DocList[TextDoc], **kwargs) -> DocList[TextDoc]:
docs.append(TextDoc(text=f'baz was here and got {len(docs)} document'))
f = (
Flow()
.add(uses=FooExecutor, name='fooExecutor')
.add(uses=BarExecutor, name='barExecutor', needs='fooExecutor')
.add(uses=BazExecutor, name='bazExecutor', needs='fooExecutor')
.add(needs=['barExecutor', 'bazExecutor'])
)
Running:
with f:
print(f.post('/', return_type=DocList[TextDoc]).text)
Results in:
RuntimeWarning: coroutine 'Flow._wait_until_all_ready.<locals>._f' was never awaited (raised from
/usr/local/lib/python3.10/dist-packages/jina/orchestrate/flow/base.py:1988)
ERROR Flow@387 Flow is aborted due to ['gateway'] can not be started. [01/07/24 19:34:40]
---------------------------------------------------------------------------
RuntimeFailToStart Traceback (most recent call last)
[<ipython-input-10-9f7d0fe08cab>](https://localhost:8080/#) in <cell line: 1>()
----> 1 with f:
2 print(f.post('/', return_type=DocList[TextDoc]).text)
3 frames
[/usr/local/lib/python3.10/dist-packages/jina/orchestrate/flow/base.py](https://localhost:8080/#) in _wait_until_all_ready(self)
2010 )
2011 self.close()
-> 2012 raise RuntimeFailToStart
2013 from rich.rule import Rule
2014
RuntimeFailToStart:
Describe how you solve it
I don't know a solution, but the following code works fine:
Thank you very much for the excellent effort and time you have invested in Jina!
Describe the bug I ran the example from the documentation for joining the different branches and noticed that an error occurs:
Running:
Results in:
Describe how you solve it I don't know a solution, but the following code works fine:
Environment
I could reproduce this error on Google Colab as well as on Paperspace Gradient.