jina.hubble.hubapi module#

Module wrapping interactions with the local executor packages.

jina.hubble.hubapi.get_dist_path(uuid, tag)[source]#

Get the package path according ID and TAG :type uuid: str :param uuid: the UUID of the executor :type tag: str :param tag: the TAG of the executor :rtype: Tuple[Path, Path] :return: package and its dist-info path

jina.hubble.hubapi.get_dist_path_of_executor(executor)[source]#

Return the path of the executor if available.

Parameters:

executor (HubExecutor) – the executor to check

Return type:

Tuple[Path, Path]

Returns:

the path of the executor package

jina.hubble.hubapi.get_config_path(local_id)[source]#

Get the local configure file :type local_id: str :param local_id: the random local ID of the executor :rtype: Path :return: json config path

jina.hubble.hubapi.get_lockfile()[source]#

Get the path of file locker :rtype: str :return: the path of file locker

jina.hubble.hubapi.get_secret_path(inode)[source]#

Get the path of secrets :type inode: str :param inode: the inode of the executor path :rtype: Path :return: the path of secrets

jina.hubble.hubapi.load_secret(work_path)[source]#

Get the UUID and Secret from local :type work_path: Path :param work_path: the work path of the executor :rtype: Tuple[str, str] :return: the UUID and secret

jina.hubble.hubapi.dump_secret(work_path, uuid8, secret)[source]#

Dump the UUID and Secret into local file :type work_path: Path :param work_path: the work path of the executor :type uuid8: str :param uuid8: the ID of the executor :type secret: str :param secret: the access secret

jina.hubble.hubapi.install_local(zip_package, executor, install_deps=False)[source]#

Install the package in zip format to the Jina Hub root.

Parameters:
  • zip_package (Path) – the path of the zip file

  • executor (HubExecutor) – the executor to install

  • install_deps (bool) – if set, install dependencies

jina.hubble.hubapi.install_package_dependencies(install_deps, pkg_dist_path, pkg_path)[source]#
Parameters:
  • install_deps (bool) – if set, then install dependencies

  • pkg_dist_path (Path) – package distribution path

  • pkg_path (Path) – package path

Return type:

None

jina.hubble.hubapi.uninstall_local(uuid)[source]#

Uninstall the executor package.

Parameters:

uuid (str) – the UUID of the executor

jina.hubble.hubapi.list_local()[source]#

List the locally-available executor packages.

Returns:

the list of local executors (if found)

jina.hubble.hubapi.exist_local(uuid, tag=None)[source]#

Check whether the executor exists in local

Parameters:
  • uuid (str) – the UUID of the executor

  • tag (Optional[str]) – the TAG of the executor

Return type:

bool

Returns:

True if existed, else False