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