Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 128E9200C5B for ; Thu, 27 Apr 2017 15:09:53 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 11295160BA7; Thu, 27 Apr 2017 13:09:53 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0AAC9160B98 for ; Thu, 27 Apr 2017 15:09:51 +0200 (CEST) Received: (qmail 56819 invoked by uid 500); 27 Apr 2017 13:09:51 -0000 Mailing-List: contact dev-help@samza.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@samza.apache.org Delivered-To: mailing list dev@samza.apache.org Received: (qmail 56806 invoked by uid 99); 27 Apr 2017 13:09:50 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 27 Apr 2017 13:09:50 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 7EF8E1B0DBC for ; Thu, 27 Apr 2017 13:09:50 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -0.422 X-Spam-Level: X-Spam-Status: No, score=-0.422 tagged_above=-999 required=6.31 tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, HTML_MESSAGE=2, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H4=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=disabled Authentication-Results: spamd2-us-west.apache.org (amavisd-new); dkim=pass (1024-bit key) header.d=linkedin.com header.b=UPkVR5Hc; dkim=pass (1024-bit key) header.d=linkedin.com header.b=EKrASWhk Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id 6Dt0Xm7nXHOu for ; Thu, 27 Apr 2017 13:09:46 +0000 (UTC) Received: from mail322.linkedin.com (mail322.linkedin.com [108.174.3.122]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTPS id 992885F4EE for ; Thu, 27 Apr 2017 13:09:45 +0000 (UTC) Authentication-Results: mail322.prod.linkedin.com x-tls.subject="/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com"; auth=pass (cipher=ECDHE-RSA-AES128-GCM-SHA256) Authentication-Results: mail322.prod.linkedin.com; iprev=pass policy.iprev="2a00:1450:400c:c09::246"; spf=softfail smtp.mailfrom="cpettitt@linkedin.com" smtp.helo="mail-wm0-x246.google.com"; dkim=pass header.d=linkedin.com; tls=pass (verified) key.ciphersuite="TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256" key.length="128" tls.v="tlsv1.2" cert.client="C=US,ST=California,L=Mountain View,O=Google Inc,CN=smtp.gmail.com" cert.clientissuer="C=US,O=Google Inc,CN=Google Internet Authority G2" Received: from [2a00:1450:400c:c09::246] ([2a00:1450:400c:c09::246.46759] helo=mail-wm0-x246.google.com) by mail322.prod.linkedin.com (envelope-from ) (ecelerity 3.6.21.53563 r(Core:3.6.21.0)) with ESMTPS (cipher=ECDHE-RSA-AES128-GCM-SHA256 subject="/C=US/ST=California/L=Mountain View/O=Google Inc/CN=smtp.gmail.com") id AD/12-02948-69DE1095; Thu, 27 Apr 2017 13:09:43 +0000 Received: by mail-wm0-x246.google.com with SMTP id u5so1240800wmg.13 for ; Thu, 27 Apr 2017 06:09:42 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to; bh=bfI50HrmVS88w/x4u/f2slPEWaSbv6iToTjBwMi5FaM=; b=QnG4gIWRN0c2m7ilezdfLjmnMJRMpD1wp0m3/J59E6YjAwF+R1VHqkI8/G2w2ygpZs M+D2+whyVdHzvePvKbXAeAyZJe2yjWrQYP/m5aPY7FkV9CCDouQEIVL9ilp7Va+zdVgB 8/oCj4L6wZfxxNE7fXE/vSu14AKmE+9CM7xSDULQ2+kKj3R6BAa7bxMq8K0E4QQhbnd5 TLVRrDo4H78LAHfTFMXcNjgvrvy+2v1VbAnvhBu4cWeEOKTYY1xYtOjCnL9ZpHTafgcX DBJP33Hm5uZk0W+diVDTBsFnE/idTE2vPaOmOGwMG8Clv7xbL6I9o3vczRbAV8MOjden KznQ== X-Gm-Message-State: AN3rC/66HB/4U8lkL95HkoPCNoYwTYiETRIyx4Jj3r6OZI/ad0nmL/bN yiwr18CSz+oV5UDmD/opKXI2aXYN3yEL5zYTxUOXn7erMrs0dz45MN07cR/6MrrWo4PIGnD/IEC d5ba5XBFVoum1ZQsOShaHXvWTTfALz75U X-Received: by 10.28.141.65 with SMTP id p62mr2194564wmd.122.1493298580670; Thu, 27 Apr 2017 06:09:40 -0700 (PDT) X-Received: by 10.28.141.65 with SMTP id p62mr2194553wmd.122.1493298580394; Thu, 27 Apr 2017 06:09:40 -0700 (PDT) MIME-Version: 1.0 Received: by 10.223.143.105 with HTTP; Thu, 27 Apr 2017 06:09:39 -0700 (PDT) In-Reply-To: References: From: Chris Pettitt Date: Thu, 27 Apr 2017 09:09:39 -0400 Message-ID: Subject: Re: [DISCUSS] SEP-2: ApplicationRunner Design To: dev@samza.apache.org Content-Type: multipart/alternative; boundary=001a114703d66dd156054e25ab2f archived-at: Thu, 27 Apr 2017 13:09:53 -0000 --001a114703d66dd156054e25ab2f Content-Type: text/plain; charset=UTF-8 That should have been: For #1, Beam doesn't have a hard requirement... On Thu, Apr 27, 2017 at 9:07 AM, Chris Pettitt wrote: > For #1, I doesn't have a hard requirement for any change from Samza. A > very nice to have would be to allow the input systems to be set up at the > same time as the rest of the StreamGraph. An even nicer to have would be to > do away with the callback based approach and treat graph building as a > library, a la Beam and Flink. > > For the moment I've worked around the two pass requirement (once for > config, once for StreamGraph) by introducing an IR layer between Beam and > the Samza Fluent translation. The IR layer is convenient independent of > this problem because it makes it easier to switch between the Fluent and > low-level APIs. > > > For #4, if we had parity with StreamProcessor for lifecycle we'd be in > great shape. One additional issue with the status call that I may not have > mentioned is that it provides you no way to get at the cause of failure. > The StreamProcessor API does allow this via the callback. > > > Re. #2 and #3, I'm a big fan of getting rid of the extra configuration > indirection you currently have to jump through (this is also related to > system consumer configuration from #1. It makes it much easier to discover > what the configurable parameters are too, if we provide some programmatic > way to tweak them in the API - which can turn into config under the hood. > > On Wed, Apr 26, 2017 at 9:20 PM, xinyu liu wrote: > >> Let me give a shot to summarize the requirements for ApplicationRunner we >> have discussed so far: >> >> - Support environment for passing in user-defined objects (streams >> potentially) into ApplicationRunner (*Beam*) >> >> - Improve ease of use for ApplicationRunner to avoid complex >> configurations >> such as zkCoordinator, zkCoordinationService. (*Standalone*) >> >> - Clean up ApplicationRunner into a single interface (*Fluent*). We can >> have one or more implementations but it's hidden from the users. >> >> - Separate StreamGraph from environment so it can be serializable (*Beam, >> Yarn*) >> >> - Better life cycle management of application, including >> start/stop/stats (*Standalone, >> Beam*) >> >> >> One way to address 2 and 3 is to provide pre-packaged runner using static >> factory methods, and the return type will be the ApplicationRunner >> interface. So we can have: >> >> ApplicationRunner runner = ApplicationRunner.zk() / >> ApplicationRunner.local() >> / ApplicationRunner.remote() / ApplicationRunner.test(). >> >> Internally we will package the right configs and run-time environment with >> the runner. For example, ApplicationRunner.zk() will define all the >> configs >> needed for zk coordination. >> >> To support 1 and 4, can we pass in a lambda function in the runner, and >> then we can run the stream graph? Like the following: >> >> ApplicationRunner.zk().env(config -> environment).run(streamGraph); >> >> Then we need a way to pass the environment into the StreamGraph. This can >> be done by either adding an extra parameter to each operator, or have a >> getEnv() function in the MessageStream, which seems to be pretty hacky. >> >> What do you think? >> >> Thanks, >> Xinyu >> >> >> >> >> >> On Sun, Apr 23, 2017 at 11:01 PM, Prateek Maheshwari < >> pmaheshwari@linkedin.com.invalid> wrote: >> >> > Thanks for putting this together Yi! >> > >> > I agree with Jake, it does seem like there are a few too many moving >> parts >> > here. That said, the problem being solved is pretty broad, so let me >> try to >> > summarize my current understanding of the requirements. Please correct >> me >> > if I'm wrong or missing something. >> > >> > ApplicationRunner and JobRunner first, ignoring test environment for the >> > moment. >> > ApplicationRunner: >> > 1. Create execution plan: Same in Standalone and Yarn >> > 2. Create intermediate streams: Same logic but different leader election >> > (ZK-based or pre-configured in standalone, AM in Yarn). >> > 3. Run jobs: In JVM in standalone. Submit to the cluster in Yarn. >> > >> > JobRunner: >> > 1. Run the StreamProcessors: Same process in Standalone & Test. Remote >> host >> > in Yarn. >> > >> > To get a single ApplicationRunner implementation, like Jake suggested, >> we >> > need to make leader election and JobRunner implementation pluggable. >> > There's still the question of whether ApplicationRunner#run API should >> be >> > blocking or non-blocking. It has to be non-blocking in YARN. We want it >> to >> > be blocking in standalone, but seems like the main reason is ease of use >> > when launched from main(). I'd prefer making it consitently non-blocking >> > instead, esp. since in embedded standalone mode (where the processor is >> > running in another container) a blocking API would not be user-friendly >> > either. If not, we can add both run and runBlocking. >> > >> > Coming to RuntimeEnvironment, which is the least clear to me so far: >> > 1. I don't think RuntimeEnvironment should be responsible for providing >> > StreamSpecs for streamIds - they can be obtained with a config/util >> class. >> > The StreamProcessor should only know about logical streamIds and the >> > streamId <-> actual stream mapping should happen within the >> > SystemProducer/Consumer/Admins provided by the RuntimeEnvironment. >> > 2. There's also other components that the user might be interested in >> > providing implementations of in embedded Standalone mode (i.e., not >> just in >> > tests) - MetricsRegistry and JMXServer come to mind. >> > 3. Most importantly, it's not clear to me who creates and manages the >> > RuntimeEnvironment. It seems like it should be the ApplicationRunner or >> the >> > user because of (2) above and because StreamManager also needs access to >> > SystemAdmins for creating intermediate streams which users might want to >> > mock. But it also needs to be passed down to the StreamProcessor - how >> > would this work on Yarn? >> > >> > I think we should figure out how to integrate RuntimeEnvironment with >> > ApplicationRunner before we can make a call on one vs. multiple >> > ApplicationRunner implementations. If we do keep LocalApplicationRunner >> and >> > RemoteApplication (and TestApplicationRunner) separate, agree with Jake >> > that we should remove the JobRunners and roll them up into the >> respective >> > ApplicationRunners. >> > >> > - Prateek >> > >> > On Thu, Apr 20, 2017 at 10:06 AM, Jacob Maes >> wrote: >> > >> > > Thanks for the SEP! >> > > >> > > +1 on introducing these new components >> > > -1 on the current definition of their roles (see Design feedback >> below) >> > > >> > > *Design* >> > > >> > > - If LocalJobRunner and RemoteJobRunner handle the different >> methods >> > of >> > > launching a Job, what additional value do the different types of >> > > ApplicationRunner and RuntimeEnvironment provide? It seems like a >> red >> > > flag >> > > that all 3 would need to change from environment to environment. It >> > > indicates that they don't have proper modularity. The >> > > call-sequence-figures >> > > support this; LocalApplicationRunner and RemoteApplicationRunner >> make >> > > the >> > > same calls and the diagram only varies after jobRunner.start() >> > > - As far as I can tell, the only difference between Local and >> Remote >> > > ApplicationRunner is that one is blocking and the other is >> > > non-blocking. If >> > > that's all they're for then either the names should be changed to >> > > reflect >> > > this, or they should be combined into one ApplicationRunner and >> just >> > > expose >> > > separate methods for run() and runBlocking() >> > > - There isn't much detail on why the main() methods for >> Local/Remote >> > > have such different implementations, how they receive the >> Application >> > > (direct vs config), and concretely how the deployment scripts, if >> any, >> > > should interact with them. >> > > >> > > >> > > *Style* >> > > >> > > - nit: None of the 11 uses of the word "actual" in the doc are >> > > *actually* >> > > needed. :-) >> > > - nit: Colors of the runtime blocks in the diagrams are >> unconventional >> > > and a little distracting. Reminds me of nai won bao. Now I'm >> hungry. >> > :-) >> > > - Prefer the name "ExecutionEnvironment" over "RuntimeEnvironment". >> > The >> > > term "execution environment" is used >> > > - The code comparisons for the ApplicationRunners are not >> > apples-apples. >> > > The local runner example is an application that USES the local >> runner. >> > > The >> > > remote runner example is the just the runner code itself. So, it's >> not >> > > readily apparent that we're comparing the main() methods and not >> the >> > > application itself. >> > > >> > > >> > > On Mon, Apr 17, 2017 at 5:02 PM, Yi Pan wrote: >> > > >> > > > Made some updates to clarify the role and functions of >> > RuntimeEnvironment >> > > > in SEP-2. >> > > > >> > > > On Fri, Apr 14, 2017 at 9:30 AM, Yi Pan >> wrote: >> > > > >> > > > > Hi, everyone, >> > > > > >> > > > > In light of new features such as fluent API and standalone that >> > > introduce >> > > > > new deployment / application launch models in Samza, I created a >> new >> > > > SEP-2 >> > > > > to address the new use cases. SEP-2 link: https://cwiki.apache. >> > > > > org/confluence/display/SAMZA/SEP-2%3A+ApplicationRunner+Design >> > > > > >> > > > > Please take a look and give feedbacks! >> > > > > >> > > > > Thanks! >> > > > > >> > > > > -Yi >> > > > > >> > > > >> > > >> > >> > > --001a114703d66dd156054e25ab2f--