{
   "components":{
      "comp-endpoint-create":{
         "executorLabel":"exec-endpoint-create",
         "inputDefinitions":{
            "parameters":{
               "display_name":{
                  "parameterType":"STRING"
               },
               "location":{
                  "parameterType":"STRING"
               },
               "project":{
                  "parameterType":"STRING"
               }
            }
         },
         "outputDefinitions":{
            "artifacts":{
               "endpoint":{
                  "artifactType":{
                     "schemaTitle":"google.VertexEndpoint",
                     "schemaVersion":"0.0.1"
                  }
               }
            },
            "parameters":{
               "gcp_resources":{
                  "parameterType":"STRING"
               }
            }
         }
      },
      "comp-model-deploy":{
         "executorLabel":"exec-model-deploy",
         "inputDefinitions":{
            "artifacts":{
               "endpoint":{
                  "artifactType":{
                     "schemaTitle":"google.VertexEndpoint",
                     "schemaVersion":"0.0.1"
                  }
               },
               "model":{
                  "artifactType":{
                     "schemaTitle":"google.VertexModel",
                     "schemaVersion":"0.0.1"
                  }
               }
            },
            "parameters":{
               "automatic_resources_max_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "automatic_resources_min_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "dedicated_resources_accelerator_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "dedicated_resources_accelerator_type":{
                  "parameterType":"STRING"
               },
               "dedicated_resources_machine_type":{
                  "parameterType":"STRING"
               },
               "dedicated_resources_max_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "dedicated_resources_min_replica_count":{
                  "parameterType":"NUMBER_INTEGER"
               },
               "deployed_model_display_name":{
                  "parameterType":"STRING"
               },
               "explanation_metadata":{
                  "parameterType":"STRUCT"
               },
               "explanation_parameters":{
                  "parameterType":"STRUCT"
               },
               "service_account":{
                  "parameterType":"STRING"
               },
               "traffic_split":{
                  "parameterType":"STRUCT"
               }
            }
         },
         "outputDefinitions":{
            "parameters":{
               "gcp_resources":{
                  "parameterType":"STRING"
               }
            }
         }
      },
      "comp-model-undeploy":{
         "executorLabel":"exec-model-undeploy",
         "inputDefinitions":{
            "artifacts":{
               "endpoint":{
                  "artifactType":{
                     "schemaTitle":"google.VertexEndpoint",
                     "schemaVersion":"0.0.1"
                  }
               },
               "model":{
                  "artifactType":{
                     "schemaTitle":"google.VertexModel",
                     "schemaVersion":"0.0.1"
                  }
               }
            }
         },
         "outputDefinitions":{
            "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-endpoint-create":{
            "container":{
               "args":[
                  "--type",
                  "CreateEndpoint",
                  "--payload",
                  "{\"display_name\": \"{{$.inputs.parameters['display_name']}}\", \"description\": \"\", \"labels\": , \"encryption_spec\": {\"kms_key_name\":\"\"}, \"network\": \"\"}",
                  "--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.endpoint.create_endpoint.launcher"
               ],
               "image":"gcr.io/ml-pipeline/google-cloud-pipeline-components:latest"
            }
         },
         "exec-model-deploy":{
            "container":{
               "args":[
                  "--type",
                  "DeployModel",
                  "--payload",
                  "{\"endpoint\": \"{{$.inputs.artifacts['endpoint'].metadata['resourceName']}}\", \"traffic_split\": {{$.inputs.parameters['traffic_split']}}, \"deployed_model\": {\"model\": \"{{$.inputs.artifacts['model'].metadata['resourceName']}}\", \"dedicated_resources\": {\"machine_spec\": {\"machine_type\": \"{{$.inputs.parameters['dedicated_resources_machine_type']}}\", \"accelerator_type\": \"{{$.inputs.parameters['dedicated_resources_accelerator_type']}}\", \"accelerator_count\": {{$.inputs.parameters['dedicated_resources_accelerator_count']}}}, \"min_replica_count\": {{$.inputs.parameters['dedicated_resources_min_replica_count']}}, \"max_replica_count\": {{$.inputs.parameters['dedicated_resources_max_replica_count']}}}, \"automatic_resources\": {\"min_replica_count\": {{$.inputs.parameters['automatic_resources_min_replica_count']}}, \"max_replica_count\": {{$.inputs.parameters['automatic_resources_max_replica_count']}}}, \"service_account\": \"{{$.inputs.parameters['service_account']}}\", \"disable_container_logging\": , \"enable_access_logging\": , \"explanation_spec\": {\"parameters\": {{$.inputs.parameters['explanation_parameters']}}, \"metadata\": {{$.inputs.parameters['explanation_metadata']}}}}}",
                  "--project",
                  "",
                  "--location",
                  "",
                  "--gcp_resources",
                  "{{$.outputs.parameters['gcp_resources'].output_file}}"
               ],
               "command":[
                  "python3",
                  "-u",
                  "-m",
                  "google_cloud_pipeline_components.container.v1.endpoint.deploy_model.launcher"
               ],
               "image":"gcr.io/ml-pipeline/google-cloud-pipeline-components:latest"
            }
         },
         "exec-model-undeploy":{
            "container":{
               "args":[
                  "--type",
                  "UndeployModel",
                  "--payload",
                  "{\"endpoint\": \"{{$.inputs.artifacts['endpoint'].metadata['resourceName']}}\", \"model\": \"{{$.inputs.artifacts['model'].metadata['resourceName']}}\", \"traffic_split\": }",
                  "--project",
                  "",
                  "--location",
                  "",
                  "--gcp_resources",
                  "{{$.outputs.parameters['gcp_resources'].output_file}}"
               ],
               "command":[
                  "python3",
                  "-u",
                  "-m",
                  "google_cloud_pipeline_components.container.v1.endpoint.undeploy_model.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":{
            "endpoint-create":{
               "cachingOptions":{
                  "enableCache":true
               },
               "componentRef":{
                  "name":"comp-endpoint-create"
               },
               "inputs":{
                  "parameters":{
                     "display_name":{
                        "runtimeValue":{
                           "constant":"test_display_name"
                        }
                     },
                     "location":{
                        "runtimeValue":{
                           "constant":"us-central1"
                        }
                     },
                     "project":{
                        "runtimeValue":{
                           "constant":"test_project"
                        }
                     }
                  }
               },
               "taskInfo":{
                  "name":"endpoint-create"
               }
            },
            "model-deploy":{
               "cachingOptions":{
                  "enableCache":true
               },
               "componentRef":{
                  "name":"comp-model-deploy"
               },
               "dependentTasks":[
                  "endpoint-create",
                  "model-upload"
               ],
               "inputs":{
                  "artifacts":{
                     "endpoint":{
                        "taskOutputArtifact":{
                           "outputArtifactKey":"endpoint",
                           "producerTask":"endpoint-create"
                        }
                     },
                     "model":{
                        "taskOutputArtifact":{
                           "outputArtifactKey":"model",
                           "producerTask":"model-upload"
                        }
                     }
                  },
                  "parameters":{
                     "automatic_resources_max_replica_count":{
                        "runtimeValue":{
                           "constant":2.0
                        }
                     },
                     "automatic_resources_min_replica_count":{
                        "runtimeValue":{
                           "constant":1.0
                        }
                     },
                     "dedicated_resources_accelerator_count":{
                        "runtimeValue":{
                           "constant":1.0
                        }
                     },
                     "dedicated_resources_accelerator_type":{
                        "runtimeValue":{
                           "constant":"fake-accelerator"
                        }
                     },
                     "dedicated_resources_machine_type":{
                        "runtimeValue":{
                           "constant":"n1-standard-4"
                        }
                     },
                     "dedicated_resources_max_replica_count":{
                        "runtimeValue":{
                           "constant":2.0
                        }
                     },
                     "dedicated_resources_min_replica_count":{
                        "runtimeValue":{
                           "constant":1.0
                        }
                     },
                     "deployed_model_display_name":{
                        "runtimeValue":{
                           "constant":"deployed_model_display_name"
                        }
                     },
                     "explanation_metadata":{
                        "runtimeValue":{
                           "constant":{
                              "xai_m":"bar"
                           }
                        }
                     },
                     "explanation_parameters":{
                        "runtimeValue":{
                           "constant":{
                              "xai_p":"foo"
                           }
                        }
                     },
                     "service_account":{
                        "runtimeValue":{
                           "constant":"fake-sa"
                        }
                     },
                     "traffic_split":{
                        "runtimeValue":{
                           "constant":{

                           }
                        }
                     }
                  }
               },
               "taskInfo":{
                  "name":"model-deploy"
               }
            },
            "model-undeploy":{
               "cachingOptions":{
                  "enableCache":true
               },
               "componentRef":{
                  "name":"comp-model-undeploy"
               },
               "dependentTasks":[
                  "endpoint-create",
                  "model-deploy",
                  "model-upload"
               ],
               "inputs":{
                  "artifacts":{
                     "endpoint":{
                        "taskOutputArtifact":{
                           "outputArtifactKey":"endpoint",
                           "producerTask":"endpoint-create"
                        }
                     },
                     "model":{
                        "taskOutputArtifact":{
                           "outputArtifactKey":"model",
                           "producerTask":"model-upload"
                        }
                     }
                  }
               },
               "taskInfo":{
                  "name":"model-undeploy"
               }
            },
            "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"
               }
            }
         }
      }
   }
}
