Skip to content

Commit

Permalink
feat: ROLLBACK: add support for new Dataproc features
Browse files Browse the repository at this point in the history
PiperOrigin-RevId: 511238112
  • Loading branch information
Google APIs authored and copybara-github committed Feb 21, 2023
1 parent c53bf8d commit d126575
Show file tree
Hide file tree
Showing 10 changed files with 222 additions and 491 deletions.
6 changes: 0 additions & 6 deletions google/cloud/dataproc/v1/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,6 @@ go_gapic_library(
transport = "grpc+rest",
deps = [
":dataproc_go_proto",
"//google/cloud/location:location_go_proto",
"//google/iam/v1:iam_go_proto",
"//google/longrunning:longrunning_go_proto",
"@com_google_cloud_go_longrunning//:go_default_library",
"@com_google_cloud_go_longrunning//autogen:go_default_library",
Expand Down Expand Up @@ -188,10 +186,6 @@ py_gapic_library(
rest_numeric_enums = True,
service_yaml = "dataproc_v1.yaml",
transport = "grpc+rest",
deps = [
"//google/iam/v1:iam_policy_py_proto",
"//google/iam/v1:policy_py_proto",
],
)

py_test(
Expand Down
65 changes: 25 additions & 40 deletions google/cloud/dataproc/v1/autoscaling_policies.proto
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright 2022 Google LLC
// Copyright 2021 Google LLC
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -36,12 +36,10 @@ option (google.api.resource_definition) = {
// Dataproc API.
service AutoscalingPolicyService {
option (google.api.default_host) = "dataproc.googleapis.com";
option (google.api.oauth_scopes) =
"https://www.googleapis.com/auth/cloud-platform";
option (google.api.oauth_scopes) = "https://www.googleapis.com/auth/cloud-platform";

// Creates new autoscaling policy.
rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest)
returns (AutoscalingPolicy) {
rpc CreateAutoscalingPolicy(CreateAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
option (google.api.http) = {
post: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies"
body: "policy"
Expand All @@ -57,8 +55,7 @@ service AutoscalingPolicyService {
//
// Disabled check for update_mask, because all updates will be full
// replacements.
rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest)
returns (AutoscalingPolicy) {
rpc UpdateAutoscalingPolicy(UpdateAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
option (google.api.http) = {
put: "/v1/{policy.name=projects/*/locations/*/autoscalingPolicies/*}"
body: "policy"
Expand All @@ -71,8 +68,7 @@ service AutoscalingPolicyService {
}

// Retrieves autoscaling policy.
rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest)
returns (AutoscalingPolicy) {
rpc GetAutoscalingPolicy(GetAutoscalingPolicyRequest) returns (AutoscalingPolicy) {
option (google.api.http) = {
get: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}"
additional_bindings {
Expand All @@ -83,8 +79,7 @@ service AutoscalingPolicyService {
}

// Lists autoscaling policies in the project.
rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest)
returns (ListAutoscalingPoliciesResponse) {
rpc ListAutoscalingPolicies(ListAutoscalingPoliciesRequest) returns (ListAutoscalingPoliciesResponse) {
option (google.api.http) = {
get: "/v1/{parent=projects/*/locations/*}/autoscalingPolicies"
additional_bindings {
Expand All @@ -96,8 +91,7 @@ service AutoscalingPolicyService {

// Deletes an autoscaling policy. It is an error to delete an autoscaling
// policy that is in use by one or more clusters.
rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest)
returns (google.protobuf.Empty) {
rpc DeleteAutoscalingPolicy(DeleteAutoscalingPolicyRequest) returns (google.protobuf.Empty) {
option (google.api.http) = {
delete: "/v1/{name=projects/*/locations/*/autoscalingPolicies/*}"
additional_bindings {
Expand Down Expand Up @@ -138,17 +132,14 @@ message AutoscalingPolicy {

// Autoscaling algorithm for policy.
oneof algorithm {
BasicAutoscalingAlgorithm basic_algorithm = 3
[(google.api.field_behavior) = REQUIRED];
BasicAutoscalingAlgorithm basic_algorithm = 3 [(google.api.field_behavior) = REQUIRED];
}

// Required. Describes how the autoscaler will operate for primary workers.
InstanceGroupAutoscalingPolicyConfig worker_config = 4
[(google.api.field_behavior) = REQUIRED];
InstanceGroupAutoscalingPolicyConfig worker_config = 4 [(google.api.field_behavior) = REQUIRED];

// Optional. Describes how the autoscaler will operate for secondary workers.
InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5
[(google.api.field_behavior) = OPTIONAL];
InstanceGroupAutoscalingPolicyConfig secondary_worker_config = 5 [(google.api.field_behavior) = OPTIONAL];

// Optional. The labels to associate with this autoscaling policy.
// Label **keys** must contain 1 to 63 characters, and must conform to
Expand All @@ -164,16 +155,14 @@ message AutoscalingPolicy {
message BasicAutoscalingAlgorithm {
oneof config {
// Required. YARN autoscaling configuration.
BasicYarnAutoscalingConfig yarn_config = 1
[(google.api.field_behavior) = REQUIRED];
BasicYarnAutoscalingConfig yarn_config = 1 [(google.api.field_behavior) = REQUIRED];
}

// Optional. Duration between scaling events. A scaling period starts after
// the update operation from the previous event has completed.
//
// Bounds: [2m, 1d]. Default: 2m.
google.protobuf.Duration cooldown_period = 2
[(google.api.field_behavior) = OPTIONAL];
google.protobuf.Duration cooldown_period = 2 [(google.api.field_behavior) = OPTIONAL];
}

// Basic autoscaling configurations for YARN.
Expand All @@ -184,23 +173,22 @@ message BasicYarnAutoscalingConfig {
// downscaling operations.
//
// Bounds: [0s, 1d].
google.protobuf.Duration graceful_decommission_timeout = 5
[(google.api.field_behavior) = REQUIRED];

// Required. Fraction of average YARN pending memory in the last cooldown
// period for which to add workers. A scale-up factor of 1.0 will result in
// scaling up so that there is no pending memory remaining after the update
// (more aggressive scaling). A scale-up factor closer to 0 will result in a
// smaller magnitude of scaling up (less aggressive scaling). See [How
// autoscaling
google.protobuf.Duration graceful_decommission_timeout = 5 [(google.api.field_behavior) = REQUIRED];

// Required. Fraction of average YARN pending memory in the last cooldown period
// for which to add workers. A scale-up factor of 1.0 will result in scaling
// up so that there is no pending memory remaining after the update (more
// aggressive scaling). A scale-up factor closer to 0 will result in a smaller
// magnitude of scaling up (less aggressive scaling).
// See [How autoscaling
// works](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
// for more information.
//
// Bounds: [0.0, 1.0].
double scale_up_factor = 1 [(google.api.field_behavior) = REQUIRED];

// Required. Fraction of average YARN pending memory in the last cooldown
// period for which to remove workers. A scale-down factor of 1 will result in
// Required. Fraction of average YARN pending memory in the last cooldown period
// for which to remove workers. A scale-down factor of 1 will result in
// scaling down so that there is no available memory remaining after the
// update (more aggressive scaling). A scale-down factor of 0 disables
// removing workers, which can be beneficial for autoscaling a single job.
Expand All @@ -218,8 +206,7 @@ message BasicYarnAutoscalingConfig {
// on any recommended change.
//
// Bounds: [0.0, 1.0]. Default: 0.0.
double scale_up_min_worker_fraction = 3
[(google.api.field_behavior) = OPTIONAL];
double scale_up_min_worker_fraction = 3 [(google.api.field_behavior) = OPTIONAL];

// Optional. Minimum scale-down threshold as a fraction of total cluster size
// before scaling occurs. For example, in a 20-worker cluster, a threshold of
Expand All @@ -228,8 +215,7 @@ message BasicYarnAutoscalingConfig {
// on any recommended change.
//
// Bounds: [0.0, 1.0]. Default: 0.0.
double scale_down_min_worker_fraction = 4
[(google.api.field_behavior) = OPTIONAL];
double scale_down_min_worker_fraction = 4 [(google.api.field_behavior) = OPTIONAL];
}

// Configuration for the size bounds of an instance group, including its
Expand Down Expand Up @@ -372,8 +358,7 @@ message ListAutoscalingPoliciesRequest {
// A response to a request to list autoscaling policies in a project.
message ListAutoscalingPoliciesResponse {
// Output only. Autoscaling policies list.
repeated AutoscalingPolicy policies = 1
[(google.api.field_behavior) = OUTPUT_ONLY];
repeated AutoscalingPolicy policies = 1 [(google.api.field_behavior) = OUTPUT_ONLY];

// Output only. This token is included in the response if there are more
// results to fetch.
Expand Down
Loading

0 comments on commit d126575

Please sign in to comment.