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] [Work logged] (BEAM-4130) Portable Flink runner JobService entry point in a Docker container
Date Wed, 13 Jun 2018 22:26:01 GMT

     [ https://issues.apache.org/jira/browse/BEAM-4130?focusedWorklogId=111708&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-111708
]

ASF GitHub Bot logged work on BEAM-4130:
----------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jun/18 22:25
            Start Date: 13/Jun/18 22:25
    Worklog Time Spent: 10m 
      Work Description: angoenka commented on a change in pull request #5493: [BEAM-4130]
Add job submission capabilities to Flink runner.
URL: https://github.com/apache/beam/pull/5493#discussion_r195214125
 
 

 ##########
 File path: runners/flink/src/main/java/org/apache/beam/runners/flink/FlinkJobInvoker.java
 ##########
 @@ -0,0 +1,74 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package org.apache.beam.runners.flink;
+
+import com.google.common.util.concurrent.ListeningExecutorService;
+import com.google.protobuf.Struct;
+import java.io.IOException;
+import java.util.UUID;
+import javax.annotation.Nullable;
+import org.apache.beam.model.pipeline.v1.RunnerApi;
+import org.apache.beam.runners.core.construction.PipelineOptionsTranslation;
+import org.apache.beam.runners.fnexecution.jobsubmission.JobInvocation;
+import org.apache.beam.runners.fnexecution.jobsubmission.JobInvoker;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Job Invoker for the {@link FlinkRunner}.
+ */
+public class FlinkJobInvoker implements JobInvoker {
+  private static final Logger LOG = LoggerFactory.getLogger(FlinkJobInvoker.class);
+
+  public static FlinkJobInvoker create(ListeningExecutorService executorService) {
+    return new FlinkJobInvoker(executorService);
+  }
+
+  private final ListeningExecutorService executorService;
+
+  private FlinkJobInvoker(ListeningExecutorService executorService) {
+    this.executorService = executorService;
+  }
+
+  @Override
+  public JobInvocation invoke(
+      RunnerApi.Pipeline pipeline, Struct options, @Nullable String artifactToken)
+      throws IOException {
+    // TODO: How to make Java/Python agree on names of keys and their values?
+    LOG.trace("Parsing pipeline options");
+    FlinkPipelineOptions flinkOptions = PipelineOptionsTranslation.fromProto(options)
+        .as(FlinkPipelineOptions.class);
+
+    String invocationId = String.format(
+        "%s_%s", flinkOptions.getJobName(), UUID.randomUUID().toString());
+    LOG.debug("Invoking job {}", invocationId);
+
+    // Set Flink Master to [auto] if no option was specified.
+    if (flinkOptions.getFlinkMaster() == null) {
+      flinkOptions.setFlinkMaster("[auto]");
+    }
+
+    flinkOptions.setRunner(null);
 
 Review comment:
   Document why do we need to set runner as null.

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


Issue Time Tracking
-------------------

    Worklog Id:     (was: 111708)

> Portable Flink runner JobService entry point in a Docker container
> ------------------------------------------------------------------
>
>                 Key: BEAM-4130
>                 URL: https://issues.apache.org/jira/browse/BEAM-4130
>             Project: Beam
>          Issue Type: New Feature
>          Components: runner-flink
>            Reporter: Ben Sidhom
>            Priority: Minor
>          Time Spent: 2h 40m
>  Remaining Estimate: 0h
>
> The portable Flink runner exists as a Job Service that runs somewhere. We need a main
entry point that itself spins up the job service (and artifact staging service). The main
program itself should be packaged into an uberjar such that it can be run locally or submitted
to a Flink deployment via `flink run`.



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

Mime
View raw message