{
  "pipelineSpec": {
    "components": {
      "comp-importer": {
        "executorLabel": "exec-importer",
        "inputDefinitions": {
          "parameters": {
            "uri": {
              "type": "STRING"
            }
          }
        },
        "outputDefinitions": {
          "artifacts": {
            "artifact": {
              "artifactType": {
                "schemaTitle": "google.VertexModel",
                "schemaVersion": "0.0.1"
              }
            }
          }
        }
      },
      "comp-model-batch-predict": {
        "executorLabel": "exec-model-batch-predict",
        "inputDefinitions": {
          "artifacts": {
            "model": {
              "artifactType": {
                "schemaTitle": "google.VertexModel",
                "schemaVersion": "0.0.1"
              }
            }
          },
          "parameters": {
            "accelerator_count": {
              "type": "INT"
            },
            "accelerator_type": {
              "type": "STRING"
            },
            "bigquery_destination_output_uri": {
              "type": "STRING"
            },
            "encryption_spec_key_name": {
              "type": "STRING"
            },
            "explanation_metadata": {
              "type": "STRING"
            },
            "explanation_parameters": {
              "type": "STRING"
            },
            "gcs_destination_output_uri_prefix": {
              "type": "STRING"
            },
            "gcs_source_uris": {
              "type": "STRING"
            },
            "generate_explanation": {
              "type": "STRING"
            },
            "instances_format": {
              "type": "STRING"
            },
            "job_display_name": {
              "type": "STRING"
            },
            "labels": {
              "type": "STRING"
            },
            "location": {
              "type": "STRING"
            },
            "machine_type": {
              "type": "STRING"
            },
            "manual_batch_tuning_parameters_batch_size": {
              "type": "INT"
            },
            "max_replica_count": {
              "type": "INT"
            },
            "model_parameters": {
              "type": "STRING"
            },
            "predictions_format": {
              "type": "STRING"
            },
            "project": {
              "type": "STRING"
            },
            "starting_replica_count": {
              "type": "INT"
            }
          }
        },
        "outputDefinitions": {
          "artifacts": {
            "batchpredictionjob": {
              "artifactType": {
                "schemaTitle": "google.VertexBatchPredictionJob",
                "schemaVersion": "0.0.1"
              }
            }
          },
          "parameters": {
            "gcp_resources": {
              "type": "STRING"
            }
          }
        }
      },
      "comp-model-evaluation": {
        "executorLabel": "exec-model-evaluation",
        "inputDefinitions": {
          "artifacts": {
            "batch_prediction_job": {
              "artifactType": {
                "schemaTitle": "google.VertexBatchPredictionJob",
                "schemaVersion": "0.0.1"
              }
            }
          },
          "parameters": {
            "class_names": {
              "type": "STRING"
            },
            "classification_type": {
              "type": "STRING"
            },
            "dataflow_disk_size": {
              "type": "INT"
            },
            "dataflow_machine_type": {
              "type": "STRING"
            },
            "dataflow_max_workers_num": {
              "type": "INT"
            },
            "dataflow_service_account": {
              "type": "STRING"
            },
            "dataflow_subnetwork": {
              "type": "STRING"
            },
            "dataflow_use_public_ips": {
              "type": "STRING"
            },
            "dataflow_workers_num": {
              "type": "INT"
            },
            "encryption_spec_key_name": {
              "type": "STRING"
            },
            "example_weight_column": {
              "type": "STRING"
            },
            "generate_feature_attribution": {
              "type": "STRING"
            },
            "ground_truth_column": {
              "type": "STRING"
            },
            "ground_truth_format": {
              "type": "STRING"
            },
            "ground_truth_gcs_source": {
              "type": "STRING"
            },
            "key_columns": {
              "type": "STRING"
            },
            "location": {
              "type": "STRING"
            },
            "positive_classes": {
              "type": "STRING"
            },
            "prediction_id_column": {
              "type": "STRING"
            },
            "prediction_label_column": {
              "type": "STRING"
            },
            "prediction_score_column": {
              "type": "STRING"
            },
            "predictions_format": {
              "type": "STRING"
            },
            "problem_type": {
              "type": "STRING"
            },
            "project": {
              "type": "STRING"
            },
            "root_dir": {
              "type": "STRING"
            }
          }
        },
        "outputDefinitions": {
          "artifacts": {
            "evaluation_metrics": {
              "artifactType": {
                "schemaTitle": "system.Metrics",
                "schemaVersion": "0.0.1"
              }
            }
          },
          "parameters": {
            "gcp_resources": {
              "type": "STRING"
            }
          }
        }
      }
    },
    "deploymentSpec": {
      "executors": {
        "exec-importer": {
          "importer": {
            "artifactUri": {
              "runtimeParameter": "uri"
            },
            "metadata": {
              "resourceName": "projects/123/locations/us-central1/models/12345"
            },
            "typeSchema": {
              "schemaTitle": "google.VertexModel",
              "schemaVersion": "0.0.1"
            }
          }
        },
        "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\": \"\"}}, \"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.gcp_launcher.launcher"
            ],
            "image": "gcr.io/ml-pipeline/google-cloud-pipeline-components:1.10.13"
          }
        },
        "exec-model-evaluation": {
          "container": {
            "args": [
              "--setup_file",
              "/setup.py",
              "--json_mode",
              "true",
              "--project_id",
              "{{$.inputs.parameters['project']}}",
              "--location",
              "{{$.inputs.parameters['location']}}",
              "--problem_type",
              "{{$.inputs.parameters['problem_type']}}",
              "--batch_prediction_format",
              "{{$.inputs.parameters['predictions_format']}}",
              "--batch_prediction_gcs_source",
              "{{$.inputs.artifacts['batch_prediction_job'].metadata['gcsOutputDirectory']}}",
              "--ground_truth_format",
              "{{$.inputs.parameters['ground_truth_format']}}",
              "--ground_truth_gcs_source",
              "{{$.inputs.parameters['ground_truth_gcs_source']}}",
              "--key_prefix_in_prediction_dataset",
              "instance",
              "--key_columns",
              "{{$.inputs.parameters['key_columns']}}",
              "--root_dir",
              "{{$.inputs.parameters['root_dir']}}/{{$.pipeline_job_uuid}}-{{$.pipeline_task_uuid}}",
              "--classification_type",
              "{{$.inputs.parameters['classification_type']}}",
              "--class_names",
              "{{$.inputs.parameters['class_names']}}",
              "--ground_truth_column",
              "instance.{{$.inputs.parameters['ground_truth_column']}}",
              "--prediction_score_column",
              "{{$.inputs.parameters['prediction_score_column']}}",
              "--prediction_label_column",
              "{{$.inputs.parameters['prediction_label_column']}}",
              "--prediction_id_column",
              "{{$.inputs.parameters['prediction_id_column']}}",
              "--example_weight_column",
              "{{$.inputs.parameters['example_weight_column']}}",
              "--positive_classes",
              "{{$.inputs.parameters['positive_classes']}}",
              "--generate_feature_attribution",
              "{{$.inputs.parameters['generate_feature_attribution']}}",
              "--dataflow_job_prefix",
              "evaluation-{{$.pipeline_job_uuid}}-{{$.pipeline_task_uuid}}",
              "--dataflow_service_account",
              "{{$.inputs.parameters['dataflow_service_account']}}",
              "--dataflow_disk_size",
              "{{$.inputs.parameters['dataflow_disk_size']}}",
              "--dataflow_machine_type",
              "{{$.inputs.parameters['dataflow_machine_type']}}",
              "--dataflow_workers_num",
              "{{$.inputs.parameters['dataflow_workers_num']}}",
              "--dataflow_max_workers_num",
              "{{$.inputs.parameters['dataflow_max_workers_num']}}",
              "--dataflow_subnetwork",
              "{{$.inputs.parameters['dataflow_subnetwork']}}",
              "--dataflow_use_public_ips",
              "{{$.inputs.parameters['dataflow_use_public_ips']}}",
              "--kms_key_name",
              "{{$.inputs.parameters['encryption_spec_key_name']}}",
              "--output_metrics_gcs_path",
              "{{$.outputs.artifacts['evaluation_metrics'].uri}}",
              "--gcp_resources",
              "{{$.outputs.parameters['gcp_resources'].output_file}}",
              "--executor_input",
              "{{$}}"
            ],
            "command": [
              "python",
              "/main.py"
            ],
            "image": "gcr.io/ml-pipeline/model-evaluation:v0.2"
          }
        }
      }
    },
    "pipelineInfo": {
      "name": "model-registry-evaluation-pipeline"
    },
    "root": {
      "dag": {
        "outputs": {
          "artifacts": {
            "model-evaluation-evaluation_metrics": {
              "artifactSelectors": [
                {
                  "outputArtifactKey": "evaluation_metrics",
                  "producerSubtask": "model-evaluation"
                }
              ]
            }
          }
        },
        "tasks": {
          "importer": {
            "cachingOptions": {
              "enableCache": true
            },
            "componentRef": {
              "name": "comp-importer"
            },
            "inputs": {
              "parameters": {
                "uri": {
                  "componentInputParameter": "model_name"
                }
              }
            },
            "taskInfo": {
              "name": "importer"
            }
          },
          "model-batch-predict": {
            "cachingOptions": {
              "enableCache": true
            },
            "componentRef": {
              "name": "comp-model-batch-predict"
            },
            "dependentTasks": [
              "importer"
            ],
            "inputs": {
              "artifacts": {
                "model": {
                  "taskOutputArtifact": {
                    "outputArtifactKey": "artifact",
                    "producerTask": "importer"
                  }
                }
              },
              "parameters": {
                "accelerator_count": {
                  "runtimeValue": {
                    "constantValue": {
                      "intValue": "0"
                    }
                  }
                },
                "accelerator_type": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "bigquery_destination_output_uri": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "encryption_spec_key_name": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "explanation_metadata": {
                  "componentInputParameter": "batch_predict_explanation_metadata"
                },
                "explanation_parameters": {
                  "componentInputParameter": "batch_predict_explanation_parameters"
                },
                "gcs_destination_output_uri_prefix": {
                  "componentInputParameter": "root_dir"
                },
                "gcs_source_uris": {
                  "componentInputParameter": "batch_predict_gcs_source_uris"
                },
                "generate_explanation": {
                  "componentInputParameter": "generate_explanation"
                },
                "instances_format": {
                  "componentInputParameter": "batch_predict_instances_format"
                },
                "job_display_name": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "model-registry-batch-explain-evaluation-{{$.pipeline_job_uuid}}-{{$.pipeline_task_uuid}}"
                    }
                  }
                },
                "labels": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "location": {
                  "componentInputParameter": "location"
                },
                "machine_type": {
                  "componentInputParameter": "batch_predict_machine_type"
                },
                "manual_batch_tuning_parameters_batch_size": {
                  "runtimeValue": {
                    "constantValue": {
                      "intValue": "0"
                    }
                  }
                },
                "max_replica_count": {
                  "componentInputParameter": "batch_predict_max_replica_count"
                },
                "model_parameters": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "predictions_format": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "jsonl"
                    }
                  }
                },
                "project": {
                  "componentInputParameter": "project"
                },
                "starting_replica_count": {
                  "componentInputParameter": "batch_predict_starting_replica_count"
                }
              }
            },
            "taskInfo": {
              "name": "model-batch-predict"
            }
          },
          "model-evaluation": {
            "cachingOptions": {
              "enableCache": true
            },
            "componentRef": {
              "name": "comp-model-evaluation"
            },
            "dependentTasks": [
              "model-batch-predict"
            ],
            "inputs": {
              "artifacts": {
                "batch_prediction_job": {
                  "taskOutputArtifact": {
                    "outputArtifactKey": "batchpredictionjob",
                    "producerTask": "model-batch-predict"
                  }
                }
              },
              "parameters": {
                "class_names": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "classification_type": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "dataflow_disk_size": {
                  "componentInputParameter": "dataflow_disk_size_gb"
                },
                "dataflow_machine_type": {
                  "componentInputParameter": "dataflow_machine_type"
                },
                "dataflow_max_workers_num": {
                  "componentInputParameter": "dataflow_max_num_workers"
                },
                "dataflow_service_account": {
                  "componentInputParameter": "dataflow_service_account"
                },
                "dataflow_subnetwork": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "dataflow_use_public_ips": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "true"
                    }
                  }
                },
                "dataflow_workers_num": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "10"
                    }
                  }
                },
                "encryption_spec_key_name": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "example_weight_column": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "generate_feature_attribution": {
                  "componentInputParameter": "generate_explanation"
                },
                "ground_truth_column": {
                  "componentInputParameter": "target_column_name"
                },
                "ground_truth_format": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "jsonl"
                    }
                  }
                },
                "ground_truth_gcs_source": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "key_columns": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "location": {
                  "componentInputParameter": "location"
                },
                "positive_classes": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "{}"
                    }
                  }
                },
                "prediction_id_column": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "prediction_label_column": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "prediction_score_column": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": ""
                    }
                  }
                },
                "predictions_format": {
                  "runtimeValue": {
                    "constantValue": {
                      "stringValue": "jsonl"
                    }
                  }
                },
                "problem_type": {
                  "componentInputParameter": "prediction_type"
                },
                "project": {
                  "componentInputParameter": "project"
                },
                "root_dir": {
                  "componentInputParameter": "root_dir"
                }
              }
            },
            "taskInfo": {
              "name": "model-evaluation"
            }
          }
        }
      },
      "inputDefinitions": {
        "parameters": {
          "batch_predict_explanation_metadata": {
            "type": "STRING"
          },
          "batch_predict_explanation_parameters": {
            "type": "STRING"
          },
          "batch_predict_gcs_source_uris": {
            "type": "STRING"
          },
          "batch_predict_instances_format": {
            "type": "STRING"
          },
          "batch_predict_machine_type": {
            "type": "STRING"
          },
          "batch_predict_max_replica_count": {
            "type": "INT"
          },
          "batch_predict_starting_replica_count": {
            "type": "INT"
          },
          "dataflow_disk_size_gb": {
            "type": "INT"
          },
          "dataflow_machine_type": {
            "type": "STRING"
          },
          "dataflow_max_num_workers": {
            "type": "INT"
          },
          "dataflow_service_account": {
            "type": "STRING"
          },
          "encryption_spec_key_name": {
            "type": "STRING"
          },
          "generate_explanation": {
            "type": "STRING"
          },
          "location": {
            "type": "STRING"
          },
          "model_name": {
            "type": "STRING"
          },
          "prediction_type": {
            "type": "STRING"
          },
          "project": {
            "type": "STRING"
          },
          "root_dir": {
            "type": "STRING"
          },
          "target_column_name": {
            "type": "STRING"
          }
        }
      },
      "outputDefinitions": {
        "artifacts": {
          "model-evaluation-evaluation_metrics": {
            "artifactType": {
              "schemaTitle": "system.Metrics",
              "schemaVersion": "0.0.1"
            }
          }
        }
      }
    },
    "schemaVersion": "2.0.0",
    "sdkVersion": "kfp-1.8.12"
  },
  "runtimeConfig": {
    "parameters": {
      "batch_predict_explanation_metadata": {
        "stringValue": "{}"
      },
      "batch_predict_explanation_parameters": {
        "stringValue": "{}"
      },
      "batch_predict_machine_type": {
        "stringValue": "n1-standard-16"
      },
      "batch_predict_max_replica_count": {
        "intValue": "10"
      },
      "batch_predict_starting_replica_count": {
        "intValue": "5"
      },
      "dataflow_disk_size_gb": {
        "intValue": "50"
      },
      "dataflow_machine_type": {
        "stringValue": "n1-standard-4"
      },
      "dataflow_max_num_workers": {
        "intValue": "25"
      },
      "dataflow_service_account": {
        "stringValue": ""
      },
      "encryption_spec_key_name": {
        "stringValue": ""
      },
      "generate_explanation": {
        "stringValue": "False"
      }
    }
  }
}