[
https://issues.apache.org/jira/browse/BEAM-4780?focusedWorklogId=145765&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-145765
]
ASF GitHub Bot logged work on BEAM-4780:
----------------------------------------
Author: ASF GitHub Bot
Created on: 19/Sep/18 18:46
Start Date: 19/Sep/18 18:46
Worklog Time Spent: 10m
Work Description: lukecwik closed pull request #6151: [BEAM-4780]
Updating to DockerJobBundleFactory in ReferenceRunner.
URL: https://github.com/apache/beam/pull/6151
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/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
index 079c0d94fa4..ab62c653873 100644
---
a/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
+++
b/runners/direct-java/src/main/java/org/apache/beam/runners/direct/portable/ReferenceRunner.java
@@ -69,6 +69,7 @@
import org.apache.beam.runners.fnexecution.ServerFactory;
import org.apache.beam.runners.fnexecution.artifact.ArtifactRetrievalService;
import org.apache.beam.runners.fnexecution.control.ControlClientPool;
+import org.apache.beam.runners.fnexecution.control.DockerJobBundleFactory;
import
org.apache.beam.runners.fnexecution.control.FnApiControlClientPoolService;
import org.apache.beam.runners.fnexecution.control.JobBundleFactory;
import org.apache.beam.runners.fnexecution.control.MapControlClientPool;
@@ -79,6 +80,7 @@
import
org.apache.beam.runners.fnexecution.environment.InProcessEnvironmentFactory;
import org.apache.beam.runners.fnexecution.logging.GrpcLoggingService;
import org.apache.beam.runners.fnexecution.logging.Slf4jLogWriter;
+import org.apache.beam.runners.fnexecution.provisioning.JobInfo;
import
org.apache.beam.runners.fnexecution.provisioning.StaticGrpcProvisionService;
import org.apache.beam.runners.fnexecution.state.GrpcStateService;
import org.apache.beam.runners.fnexecution.wire.LengthPrefixUnknownCoders;
@@ -160,6 +162,7 @@ public void execute() throws Exception {
ServerFactory serverFactory = createServerFactory();
ControlClientPool controlClientPool = MapControlClientPool.create();
ExecutorService dataExecutor = Executors.newCachedThreadPool();
+ // TODO(BEAM-5095): Fill out ProvisionInfo/JobInfo properly, without
placeholder values.
ProvisionInfo provisionInfo =
ProvisionInfo.newBuilder()
.setJobId("id")
@@ -168,6 +171,7 @@ public void execute() throws Exception {
.setWorkerId("foo")
.setResourceLimits(Resources.getDefaultInstance())
.build();
+ JobInfo jobInfo = JobInfo.create("id", "reference", "retrieval-token",
options);
try (GrpcFnServer<GrpcLoggingService> logging =
GrpcFnServer.allocatePortAndCreateFor(
GrpcLoggingService.forWriter(Slf4jLogWriter.getDefault()),
serverFactory);
@@ -198,7 +202,7 @@ public void execute() throws Exception {
createEnvironmentFactory(
control, logging, artifact, provisioning,
controlClientPool.getSource());
JobBundleFactory jobBundleFactory =
- SingleEnvironmentInstanceJobBundleFactory.create(environmentFactory,
data, state);
+ createJobBundleFactory(jobInfo, environmentFactory, data, state);
TransformEvaluatorRegistry transformRegistry =
TransformEvaluatorRegistry.portableRegistry(
@@ -253,6 +257,23 @@ private EnvironmentFactory createEnvironmentFactory(
}
}
+ private JobBundleFactory createJobBundleFactory(
+ JobInfo jobInfo,
+ EnvironmentFactory environmentFactory,
+ GrpcFnServer<GrpcDataService> data,
+ GrpcFnServer<GrpcStateService> state)
+ throws Exception {
+ switch (environmentType) {
+ case DOCKER:
+ return DockerJobBundleFactory.create(jobInfo);
+ case IN_PROCESS:
+ return
SingleEnvironmentInstanceJobBundleFactory.create(environmentFactory, data,
state);
+ default:
+ throw new IllegalArgumentException(
+ String.format("Unknown %s %s",
EnvironmentType.class.getSimpleName(), environmentType));
+ }
+ }
+
@VisibleForTesting
static class PortableGroupByKeyReplacer implements TransformReplacement {
@Override
----------------------------------------------------------------
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:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 145765)
Time Spent: 1h 50m (was: 1h 40m)
> Entry point for ULR JobService compatible with TestPortableRunner
> -----------------------------------------------------------------
>
> Key: BEAM-4780
> URL: https://issues.apache.org/jira/browse/BEAM-4780
> Project: Beam
> Issue Type: Bug
> Components: runner-direct
> Reporter: Eugene Kirpichov
> Assignee: Daniel Oliveira
> Priority: Major
> Time Spent: 1h 50m
> Remaining Estimate: 0h
>
> [https://github.com/apache/beam/pull/5935] introduces a TestPortableRunner
> that can run ValidatesRunner tests against a given portable runner,
> identified by a class name of a shim that can start/stop its JobService
> endpoint.
> For ULR to run VR tests, it needs to provide such a shim.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)