Registration is open for TensorFlow Dev Summit 2020 Learn more

tfx.extensions.google_cloud_ai_platform.pusher.executor.Executor

View source on GitHub

Class Executor

Deploy a model to Google Cloud AI Platform serving.

Inherits From: Executor

__init__

View source

__init__(context=None)

Constructs a beam based executor.

Child Classes

class Context

Methods

CheckBlessing

View source

CheckBlessing(
    input_dict,
    output_dict
)

Check that model is blessed by upstream ModelValidator, or update output.

Args:

  • input_dict: Input dict from input key to a list of artifacts:
    • model_blessing: model blessing path from model_validator. Pusher looks for a file named 'BLESSED' to consider the model blessed and safe to push.
  • output_dict: Output dict from key to a list of artifacts, including:
    • model_push: A list of 'ModelPushPath' artifact of size one.

Returns:

True if the model is blessed by validator.

Do

View source

Do(
    input_dict,
    output_dict,
    exec_properties
)

Overrides the tfx_pusher_executor.

Args:

  • input_dict: Input dict from input key to a list of artifacts, including:
    • model_export: exported model from trainer.
    • model_blessing: model blessing path from model_validator.
  • output_dict: Output dict from key to a list of artifacts, including:
    • model_push: A list of 'ModelPushPath' artifact of size one. It will include the model in this push execution if the model was pushed.
  • exec_properties: Mostly a passthrough input dict for tfx.components.Pusher.executor. custom_config.ai_platform_serving_args is consumed by this class. For the full set of parameters supported by Google Cloud AI Platform, refer to https://cloud.google.com/ml-engine/docs/tensorflow/deploying-models#creating_a_model_version.

Returns:

None

Raises:

  • ValueError: if ai_platform_serving_args is not in exec_properties.custom_config.
  • RuntimeError: if the Google Cloud AI Platform training job failed.