[
https://issues.apache.org/jira/browse/BEAM-8472?focusedWorklogId=338842&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-338842
]
ASF GitHub Bot logged work on BEAM-8472:
----------------------------------------
Author: ASF GitHub Bot
Created on: 05/Nov/19 16:25
Start Date: 05/Nov/19 16:25
Worklog Time Spent: 10m
Work Description: lukecwik commented on pull request #9974: [BEAM-8472]
Get default GCP region from gcloud (Java)
URL: https://github.com/apache/beam/pull/9974#discussion_r342650592
##########
File path:
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
##########
@@ -357,6 +357,49 @@ public static DataflowRunner fromOptions(PipelineOptions
options) {
return new DataflowRunner(dataflowOptions);
}
+ /**
+ * Get a default value for Google Cloud region according to
+ * https://cloud.google.com/compute/docs/gcloud-compute/#default-properties.
If no other default
+ * can be found, returns "us-central1".
+ */
+ static String getDefaultGcpRegion() {
Review comment:
Is there a reason why we aren't using the default instance factory to
configure the region instead of detecting and setting it here. This would mean
that all users of the pipeline option would get it and not just Dataflow.
See
[DefaultProjectFactory](https://github.com/apache/beam/blob/1c56a7627648c4f271dcfb35f0a6f2cfe303a18c/sdks/java/extensions/google-cloud-platform-core/src/main/java/org/apache/beam/sdk/extensions/gcp/options/GcpOptions.java#L180)
for an example.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 338842)
Time Spent: 2h 20m (was: 2h 10m)
> Get default GCP region from gcloud
> ----------------------------------
>
> Key: BEAM-8472
> URL: https://issues.apache.org/jira/browse/BEAM-8472
> Project: Beam
> Issue Type: Improvement
> Components: runner-dataflow
> Reporter: Kyle Weaver
> Assignee: Kyle Weaver
> Priority: Major
> Time Spent: 2h 20m
> Remaining Estimate: 0h
>
> Currently, we default to us-central1 if --region flag is not set. The Google
> Cloud SDK generally tries to get a default value in this case for
> convenience, which we should follow.
> [https://cloud.google.com/compute/docs/gcloud-compute/#order_of_precedence_for_default_properties]
--
This message was sent by Atlassian Jira
(v8.3.4#803005)