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 201E7200D0A for ; Wed, 4 Oct 2017 21:37:29 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 1E6611609DD; Wed, 4 Oct 2017 19:37:29 +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 606401609D6 for ; Wed, 4 Oct 2017 21:37:28 +0200 (CEST) Received: (qmail 96708 invoked by uid 500); 4 Oct 2017 19:37:27 -0000 Mailing-List: contact dev-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 dev@airflow.incubator.apache.org Delivered-To: moderator for dev@airflow.incubator.apache.org Received: (qmail 59564 invoked by uid 99); 4 Oct 2017 12:51:15 -0000 X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: 2.174 X-Spam-Level: ** X-Spam-Status: No, score=2.174 tagged_above=-999 required=6.31 tests=[DKIM_ADSP_CUSTOM_MED=0.001, FROM_MISSPACED=0.001, NML_ADSP_CUSTOM_MED=1.2, SPF_SOFTFAIL=0.972] autolearn=disabled MIME-Version: 1.0 Message-ID: Subject: Re: TriggerDagRunOperator sub tasks are scheduled to run after few hours later References: From: "jspsai@gmail.com" In-Reply-To: Content-Type: text/plain; charset="iso-8859-1" x-ponymail-sender: b58493afe2ab0d043b6191d92bb74cd3f95ab95e Date: Wed, 04 Oct 2017 12:51:11 -0000 x-ponymail-agent: PonyMail Composer/0.2 To: X-Mailer: LuaSocket 3.0-rc1 archived-at: Wed, 04 Oct 2017 19:37:29 -0000 On 2017-10-03 11:20, Justin Palmer wrote: > Hi Sai, > > That operator would be a plugin > , so you'll need > to import it as such using plugins.operators. > > from plugins.operators.execute_dag_run_operator import ExecuteDagRunOperator > > > -Justin > > On Tue, Oct 3, 2017 at 8:13 AM jspsai@gmail.com wrote: > > > > > > > On 2017-10-02 18:38, Justin Palmer wrote: > > > Hi Sai, > > > > > > At GitHub we had a similar issue with TriggerDagRunOperator. In addition > > > to scheduling tasks in the future, we wanted a stable execution date that > > > was based on the triggering DAG. We created a plugin that is basically a > > > copy of TriggerDagRunOperator, except it passes in the `execution_date` > > to > > > the triggered DAG. I've linked the plugin below. Feel free to use it > > > under the MIT license. > > > > > > https://gist.github.com/Caged/f356430518247d1bbc2439a153e3c79e > > > > > > -Justin > > > > > > On Mon, Oct 2, 2017 at 2:02 PM jspsai@gmail.com > > wrote: > > > > > > > Hi experts, > > > > > > > > I am running the TriggerDagRunOperator example that comes with Airflow. > > > > > > > > example_trigger_controller_dag > > > > example_trigger_target_dag > > > > > > > > I've created 2 new dags when are based on the above controller and > > trigger > > > > dags. > > > > > > > > when I run the example_trigger_controller_dag, i see that the > > > > examle_trigger_target_dag is scheduled to run after a few hours later, > > how > > > > to schedule it to run immediately? > > > > here is the logs where the Sub task that is scheduled to run at > > 17:53:31 > > > > and the Base task has ran at 13:53:31. > > > > > > > > [2017-10-02 13:53:31,624] {base_task_runner.py:95} INFO - Subtask: > > > > [2017-10-02 13:53:31,623] {dagrun_operator.py:74} INFO - Creating > > DagRun > > > > > > > trig__2017-10-02T13:53:31.248671, externally triggered: True> > > > > > > > > I might me doing something really stupid here. > > > > please help. > > > > > > > > Thanks > > > > -Sai. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > Justin, > > > > When i try to compile i am getting an import error for the plugin > > This is how i am importing. > > from airflow.operators.execute_dag_run_operator import > > ExecuteDagRunOperator > > > > Below is the error when compiled. > > ImportError: No module named execute_dag_run_operator > > [2017-10-03 11:09:36,242] [22209] {models.py:266} ERROR - Failed to > > import: /home/ec2-user/airflow/dags/Test_Controller_Job.py > > Traceback (most recent call last): > > File "/usr/lib/python2.7/site-packages/airflow/models.py", line 263, in > > process_file > > m = imp.load_source(mod_name, filepath) > > File "/home/ec2-user/airflow/dags/Test_Controller_Job.py", line 43, in > > > > from airflow.operators.execute_dag_run_operator import > > ExecuteDagRunOperator > > > > I am on Airflow 1.8, > > > > Do you have an example implementation for this? > > > > Thanks > > Sai >Thanks Justin!, i'll give it a try