From 627646187513c840b8481a0b4f6249eba04a418f Mon Sep 17 00:00:00 2001 From: Google APIs Date: Mon, 25 Jul 2022 12:19:25 -0700 Subject: [PATCH] feat: add DeploymentResourcePool in aiplatform v1beta1 deployment_resource_pool.proto feat: add DeploymentResourcePoolService in aiplatform v1beta1 deployment_resource_pool_service.proto feat: add SHARED_RESOURCES to DeploymentResourcesType in aiplatform v1beta1 model.proto PiperOrigin-RevId: 463147866 --- google/cloud/aiplatform/v1beta1/BUILD.bazel | 2 + .../v1beta1/aiplatform_v1beta1.yaml | 9 + .../v1beta1/deployment_resource_pool.proto | 50 ++++ .../deployment_resource_pool_service.proto | 219 ++++++++++++++++++ .../cloud/aiplatform/v1beta1/endpoint.proto | 4 - google/cloud/aiplatform/v1beta1/model.proto | 4 + 6 files changed, 284 insertions(+), 4 deletions(-) create mode 100644 google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto create mode 100644 google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto diff --git a/google/cloud/aiplatform/v1beta1/BUILD.bazel b/google/cloud/aiplatform/v1beta1/BUILD.bazel index f47c1bacc..1566745c0 100644 --- a/google/cloud/aiplatform/v1beta1/BUILD.bazel +++ b/google/cloud/aiplatform/v1beta1/BUILD.bazel @@ -35,6 +35,8 @@ proto_library( "dataset_service.proto", "deployed_index_ref.proto", "deployed_model_ref.proto", + "deployment_resource_pool.proto", + "deployment_resource_pool_service.proto", "encryption_spec.proto", "endpoint.proto", "endpoint_service.proto", diff --git a/google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml b/google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml index 78a3ea8dc..013f1e54b 100644 --- a/google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml +++ b/google/cloud/aiplatform/v1beta1/aiplatform_v1beta1.yaml @@ -5,6 +5,7 @@ title: Vertex AI API apis: - name: google.cloud.aiplatform.v1beta1.DatasetService +- name: google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService - name: google.cloud.aiplatform.v1beta1.EndpointService - name: google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService - name: google.cloud.aiplatform.v1beta1.FeaturestoreService @@ -33,6 +34,7 @@ types: - name: google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateMetatdata - name: google.cloud.aiplatform.v1beta1.CheckTrialEarlyStoppingStateResponse - name: google.cloud.aiplatform.v1beta1.CreateDatasetOperationMetadata +- name: google.cloud.aiplatform.v1beta1.CreateDeploymentResourcePoolOperationMetadata - name: google.cloud.aiplatform.v1beta1.CreateEndpointOperationMetadata - name: google.cloud.aiplatform.v1beta1.CreateEntityTypeOperationMetadata - name: google.cloud.aiplatform.v1beta1.CreateFeatureOperationMetadata @@ -73,6 +75,7 @@ types: - name: google.cloud.aiplatform.v1beta1.UndeployIndexResponse - name: google.cloud.aiplatform.v1beta1.UndeployModelOperationMetadata - name: google.cloud.aiplatform.v1beta1.UndeployModelResponse +- name: google.cloud.aiplatform.v1beta1.UpdateDeploymentResourcePoolOperationMetadata - name: google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetOperationMetadata - name: google.cloud.aiplatform.v1beta1.UpdateExplanationDatasetResponse - name: google.cloud.aiplatform.v1beta1.UpdateFeaturestoreOperationMetadata @@ -124,6 +127,8 @@ backend: rules: - selector: 'google.cloud.aiplatform.v1beta1.DatasetService.*' deadline: 60.0 + - selector: 'google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.*' + deadline: 30.0 - selector: 'google.cloud.aiplatform.v1beta1.EndpointService.*' deadline: 60.0 - selector: google.cloud.aiplatform.v1beta1.FeaturestoreOnlineServingService.ReadFeatureValues @@ -517,6 +522,10 @@ authentication: oauth: canonical_scopes: |- https://www.googleapis.com/auth/cloud-platform + - selector: 'google.cloud.aiplatform.v1beta1.DeploymentResourcePoolService.*' + oauth: + canonical_scopes: |- + https://www.googleapis.com/auth/cloud-platform - selector: 'google.cloud.aiplatform.v1beta1.EndpointService.*' oauth: canonical_scopes: |- diff --git a/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto b/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto new file mode 100644 index 000000000..2249e655c --- /dev/null +++ b/google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto @@ -0,0 +1,50 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/machine_resources.proto"; +import "google/protobuf/timestamp.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeploymentResourcePoolProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A description of resources that can be shared by multiple DeployedModels, +// whose underlying specification consists of a DedicatedResources. +message DeploymentResourcePool { + option (google.api.resource) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + pattern: "projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}" + }; + + // Output only. The resource name of the DeploymentResourcePool. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [(google.api.field_behavior) = OUTPUT_ONLY]; + + // Required. The underlying DedicatedResources that the DeploymentResourcePool uses. + DedicatedResources dedicated_resources = 2 [(google.api.field_behavior) = REQUIRED]; + + // Output only. Timestamp when this DeploymentResourcePool was created. + google.protobuf.Timestamp create_time = 4 [(google.api.field_behavior) = OUTPUT_ONLY]; +} diff --git a/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto b/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto new file mode 100644 index 000000000..11eddf67c --- /dev/null +++ b/google/cloud/aiplatform/v1beta1/deployment_resource_pool_service.proto @@ -0,0 +1,219 @@ +// Copyright 2022 Google LLC +// +// Licensed under the Apache License, Version 2.0 (the "License"); +// you may not use this file except in compliance with the License. +// You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, software +// distributed under the License is distributed on an "AS IS" BASIS, +// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +// See the License for the specific language governing permissions and +// limitations under the License. + +syntax = "proto3"; + +package google.cloud.aiplatform.v1beta1; + +import "google/api/annotations.proto"; +import "google/api/client.proto"; +import "google/api/field_behavior.proto"; +import "google/api/resource.proto"; +import "google/cloud/aiplatform/v1beta1/deployed_model_ref.proto"; +import "google/cloud/aiplatform/v1beta1/deployment_resource_pool.proto"; +import "google/cloud/aiplatform/v1beta1/endpoint.proto"; +import "google/cloud/aiplatform/v1beta1/operation.proto"; +import "google/longrunning/operations.proto"; + +option csharp_namespace = "Google.Cloud.AIPlatform.V1Beta1"; +option go_package = "google.golang.org/genproto/googleapis/cloud/aiplatform/v1beta1;aiplatform"; +option java_multiple_files = true; +option java_outer_classname = "DeploymentResourcePoolServiceProto"; +option java_package = "com.google.cloud.aiplatform.v1beta1"; +option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; +option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; + +// A service that manages the DeploymentResourcePool resource. +service DeploymentResourcePoolService { + option (google.api.default_host) = "aiplatform.googleapis.com"; + option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform"; + + // Create a DeploymentResourcePool. + rpc CreateDeploymentResourcePool(CreateDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + post: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" + body: "*" + }; + option (google.api.method_signature) = "parent,deployment_resource_pool,deployment_resource_pool_id"; + option (google.longrunning.operation_info) = { + response_type: "DeploymentResourcePool" + metadata_type: "CreateDeploymentResourcePoolOperationMetadata" + }; + } + + // Get a DeploymentResourcePool. + rpc GetDeploymentResourcePool(GetDeploymentResourcePoolRequest) returns (DeploymentResourcePool) { + option (google.api.http) = { + get: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" + }; + option (google.api.method_signature) = "name"; + } + + // List DeploymentResourcePools in a location. + rpc ListDeploymentResourcePools(ListDeploymentResourcePoolsRequest) returns (ListDeploymentResourcePoolsResponse) { + option (google.api.http) = { + get: "/v1beta1/{parent=projects/*/locations/*}/deploymentResourcePools" + }; + option (google.api.method_signature) = "parent"; + } + + // Delete a DeploymentResourcePool. + rpc DeleteDeploymentResourcePool(DeleteDeploymentResourcePoolRequest) returns (google.longrunning.Operation) { + option (google.api.http) = { + delete: "/v1beta1/{name=projects/*/locations/*/deploymentResourcePools/*}" + }; + option (google.api.method_signature) = "name"; + option (google.longrunning.operation_info) = { + response_type: "google.protobuf.Empty" + metadata_type: "DeleteOperationMetadata" + }; + } + + // List DeployedModels that have been deployed on this DeploymentResourcePool. + rpc QueryDeployedModels(QueryDeployedModelsRequest) returns (QueryDeployedModelsResponse) { + option (google.api.http) = { + get: "/v1beta1/{deployment_resource_pool=projects/*/locations/*/deploymentResourcePools/*}:queryDeployedModels" + }; + option (google.api.method_signature) = "deployment_resource_pool"; + } +} + +// Request message for CreateDeploymentResourcePool method. +message CreateDeploymentResourcePoolRequest { + // Required. The parent location resource where this DeploymentResourcePool will be + // created. Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "locations.googleapis.com/Location" + } + ]; + + // Required. The DeploymentResourcePool to create. + DeploymentResourcePool deployment_resource_pool = 2 [(google.api.field_behavior) = REQUIRED]; + + // Required. The ID to use for the DeploymentResourcePool, which + // will become the final component of the DeploymentResourcePool's resource + // name. + // + // The maximum length is 63 characters, and valid characters + // are `/^[a-z]([a-z0-9-]{0,61}[a-z0-9])?$/`. + string deployment_resource_pool_id = 3 [(google.api.field_behavior) = REQUIRED]; +} + +// Runtime operation information for CreateDeploymentResourcePool method. +message CreateDeploymentResourcePoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for GetDeploymentResourcePool method. +message GetDeploymentResourcePoolRequest { + // Required. The name of the DeploymentResourcePool to retrieve. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + } + ]; +} + +// Request message for ListDeploymentResourcePools method. +message ListDeploymentResourcePoolsRequest { + // Required. The parent Location which owns this collection of DeploymentResourcePools. + // Format: projects/{project}/locations/{location} + string parent = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + child_type: "locations.googleapis.com/Location" + } + ]; + + // The maximum number of DeploymentResourcePools to return. The service may + // return fewer than this value. + int32 page_size = 2; + + // A page token, received from a previous `ListDeploymentResourcePools` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `ListDeploymentResourcePools` must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for ListDeploymentResourcePools method. +message ListDeploymentResourcePoolsResponse { + // The DeploymentResourcePools from the specified location. + repeated DeploymentResourcePool deployment_resource_pools = 1; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; +} + +// Runtime operation information for UpdateDeploymentResourcePool method. +message UpdateDeploymentResourcePoolOperationMetadata { + // The operation generic information. + GenericOperationMetadata generic_metadata = 1; +} + +// Request message for DeleteDeploymentResourcePool method. +message DeleteDeploymentResourcePoolRequest { + // Required. The name of the DeploymentResourcePool to delete. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string name = 1 [ + (google.api.field_behavior) = REQUIRED, + (google.api.resource_reference) = { + type: "aiplatform.googleapis.com/DeploymentResourcePool" + } + ]; +} + +// Request message for QueryDeployedModels method. +message QueryDeployedModelsRequest { + // Required. The name of the target DeploymentResourcePool to query. + // Format: + // projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool} + string deployment_resource_pool = 1 [(google.api.field_behavior) = REQUIRED]; + + // The maximum number of DeployedModels to return. The service may return + // fewer than this value. + int32 page_size = 2; + + // A page token, received from a previous `QueryDeployedModels` call. + // Provide this to retrieve the subsequent page. + // + // When paginating, all other parameters provided to + // `QueryDeployedModels` must match the call that provided the page + // token. + string page_token = 3; +} + +// Response message for QueryDeployedModels method. +message QueryDeployedModelsResponse { + // DEPRECATED Use deployed_model_refs instead. + repeated DeployedModel deployed_models = 1 [deprecated = true]; + + // A token, which can be sent as `page_token` to retrieve the next page. + // If this field is omitted, there are no subsequent pages. + string next_page_token = 2; + + // References to the DeployedModels that share the specified + // deploymentResourcePool. + repeated DeployedModelRef deployed_model_refs = 3; +} diff --git a/google/cloud/aiplatform/v1beta1/endpoint.proto b/google/cloud/aiplatform/v1beta1/endpoint.proto index e99590864..0236e532f 100644 --- a/google/cloud/aiplatform/v1beta1/endpoint.proto +++ b/google/cloud/aiplatform/v1beta1/endpoint.proto @@ -31,10 +31,6 @@ option java_outer_classname = "EndpointProto"; option java_package = "com.google.cloud.aiplatform.v1beta1"; option php_namespace = "Google\\Cloud\\AIPlatform\\V1beta1"; option ruby_package = "Google::Cloud::AIPlatform::V1beta1"; -option (google.api.resource_definition) = { - type: "aiplatform.googleapis.com/DeploymentResourcePool" - pattern: "projects/{project}/locations/{location}/deploymentResourcePools/{deployment_resource_pool}" -}; // Models are deployed into it, and afterwards Endpoint is called to obtain // predictions and explanations. diff --git a/google/cloud/aiplatform/v1beta1/model.proto b/google/cloud/aiplatform/v1beta1/model.proto index d17275bb8..ba9b2cd5a 100644 --- a/google/cloud/aiplatform/v1beta1/model.proto +++ b/google/cloud/aiplatform/v1beta1/model.proto @@ -98,6 +98,10 @@ message Model { // Resources that to large degree are decided by Vertex AI, and require // only a modest additional configuration. AUTOMATIC_RESOURCES = 2; + + // Resources that can be shared by multiple [DeployedModels][google.cloud.aiplatform.v1beta1.DeployedModel]. + // A pre-configured [DeploymentResourcePool][google.cloud.aiplatform.v1beta1.DeploymentResourcePool] is required. + SHARED_RESOURCES = 3; } // The resource name of the Model.