Skip to content

Commit 0998e04

Browse files
Google APIscopybara-github
authored andcommitted
fix!: An existing resource_definition cloudbuild.googleapis.com/WorkerPool is removed
fix!: A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.SubmitBuildRequest` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool` fix!: A type of an existing resource_reference option of the field `worker_pool` in message `.google.cloud.run.v2.BuildConfig` is changed from `cloudbuild.googleapis.com/WorkerPool` to `cloudbuild.googleapis.com/BuildWorkerPool` feat: Adding new resource tpye run.googleapis.com/WorkerPool. PiperOrigin-RevId: 792236244
1 parent a386edb commit 0998e04

8 files changed

Lines changed: 693 additions & 3 deletions

File tree

google/cloud/run/v2/BUILD.bazel

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ proto_library(
2828
"condition.proto",
2929
"execution.proto",
3030
"execution_template.proto",
31+
"instance_split.proto",
3132
"job.proto",
3233
"k8s.min.proto",
3334
"revision.proto",
@@ -38,6 +39,8 @@ proto_library(
3839
"task_template.proto",
3940
"traffic_target.proto",
4041
"vendor_settings.proto",
42+
"worker_pool.proto",
43+
"worker_pool_revision_template.proto",
4144
],
4245
deps = [
4346
"//google/api:annotations_proto",
@@ -125,6 +128,8 @@ java_gapic_test(
125128
"com.google.cloud.run.v2.ServicesClientTest",
126129
"com.google.cloud.run.v2.TasksClientHttpJsonTest",
127130
"com.google.cloud.run.v2.TasksClientTest",
131+
"com.google.cloud.run.v2.WorkerPoolsClientHttpJsonTest",
132+
"com.google.cloud.run.v2.WorkerPoolsClientTest",
128133
],
129134
runtime_deps = [":run_java_gapic_test"],
130135
)
@@ -379,6 +384,7 @@ load(
379384

380385
csharp_proto_library(
381386
name = "run_csharp_proto",
387+
extra_opts = [],
382388
deps = [":run_proto"],
383389
)
384390

google/cloud/run/v2/build.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ option java_multiple_files = true;
2727
option java_outer_classname = "BuildProto";
2828
option java_package = "com.google.cloud.run.v2";
2929
option (google.api.resource_definition) = {
30-
type: "cloudbuild.googleapis.com/WorkerPool"
30+
type: "cloudbuild.googleapis.com/BuildWorkerPool"
3131
pattern: "projects/{project}/locations/{location}/workerPools/{worker_pool}"
3232
};
3333

@@ -122,7 +122,7 @@ message SubmitBuildRequest {
122122
string worker_pool = 7 [
123123
(google.api.field_behavior) = OPTIONAL,
124124
(google.api.resource_reference) = {
125-
type: "cloudbuild.googleapis.com/WorkerPool"
125+
type: "cloudbuild.googleapis.com/BuildWorkerPool"
126126
}
127127
];
128128

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
// Copyright 2025 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+
15+
syntax = "proto3";
16+
17+
package google.cloud.run.v2;
18+
19+
import "google/api/resource.proto";
20+
21+
option go_package = "cloud.google.com/go/run/apiv2/runpb;runpb";
22+
option java_multiple_files = true;
23+
option java_outer_classname = "InstanceSplitProto";
24+
option java_package = "com.google.cloud.run.v2";
25+
26+
// Holds a single instance split entry for the Worker. Allocations can be done
27+
// to a specific Revision name, or pointing to the latest Ready Revision.
28+
message InstanceSplit {
29+
// The allocation type for this instance split.
30+
InstanceSplitAllocationType type = 1;
31+
32+
// Revision to which to assign this portion of instances, if split allocation
33+
// is by revision.
34+
string revision = 2 [
35+
(google.api.resource_reference) = { type: "run.googleapis.com/Revision" }
36+
];
37+
38+
// Specifies percent of the instance split to this Revision.
39+
// This defaults to zero if unspecified.
40+
int32 percent = 3;
41+
}
42+
43+
// Represents the observed state of a single `InstanceSplit` entry.
44+
message InstanceSplitStatus {
45+
// The allocation type for this instance split.
46+
InstanceSplitAllocationType type = 1;
47+
48+
// Revision to which this instance split is assigned.
49+
string revision = 2 [
50+
(google.api.resource_reference) = { type: "run.googleapis.com/Revision" }
51+
];
52+
53+
// Specifies percent of the instance split to this Revision.
54+
int32 percent = 3;
55+
}
56+
57+
// The type of instance split allocation.
58+
enum InstanceSplitAllocationType {
59+
// Unspecified instance allocation type.
60+
INSTANCE_SPLIT_ALLOCATION_TYPE_UNSPECIFIED = 0;
61+
62+
// Allocates instances to the Service's latest ready Revision.
63+
INSTANCE_SPLIT_ALLOCATION_TYPE_LATEST = 1;
64+
65+
// Allocates instances to a Revision by name.
66+
INSTANCE_SPLIT_ALLOCATION_TYPE_REVISION = 2;
67+
}

google/cloud/run/v2/revision.proto

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,9 @@ service Revisions {
4545
rpc GetRevision(GetRevisionRequest) returns (Revision) {
4646
option (google.api.http) = {
4747
get: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
48+
additional_bindings {
49+
get: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}"
50+
}
4851
};
4952
option (google.api.routing) = {
5053
routing_parameters {
@@ -60,6 +63,9 @@ service Revisions {
6063
rpc ListRevisions(ListRevisionsRequest) returns (ListRevisionsResponse) {
6164
option (google.api.http) = {
6265
get: "/v2/{parent=projects/*/locations/*/services/*}/revisions"
66+
additional_bindings {
67+
get: "/v2/{parent=projects/*/locations/*/workerPools/*}/revisions"
68+
}
6369
};
6470
option (google.api.routing) = {
6571
routing_parameters {
@@ -75,6 +81,9 @@ service Revisions {
7581
returns (google.longrunning.Operation) {
7682
option (google.api.http) = {
7783
delete: "/v2/{name=projects/*/locations/*/services/*/revisions/*}"
84+
additional_bindings {
85+
delete: "/v2/{name=projects/*/locations/*/workerPools/*/revisions/*}"
86+
}
7887
};
7988
option (google.api.routing) = {
8089
routing_parameters {

google/cloud/run/v2/run_v2.yaml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ apis:
1111
- name: google.cloud.run.v2.Revisions
1212
- name: google.cloud.run.v2.Services
1313
- name: google.cloud.run.v2.Tasks
14+
- name: google.cloud.run.v2.WorkerPools
1415
- name: google.longrunning.Operations
1516

1617
documentation:
@@ -70,6 +71,10 @@ authentication:
7071
oauth:
7172
canonical_scopes: |-
7273
https://www.googleapis.com/auth/cloud-platform
74+
- selector: 'google.cloud.run.v2.WorkerPools.*'
75+
oauth:
76+
canonical_scopes: |-
77+
https://www.googleapis.com/auth/cloud-platform
7378
- selector: 'google.longrunning.Operations.*'
7479
oauth:
7580
canonical_scopes: |-

google/cloud/run/v2/vendor_settings.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,13 @@ message ServiceScaling {
170170
[(google.api.field_behavior) = OPTIONAL];
171171
}
172172

173+
// Worker pool scaling settings.
174+
message WorkerPoolScaling {
175+
// Optional. The total number of instances in manual scaling mode.
176+
optional int32 manual_instance_count = 6
177+
[(google.api.field_behavior) = OPTIONAL];
178+
}
179+
173180
// Hardware constraints configuration.
174181
message NodeSelector {
175182
// Required. GPU accelerator type to attach to an instance.
@@ -216,7 +223,7 @@ message BuildConfig {
216223
string worker_pool = 7 [
217224
(google.api.field_behavior) = OPTIONAL,
218225
(google.api.resource_reference) = {
219-
type: "cloudbuild.googleapis.com/WorkerPool"
226+
type: "cloudbuild.googleapis.com/BuildWorkerPool"
220227
}
221228
];
222229

0 commit comments

Comments
 (0)