From b9d12033985c3066cd5d1232b80c66a4c7689be9 Mon Sep 17 00:00:00 2001 From: Jed Cunningham <66968678+jedcunningham@users.noreply.github.com> Date: Tue, 14 Jan 2025 13:04:47 -0700 Subject: [PATCH] Add standalone DAG processor to docker compose (#45650) We are moving to only support a standalone DAG processor in Airflow 3, so let's switch our compose setup to have it. We can remove the env var once that's the only option, but for now it let's us avoid a massive PR :) --- .../howto/docker-compose/docker-compose.yaml | 16 ++++++++++++++++ .../howto/docker-compose/index.rst | 1 + 2 files changed, 17 insertions(+) diff --git a/docs/apache-airflow/howto/docker-compose/docker-compose.yaml b/docs/apache-airflow/howto/docker-compose/docker-compose.yaml index eb3656940e721..c64eac5b37579 100644 --- a/docs/apache-airflow/howto/docker-compose/docker-compose.yaml +++ b/docs/apache-airflow/howto/docker-compose/docker-compose.yaml @@ -60,6 +60,7 @@ x-airflow-common: AIRFLOW__CORE__FERNET_KEY: '' AIRFLOW__CORE__DAGS_ARE_PAUSED_AT_CREATION: 'true' AIRFLOW__CORE__LOAD_EXAMPLES: 'true' + AIRFLOW__SCHEDULER__STANDALONE_DAG_PROCESSOR: 'true' AIRFLOW__API__AUTH_BACKENDS: >- airflow.providers.fab.auth_manager.api.auth.backend.basic_auth,airflow.api.auth.backend.session # yamllint disable rule:line-length @@ -148,6 +149,21 @@ services: airflow-init: condition: service_completed_successfully + airflow-dag-processor: + <<: *airflow-common + command: dag-processor + healthcheck: + test: ["CMD-SHELL", 'airflow jobs check --job-type DagProcessorJob --hostname "$${HOSTNAME}"'] + interval: 30s + timeout: 10s + retries: 5 + start_period: 30s + restart: always + depends_on: + <<: *airflow-common-depends-on + airflow-init: + condition: service_completed_successfully + airflow-worker: <<: *airflow-common command: celery worker diff --git a/docs/apache-airflow/howto/docker-compose/index.rst b/docs/apache-airflow/howto/docker-compose/index.rst index 65151c22e0656..54cde82635e08 100644 --- a/docs/apache-airflow/howto/docker-compose/index.rst +++ b/docs/apache-airflow/howto/docker-compose/index.rst @@ -88,6 +88,7 @@ This file contains several service definitions: - ``airflow-scheduler`` - The :doc:`scheduler ` monitors all tasks and DAGs, then triggers the task instances once their dependencies are complete. +- ``airflow-dag-processor`` - The DAG processor parses DAG files. - ``airflow-webserver`` - The webserver is available at ``http://localhost:8080``. - ``airflow-worker`` - The worker that executes the tasks given by the scheduler. - ``airflow-triggerer`` - The triggerer runs an event loop for deferrable tasks.