You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@beam.apache.org by GitBox <gi...@apache.org> on 2021/04/21 22:22:48 UTC

[GitHub] [beam] tysonjh commented on a change in pull request #14575: Adds --sdkContainerImage as new Java Dataflow PipelineOption

tysonjh commented on a change in pull request #14575:
URL: https://github.com/apache/beam/pull/14575#discussion_r617930683



##########
File path: runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
##########
@@ -401,8 +402,34 @@ static boolean isServiceEndpoint(String endpoint) {
     return Strings.isNullOrEmpty(endpoint) || Pattern.matches(ENDPOINT_REGEXP, endpoint);
   }
 
+  static void validateSdkContainerImageOptions(DataflowPipelineWorkerPoolOptions workerOptions) {
+    // Check against null - empty string value for workerHarnessContainerImage
+    // must be preserved for legacy dataflowWorkerJar to work.
+    Preconditions.checkArgument(
+        workerOptions.getWorkerHarnessContainerImage() == null
+            || workerOptions.getSdkContainerImage() == null
+            || workerOptions
+                .getWorkerHarnessContainerImage()
+                .equals(workerOptions.getSdkContainerImage()),
+        "Cannot use legacy option workerHarnessContainerImage with sdkContainerImage. Prefer sdkContainerImage.");
+
+    // Make sure the values are the same for legacy flag and current flag.
+    if (workerOptions.getSdkContainerImage() != null) {
+      workerOptions.setWorkerHarnessContainerImage(workerOptions.getSdkContainerImage());
+    } else if (workerOptions.getWorkerHarnessContainerImage() != null) {
+      LOG.warn(
+          "Prefer --sdkContainerImage over deprecated legacy option --workerHarnessContainerImage.");
+      workerOptions.setSdkContainerImage(workerOptions.getWorkerHarnessContainerImage());
+    }
+  }

Review comment:
       Is it possible that both sdkContainerImage and workerHarnessContainerImage are null?




-- 
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:
users@infra.apache.org