Join the SIG TFX-Addons community and help make TFX even better!


Deploy a model to Google Cloud AI Platform serving.

Inherits From: Executor, BaseExecutor

Child Classes

class Context



View source

Check that model is blessed by upstream validators.

input_dict Input dict from input key to a list of artifacts:

  • model_blessing: A ModelBlessing artifact from model validator or evaluator. Pusher looks for a custom property blessed in the artifact to check it is safe to push.
  • infra_blessing: An InfraBlessing artifact from infra validator. Pusher looks for a custom proeprty blessed in the artifact to determine whether the model is mechanically servable from the model server to which Pusher is going to push.

True if the model is blessed by validator.


View source

Overrides the tfx_pusher_executor.

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 evaluator.
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. The following keys in custom_config are consumed by this class:
  • ai_platform_serving_args: For the full set of parameters supported by Google Cloud AI Platform, refer to
  • endpoint: Optional endpoint override. Should be in format of https://[region] Default to global endpoint if not set. Using regional endpoint is recommended by Cloud AI Platform. When set, 'regions' key in ai_platform_serving_args cannot be set. For more details, please see
  • Raises
    ValueError If ai_platform_serving_args is not in exec_properties.custom_config. If Serving model path does not start with gs://. If 'endpoint' and 'regions' are set simultanuously.
    RuntimeError if the Google Cloud AI Platform training job failed.


    View source

    Get input model path to push.

    Pusher can push various types of artifacts if it contains the model. This method decides which artifact type is given to the Pusher and extracts the real model path. Subclass of Pusher Executor should use this method to acquire the source model path.

    input_dict A dictionary of artifacts that is given as the fisrt argument to the Executor.Do() method.

    A resolved input model path.

    RuntimeError If no model path is found from input_dict.