flytekit.extend.Image#

class flytekit.extend.Image(name, fqn, tag=None, digest=None)[source]#

Image is a structured wrapper for task container images used in object serialization.

Parameters:
name#

A user-provided name to identify this image.

Type:

str

fqn#

Fully qualified image name. This consists of #. a registry location #. a username #. a repository name For example: hostname/username/reponame

Type:

str

tag#

Optional tag used to specify which version of an image to pull

Type:

str

digest#

Optional digest used to specify which version of an image to pull

Type:

str

Methods

classmethod from_dict(kvs, *, infer_missing=False)#
Parameters:

kvs (dict | list | str | int | float | bool | None)

Return type:

A

classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)#
Parameters:

s (str | bytes | bytearray)

Return type:

A

static look_up_image_info(name, image_identifier, allow_no_tag_or_digest=False)[source]#

Creates an Image object from an image identifier string or a path to an ImageSpec yaml file.

This function is used when registering tasks/workflows with Admin. When using the canonical Python-based development cycle, the version that is used to register workflows and tasks with Admin should be the version of the image itself, which should ideally be something unique like the git revision SHA1 of the latest commit.

Parameters:
  • name (str)

  • image_identifier (str) – Either the full image identifier string e.g. somedocker.com/myimage:someversion123 or a path to a file containing a ImageSpec.

  • allow_no_tag_or_digest (bool)

Return type:

Image

classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)#
Parameters:
Return type:

SchemaF[A]

to_dict(encode_json=False)#
Return type:

Dict[str, dict | list | str | int | float | bool | None]

to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)#
Parameters:
Return type:

str

Attributes

dataclass_json_config = None
digest: str | None = None
full

” Return the full image name with tag or digest, whichever is available.

When using a tag the separator is : and when using a digest the separator is @.

tag: str | None = None
version

Return the version of the image. This could be the tag or digest, whichever is available.

name: str
fqn: str