jina.docker.hubio

Module for wrapping Jina Hub API calls.

class jina.docker.hubio.HubIO(args)[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 image and publish it to the world.

Examples:
  • jina hub build my_pod/ build the image

  • jina hub build my_pod/ --push build the image and push to the public registry

  • jina hub pull jinahub/pod.dummy_mwu_encoder:0.0.6 to download the image

Create a new HubIO.

Parameters

args (Namespace) – arguments

new(no_input=False)[source]

Create a new executor using cookiecutter template.

Parameters

no_input (bool) – Argument to avoid prompting dialogue (just to be used for testing)

Return type

None

login()[source]

Login using Github Device flow to allow push access to Jina Hub Registry.

Return type

None

list()[source]

List all hub images given a filter specified by CLI.

Return type

Optional[List[Dict[str, Any]]]

Returns

list of dictionaries of images

push(name=None, build_result=None)[source]

Push image to Jina Hub.

Parameters
  • name (Optional[str]) – name of image

  • build_result (Optional[Dict]) – dictionary containing the build summary

Return type

None

Returns

None

pull()[source]

Pull docker image.

Return type

None

build()[source]

Perform a build of the Docker image.

Return type

Dict

Returns

dictionary with information on image (manifest)

dry_run()[source]

Perform a dry-run.

Return type

Dict

Returns

a dict with the manifest info.

create(no_input=False)

Create a new executor using cookiecutter template.

Parameters

no_input (bool) – Argument to avoid prompting dialogue (just to be used for testing)

Return type

None

init(no_input=False)

Create a new executor using cookiecutter template.

Parameters

no_input (bool) – Argument to avoid prompting dialogue (just to be used for testing)

Return type

None