{
   "components":{
      "comp-model-batch-predict":{
         "executorLabel":"exec-model-batch-predict",
         "inputDefinitions":{
            "artifacts":{
               "model":{
                  "artifactType":{
                     "schemaTitle":"google.VertexModel",
                     "schemaVersion":"0.0.1"
                  }
               }
            },
            "parameters":{
               "accelerator_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "accelerator_type":{
                  "parameterType":"STRING"
               },
               "bigquery_destination_output_uri":{
                  "parameterType":"STRING"
               },
               "bigquery_source_input_uri":{
                  "parameterType":"STRING"
               },
               "encryption_spec_key_name":{
                  "parameterType":"STRING"
               },
               "explanation_metadata":{
                  "parameterType":"STRUCT"
               },
               "explanation_parameters":{
                  "parameterType":"STRUCT"
               },
               "gcs_destination_output_uri_prefix":{
                  "parameterType":"STRING"
               },
               "gcs_source_uris":{
                  "parameterType":"LIST"
               },
               "generate_explanation":{
                  "parameterType":"BOOLEAN"
               },
               "instances_format":{
                  "parameterType":"STRING"
               },
               "job_display_name":{
                  "parameterType":"STRING"
               },
               "labels":{
                  "parameterType":"STRUCT"
               },
               "location":{
                  "parameterType":"STRING"
               },
               "machine_type":{
                  "parameterType":"STRING"
               },
               "manual_batch_tuning_parameters_batch_size":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "max_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "model_parameters":{
                  "parameterType":"STRUCT"
               },
               "predictions_format":{
                  "parameterType":"STRING"
               },
               "project":{
                  "parameterType":"STRING"
               },
               "starting_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               }
            }
         },
         "outputDefinitions":{
            "artifacts":{
               "batchpredictionjob":{
                  "artifactType":{
                     "schemaTitle":"google.VertexBatchPredictionJob",
                     "schemaVersion":"0.0.1"
                  }
               },
               "gcs_output_directory":{
                  "artifactType":{
                     "schemaTitle":"system.Artifact",
                     "schemaVersion":"0.0.1"
                  }
               },
               "bigquery_output_table":{
                  "artifactType":{
                     "schemaTitle":"google.BQTable",
                     "schemaVersion":"0.0.1"
                  }
               }
            },
            "parameters":{
               "gcp_resources":{
                  "parameterType":"STRING"
               }
            }
         }
      },
      "comp-model-upload":{
         "executorLabel":"exec-model-upload",
         "inputDefinitions":{
            "parameters":{
               "artifact_uri":{
                  "parameterType":"STRING"
               },
               "display_name":{
                  "parameterType":"STRING"
               },
               "project":{
                  "parameterType":"STRING"
               },
               "serving_container_image_uri":{
                  "parameterType":"STRING"
               }
            }
         },
         "outputDefinitions":{
            "artifacts":{
               "model":{
                  "artifactType":{
                     "schemaTitle":"google.VertexModel",
                     "schemaVersion":"0.0.1"
                  }
               }
            },
            "parameters":{
               "gcp_resources":{
                  "parameterType":"STRING"
               }
            }
         }
      }
   },
   "deploymentSpec":{
      "executors":{
         "exec-model-batch-predict":{
            "container":{
               "args":[
                  "--type",
                  "BatchPredictionJob",
                  "--payload",
                  "{\"display_name\": \"{{$.inputs.parameters['job_display_name']}}\", \"model\": \"{{$.inputs.artifacts['model'].metadata['resourceName']}}\", \"input_config\": {\"instances_format\": \"{{$.inputs.parameters['instances_format']}}\", \"gcs_source\": {\"uris\":{{$.inputs.parameters['gcs_source_uris']}}}, \"bigquery_source\": {\"input_uri\": \"{{$.inputs.parameters['bigquery_source_input_uri']}}\"}}, \"model_parameters\": {{$.inputs.parameters['model_parameters']}}, \"output_config\": {\"predictions_format\": \"{{$.inputs.parameters['predictions_format']}}\", \"gcs_destination\": {\"output_uri_prefix\": \"{{$.inputs.parameters['gcs_destination_output_uri_prefix']}}\"}, \"bigquery_destination\": {\"output_uri\": \"{{$.inputs.parameters['bigquery_destination_output_uri']}}\"}}, \"dedicated_resources\": {\"machine_spec\": {\"machine_type\": \"{{$.inputs.parameters['machine_type']}}\", \"accelerator_type\": \"{{$.inputs.parameters['accelerator_type']}}\", \"accelerator_count\": {{$.inputs.parameters['accelerator_count']}}}, \"starting_replica_count\": {{$.inputs.parameters['starting_replica_count']}}, \"max_replica_count\": {{$.inputs.parameters['max_replica_count']}}}, \"manual_batch_tuning_parameters\": {\"batch_size\": {{$.inputs.parameters['manual_batch_tuning_parameters_batch_size']}}}, \"generate_explanation\": {{$.inputs.parameters['generate_explanation']}}, \"explanation_spec\": {\"parameters\": {{$.inputs.parameters['explanation_parameters']}}, \"metadata\": {{$.inputs.parameters['explanation_metadata']}}}, \"labels\": {{$.inputs.parameters['labels']}}, \"encryption_spec\": {\"kms_key_name\":\"{{$.inputs.parameters['encryption_spec_key_name']}}\"}}",
                  "--project",
                  "{{$.inputs.parameters['project']}}",
                  "--location",
                  "{{$.inputs.parameters['location']}}",
                  "--gcp_resources",
                  "{{$.outputs.parameters['gcp_resources'].output_file}}",
                  "--executor_input",
                  "{{$}}"
               ],
               "command":[
                  "python3",
                  "-u",
                  "-m",
                  "google_cloud_pipeline_components.container.v1.batch_prediction_job.launcher"
               ],
               "image":"gcr.io/ml-pipeline/google-cloud-pipeline-components:latest"
            }
         },
         "exec-model-upload":{
            "container":{
               "args":[
                  "--type",
                  "UploadModel",
                  "--payload",
                  "{\"display_name\": \"{{$.inputs.parameters['display_name']}}\", \"description\": \"\", \"predict_schemata\": {\"instance_schema_uri\": \"\", \"parameters_schema_uri\": \"\", \"prediction_schema_uri\": \"\"}, \"container_spec\": {\"image_uri\": \"{{$.inputs.parameters['serving_container_image_uri']}}\", \"command\": , \"args\": , \"env\": , \"ports\": , \"predict_route\": \"\", \"health_route\": \"\"}, \"artifact_uri\": \"{{$.inputs.parameters['artifact_uri']}}\", \"explanation_spec\": {\"parameters\": , \"metadata\": }, \"encryption_spec\": {\"kms_key_name\":\"\"}, \"labels\": }",
                  "--project",
                  "{{$.inputs.parameters['project']}}",
                  "--location",
                  "--gcp_resources",
                  "{{$.outputs.parameters['gcp_resources'].output_file}}",
                  "--executor_input",
                  "{{$}}"
               ],
               "command":[
                  "python3",
                  "-u",
                  "-m",
                  "google_cloud_pipeline_components.container.v1.model.upload_model.launcher"
               ],
               "image":"gcr.io/ml-pipeline/google-cloud-pipeline-components:latest"
            }
         }
      }
   },
   "pipelineInfo":{
      "name":"training-test"
   },
   "root":{
      "dag":{
         "tasks":{
            "model-batch-predict":{
               "cachingOptions":{
                  "enableCache":true
               },
               "componentRef":{
                  "name":"comp-model-batch-predict"
               },
               "dependentTasks":[
                  "model-upload"
               ],
               "inputs":{
                  "artifacts":{
                     "model":{
                        "taskOutputArtifact":{
                           "outputArtifactKey":"model",
                           "producerTask":"model-upload"
                        }
                     }
                  },
                  "parameters":{
                     "accelerator_count":{
                        "runtimeValue":{
                           "constant":1.0
                        }
                     },
                     "accelerator_type":{
                        "runtimeValue":{
                           "constant":"accelerator_type"
                        }
                     },
                     "bigquery_destination_output_uri":{
                        "runtimeValue":{
                           "constant":"bigquery_destination_output_uri"
                        }
                     },
                     "bigquery_source_input_uri":{
                        "runtimeValue":{
                           "constant":"bigquery_source_input_uri"
                        }
                     },
                     "encryption_spec_key_name":{
                        "runtimeValue":{
                           "constant":"some encryption_spec_key_name"
                        }
                     },
                     "explanation_metadata":{
                        "runtimeValue":{
                           "constant":{
                              "xai_m":"bar"
                           }
                        }
                     },
                     "explanation_parameters":{
                        "runtimeValue":{
                           "constant":{
                              "xai_p":"foo"
                           }
                        }
                     },
                     "gcs_destination_output_uri_prefix":{
                        "runtimeValue":{
                           "constant":"gs://test_gcs_output_dir/batch_prediction"
                        }
                     },
                     "gcs_source_uris":{
                        "runtimeValue":{
                           "constant":[
                              "gs://test_gcs_source"
                           ]
                        }
                     },
                     "generate_explanation":{
                        "runtimeValue":{
                           "constant":1.0
                        }
                     },
                     "instances_format":{
                        "runtimeValue":{
                           "constant":"instance_format"
                        }
                     },
                     "job_display_name":{
                        "runtimeValue":{
                           "constant":"test_display_name"
                        }
                     },
                     "labels":{
                        "runtimeValue":{
                           "constant":{
                              "foo":"bar"
                           }
                        }
                     },
                     "location":{
                        "runtimeValue":{
                           "constant":"us-central1"
                        }
                     },
                     "machine_type":{
                        "runtimeValue":{
                           "constant":"machine_type"
                        }
                     },
                     "manual_batch_tuning_parameters_batch_size":{
                        "runtimeValue":{
                           "constant":4.0
                        }
                     },
                     "max_replica_count":{
                        "runtimeValue":{
                           "constant":3.0
                        }
                     },
                     "model_parameters":{
                        "runtimeValue":{
                           "constant":{
                              "foo":"bar"
                           }
                        }
                     },
                     "predictions_format":{
                        "runtimeValue":{
                           "constant":"predictions_format"
                        }
                     },
                     "project":{
                        "runtimeValue":{
                           "constant":"test_project"
                        }
                     },
                     "starting_replica_count":{
                        "runtimeValue":{
                           "constant":2.0
                        }
                     }
                  }
               },
               "taskInfo":{
                  "name":"model-batch-predict"
               }
            },
            "model-upload":{
               "cachingOptions":{
                  "enableCache":true
               },
               "componentRef":{
                  "name":"comp-model-upload"
               },
               "inputs":{
                  "parameters":{
                     "artifact_uri":{
                        "runtimeValue":{
                           "constant":"project/test_artifact_uri"
                        }
                     },
                     "display_name":{
                        "runtimeValue":{
                           "constant":"test_display_name"
                        }
                     },
                     "project":{
                        "runtimeValue":{
                           "constant":"test_project"
                        }
                     },
                     "serving_container_image_uri":{
                        "runtimeValue":{
                           "constant":"gcr.io/test_project/test_image:test_tag"
                        }
                     }
                  }
               },
               "taskInfo":{
                  "name":"model-upload"
               }
            }
         }
      }
   },
   "schemaVersion":"2.1.0"
}
