github jina-ai/serve v3.7.0
πŸ’« Release v3.7.0

latest releases: v3.27.20, v3.27.19, v3.27.18...
2 years ago

Highlights 🌟

Floating Executor 🎈

You can add floating Executors in your Flow. This way of adding Executors in a Flow can be used for asynchronous backround tasks that are not needed for the response of the service you are building.

f = Flow().add().add(needs=['gateway'],floating=True)

#4967 #5004

Parameter per Executor πŸƒ

You can send specific parameters to each Executor by using the executorname__paramname syntax. The Executor named executorname will receive the parameter paramname (without the executorname__ in the key name) and none of the other Executors will receive it.

from jina import Flow, DocumentArray
with Flow().add(name='exec1').add(name='exec2') as flow:
    flow.index(
        DocumentArray.empty(size=5),
        parameters={'exec1__traversal_path': '@r', 'exec2__traversal_path': '@c'},
    )

#4939

Map multiple Executor endpoints to the same method πŸ—ΊοΈ

Now you can dynamically map different endpoints to the same Executor.

from jina import Flow, requests, Executor, Document, DocumentArray, Client

class MyExec(Executor):
    @requests(on='/foo')
    def foo(self, docs, **kwargs):
        for d in docs:
            d.text = 'foo'


# change bind to bar()
f = Flow().add(uses=MyExec, uses_requests={'/index': 'foo', '/search': 'foo'})
with f:
    req = Client(port=f.port).post(
        '/index', Document()
    )

    print(req[0].text)

#5009

Import Executor from installed Python modules

You can now import Executors from a module path by passing it in the py_modules.

f = Flow().add(uses='MyExecutor', py_modules=['module.path.to.my_executor'])

#4954 #5013

Expose Jina environment information on every Runtime ℹ️

Each Flow microservice provides an endpoint that exposes relevant information about the environment where it runs.

#4902

Other changes

  • Support passing different monitoring ports for each replica when running Flow locally #4961
  • Show the monitoring ports of replicas in logs #4956
  • Efficient access to parameters from Request without serializing DocumentArray protobuf #4991
  • Asynchronously send gather endpoints requests from Gateway without awaiting them #5015

Bug fixes

  • Fix issue with how Gateway handled prefetching #5012
  • Fix issue observed when Gateway tries to reconnect to respawned Executor #4941
  • Fix bug with some monitoring metrics in the presence of communication exceptions #4974

Don't miss a new serve release

NewReleases is sending notifications on new releases.