[Python] is this tutorial -> "Running Airflow in Docker" still working? [closed]

Discussão em 'Python' iniciado por Stack, Abril 1, 2025.

  1. Stack

    Stack Membro Participativo

    I've followed this tutorial and I could run everything and airflow is running, ok, but if I try to create a new dag (inside the dags folder)

    ├───dags
    │ └───__pycache__
    ├───plugins
    ├───config
    └───logs


    ls inside dags/ :

    ---- ------------- ------ ----
    d----- 01/04/2025 09:16 __pycache__
    ------ 01/04/2025 08:37 7358 create_tables_dag.py
    ------ 01/04/2025 08:37 620 dag_dummy.py
    ------ 01/04/2025 08:37 1148 simple_dag_ru.py


    dag example code:

    from datetime import datetime, timedelta
    from textwrap import dedent

    # The DAG object; we'll need this to instantiate a DAG
    from airflow import DAG

    # Operators; we need this to operate!
    from airflow.operators.bash import BashOperator

    with DAG(
    "tutorial",
    # These args will get passed on to each operator
    # You can override them on a per-task basis during operator initialization
    default_args={
    "depends_on_past": False,
    "email": ["airflow@example.com"],
    "email_on_failure": False,
    "email_on_retry": False,
    "retries": 1,
    "retry_delay": timedelta(minutes=5),
    },
    description="A simple tutorial DAG",
    schedule=timedelta(days=1),
    start_date=datetime(2021, 1, 1),
    catchup=False,
    tags=["example"],
    ) as dag:

    # t1, t2 are examples of tasks created by instantiating operators
    t1 = BashOperator(
    task_id="print_date_ru",
    bash_command="date",
    )

    t2 = BashOperator(
    task_id="sleep",
    depends_on_past=False,
    bash_command="sleep 5",
    retries=3,
    )
    t1 >> t2


    This dag simply doesn't show on UI. I've try to wait (at least 15 minutes), I try to go to the worker cmd inside docker, go to dags folder, run "ls" and nothing is listed. I really don't no what I can do.

    Obs: I've used black to correct my files (everything is ok)

    Continue reading...

Compartilhe esta Página