jina.hubble.hubio module#

Module for wrapping Jina Hub API calls.

class jina.hubble.hubio.HubIO(args=None, **kwargs)[source]#

Bases: object

HubIO provides the way to interact with Jina Hub registry. You can use it with CLI to package a directory into a Jina Hub and publish it to the world. Examples:

  • jina hub push my_executor/ to push the executor package to Jina Hub

  • jina hub pull UUID8 to download the executor identified by UUID8

To create a HubIO object, simply:

Parameters

args (Optional[Namespace]) – arguments

new()[source]#

Create a new executor folder interactively.

Return type

None

push()[source]#

Push the executor package to Jina Hub.

Return type

None

static fetch_meta(name, tag, *, secret=None, image_required=True, rebuild_image=True, force=False)[source]#

Fetch the executor meta info from Jina Hub. :type name: str :param name: the UUID/Name of the executor :type tag: str :param tag: the tag of the executor if available, otherwise, use None as the value :type secret: Optional[str] :param secret: the access secret of the executor :type image_required: bool :param image_required: it indicates whether a Docker image is required or not :type rebuild_image: bool :param rebuild_image: it indicates whether Jina Hub need to rebuild image or not :type force: bool :param force: if set to True, access to fetch_meta will always pull latest Executor metas, otherwise, default

to local cache

Return type

HubExecutor

Returns

meta of executor

Note

The name and tag should be passed via args and force and secret as kwargs, otherwise, cache does not work.

static deploy_public_sandbox(args)[source]#

Deploy a public sandbox to Jina Hub. :type args: Union[Namespace, Dict] :param args: arguments parsed from the CLI

Return type

str

Returns

the host and port of the sandbox

pull()[source]#

Pull the executor package from Jina Hub.

Return type

str

Returns

the uses string