model.proto 30 KB

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