Skip to content

Commit 4a5a6fd

Browse files
Google APIscopybara-github
authored andcommitted
feat: support min_num_instances for primary worker and InstanceFlexibilityPolicy for secondary worker
PiperOrigin-RevId: 559135594
1 parent f5987af commit 4a5a6fd

File tree

3 files changed

+134
-32
lines changed

3 files changed

+134
-32
lines changed

google/cloud/dataproc/v1/BUILD.bazel

Lines changed: 25 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
# This file was automatically generated by BuildFileGenerator
2+
# https://github.com/googleapis/rules_gapic/tree/master/bazel
3+
4+
# Most of the manual changes to this file will be overwritten.
5+
# It's **only** allowed to change the following rule attribute values:
6+
# - names of *_gapic_assembly_* rules
7+
# - certain parameters of *_gapic_library rules, including but not limited to:
8+
# * extra_protoc_parameters
9+
# * extra_protoc_file_parameters
10+
# The complete list of preserved parameters can be found in the source code.
211

312
# This is an API workspace, having public visibility by default makes perfect sense.
413
package(default_visibility = ["//visibility:public"])
@@ -39,6 +48,7 @@ proto_library_with_info(
3948
deps = [
4049
":dataproc_proto",
4150
"//google/cloud:common_resources_proto",
51+
"//google/iam/v1:iam_policy_proto",
4252
],
4353
)
4454

@@ -73,29 +83,32 @@ java_gapic_library(
7383
rest_numeric_enums = True,
7484
service_yaml = "dataproc_v1.yaml",
7585
test_deps = [
86+
"//google/iam/v1:iam_java_grpc",
7687
":dataproc_java_grpc",
7788
],
7889
transport = "grpc+rest",
7990
deps = [
8091
":dataproc_java_proto",
8192
"//google/api:api_java_proto",
93+
"//google/iam/v1:iam_java_proto",
8294
],
8395
)
8496

