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 D330C2004C8 for ; Mon, 9 May 2016 20:51:16 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id D1C0616099C; Mon, 9 May 2016 18:51:16 +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 2717F1609A8 for ; Mon, 9 May 2016 20:51:16 +0200 (CEST) Received: (qmail 58773 invoked by uid 500); 9 May 2016 18:51:15 -0000 Mailing-List: contact commits-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list commits@airflow.incubator.apache.org Received: (qmail 58764 invoked by uid 99); 9 May 2016 18:51:15 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 18:51:15 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 93DD3C73B6 for ; Mon, 9 May 2016 18:51:14 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -6.099 X-Spam-Level: X-Spam-Status: No, score=-6.099 tagged_above=-999 required=6.31 tests=[KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-2.079] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id 16-3YC3uz65D for ; Mon, 9 May 2016 18:51:13 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with SMTP id B150C5F2C5 for ; Mon, 9 May 2016 18:51:13 +0000 (UTC) Received: (qmail 58301 invoked by uid 99); 9 May 2016 18:51:13 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 09 May 2016 18:51:13 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id DD8222C14F4 for ; Mon, 9 May 2016 18:51:12 +0000 (UTC) Date: Mon, 9 May 2016 18:51:12 +0000 (UTC) From: "Chris Riccomini (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-14) DagRun Refactor (Scheduler 2.0) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Mon, 09 May 2016 18:51:17 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-14?page=3Dcom.atlassian= .jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D1527= 6805#comment-15276805 ]=20 Chris Riccomini commented on AIRFLOW-14: ---------------------------------------- Yea, I agree with this. I guess the two things that I'm worried about are: # Will this mean we can't safely run more than one LocalExecutor? # Will this break the CeleryExecutor? > DagRun Refactor (Scheduler 2.0) > ------------------------------- > > Key: AIRFLOW-14 > URL: https://issues.apache.org/jira/browse/AIRFLOW-14 > Project: Apache Airflow > Issue Type: Improvement > Components: scheduler > Reporter: Jeremiah Lowin > Assignee: Jeremiah Lowin > Labels: backfill, dagrun, scheduler > > For full proposal, please see the Wiki: https://cwiki.apache.org/confluen= ce/pages/viewpage.action?pageId=3D62694286 > Borrowing from that page:=20 > *Description of New Workflow* > DagRuns represent the state of a DAG at a certain point in time (perhaps = they should be called DagInstances?). To run a DAG =E2=80=93 or to manage t= he execution of a DAG =E2=80=93 a DagRun must first be created. This can be= done manually (simply by creating a DagRun object) or automatically, using= methods like dag.schedule_dag(). Therefore, both scheduling new runs OR in= troducing ad-hoc runs can be done by any process at any time, simply by cre= ating the appropriate object. > Just creating a DagRun is not enough to actually run the DAG (just as cre= ating a TaskInstance is not the same as actually running a task). We need a= Job for that. The DagRunJob is fairly simple in structure. It maintains a = set of DagRuns that it is tasked with executing, and loops over that set un= til all the DagRuns either succeed or fail. New DagRuns can be passed to th= e job explicitly via DagRunJob.submit_dagruns() or by defining its DagRunJo= b.collect_dagruns() method, which is called during each loop. When the DagR= unJob is executing a specific DagRun, it locks it. Other DagRunJobs will no= t try to execute locked DagRuns. This way, many DagRunJobs can run simultan= eously in either a local or distributed setting, and can even be pointed at= the same DagRuns, without worrying about collisions or interference. > The basic DagRunJob loop works like this: > - refresh dags > - collect new dagruns > - process dagruns (including updating dagrun states for success/failure) > - call executor/own heartbeat > By tweaking the DagRunJob, we can easily recreate the behavior of the cur= rent SchedulerJob and BackfillJob. The Scheduler simply runs forever and pi= cks up ALL active DagRuns in collect_dagruns(); Backfill generates DagRuns = corresponding to the requested start/end dates and submits them to itself p= rior to initiating its loop. -- This message was sent by Atlassian JIRA (v6.3.4#6332)