flytekit.extend.ImageConfig#
- class flytekit.extend.ImageConfig(default_image=None, images=None)[source]#
We recommend you to use ImageConfig.auto(img_name=None) to create an ImageConfig. For example, ImageConfig.auto(img_name=””ghcr.io/flyteorg/flytecookbook:v1.0.0””) will create an ImageConfig.
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.
- default_image#
The default image to be used as a container for task serialization.
- Type:
Optional[Image]
- 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:
- classmethod from_dict(kvs, *, infer_missing=False)#
- 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": "...", } )
- classmethod from_json(s, *, parse_float=None, parse_int=None, parse_constant=None, infer_missing=False, **kw)#
- classmethod schema(*, infer_missing=False, only=None, exclude=(), many=False, context=None, load_only=(), dump_only=(), partial=False, unknown=None)#
- to_json(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, indent=None, separators=None, default=None, sort_keys=False, **kw)#
- 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=<image_uri>
or just<image_uri>
. All other images should be provided with a name, in the formatname=<image_uri>
This method can be used with the CLI- Parameters:
- Returns:
- Return type:
Attributes
- dataclass_json_config = None