You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@beam.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/24 00:32:00 UTC

[jira] [Commented] (BEAM-2524) Update Google Cloud Console URL returned by DataflowRunner to support regions.

    [ https://issues.apache.org/jira/browse/BEAM-2524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16336632#comment-16336632 ] 

ASF GitHub Bot commented on BEAM-2524:
--------------------------------------

lostluck closed pull request #4144: [BEAM-2524] Update the gcloud cancel command to include the --region flag.
URL: https://github.com/apache/beam/pull/4144
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java
index cf464066c12..3388c52dfa2 100644
--- a/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java
+++ b/runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/util/MonitoringUtil.java
@@ -214,8 +214,8 @@ public static String getGcloudCancelCommand(DataflowPipelineOptions options, Str
     }
 
     // Assemble cancel command from optional prefix and project/job parameters.
-    return String.format("%s%s jobs --project=%s cancel %s",
-        dataflowApiOverridePrefix, GCLOUD_DATAFLOW_PREFIX, options.getProject(), jobId);
+    return String.format("%s%s jobs --project=%s cancel %s --region=%s",
+        dataflowApiOverridePrefix, GCLOUD_DATAFLOW_PREFIX, options.getProject(), jobId, options.getRegion());
   }
 
   public static State toState(String stateName) {
diff --git a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/util/MonitoringUtilTest.java b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/util/MonitoringUtilTest.java
index 499198221a7..1996e6bd5a5 100644
--- a/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/util/MonitoringUtilTest.java
+++ b/runners/google-cloud-dataflow-java/src/test/java/org/apache/beam/runners/dataflow/util/MonitoringUtilTest.java
@@ -49,6 +49,7 @@
 @RunWith(JUnit4.class)
 public class MonitoringUtilTest {
   private static final String PROJECT_ID = "someProject";
+  private static final String REGION_ID = "thatRegion";
   private static final String JOB_ID = "1234";
 
   @Rule public ExpectedLogs expectedLogs = ExpectedLogs.none(LoggingHandler.class);
@@ -119,9 +120,10 @@ public void testDontOverrideEndpointWithDefaultApi() {
     DataflowPipelineOptions options =
         PipelineOptionsFactory.create().as(DataflowPipelineOptions.class);
     options.setProject(PROJECT_ID);
+    options.setRegion(REGION_ID);
     options.setGcpCredential(new TestCredential());
     String cancelCommand = MonitoringUtil.getGcloudCancelCommand(options, JOB_ID);
-    assertEquals("gcloud dataflow jobs --project=someProject cancel 1234", cancelCommand);
+    assertEquals("gcloud dataflow jobs --project=someProject cancel 1234 --region=thatRegion", cancelCommand);
   }
 
   @Test
@@ -129,13 +131,14 @@ public void testOverridesEndpointWithStagedDataflowEndpoint() {
     DataflowPipelineOptions options =
         PipelineOptionsFactory.create().as(DataflowPipelineOptions.class);
     options.setProject(PROJECT_ID);
+    options.setRegion(REGION_ID);
     options.setGcpCredential(new TestCredential());
     String stagingDataflowEndpoint = "v0neverExisted";
     options.setDataflowEndpoint(stagingDataflowEndpoint);
     String cancelCommand = MonitoringUtil.getGcloudCancelCommand(options, JOB_ID);
     assertEquals(
         "CLOUDSDK_API_ENDPOINT_OVERRIDES_DATAFLOW=https://dataflow.googleapis.com/v0neverExisted/ "
-        + "gcloud dataflow jobs --project=someProject cancel 1234",
+        + "gcloud dataflow jobs --project=someProject cancel 1234 --region=thatRegion",
         cancelCommand);
   }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Update Google Cloud Console URL returned by DataflowRunner to support regions.
> ------------------------------------------------------------------------------
>
>                 Key: BEAM-2524
>                 URL: https://issues.apache.org/jira/browse/BEAM-2524
>             Project: Beam
>          Issue Type: Improvement
>          Components: runner-dataflow
>            Reporter: Robert Burke
>            Assignee: Robert Burke
>            Priority: Major
>             Fix For: 2.2.0
>
>   Original Estimate: 24h
>  Remaining Estimate: 24h
>
> Both the Java and Python Dataflow Runners need to be updated with a regionalized form of the Google Cloud Console URL to support multiple Dataflow Regions.
> The new URL format will be:
> https://console.cloud.corp.google.com/dataflow/jobsDetail/locations/<regionId>/jobs/<jobId>?project=<projectId>



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)