ihji commented on a change in pull request #13605:
URL: https://github.com/apache/beam/pull/13605#discussion_r552292914
##########
File path:
runners/google-cloud-dataflow-java/src/main/java/org/apache/beam/runners/dataflow/DataflowRunner.java
##########
@@ -1186,6 +1190,45 @@ public DataflowPipelineJob run(Pipeline pipeline) {
return dataflowPipelineJob;
}
+ static void configureSdkHarnessContainerImages(
+ DataflowPipelineOptions options,
+ RunnerApi.Pipeline pipelineProto,
+ Job newJob,
+ String workerHarnessContainerImage) {
+ if (hasExperiment(options, "use_runner_v2") || hasExperiment(options,
"use_unified_worker")) {
+ ImmutableSet.Builder<String> sdkContainerUrlSetBuilder =
ImmutableSet.builder();
+ sdkContainerUrlSetBuilder.add(workerHarnessContainerImage);
+ for (Map.Entry<String, RunnerApi.Environment> entry :
+ pipelineProto.getComponents().getEnvironmentsMap().entrySet()) {
+ if
(!BeamUrns.getUrn(RunnerApi.StandardEnvironments.Environments.DOCKER)
+ .equals(entry.getValue().getUrn())) {
+ throw new RuntimeException(
+ "Dataflow can only execute pipeline steps in Docker
environments: "
+ + entry.getValue().getUrn());
+ }
+ RunnerApi.DockerPayload dockerPayload;
+ try {
+ dockerPayload =
RunnerApi.DockerPayload.parseFrom(entry.getValue().getPayload());
+ } catch (InvalidProtocolBufferException e) {
+ throw new RuntimeException("Error parsing docker payload.", e);
+ }
+ sdkContainerUrlSetBuilder.add(dockerPayload.getContainerImage());
Review comment:
We are collecting the urls in an immutable set so there should be only
one entry with the same container url.
----------------------------------------------------------------
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]