model.proto 32 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622
  1. // Copyright 2022 Google LLC
  2. //
  3. // Licensed under the Apache License, Version 2.0 (the "License");
  4. // you may not use this file except in compliance with the License.
  5. // You may obtain a copy of the License at
  6. //
  7. // http://www.apache.org/licenses/LICENSE-2.0
  8. //
  9. // Unless required by applicable law or agreed to in writing, software
  10. // distributed under the License is distributed on an "AS IS" BASIS,
  11. // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  12. // See the License for the specific language governing permissions and
  13. // limitations under the License.
  14. syntax = "proto3";
  15. package google.cloud.aiplatform.v1;
  16. import "google/api/field_behavior.proto";
  17. import "google/api/resource.proto";
  18. import "google/cloud/aiplatform/v1/deployed_model_ref.proto";
  19. import "google/cloud/aiplatform/v1/encryption_spec.proto";
  20. import "google/cloud/aiplatform/v1/env_var.proto";
  21. import "google/cloud/aiplatform/v1/explanation.proto";
  22. import "google/protobuf/struct.proto";
  23. import "google/protobuf/timestamp.proto";
  24. option csharp_namespace = "Google.Cloud.AIPlatform.V1";
  25. option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1;aiplatform";
  26. option java_multiple_files = true;
  27. option java_outer_classname = "ModelProto";
  28. option java_package = "com.google.cloud.aiplatform.v1";
  29. option php_namespace = "Google\\Cloud\\AIPlatform\\V1";
  30. option ruby_package = "Google::Cloud::AIPlatform::V1";
  31. // A trained machine learning Model.
  32. message Model {
  33. option (google.api.resource) = {
  34. type: "aiplatform.googleapis.com/Model"
  35. pattern: "projects/{project}/locations/{location}/models/{model}"
  36. };
  37. // Represents export format supported by the Model.
  38. // All formats export to Google Cloud Storage.
  39. message ExportFormat {
  40. // The Model content that can be exported.
  41. enum ExportableContent {
  42. // Should not be used.
  43. EXPORTABLE_CONTENT_UNSPECIFIED = 0;
  44. // Model artifact and any of its supported files. Will be exported to the
  45. // location specified by the `artifactDestination` field of the
  46. // [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object.
  47. ARTIFACT = 1;
  48. // The container image that is to be used when deploying this Model. Will
  49. // be exported to the location specified by the `imageDestination` field
  50. // of the [ExportModelRequest.output_config][google.cloud.aiplatform.v1.ExportModelRequest.output_config] object.
  51. IMAGE = 2;
  52. }
  53. // Output only. The ID of the export format.
  54. // The possible format IDs are:
  55. //
  56. // * `tflite`
  57. // Used for Android mobile devices.
  58. //
  59. // * `edgetpu-tflite`
  60. // Used for [Edge TPU](https://cloud.google.com/edge-tpu/) devices.
  61. //
  62. // * `tf-saved-model`
  63. // A tensorflow model in SavedModel format.
  64. //
  65. // * `tf-js`
  66. // A [TensorFlow.js](https://www.tensorflow.org/js) model that can be used
  67. // in the browser and in Node.js using JavaScript.
  68. //
  69. // * `core-ml`
  70. // Used for iOS mobile devices.
  71. //
  72. // * `custom-trained`
  73. // A Model that was uploaded or trained by custom code.
  74. string id = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
  75. // Output only. The content of this Model that may be exported.
  76. repeated ExportableContent exportable_contents = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
  77. }
  78. // Identifies a type of Model's prediction resources.
  79. enum DeploymentResourcesType {
  80. // Should not be used.
  81. DEPLOYMENT_RESOURCES_TYPE_UNSPECIFIED = 0;
  82. // Resources that are dedicated to the [DeployedModel][google.cloud.aiplatform.v1.DeployedModel], and that need a
  83. // higher degree of manual configuration.
  84. DEDICATED_RESOURCES = 1;
  85. // Resources that to large degree are decided by Vertex AI, and require
  86. // only a modest additional configuration.
  87. AUTOMATIC_RESOURCES = 2;
  88. // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1.DeployedModel].
  89. // A pre-configured [DeploymentResourcePool][] is required.
  90. SHARED_RESOURCES = 3;
  91. }
  92. // The resource name of the Model.
  93. string name = 1;
  94. // Output only. Immutable. The version ID of the model.
  95. // A new version is committed when a new model version is uploaded or
  96. // trained under an existing model id. It is an auto-incrementing decimal
  97. // number in string representation.
  98. string version_id = 28 [
  99. (google.api.field_behavior) = IMMUTABLE,
  100. (google.api.field_behavior) = OUTPUT_ONLY
  101. ];
  102. // User provided version aliases so that a model version can be referenced via
  103. // alias (i.e.
  104. // `projects/{project}/locations/{location}/models/{model_id}@{version_alias}`
  105. // instead of auto-generated version id (i.e.
  106. // `projects/{project}/locations/{location}/models/{model_id}@{version_id})`.
  107. // The format is [a-z][a-zA-Z0-9-]{0,126}[a-z0-9] to distinguish from
  108. // version_id. A default version alias will be created for the first version
  109. // of the model, and there must be exactly one default version alias for a
  110. // model.
  111. repeated string version_aliases = 29;
  112. // Output only. Timestamp when this version was created.
  113. google.protobuf.Timestamp version_create_time = 31 [(google.api.field_behavior) = OUTPUT_ONLY];
  114. // Output only. Timestamp when this version was most recently updated.
  115. google.protobuf.Timestamp version_update_time = 32 [(google.api.field_behavior) = OUTPUT_ONLY];
  116. // Required. The display name of the Model.
  117. // The name can be up to 128 characters long and can be consist of any UTF-8
  118. // characters.
  119. string display_name = 2 [(google.api.field_behavior) = REQUIRED];
  120. // The description of the Model.
  121. string description = 3;
  122. // The description of this version.
  123. string version_description = 30;
  124. // The schemata that describe formats of the Model's predictions and
  125. // explanations as given and returned via
  126. // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] and [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain].
  127. PredictSchemata predict_schemata = 4;
  128. // Immutable. Points to a YAML file stored on Google Cloud Storage describing additional
  129. // information about the Model, that is specific to it. Unset if the Model
  130. // does not have any additional information.
  131. // The schema is defined as an OpenAPI 3.0.2 [Schema
  132. // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
  133. // AutoML Models always have this field populated by Vertex AI, if no
  134. // additional metadata is needed, this field is set to an empty string.
  135. // Note: The URI given on output will be immutable and probably different,
  136. // including the URI scheme, than the one given on input. The output URI will
  137. // point to a location where the user only has a read access.
  138. string metadata_schema_uri = 5 [(google.api.field_behavior) = IMMUTABLE];
  139. // Immutable. An additional information about the Model; the schema of the metadata can
  140. // be found in [metadata_schema][google.cloud.aiplatform.v1.Model.metadata_schema_uri].
  141. // Unset if the Model does not have any additional information.
  142. google.protobuf.Value metadata = 6 [(google.api.field_behavior) = IMMUTABLE];
  143. // Output only. The formats in which this Model may be exported. If empty, this Model is
  144. // not available for export.
  145. repeated ExportFormat supported_export_formats = 20 [(google.api.field_behavior) = OUTPUT_ONLY];
  146. // Output only. The resource name of the TrainingPipeline that uploaded this Model, if
  147. // any.
  148. string training_pipeline = 7 [
  149. (google.api.field_behavior) = OUTPUT_ONLY,
  150. (google.api.resource_reference) = {
  151. type: "aiplatform.googleapis.com/TrainingPipeline"
  152. }
  153. ];
  154. // Input only. The specification of the container that is to be used when deploying
  155. // this Model. The specification is ingested upon
  156. // [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], and all binaries it contains are copied
  157. // and stored internally by Vertex AI.
  158. // Not present for AutoML Models.
  159. ModelContainerSpec container_spec = 9 [(google.api.field_behavior) = INPUT_ONLY];
  160. // Immutable. The path to the directory containing the Model artifact and any of its
  161. // supporting files.
  162. // Not present for AutoML Models.
  163. string artifact_uri = 26 [(google.api.field_behavior) = IMMUTABLE];
  164. // Output only. When this Model is deployed, its prediction resources are described by the
  165. // `prediction_resources` field of the [Endpoint.deployed_models][google.cloud.aiplatform.v1.Endpoint.deployed_models] object.
  166. // Because not all Models support all resource configuration types, the
  167. // configuration types this Model supports are listed here. If no
  168. // configuration types are listed, the Model cannot be deployed to an
  169. // [Endpoint][google.cloud.aiplatform.v1.Endpoint] and does not support
  170. // online predictions ([PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or
  171. // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain]). Such a Model can serve predictions by
  172. // using a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob], if it has at least one entry each in
  173. // [supported_input_storage_formats][google.cloud.aiplatform.v1.Model.supported_input_storage_formats] and
  174. // [supported_output_storage_formats][google.cloud.aiplatform.v1.Model.supported_output_storage_formats].
  175. repeated DeploymentResourcesType supported_deployment_resources_types = 10 [(google.api.field_behavior) = OUTPUT_ONLY];
  176. // Output only. The formats this Model supports in
  177. // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config]. If
  178. // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] exists, the instances
  179. // should be given as per that schema.
  180. //
  181. // The possible formats are:
  182. //
  183. // * `jsonl`
  184. // The JSON Lines format, where each instance is a single line. Uses
  185. // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source].
  186. //
  187. // * `csv`
  188. // The CSV format, where each instance is a single comma-separated line.
  189. // The first line in the file is the header, containing comma-separated field
  190. // names. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source].
  191. //
  192. // * `tf-record`
  193. // The TFRecord format, where each instance is a single record in tfrecord
  194. // syntax. Uses [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source].
  195. //
  196. // * `tf-record-gzip`
  197. // Similar to `tf-record`, but the file is gzipped. Uses
  198. // [GcsSource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.gcs_source].
  199. //
  200. // * `bigquery`
  201. // Each instance is a single row in BigQuery. Uses
  202. // [BigQuerySource][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig.bigquery_source].
  203. //
  204. // * `file-list`
  205. // Each line of the file is the location of an instance to process, uses
  206. // `gcs_source` field of the
  207. // [InputConfig][google.cloud.aiplatform.v1.BatchPredictionJob.InputConfig] object.
  208. //
  209. //
  210. // If this Model doesn't support any of these formats it means it cannot be
  211. // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has
  212. // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online
  213. // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or
  214. // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain].
  215. repeated string supported_input_storage_formats = 11 [(google.api.field_behavior) = OUTPUT_ONLY];
  216. // Output only. The formats this Model supports in
  217. // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config]. If both
  218. // [PredictSchemata.instance_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.instance_schema_uri] and
  219. // [PredictSchemata.prediction_schema_uri][google.cloud.aiplatform.v1.PredictSchemata.prediction_schema_uri] exist, the predictions
  220. // are returned together with their instances. In other words, the
  221. // prediction has the original instance data first, followed
  222. // by the actual prediction content (as per the schema).
  223. //
  224. // The possible formats are:
  225. //
  226. // * `jsonl`
  227. // The JSON Lines format, where each prediction is a single line. Uses
  228. // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination].
  229. //
  230. // * `csv`
  231. // The CSV format, where each prediction is a single comma-separated line.
  232. // The first line in the file is the header, containing comma-separated field
  233. // names. Uses
  234. // [GcsDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.gcs_destination].
  235. //
  236. // * `bigquery`
  237. // Each prediction is a single row in a BigQuery table, uses
  238. // [BigQueryDestination][google.cloud.aiplatform.v1.BatchPredictionJob.OutputConfig.bigquery_destination]
  239. // .
  240. //
  241. //
  242. // If this Model doesn't support any of these formats it means it cannot be
  243. // used with a [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob]. However, if it has
  244. // [supported_deployment_resources_types][google.cloud.aiplatform.v1.Model.supported_deployment_resources_types], it could serve online
  245. // predictions by using [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict] or
  246. // [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain].
  247. repeated string supported_output_storage_formats = 12 [(google.api.field_behavior) = OUTPUT_ONLY];
  248. // Output only. Timestamp when this Model was uploaded into Vertex AI.
  249. google.protobuf.Timestamp create_time = 13 [(google.api.field_behavior) = OUTPUT_ONLY];
  250. // Output only. Timestamp when this Model was most recently updated.
  251. google.protobuf.Timestamp update_time = 14 [(google.api.field_behavior) = OUTPUT_ONLY];
  252. // Output only. The pointers to DeployedModels created from this Model. Note that
  253. // Model could have been deployed to Endpoints in different Locations.
  254. repeated DeployedModelRef deployed_models = 15 [(google.api.field_behavior) = OUTPUT_ONLY];
  255. // The default explanation specification for this Model.
  256. //
  257. // The Model can be used for [requesting
  258. // explanation][PredictionService.Explain] after being
  259. // [deployed][google.cloud.aiplatform.v1.EndpointService.DeployModel] if it is populated.
  260. // The Model can be used for [batch
  261. // explanation][BatchPredictionJob.generate_explanation] if it is populated.
  262. //
  263. // All fields of the explanation_spec can be overridden by
  264. // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of
  265. // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model], or
  266. // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of
  267. // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob].
  268. //
  269. // If the default explanation specification is not set for this Model, this
  270. // Model can still be used for [requesting
  271. // explanation][PredictionService.Explain] by setting
  272. // [explanation_spec][google.cloud.aiplatform.v1.DeployedModel.explanation_spec] of
  273. // [DeployModelRequest.deployed_model][google.cloud.aiplatform.v1.DeployModelRequest.deployed_model] and for [batch
  274. // explanation][BatchPredictionJob.generate_explanation] by setting
  275. // [explanation_spec][google.cloud.aiplatform.v1.BatchPredictionJob.explanation_spec] of
  276. // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob].
  277. ExplanationSpec explanation_spec = 23;
  278. // Used to perform consistent read-modify-write updates. If not set, a blind
  279. // "overwrite" update happens.
  280. string etag = 16;
  281. // The labels with user-defined metadata to organize your Models.
  282. //
  283. // Label keys and values can be no longer than 64 characters
  284. // (Unicode codepoints), can only contain lowercase letters, numeric
  285. // characters, underscores and dashes. International characters are allowed.
  286. //
  287. // See https://goo.gl/xmQnxf for more information and examples of labels.
  288. map<string, string> labels = 17;
  289. // Customer-managed encryption key spec for a Model. If set, this
  290. // Model and all sub-resources of this Model will be secured by this key.
  291. EncryptionSpec encryption_spec = 24;
  292. // Output only. Source of a model. It can either be automl training pipeline, custom
  293. // training pipeline, BigQuery ML, or existing Vertex AI Model.
  294. ModelSourceInfo model_source_info = 38 [(google.api.field_behavior) = OUTPUT_ONLY];
  295. // Output only. The resource name of the Artifact that was created in MetadataStore when
  296. // creating the Model. The Artifact resource name pattern is
  297. // `projects/{project}/locations/{location}/metadataStores/{metadata_store}/artifacts/{artifact}`.
  298. string metadata_artifact = 44 [(google.api.field_behavior) = OUTPUT_ONLY];
  299. }
  300. // Contains the schemata used in Model's predictions and explanations via
  301. // [PredictionService.Predict][google.cloud.aiplatform.v1.PredictionService.Predict], [PredictionService.Explain][google.cloud.aiplatform.v1.PredictionService.Explain] and
  302. // [BatchPredictionJob][google.cloud.aiplatform.v1.BatchPredictionJob].
  303. message PredictSchemata {
  304. // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format
  305. // of a single instance, which are used in [PredictRequest.instances][google.cloud.aiplatform.v1.PredictRequest.instances],
  306. // [ExplainRequest.instances][google.cloud.aiplatform.v1.ExplainRequest.instances] and
  307. // [BatchPredictionJob.input_config][google.cloud.aiplatform.v1.BatchPredictionJob.input_config].
  308. // The schema is defined as an OpenAPI 3.0.2 [Schema
  309. // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
  310. // AutoML Models always have this field populated by Vertex AI.
  311. // Note: The URI given on output will be immutable and probably different,
  312. // including the URI scheme, than the one given on input. The output URI will
  313. // point to a location where the user only has a read access.
  314. string instance_schema_uri = 1 [(google.api.field_behavior) = IMMUTABLE];
  315. // Immutable. Points to a YAML file stored on Google Cloud Storage describing the
  316. // parameters of prediction and explanation via
  317. // [PredictRequest.parameters][google.cloud.aiplatform.v1.PredictRequest.parameters], [ExplainRequest.parameters][google.cloud.aiplatform.v1.ExplainRequest.parameters] and
  318. // [BatchPredictionJob.model_parameters][google.cloud.aiplatform.v1.BatchPredictionJob.model_parameters].
  319. // The schema is defined as an OpenAPI 3.0.2 [Schema
  320. // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
  321. // AutoML Models always have this field populated by Vertex AI, if no
  322. // parameters are supported, then it is set to an empty string.
  323. // Note: The URI given on output will be immutable and probably different,
  324. // including the URI scheme, than the one given on input. The output URI will
  325. // point to a location where the user only has a read access.
  326. string parameters_schema_uri = 2 [(google.api.field_behavior) = IMMUTABLE];
  327. // Immutable. Points to a YAML file stored on Google Cloud Storage describing the format
  328. // of a single prediction produced by this Model, which are returned via
  329. // [PredictResponse.predictions][google.cloud.aiplatform.v1.PredictResponse.predictions], [ExplainResponse.explanations][google.cloud.aiplatform.v1.ExplainResponse.explanations], and
  330. // [BatchPredictionJob.output_config][google.cloud.aiplatform.v1.BatchPredictionJob.output_config].
  331. // The schema is defined as an OpenAPI 3.0.2 [Schema
  332. // Object](https://github.com/OAI/OpenAPI-Specification/blob/main/versions/3.0.2.md#schemaObject).
  333. // AutoML Models always have this field populated by Vertex AI.
  334. // Note: The URI given on output will be immutable and probably different,
  335. // including the URI scheme, than the one given on input. The output URI will
  336. // point to a location where the user only has a read access.
  337. string prediction_schema_uri = 3 [(google.api.field_behavior) = IMMUTABLE];
  338. }
  339. // Specification of a container for serving predictions. Some fields in this
  340. // message correspond to fields in the [Kubernetes Container v1 core
  341. // specification](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
  342. message ModelContainerSpec {
  343. // Required. Immutable. URI of the Docker image to be used as the custom container for serving
  344. // predictions. This URI must identify an image in Artifact Registry or
  345. // Container Registry. Learn more about the [container publishing
  346. // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#publishing),
  347. // including permissions requirements for the Vertex AI Service Agent.
  348. //
  349. // The container image is ingested upon [ModelService.UploadModel][google.cloud.aiplatform.v1.ModelService.UploadModel], stored
  350. // internally, and this original path is afterwards not used.
  351. //
  352. // To learn about the requirements for the Docker image itself, see
  353. // [Custom container
  354. // requirements](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#).
  355. //
  356. // You can use the URI to one of Vertex AI's [pre-built container images for
  357. // prediction](https://cloud.google.com/vertex-ai/docs/predictions/pre-built-containers)
  358. // in this field.
  359. string image_uri = 1 [
  360. (google.api.field_behavior) = REQUIRED,
  361. (google.api.field_behavior) = IMMUTABLE
  362. ];
  363. // Immutable. Specifies the command that runs when the container starts. This overrides
  364. // the container's
  365. // [ENTRYPOINT](https://docs.docker.com/engine/reference/builder/#entrypoint).
  366. // Specify this field as an array of executable and arguments, similar to a
  367. // Docker `ENTRYPOINT`'s "exec" form, not its "shell" form.
  368. //
  369. // If you do not specify this field, then the container's `ENTRYPOINT` runs,
  370. // in conjunction with the [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] field or the
  371. // container's [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd),
  372. // if either exists. If this field is not specified and the container does not
  373. // have an `ENTRYPOINT`, then refer to the Docker documentation about [how
  374. // `CMD` and `ENTRYPOINT`
  375. // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
  376. //
  377. // If you specify this field, then you can also specify the `args` field to
  378. // provide additional arguments for this command. However, if you specify this
  379. // field, then the container's `CMD` is ignored. See the
  380. // [Kubernetes documentation about how the
  381. // `command` and `args` fields interact with a container's `ENTRYPOINT` and
  382. // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
  383. //
  384. // In this field, you can reference [environment variables set by Vertex
  385. // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables)
  386. // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field.
  387. // You cannot reference environment variables set in the Docker image. In
  388. // order for environment variables to be expanded, reference them by using the
  389. // following syntax:
  390. // <code>$(<var>VARIABLE_NAME</var>)</code>
  391. // Note that this differs from Bash variable expansion, which does not use
  392. // parentheses. If a variable cannot be resolved, the reference in the input
  393. // string is used unchanged. To avoid variable expansion, you can escape this
  394. // syntax with `$$`; for example:
  395. // <code>$$(<var>VARIABLE_NAME</var>)</code>
  396. // This field corresponds to the `command` field of the Kubernetes Containers
  397. // [v1 core
  398. // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
  399. repeated string command = 2 [(google.api.field_behavior) = IMMUTABLE];
  400. // Immutable. Specifies arguments for the command that runs when the container starts.
  401. // This overrides the container's
  402. // [`CMD`](https://docs.docker.com/engine/reference/builder/#cmd). Specify
  403. // this field as an array of executable and arguments, similar to a Docker
  404. // `CMD`'s "default parameters" form.
  405. //
  406. // If you don't specify this field but do specify the
  407. // [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] field, then the command from the
  408. // `command` field runs without any additional arguments. See the
  409. // [Kubernetes documentation about how the
  410. // `command` and `args` fields interact with a container's `ENTRYPOINT` and
  411. // `CMD`](https://kubernetes.io/docs/tasks/inject-data-application/define-command-argument-container/#notes).
  412. //
  413. // If you don't specify this field and don't specify the `command` field,
  414. // then the container's
  415. // [`ENTRYPOINT`](https://docs.docker.com/engine/reference/builder/#cmd) and
  416. // `CMD` determine what runs based on their default behavior. See the Docker
  417. // documentation about [how `CMD` and `ENTRYPOINT`
  418. // interact](https://docs.docker.com/engine/reference/builder/#understand-how-cmd-and-entrypoint-interact).
  419. //
  420. // In this field, you can reference [environment variables
  421. // set by Vertex
  422. // AI](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables)
  423. // and environment variables set in the [env][google.cloud.aiplatform.v1.ModelContainerSpec.env] field.
  424. // You cannot reference environment variables set in the Docker image. In
  425. // order for environment variables to be expanded, reference them by using the
  426. // following syntax:
  427. // <code>$(<var>VARIABLE_NAME</var>)</code>
  428. // Note that this differs from Bash variable expansion, which does not use
  429. // parentheses. If a variable cannot be resolved, the reference in the input
  430. // string is used unchanged. To avoid variable expansion, you can escape this
  431. // syntax with `$$`; for example:
  432. // <code>$$(<var>VARIABLE_NAME</var>)</code>
  433. // This field corresponds to the `args` field of the Kubernetes Containers
  434. // [v1 core
  435. // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
  436. repeated string args = 3 [(google.api.field_behavior) = IMMUTABLE];
  437. // Immutable. List of environment variables to set in the container. After the container
  438. // starts running, code running in the container can read these environment
  439. // variables.
  440. //
  441. // Additionally, the [command][google.cloud.aiplatform.v1.ModelContainerSpec.command] and
  442. // [args][google.cloud.aiplatform.v1.ModelContainerSpec.args] fields can reference these variables. Later
  443. // entries in this list can also reference earlier entries. For example, the
  444. // following example sets the variable `VAR_2` to have the value `foo bar`:
  445. //
  446. // ```json
  447. // [
  448. // {
  449. // "name": "VAR_1",
  450. // "value": "foo"
  451. // },
  452. // {
  453. // "name": "VAR_2",
  454. // "value": "$(VAR_1) bar"
  455. // }
  456. // ]
  457. // ```
  458. //
  459. // If you switch the order of the variables in the example, then the expansion
  460. // does not occur.
  461. //
  462. // This field corresponds to the `env` field of the Kubernetes Containers
  463. // [v1 core
  464. // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
  465. repeated EnvVar env = 4 [(google.api.field_behavior) = IMMUTABLE];
  466. // Immutable. List of ports to expose from the container. Vertex AI sends any
  467. // prediction requests that it receives to the first port on this list. Vertex
  468. // AI also sends
  469. // [liveness and health
  470. // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#liveness)
  471. // to this port.
  472. //
  473. // If you do not specify this field, it defaults to following value:
  474. //
  475. // ```json
  476. // [
  477. // {
  478. // "containerPort": 8080
  479. // }
  480. // ]
  481. // ```
  482. //
  483. // Vertex AI does not use ports other than the first one listed. This field
  484. // corresponds to the `ports` field of the Kubernetes Containers
  485. // [v1 core
  486. // API](https://kubernetes.io/docs/reference/generated/kubernetes-api/v1.23/#container-v1-core).
  487. repeated Port ports = 5 [(google.api.field_behavior) = IMMUTABLE];
  488. // Immutable. HTTP path on the container to send prediction requests to. Vertex AI
  489. // forwards requests sent using
  490. // [projects.locations.endpoints.predict][google.cloud.aiplatform.v1.PredictionService.Predict] to this
  491. // path on the container's IP address and port. Vertex AI then returns the
  492. // container's response in the API response.
  493. //
  494. // For example, if you set this field to `/foo`, then when Vertex AI
  495. // receives a prediction request, it forwards the request body in a POST
  496. // request to the `/foo` path on the port of your container specified by the
  497. // first value of this `ModelContainerSpec`'s
  498. // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field.
  499. //
  500. // If you don't specify this field, it defaults to the following value when
  501. // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]:
  502. // <code>/v1/endpoints/<var>ENDPOINT</var>/deployedModels/<var>DEPLOYED_MODEL</var>:predict</code>
  503. // The placeholders in this value are replaced as follows:
  504. //
  505. // * <var>ENDPOINT</var>: The last segment (following `endpoints/`)of the
  506. // Endpoint.name][] field of the Endpoint where this Model has been
  507. // deployed. (Vertex AI makes this value available to your container code
  508. // as the [`AIP_ENDPOINT_ID` environment
  509. // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
  510. //
  511. // * <var>DEPLOYED_MODEL</var>: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`.
  512. // (Vertex AI makes this value available to your container code
  513. // as the [`AIP_DEPLOYED_MODEL_ID` environment
  514. // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
  515. string predict_route = 6 [(google.api.field_behavior) = IMMUTABLE];
  516. // Immutable. HTTP path on the container to send health checks to. Vertex AI
  517. // intermittently sends GET requests to this path on the container's IP
  518. // address and port to check that the container is healthy. Read more about
  519. // [health
  520. // checks](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#health).
  521. //
  522. // For example, if you set this field to `/bar`, then Vertex AI
  523. // intermittently sends a GET request to the `/bar` path on the port of your
  524. // container specified by the first value of this `ModelContainerSpec`'s
  525. // [ports][google.cloud.aiplatform.v1.ModelContainerSpec.ports] field.
  526. //
  527. // If you don't specify this field, it defaults to the following value when
  528. // you [deploy this Model to an Endpoint][google.cloud.aiplatform.v1.EndpointService.DeployModel]:
  529. // <code>/v1/endpoints/<var>ENDPOINT</var>/deployedModels/<var>DEPLOYED_MODEL</var>:predict</code>
  530. // The placeholders in this value are replaced as follows:
  531. //
  532. // * <var>ENDPOINT</var>: The last segment (following `endpoints/`)of the
  533. // Endpoint.name][] field of the Endpoint where this Model has been
  534. // deployed. (Vertex AI makes this value available to your container code
  535. // as the [`AIP_ENDPOINT_ID` environment
  536. // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
  537. //
  538. // * <var>DEPLOYED_MODEL</var>: [DeployedModel.id][google.cloud.aiplatform.v1.DeployedModel.id] of the `DeployedModel`.
  539. // (Vertex AI makes this value available to your container code as the
  540. // [`AIP_DEPLOYED_MODEL_ID` environment
  541. // variable](https://cloud.google.com/vertex-ai/docs/predictions/custom-container-requirements#aip-variables).)
  542. string health_route = 7 [(google.api.field_behavior) = IMMUTABLE];
  543. }
  544. // Represents a network port in a container.
  545. message Port {
  546. // The number of the port to expose on the pod's IP address.
  547. // Must be a valid port number, between 1 and 65535 inclusive.
  548. int32 container_port = 3;
  549. }
  550. // Detail description of the source information of the model.
  551. message ModelSourceInfo {
  552. // Source of the model.
  553. enum ModelSourceType {
  554. // Should not be used.
  555. MODEL_SOURCE_TYPE_UNSPECIFIED = 0;
  556. // The Model is uploaded by automl training pipeline.
  557. AUTOML = 1;
  558. // The Model is uploaded by user or custom training pipeline.
  559. CUSTOM = 2;
  560. // The Model is registered and sync'ed from BigQuery ML.
  561. BQML = 3;
  562. }
  563. // Type of the model source.
  564. ModelSourceType source_type = 1;
  565. }