Highlights 🌟
Health check 💻
Jina has changed the way Executors expose their health status to the external world. Now Executors and every single Runtime in Jina exposing a GRPC service, adhere to the GRPC Health checking protocol
Dry run 🏃
In order to expose the readiness of the complete Flow, now Flow
and Client
expose dry_run
interface to check the availability of Flow to serve requests successfully.
client = Client('host:port')
print(client.dry_run())
Logging of Executor 🖨️
Every Executor has an attribute self.logger
which is an instance of JinaLogger
which can be used to log the behavior of the specific Executor.
from jina import Executor, requests
class MyExecutor(Executor):
@requests
def foo(self, docs, **kwargs):
self.logger.info('Processing {len(docs)} documents')
...
Efficient GPU usage 🔋
In a multi-gpu environment, When running on local several replicas of the same Executor, it can be desirable for each of the replicas to use a different set of GPU devices. With this, one can maximize the utilization of the GPU resources. Now, Jina Flow will read the CUDA_VISIBLE_DEVICES
environment variable, and in case RR
(Round Robin) pattern is found, it will assign CUDA_VISIBLE_DIVICES inside each replica in a round robin manner.
CUDA_VISIBLE_DEVICES=RR jina flow --uses flow.yaml
Enable secure connection to External Executor 🔒
Accept tls
parameter for connecting to External
executor with encription.
from jina import Flow
f = Flow().add(tls=True, host='host.wolf.jina.ai', external=True)
Export Flows to Kubernetes or Docker compose from CLI 🔧
Now you can export your Flows to Kubernetes or Docker compose using Jina CLI.
Use:
jina export kubernetes --help
jina export docker-compose --help
Custom monitoring using monitor
context manager 🖲️
Now you can add monitoring inside your own Executor by using monitor
attribute as a context manager.
from jina import Executor, requests
class MyExecutor(Executor):
@requests
def foo(docs, **kwargs):
with self.monitor(name='process_seconds', documentation='process time in seconds'):
...
Other changes
- Add
to_kubernetes_yaml
as alias ofto_k8s_yaml
API forFlow
- Add additional metrics for monitoring #4789
- Default port when
Client
is initialized #4855 - Use
jtype
syntax forFlow
whensave_config
is used, making it compatible withjcloud
#4809
Breaking changes ⚠️
join
API has been deprecated fromFlow
. Useneeds
with the requiredExecutor
to have an equivalentFlow
topography.
Before:
from jina import Flow
flow = Flow().add(name='executor1').add(
name='executor2',
needs=['executor1'],
).add(
name='executor3',
needs=['executor1'],
).join(needs=['executor2', 'executor3'])
After:
from jina import Flow
flow = Flow().add(name='executor1').add(
name='executor2',
needs=['executor1'],
).add(
name='executor3',
needs=['executor1'],
).needs(needs=['executor2', 'executor3'])
-
ControlRequest has disappeared and is not anymore part of the Jina Protobuf messages.
-
Hello world examples have been removed