Skip to content
This repository was archived by the owner on Nov 29, 2023. It is now read-only.

Commit a80fc72

Browse files
feat: add support for temp_bucket, endpoint_config in clusters; add preemptibility for instance group configs (#60)
* feat: Additional fields for the `ClusterConfig` and `InstanceGroupConfig` messages. This change includes the following updates: 1. There is a new `temp_bucket` field for clusters. 2. There is a new `endpoint_config` field for clusters. 3. There is a new `preemptibility` field for instance group configs. 4. There are various updates to the doc comments. PiperOrigin-RevId: 323829608 Source-Author: Google APIs <[email protected]> Source-Date: Wed Jul 29 11:26:43 2020 -0700 Source-Repo: googleapis/googleapis Source-Sha: d8a3dfb82f5cae3f1bcdcec7c5726581532da7d5 Source-Link: googleapis/googleapis@d8a3dfb
1 parent 380e122 commit a80fc72

11 files changed

+597
-203
lines changed

google/cloud/dataproc_v1/gapic/enums.py

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ class Component(enum.IntEnum):
2424
Cluster components that can be activated.
2525
2626
Attributes:
27-
COMPONENT_UNSPECIFIED (int): Unspecified component.
27+
COMPONENT_UNSPECIFIED (int): Unspecified component. Specifying this will cause Cluster creation to fail.
2828
ANACONDA (int): The Anaconda python distribution.
2929
HIVE_WEBHCAT (int): The Hive Web HCatalog (the REST service for accessing HCatalog).
3030
JUPYTER (int): The Jupyter Notebook.
@@ -103,6 +103,30 @@ class Substate(enum.IntEnum):
103103
STALE_STATUS = 2
104104

105105

106+
class InstanceGroupConfig(object):
107+
class Preemptibility(enum.IntEnum):
108+
"""
109+
Controls the use of [preemptible instances]
110+
(https://cloud.google.com/compute/docs/instances/preemptible) within the
111+
group.
112+
113+
Attributes:
114+
PREEMPTIBILITY_UNSPECIFIED (int): Preemptibility is unspecified, the system will choose the
115+
appropriate setting for each instance group.
116+
NON_PREEMPTIBLE (int): Instances are non-preemptible.
117+
118+
This option is allowed for all instance groups and is the only valid
119+
value for Master and Worker instance groups.
120+
PREEMPTIBLE (int): Instances are preemptible.
121+
122+
This option is allowed only for secondary worker groups.
123+
"""
124+
125+
PREEMPTIBILITY_UNSPECIFIED = 0
126+
NON_PREEMPTIBLE = 1
127+
PREEMPTIBLE = 2
128+
129+
106130
class JobStatus(object):
107131
class State(enum.IntEnum):
108132
"""

google/cloud/dataproc_v1/proto/autoscaling_policies.proto

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,20 +164,26 @@ message BasicYarnAutoscalingConfig {
164164
// Bounds: [0s, 1d].
165165
google.protobuf.Duration graceful_decommission_timeout = 5 [(google.api.field_behavior) = REQUIRED];
166166

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

176-
// Required. Fraction of average pending memory in the last cooldown period
179+
// Required. Fraction of average YARN pending memory in the last cooldown period
177180
// for which to remove workers. A scale-down factor of 1 will result in
178181
// scaling down so that there is no available memory remaining after the
179182
// update (more aggressive scaling). A scale-down factor of 0 disables
180183
// removing workers, which can be beneficial for autoscaling a single job.
184+
// See [How autoscaling
185+
// works](/dataproc/docs/concepts/configuring-clusters/autoscaling#how_autoscaling_works)
186+
// for more information.
181187
//
182188
// Bounds: [0.0, 1.0].
183189
double scale_down_factor = 2 [(google.api.field_behavior) = REQUIRED];

google/cloud/dataproc_v1/proto/autoscaling_policies_pb2.py

Lines changed: 10 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

google/cloud/dataproc_v1/proto/clusters.proto

Lines changed: 57 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,17 @@ message ClusterConfig {
170170
// bucket](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/staging-bucket)).
171171
string config_bucket = 1 [(google.api.field_behavior) = OPTIONAL];
172172

173+
// Optional. A Cloud Storage bucket used to store ephemeral cluster and jobs data,
174+
// such as Spark and MapReduce history files.
175+
// If you do not specify a temp bucket,
176+
// Dataproc will determine a Cloud Storage location (US,
177+
// ASIA, or EU) for your cluster's temp bucket according to the
178+
// Compute Engine zone where your cluster is deployed, and then create
179+
// and manage this project-level, per-location bucket. The default bucket has
180+
// a TTL of 90 days, but you can use any TTL (or none) if you specify a
181+
// bucket.
182+
string temp_bucket = 2 [(google.api.field_behavior) = OPTIONAL];
183+
173184
// Optional. The shared Compute Engine config settings for
174185
// all instances in a cluster.
175186
GceClusterConfig gce_cluster_config = 8 [(google.api.field_behavior) = OPTIONAL];
@@ -216,6 +227,20 @@ message ClusterConfig {
216227

217228
// Optional. Lifecycle setting for the cluster.
218229
LifecycleConfig lifecycle_config = 17 [(google.api.field_behavior) = OPTIONAL];
230+
231+
// Optional. Port/endpoint configuration for this cluster
232+
EndpointConfig endpoint_config = 19 [(google.api.field_behavior) = OPTIONAL];
233+
}
234+
235+
// Endpoint config for this cluster
236+
message EndpointConfig {
237+
// Output only. The map of port descriptions to URLs. Will only be populated
238+
// if enable_http_port_access is true.
239+
map<string, string> http_ports = 1 [(google.api.field_behavior) = OUTPUT_ONLY];
240+
241+
// Optional. If true, enable http access to specific ports on the cluster
242+
// from external sources. Defaults to false.
243+
bool enable_http_port_access = 2 [(google.api.field_behavior) = OPTIONAL];
219244
}
220245

221246
// Autoscaling Policy config associated with the cluster.
@@ -288,7 +313,7 @@ message GceClusterConfig {
288313
bool internal_ip_only = 7 [(google.api.field_behavior) = OPTIONAL];
289314

290315
// Optional. The [Dataproc service
291-
// account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_cloud_dataproc)
316+
// account](https://cloud.google.com/dataproc/docs/concepts/configuring-clusters/service-accounts#service_accounts_in_dataproc)
292317
// (also see [VM Data Plane
293318
// identity](https://cloud.google.com/dataproc/docs/concepts/iam/dataproc-principals#vm_service_account_data_plane_identity))
294319
// used by Dataproc cluster VM instances to access Google Cloud Platform
@@ -332,6 +357,27 @@ message GceClusterConfig {
332357
// The config settings for Compute Engine resources in
333358
// an instance group, such as a master or worker group.
334359
message InstanceGroupConfig {
360+
// Controls the use of
361+
// [preemptible instances]
362+
// (https://cloud.google.com/compute/docs/instances/preemptible)
363+
// within the group.
364+
enum Preemptibility {
365+
// Preemptibility is unspecified, the system will choose the
366+
// appropriate setting for each instance group.
367+
PREEMPTIBILITY_UNSPECIFIED = 0;
368+
369+
// Instances are non-preemptible.
370+
//
371+
// This option is allowed for all instance groups and is the only valid
372+
// value for Master and Worker instance groups.
373+
NON_PREEMPTIBLE = 1;
374+
375+
// Instances are preemptible.
376+
//
377+
// This option is allowed only for secondary worker groups.
378+
PREEMPTIBLE = 2;
379+
}
380+
335381
// Optional. The number of VM instances in the instance group.
336382
// For master instance groups, must be set to 1.
337383
int32 num_instances = 1 [(google.api.field_behavior) = OPTIONAL];
@@ -382,6 +428,15 @@ message InstanceGroupConfig {
382428
// instances.
383429
bool is_preemptible = 6 [(google.api.field_behavior) = OUTPUT_ONLY];
384430

431+
// Optional. Specifies the preemptibility of the instance group.
432+
//
433+
// The default value for master and worker groups is
434+
// `NON_PREEMPTIBLE`. This default cannot be changed.
435+
//
436+
// The default value for secondary instances is
437+
// `PREEMPTIBLE`.
438+
Preemptibility preemptibility = 10 [(google.api.field_behavior) = OPTIONAL];
439+
385440
// Output only. The config for Compute Engine Instance Group
386441
// Manager that manages this group.
387442
// This is only used for preemptible instance groups.
@@ -608,7 +663,7 @@ message KerberosConfig {
608663
message SoftwareConfig {
609664
// Optional. The version of software inside the cluster. It must be one of the
610665
// supported [Dataproc
611-
// Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_cloud_dataproc_versions),
666+
// Versions](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#supported_dataproc_versions),
612667
// such as "1.2" (including a subminor version, such as "1.2.29"), or the
613668
// ["preview"
614669
// version](https://cloud.google.com/dataproc/docs/concepts/versioning/dataproc-versions#other_versions).

0 commit comments

Comments
 (0)