flytekit.configuration.ImageConfig#

class flytekit.configuration.ImageConfig(default_image=None, images=None)[source]#

ImageConfig holds available images which can be used at registration time. A default image can be specified along with optional additional images. Each image in the config must have a unique name.

Parameters
Return type

None

default_image#

The default image to be used as a container for task serialization.

Type

str

images#

Optional, additional images which can be used in task container definitions.

Type

List[Image]

Methods

classmethod auto(config_file=None, img_name=None)[source]#

Reads from config file or from img_name Note that this function does not take into account the flytekit default images (see the Dockerfiles at the base of this repo). To pick those up, see the auto_default_image function..

Parameters
Returns

Return type

flytekit.configuration.ImageConfig

classmethod auto_default_image()[source]#
Return type

flytekit.configuration.ImageConfig

classmethod create_from(default_image, other_images=None)[source]#
Parameters
Return type

flytekit.configuration.ImageConfig

find_image(name)[source]#

Return an image, by name, if it exists.

Return type

Optional[flytekit.configuration.Image]

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

kvs (Optional[Union[dict, list, str, int, float, bool]]) –

Return type

dataclasses_json.api.A

classmethod from_images(default_image, m=None)[source]#

Allows you to programmatically create an ImageConfig. Usually only the default_image is required, unless your workflow uses multiple images

ImageConfig.from_dict(
    "ghcr.io/flyteorg/flytecookbook:v1.0.0",
     {
          "spark": "ghcr.io/flyteorg/myspark:...",
          "other": "...",
})
Returns

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

s (Union[str, bytes, bytearray]) –

Return type

dataclasses_json.api.A

classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)#
Parameters
  • infer_missing (bool) –

  • many (bool) –

  • partial (bool) –

Return type

dataclasses_json.mm.SchemaF[dataclasses_json.mm.A]

to_dict(encode_json=False)#
Return type

Dict[str, Optional[Union[dict, list, str, int, float, bool]]]

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

static validate_image(_, param, values)[source]#

Validates the image to match the standard format. Also validates that only one default image is provided. a default image, is one that is specified as

default=img or just img. All other images should be provided with a name, in the format name=img

This method can be used with the CLI

Parameters
  • _ (Any) – click argument, ignored here.

  • param (str) – the click argument, here should be “image”

  • values (tuple) – user-supplied images

Returns

Return type

flytekit.configuration.ImageConfig

Attributes

default_image: Optional[flytekit.configuration.Image] = None#
images: Optional[List[flytekit.configuration.Image]] = None#