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, 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 force: bool :param force: if set to True, access to fetch_meta will always pull latest Executor metas, otherwise, default

    to local cache

    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(uses)[source]

    Deploy a public sandbox to Jina Hub. :type uses: str :param uses: the executor uses string

    • Returns

      the host and port of the sandbox

  • pull()[source]

    Pull the executor package from Jina Hub.

    • Return type

      str

      Returns

      the uses string