Re: Using Airflow with dataset dependant flows (not date)
Thanks for your answer, I have been able to try your suggested solution,
and as expected it works fine. However I have found that because the
parametrization always comes with an execution_date, it can be misleading
to users to have all runs still depending on that parameter. I could
generate a cli on top of airflow that would hide the fact that we are
circumventing the usecase through that wildcard parameter, however the
maintenance of such tool, in addition that it would be "our" way of doing
things, could actually cause more harm than actually using other system in
After diving into the code for a few days, and reading your suggestions
today, I agree that new web views would be required for this kind of runs,
however I still think the parametrization would still need to be more
controlled (as in part of the system) to feel comfortable with the
stability of the solution. I also agree with you that we would need to have
a new kind of schedulers too, such as Kafka messages based or database
changes tracking ones.
You mention that a lot would have to be changed for that. What steps do you
think we could do to decompose the problem in smaller and more affordable
On Mon, May 28, 2018 at 10:28 AM Daniel (Daniel Lamblin) [BDP - Seoul] <
> This seemed like a very clear explanation of the JIRA ticket and the idea
> of making dagruns depend not on a schedule but the arrival of a dataset.
> I think a lot would have to change if the execution date was changed to a
> parameterized value, and that's not the only thing that would have to
> change to support a dataset trigger.
> Thinking about the video encoding example, it seem the airflow way to kind
> of do that would be to have dataset dags be dependent on a dag that is
> frequently scheduled to run just a TriggerDagOperator which contains a
> python callable polling for the new datasets (or subscribing to a queue of
> updates about them) which then decides which DAG ID to trigger for the
> particular dataset, and what dag_run_obj.payload should be to inform it of
> the right dataset to run on.
> You might want to write a plugin that give a different kind of tree view
> for these types of DAGs that get triggered this way so that you can easily
> see the dataset and payload specifics in the overview of the runs.
> There's an example of triggering a dag with an assigned payload:
> And an example of the triggered dag using the payload:
> The latter part works the same way as when a cli triggered dag accepts a
> conf object.
> The experimental API also contains a way of triggering with a conf object:
> So if you wanted to skip the high-frequency trigger controller dag, and
> used a kind of queue, like an SQS queue to which you could subscribe a
> https trigger or something, then the queue system could trigger a target
> dag through the API.
> Does this help you in more concretely using Airflow for your needs or are
> you looking to fill in a feature for some part of the roadmap that doesn't
> yet exist?
> On 5/18/18, 4:52 PM, "Javier Domingo Cansino" <javierdo1@xxxxxxxxx>
> Hello Guys,
> First of all, I have submitted the idea to JIRA, and after speaking
> the guys at gitter,
> they told me to bring the discussion here too.
> Right now Airflow only understands of being a date based scheduler. It
> extremely complete on
> that sense, and makes it really easy to populate and backfill your
> Monitoring is quite
> decent, and can be improved through plugins. Everything is code, as
> to most of the
> alternatives out there, and you may or not depend on files
> existing to go to the next
> step. There is an UI that lets you visualize the status of your
> systems and
> trigger manually
> There is a limitation however on running on dates only, and is that
> sometimes there are DAGs
> that will not depend on the date, but on the dataset. Some examples I
> close to:
> * Bioinf pipeline, where you process samples
> * Media pipeline, where you may process different videos/audios in
> same way
> Right now I am using Snakemake for the first ones, and bash scripts
> for the
> second one, however
> I have thought that maybe Airflow could be a solution to these two
> I have been reading the code, and although the term execution_date is
> coupled, it seems
> like it could be doable to abstract the datatype of this
> variable (datetime) and
> extend it to be something that could depend on something else (string).
> After all, for what I have seen execution_date is just the
> Questions I would like to ask:
> * Is this some need you have had? If so, how did you solve it? Is
> any other tool with the
> features I described that could help me on that?
> * How do you recommend solving this with Airflow?
> * In gitter people has proposed forgetting about execution_dates,
> triggering the DAGs
> and parametrizing the run through variables. However this has the
> drawback to lose execution
> tracking, and make impossible to run several DAGs at the same
> for different datasets
> * There was also the proposal to instantiate subDAGs per dataset,
> have one DAG where the
> first step is to read what are the samples to run on. The
> problem I
> see with this is that
> you lose tracking on which samples have been run, and you cannot
> per sample historic
> * Airflow works good when you have datasets that change, therefore,
> other solution would be
> to instantiate one DAG per sample, and then have a single
> However this sounds a
> bit overkill to me, because you would just have one DAGRun per
> * If this is something that would be interesting to you, and you
> like to see this usecase
> solved within airflow, please tell, as I am interested on making a
> proposal that is both
> simple and works for everyone
> Right now the best idea I have is:
> * Rename execution_date to parametrization_value changing it's
> to string. We
> ensure backward compatibility because already existing
> can be serialized.
> * Create a new entity called parametrization_group, where we could
> groups of these
> parameters for the scheduler to know that it needs to trigger a
> on every DAG that
> depends on such group.
> * Extend a bit the cli to let it modify these parametrization_group.
> * Extend the scheduler to understand what parametrization_group DAGs
> depend on, and trigger
> all the DAGs to run when new parametrization_group elements are
> * Enable backill to run without --start-date and --end-date when the
> depend on
> parametrization_group, and with an optional
> that accepts a list
> to work on.
> How does all this sound to you? Any ideas?
> Cheers, Javier
>  JIRA ticket for dataset related execution:
>  Awesome 1: https://github.com/meirwah/awesome-workflow-engines
>  Awesome 2: https://github.com/pawl/awesome-etl
>  Awesome 3: https://github.com/pditommaso/awesome-