8597
java_gapic_test(
8698
name = "dataproc_java_gapic_test_suite",
8799
test_classes = [
88-
# Add AutoscalingPolicyService to gapic yaml
89100
"com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClientHttpJsonTest",
90101
"com.google.cloud.dataproc.v1.AutoscalingPolicyServiceClientTest",
102+
"com.google.cloud.dataproc.v1.BatchControllerClientHttpJsonTest",
103+
"com.google.cloud.dataproc.v1.BatchControllerClientTest",
91104
"com.google.cloud.dataproc.v1.ClusterControllerClientHttpJsonTest",
92105
"com.google.cloud.dataproc.v1.ClusterControllerClientTest",
93106
"com.google.cloud.dataproc.v1.JobControllerClientHttpJsonTest",
94107
"com.google.cloud.dataproc.v1.JobControllerClientTest",
95-
"com.google.cloud.dataproc.v1.WorkflowTemplateServiceClientHttpJsonTest",
96-
"com.google.cloud.dataproc.v1.WorkflowTemplateServiceClientTest",
97108
"com.google.cloud.dataproc.v1.NodeGroupControllerClientHttpJsonTest",
98109
"com.google.cloud.dataproc.v1.NodeGroupControllerClientTest",
110+
"com.google.cloud.dataproc.v1.WorkflowTemplateServiceClientHttpJsonTest",
111+
"com.google.cloud.dataproc.v1.WorkflowTemplateServiceClientTest",
99112
],
100113
runtime_deps = [":dataproc_java_gapic_test"],
101114
)
@@ -146,7 +159,6 @@ go_gapic_library(
146159
transport = "grpc+rest",
147160
deps = [
148161
":dataproc_go_proto",
149-
"//google/cloud/location:location_go_proto",
150162
"//google/iam/v1:iam_go_proto",
151163
"//google/longrunning:longrunning_go_proto",
152164
"@com_google_cloud_go_longrunning//:go_default_library",
@@ -160,6 +172,7 @@ go_gapic_assembly_pkg(
160172
name = "gapi-cloud-dataproc-v1-go",
161173
deps = [
162174
":dataproc_go_gapic",
175+
":dataproc_go_gapic_srcjar-metadata.srcjar",
163176
":dataproc_go_gapic_srcjar-snippets.srcjar",
164177
":dataproc_go_gapic_srcjar-test.srcjar",
165178
":dataproc_go_proto",
@@ -185,7 +198,6 @@ py_gapic_library(
185198
transport = "grpc+rest",
186199
deps = [
187200
"//google/iam/v1:iam_policy_py_proto",
188-
"//google/iam/v1:policy_py_proto",
189201
],
190202
)
191203

@@ -199,6 +211,7 @@ py_test(
199211
deps = [":dataproc_py_gapic"],
200212
)
201213

214+
# Open Source Packages
202215
py_gapic_assembly_pkg(
203216
name = "dataproc-v1-py",
204217
deps = [
@@ -224,13 +237,14 @@ php_proto_library(
224237
php_gapic_library(
225238
name = "dataproc_php_gapic",
226239
srcs = [":dataproc_proto_with_info"],
227-
gapic_yaml = "dataproc_gapic.yaml",
228240
grpc_service_config = "dataproc_grpc_service_config.json",
229241
migration_mode = "MIGRATION_MODE_UNSPECIFIED",
230242
rest_numeric_enums = True,
231243
service_yaml = "dataproc_v1.yaml",
232244
transport = "grpc+rest",
233-
deps = [":dataproc_php_proto"],
245+
deps = [
246+
":dataproc_php_proto",
247+
],
234248
)
235249

236250
# Open Source Packages
@@ -299,11 +313,11 @@ ruby_cloud_gapic_library(
299313
name = "dataproc_ruby_gapic",
300314
srcs = [":dataproc_proto_with_info"],
301315
extra_protoc_parameters = [
302-
"ruby-cloud-gem-name=google-cloud-dataproc-v1",
303-
"ruby-cloud-env-prefix=DATAPROC",
304-
"ruby-cloud-product-url=https://cloud.google.com/dataproc",
305316
"ruby-cloud-api-id=dataproc.googleapis.com",
306317
"ruby-cloud-api-shortname=dataproc",
318+
"ruby-cloud-env-prefix=DATAPROC",
319+
"ruby-cloud-gem-name=google-cloud-dataproc-v1",
320+
"ruby-cloud-product-url=https://cloud.google.com/dataproc",
307321
],
308322
grpc_service_config = "dataproc_grpc_service_config.json",
309323
rest_numeric_enums = True,
@@ -340,6 +354,7 @@ load(
340354

341355
csharp_proto_library(
342356
name = "dataproc_csharp_proto",
357+
extra_opts = [],
343358
deps = [":dataproc_proto"],
344359
)
345360

google/cloud/dataproc/v1/clusters.proto

Lines changed: 107 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -489,10 +489,10 @@ message GceClusterConfig {
489489
// instances](https://cloud.google.com/compute/docs/label-or-tag-resources#tags)).
490490
repeated string tags = 4;
491491

492-
// The Compute Engine metadata entries to add to all instances (see
492+
// Optional. The Compute Engine metadata entries to add to all instances (see
493493
// [Project and instance
494494
// metadata](https://cloud.google.com/compute/docs/storing-retrieving-metadata#project_and_instance_metadata)).
495-
map<string, string> metadata = 5;
495+
map<string, string> metadata = 5 [(google.api.field_behavior) = OPTIONAL];
496496

497497
// Optional. Reservation Affinity for consuming Zonal reservation.
498498
ReservationAffinity reservation_affinity = 11
@@ -600,6 +600,10 @@ message InstanceGroupConfig {
600600
repeated string instance_names = 2
601601
[(google.api.field_behavior) = OUTPUT_ONLY];
602602

603+
// Output only. List of references to Compute Engine instances.
604+
repeated InstanceReference instance_references = 11
605+
[(google.api.field_behavior) = OUTPUT_ONLY];
606+
603607
// Optional. The Compute Engine image resource used for cluster instances.
604608
//
605609
// The URI can represent an image or image family.
@@ -666,6 +670,44 @@ message InstanceGroupConfig {
666670
// See [Dataproc -> Minimum CPU
667671
// Platform](https://cloud.google.com/dataproc/docs/concepts/compute/dataproc-min-cpu).
668672
string min_cpu_platform = 9 [(google.api.field_behavior) = OPTIONAL];
673+
674+
// Optional. The minimum number of instances to create.
675+
// If min_num_instances is set, min_num_instances is used for a criteria to
676+
// decide the cluster. Cluster creation will be failed by being an error state
677+
// if the total number of instances created is less than the
678+
// min_num_instances.
679+
// For example, given that num_instances = 5 and min_num_instances = 3,
680+
// * if 4 instances are created and then registered successfully but one
681+
// instance is failed, the failed VM will be deleted and the cluster will be
682+
// resized to 4 instances in running state.
683+
// * if 2 instances are created successfully and 3 instances are failed,
684+
// the cluster will be in an error state and does not delete failed VMs for
685+
// debugging.
686+
// * if 2 instance are created and then registered successfully but 3
687+
// instances are failed to initialize, the cluster will be in an error state
688+
// and does not delete failed VMs for debugging.
689+
// NB: This can only be set for primary workers now.
690+
int32 min_num_instances = 12 [(google.api.field_behavior) = OPTIONAL];
691+
692+
// Optional. Instance flexibility Policy allowing a mixture of VM shapes and
693+
// provisioning models.
694+
InstanceFlexibilityPolicy instance_flexibility_policy = 13
695+
[(google.api.field_behavior) = OPTIONAL];
696+
}
697+
698+
// A reference to a Compute Engine instance.
699+
message InstanceReference {
700+
// The user-friendly name of the Compute Engine instance.
701+
string instance_name = 1;
702+
703+
// The unique identifier of the Compute Engine instance.
704+
string instance_id = 2;
705+
706+
// The public RSA key used for sharing data with this instance.
707+
string public_key = 3;
708+
709+
// The public ECIES key used for sharing data with this instance.
710+
string public_ecies_key = 4;
669711
}
670712

671713
// Specifies the resources used to actively manage an instance group.
@@ -677,6 +719,48 @@ message ManagedGroupConfig {
677719
// Output only. The name of the Instance Group Manager for this group.
678720
string instance_group_manager_name = 2
679721
[(google.api.field_behavior) = OUTPUT_ONLY];
722+
723+
// Output only. The partial URI to the instance group manager for this group.
724+
// E.g. projects/my-project/regions/us-central1/instanceGroupManagers/my-igm.
725+
string instance_group_manager_uri = 3
726+
[(google.api.field_behavior) = OUTPUT_ONLY];
727+
}
728+
729+
// Instance flexibility Policy allowing a mixture of VM shapes and provisioning
730+
// models.
731+
message InstanceFlexibilityPolicy {
732+
// Defines machines types and a rank to which the machines types belong.
733+
message InstanceSelection {
734+
// Optional. Full machine-type names, e.g. "n1-standard-16".
735+
repeated string machine_types = 1 [(google.api.field_behavior) = OPTIONAL];
736+
737+
// Optional. Preference of this instance selection. Lower number means
738+
// higher preference. Dataproc will first try to create a VM based on the
739+
// machine-type with priority rank and fallback to next rank based on
740+
// availability. Machine types and instance selections with the same
741+
// priority have the same preference.
742+
int32 rank = 2 [(google.api.field_behavior) = OPTIONAL];
743+
}
744+
745+
// Defines a mapping from machine types to the number of VMs that are created
746+
// with each machine type.
747+
message InstanceSelectionResult {
748+
// Output only. Full machine-type names, e.g. "n1-standard-16".
749+
optional string machine_type = 1
750+
[(google.api.field_behavior) = OUTPUT_ONLY];
751+
752+
// Output only. Number of VM provisioned with the machine_type.
753+
optional int32 vm_count = 2 [(google.api.field_behavior) = OUTPUT_ONLY];
754+
}
755+
756+
// Optional. List of instance selection options that the group will use when
757+
// creating new VMs.
758+
repeated InstanceSelection instance_selection_list = 2
759+
[(google.api.field_behavior) = OPTIONAL];
760+
761+
// Output only. A list of instance selection results in the group.
762+
repeated InstanceSelectionResult instance_selection_results = 3
763+
[(google.api.field_behavior) = OUTPUT_ONLY];
680764
}
681765

682766
// Specifies the type and number of accelerator cards attached to the instances
@@ -844,6 +928,9 @@ message ClusterStatus {
844928

845929
// The cluster is being started. It is not ready for use.
846930
STARTING = 8;
931+
932+
// The cluster is being repaired. It is not ready for use.
933+
REPAIRING = 10;
847934
}
848935

849936
// The cluster substate.
@@ -1075,16 +1162,16 @@ message ClusterMetrics {
10751162

10761163
// Dataproc metric config.
10771164
message DataprocMetricConfig {
1078-
// A source for the collection of Dataproc OSS metrics (see [available OSS
1165+
// A source for the collection of Dataproc custom metrics (see [Custom
10791166
// metrics]
1080-
// (https://cloud.google.com//dataproc/docs/guides/monitoring#available_oss_metrics)).
1167+
// (https://cloud.google.com//dataproc/docs/guides/dataproc-metrics#custom_metrics)).
10811168
enum MetricSource {
10821169
// Required unspecified metric source.
10831170
METRIC_SOURCE_UNSPECIFIED = 0;
10841171

1085-
// Default monitoring agent metrics. If this source is enabled,
1172+
// Monitoring agent metrics. If this source is enabled,
10861173
// Dataproc enables the monitoring agent in Compute Engine,
1087-
// and collects default monitoring agent metrics, which are published
1174+
// and collects monitoring agent metrics, which are published
10881175
// with an `agent.googleapis.com` prefix.
10891176
MONITORING_AGENT_DEFAULTS = 1;
10901177

@@ -1107,17 +1194,17 @@ message DataprocMetricConfig {
11071194
HIVEMETASTORE = 7;
11081195
}
11091196

1110-
// A Dataproc OSS metric.
1197+
// A Dataproc custom metric.
11111198
message Metric {
1112-
// Required. Default metrics are collected unless `metricOverrides` are
1113-
// specified for the metric source (see [Available OSS metrics]
1114-
// (https://cloud.google.com/dataproc/docs/guides/monitoring#available_oss_metrics)
1199+
// Required. A standard set of metrics is collected unless `metricOverrides`
1200+
// are specified for the metric source (see [Custom metrics]
1201+
// (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics)
11151202
// for more information).
11161203
MetricSource metric_source = 1 [(google.api.field_behavior) = REQUIRED];
11171204

1118-
// Optional. Specify one or more [available OSS metrics]
1119-
// (https://cloud.google.com/dataproc/docs/guides/monitoring#available_oss_metrics)
1120-
// to collect for the metric course (for the `SPARK` metric source, any
1205+
// Optional. Specify one or more [Custom metrics]
1206+
// (https://cloud.google.com/dataproc/docs/guides/dataproc-metrics#custom_metrics)
1207+
// to collect for the metric course (for the `SPARK` metric source (any
11211208
// [Spark metric]
11221209
// (https://spark.apache.org/docs/latest/monitoring.html#metrics) can be
11231210
// specified).
@@ -1137,13 +1224,13 @@ message DataprocMetricConfig {
11371224
//
11381225
// Notes:
11391226
//
1140-
// * Only the specified overridden metrics will be collected for the
1227+
// * Only the specified overridden metrics are collected for the
11411228
// metric source. For example, if one or more `spark:executive` metrics
1142-
// are listed as metric overrides, other `SPARK` metrics will not be
1143-
// collected. The collection of the default metrics for other OSS metric
1144-
// sources is unaffected. For example, if both `SPARK` andd `YARN` metric
1145-
// sources are enabled, and overrides are provided for Spark metrics only,
1146-
// all default YARN metrics will be collected.
1229+
// are listed as metric overrides, other `SPARK` metrics are not
1230+
// collected. The collection of the metrics for other enabled custom
1231+
// metric sources is unaffected. For example, if both `SPARK` andd `YARN`
1232+
// metric sources are enabled, and overrides are provided for Spark
1233+
// metrics only, all YARN metrics are collected.
11471234
repeated string metric_overrides = 2
11481235
[(google.api.field_behavior) = OPTIONAL];
11491236
}

google/cloud/dataproc/v1/node_groups.proto

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright 2022 Google LLC
1+
// Copyright 2023 Google LLC
22
//
33
// Licensed under the Apache License, Version 2.0 (the "License");
44
// you may not use this file except in compliance with the License.
@@ -144,7 +144,7 @@ message ResizeNodeGroupRequest {
144144
// underscores (_), and hyphens (-). The maximum length is 40 characters.
145145
string request_id = 3 [(google.api.field_behavior) = OPTIONAL];
146146

147-
// Optional. Timeout for graceful YARN decomissioning. [Graceful
147+
// Optional. Timeout for graceful YARN decommissioning. [Graceful
148148
// decommissioning]
149149
// (https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/scaling-clusters#graceful_decommissioning)
150150
// allows the removal of nodes from the Compute Engine node group

0 commit comments

Comments
 (0)