Assigning tasks to specific machines with airflow

前端 未结 1 1526
离开以前
离开以前 2021-01-02 07:09

I\'m new to Airflow.

I have a DAG which contains a task that should run on a specific machine (EMR cluster in my case). How can I tell airflow where to run specific

1条回答
  •  我在风中等你
    2021-01-02 07:32

    Run your worker on that machine with a queue name. In the airflow cli you could do something like:

    airflow worker -q my_queue
    

    Then define that task to use that queue:

    task = PythonOperator(
        task_id='task',
        python_callable=my_callable,
        queue='my_queue',
        dag=dag)
    

    0 讨论(0)
提交回复
热议问题