How to start a simple airflow

I am completely unfamiliar with the airflow. I would like to run a simple dag on the specified date. I'm struggling to make a difference between the start date, the due date, and backfill. And what is the command to run dag?

Here is what I tried:

airflow run dag_1 task_1 2017-1-23

The first time I ran this command, the task completed correctly, but when I tried again, it did not work. Here is another command I ran:

airflow backfill dag_1 -s 2017-1-23 -e 2017-1-24

I do not know what to expect from this team. Will they perform tricks every day from 23 to 24? Before you run the two commands above. I have done this:

airflow initdb
airflow scheduler 
airflow webserver -p 8085 --debug &

Here is my dag

from airflow import DAG
from airflow.operators.bash_operator import BashOperator
from datetime import datetime, timedelta
default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2017, 1, 23, 12),
    'email': ['airflow@airflow.com'],
    'email_on_failure': False,
    'email_on_retry': False,
    'retries': 1,
    'retry_delay': timedelta(minutes=5),
}

dag = DAG(
    'dag_1', default_args=default_args, schedule_interval=timedelta(1))

t1 = BashOperator(
    task_id='create_clients',
    bash_command='Rscript /scripts/Cli.r',
    dag=dag)

t2 = BashOperator(
    task_id='create_operation',
    bash_command='Rscript Operation.r',
    retries=3,
    dag=dag)

t2.set_upstream(t1)

Screenshot: Tree view

UPDATE

airflow run dag_1 task_1 2017-1-23T10:34
+4
source share
2 answers

airflow run dag_1 task_1 2017-1-23

, , ,

airflow run --force=true dag_1 task_1 2017-1-23

, , . , DAG, , 24 , .

,

airflow clear dag_1 -s 2017-1-23 -e 2017-1-24

cli docs: https://airflow.incubator.apache.org/cli.html

+9

,

DAG, / DAG/re, DAG, . CLI

airflow backfill -s <<start_date>> <<dag>> 
#optionally provide -1 as start_date to run it immediately

start_date, , , DAG

execute_date - , . DAG

airflow test <<dag>> <<task>> <<exec_date>>

dag

- DAG . DAG DAGBAG, , DAG

airflow backfill -s <<start_date>> <<dag>> 
#optionally provide -1 as start_date to run it immediately
+1

Source: https://habr.com/ru/post/1667543/


All Articles