beam-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (BEAM-2885) Support job+artifact APIs locally
Date Tue, 28 Nov 2017 19:27:00 GMT

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

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

lukecwik commented on a change in pull request #4150: [BEAM-2885] Maintain In-flight preparation
requests
URL: https://github.com/apache/beam/pull/4150#discussion_r153596485
 
 

 ##########
 File path: runners/reference/job-server/src/test/java/org/apache/beam/runners/reference/job/ReferenceRunnerJobServiceTest.java
 ##########
 @@ -27,8 +47,54 @@
  */
 @RunWith(JUnit4.class)
 public class ReferenceRunnerJobServiceTest {
+  @Rule public TemporaryFolder temp = new TemporaryFolder();
+
+  private InProcessServerFactory serverFactory = InProcessServerFactory.create();
+  private ReferenceRunnerJobService service;
+  private GrpcFnServer<ReferenceRunnerJobService> server;
+  private JobServiceBlockingStub stub;
+
+  @Before
+  public void setup() throws Exception {
+    service = ReferenceRunnerJobService.create(serverFactory);
+    server = GrpcFnServer.allocatePortAndCreateFor(service, serverFactory);
+    stub =
+        JobServiceGrpc.newBlockingStub(
+            InProcessChannelBuilder.forName(server.getApiServiceDescriptor().getUrl()).build());
+  }
+
+  @After
+  public void teardown() throws Exception {
+    server.close();
+  }
+
   @Test
-  public void testPrepareJob() {
-    // TODO: Implement when PrepareJob is implemented.
+  public void testPrepareJob() throws Exception {
+    PrepareJobResponse response =
+        stub.prepare(
+            PrepareJobRequest.newBuilder()
+                .setPipelineOptions(Struct.getDefaultInstance())
+                .setPipeline(Pipeline.getDefaultInstance())
+                .setJobName("myJobName")
+                .build());
+
+    ApiServiceDescriptor stagingEndpoint = response.getArtifactStagingEndpoint();
+    ArtifactServiceStager stager =
+        ArtifactServiceStager.overChannel(
+            InProcessChannelBuilder.forName(stagingEndpoint.getUrl()).build());
+    File foo = writeTempFile("foo", "foo, bar, baz".getBytes());
+    File bar = writeTempFile("spam", "spam, ham, eggs".getBytes());
+    stager.stage(ImmutableList.<File>of(foo, bar));
+    // TODO: 'run' the job with some sort of noop backend, to verify state is cleaned up.
+    // TODO: Verify that the artifacts have been staged
 
 Review comment:
   Filling in this TODO about verifying the staged artifacts should be a high priority followup
PR before you move onto something else.

----------------------------------------------------------------
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


> Support job+artifact APIs locally
> ---------------------------------
>
>                 Key: BEAM-2885
>                 URL: https://issues.apache.org/jira/browse/BEAM-2885
>             Project: Beam
>          Issue Type: Sub-task
>          Components: runner-dataflow
>            Reporter: Henning Rohde
>            Assignee: Thomas Groh
>              Labels: portability
>
> As per https://s.apache.org/beam-job-api, use local support for submission-side. 



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message