github jina-ai/jina v3.6.0
💫 Release v3.6.0

latest releases: v3.27.13, v3.27.12, v3.27.11...
2 years ago

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

#4779

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())

#4779

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')
       ...

#4818

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

#4786

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)

#4849

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

#4890

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'):
            ...

#4892

Other changes

  • Add to_kubernetes_yaml as alias of to_k8s_yaml API for Flow
  • Add additional metrics for monitoring #4789
  • Default port when Client is initialized #4855
  • Use jtype syntax for Flow when save_config is used, making it compatible with jcloud #4809

Breaking changes ⚠️

  • join API has been deprecated from Flow. Use needs with the required Executor to have an equivalent Flow 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

Don't miss a new jina release

NewReleases is sending notifications on new releases.