model.proto 28 KB

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