updated docker setup and airflow
This commit is contained in:
parent
34288dcbbe
commit
47a5e249c9
1270 changed files with 1022 additions and 3 deletions
29
airflow/airflow/dags/run_scripts2.py
Normal file
29
airflow/airflow/dags/run_scripts2.py
Normal file
|
|
@ -0,0 +1,29 @@
|
||||||
|
from airflow import DAG
|
||||||
|
from airflow.operators.python import PythonOperator
|
||||||
|
from datetime import datetime, timedelta
|
||||||
|
|
||||||
|
def my_task():
|
||||||
|
print("Hello Airflow! Task 2 is running.")
|
||||||
|
|
||||||
|
default_args = {
|
||||||
|
'owner': 'airflow',
|
||||||
|
'depends_on_past': False,
|
||||||
|
'retries': 1,
|
||||||
|
'retry_delay': timedelta(minutes=5),
|
||||||
|
}
|
||||||
|
|
||||||
|
with DAG(
|
||||||
|
'example_dag',
|
||||||
|
default_args=default_args,
|
||||||
|
description='My second DAG',
|
||||||
|
start_date=datetime(2025, 12, 10),
|
||||||
|
schedule=timedelta(minutes=3),
|
||||||
|
catchup=False,
|
||||||
|
) as dag:
|
||||||
|
|
||||||
|
task1 = PythonOperator(
|
||||||
|
task_id='print_hello',
|
||||||
|
python_callable=my_task
|
||||||
|
)
|
||||||
|
|
||||||
|
task1
|
||||||
|
|
@ -10,20 +10,37 @@ services:
|
||||||
POSTGRES_DB: ${POSTGRES_DB}
|
POSTGRES_DB: ${POSTGRES_DB}
|
||||||
volumes:
|
volumes:
|
||||||
- postgres_data:/var/lib/postgresql/data
|
- postgres_data:/var/lib/postgresql/data
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
af:
|
airflow:
|
||||||
container_name: airflow_container
|
container_name: airflow_container
|
||||||
image: apache/airflow:3.1.3
|
image: apache/airflow:3.1.3
|
||||||
ports:
|
ports:
|
||||||
- ${AIRFLOW_PORT}:8080
|
- ${AIRFLOW_PORT}:8080
|
||||||
environment:
|
environment:
|
||||||
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://airflow:airflow@db:5432/airflow
|
# Database connection
|
||||||
|
AIRFLOW__DATABASE__SQL_ALCHEMY_CONN: postgresql+psycopg2://${POSTGRES_USER}:${POSTGRES_PASSWORD}@db:5432/${POSTGRES_DB}
|
||||||
|
|
||||||
|
# Custom admin credentials
|
||||||
|
AIRFLOW__WEBSERVER__DEFAULT_USER_USERNAME: ${AIRFLOW_ADMIN_USER}
|
||||||
|
AIRFLOW__WEBSERVER__DEFAULT_USER_PASSWORD: ${AIRFLOW_ADMIN_PASSWORD}
|
||||||
|
|
||||||
|
# Airflow config
|
||||||
|
AIRFLOW__CORE__LOAD_EXAMPLES: "false"
|
||||||
|
AIRFLOW__CORE__EXECUTOR: LocalExecutor
|
||||||
|
AIRFLOW__WEBSERVER__EXPOSE_CONFIG: "true"
|
||||||
|
|
||||||
depends_on:
|
depends_on:
|
||||||
- db
|
- db
|
||||||
volumes:
|
volumes:
|
||||||
- ./airflow/dags:/opt/airflow/dags
|
- ./airflow/dags:/opt/airflow/dags
|
||||||
|
- ./airflow/logs:/opt/airflow/logs
|
||||||
|
- ./airflow/plugins:/opt/airflow/plugins
|
||||||
command: >
|
command: >
|
||||||
bash -c "airflow db migrate && airflow standalone"
|
bash -c "airflow db migrate && airflow scheduler & exec airflow webserver"
|
||||||
|
restart: unless-stopped
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
postgres_data:
|
postgres_data:
|
||||||
|
airflow_logs:
|
||||||
|
airflow_plugins:
|
||||||
|
|
|
||||||
1
airflow/postgres/data/PG_VERSION
Normal file
1
airflow/postgres/data/PG_VERSION
Normal file
|
|
@ -0,0 +1 @@
|
||||||
|
15
|
||||||
BIN
airflow/postgres/data/base/1/112
Normal file
BIN
airflow/postgres/data/base/1/112
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/113
Normal file
BIN
airflow/postgres/data/base/1/113
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1247
Normal file
BIN
airflow/postgres/data/base/1/1247
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1247_fsm
Normal file
BIN
airflow/postgres/data/base/1/1247_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1247_vm
Normal file
BIN
airflow/postgres/data/base/1/1247_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1249
Normal file
BIN
airflow/postgres/data/base/1/1249
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1249_fsm
Normal file
BIN
airflow/postgres/data/base/1/1249_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1249_vm
Normal file
BIN
airflow/postgres/data/base/1/1249_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1255
Normal file
BIN
airflow/postgres/data/base/1/1255
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1255_fsm
Normal file
BIN
airflow/postgres/data/base/1/1255_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1255_vm
Normal file
BIN
airflow/postgres/data/base/1/1255_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1259
Normal file
BIN
airflow/postgres/data/base/1/1259
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1259_fsm
Normal file
BIN
airflow/postgres/data/base/1/1259_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/1259_vm
Normal file
BIN
airflow/postgres/data/base/1/1259_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13457
Normal file
BIN
airflow/postgres/data/base/1/13457
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13457_fsm
Normal file
BIN
airflow/postgres/data/base/1/13457_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13457_vm
Normal file
BIN
airflow/postgres/data/base/1/13457_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/13460
Normal file
0
airflow/postgres/data/base/1/13460
Normal file
BIN
airflow/postgres/data/base/1/13461
Normal file
BIN
airflow/postgres/data/base/1/13461
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13462
Normal file
BIN
airflow/postgres/data/base/1/13462
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13462_fsm
Normal file
BIN
airflow/postgres/data/base/1/13462_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13462_vm
Normal file
BIN
airflow/postgres/data/base/1/13462_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/13465
Normal file
0
airflow/postgres/data/base/1/13465
Normal file
BIN
airflow/postgres/data/base/1/13466
Normal file
BIN
airflow/postgres/data/base/1/13466
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13467
Normal file
BIN
airflow/postgres/data/base/1/13467
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13467_fsm
Normal file
BIN
airflow/postgres/data/base/1/13467_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13467_vm
Normal file
BIN
airflow/postgres/data/base/1/13467_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/13470
Normal file
0
airflow/postgres/data/base/1/13470
Normal file
BIN
airflow/postgres/data/base/1/13471
Normal file
BIN
airflow/postgres/data/base/1/13471
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13472
Normal file
BIN
airflow/postgres/data/base/1/13472
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13472_fsm
Normal file
BIN
airflow/postgres/data/base/1/13472_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/13472_vm
Normal file
BIN
airflow/postgres/data/base/1/13472_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/13475
Normal file
0
airflow/postgres/data/base/1/13475
Normal file
BIN
airflow/postgres/data/base/1/13476
Normal file
BIN
airflow/postgres/data/base/1/13476
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/1417
Normal file
0
airflow/postgres/data/base/1/1417
Normal file
0
airflow/postgres/data/base/1/1418
Normal file
0
airflow/postgres/data/base/1/1418
Normal file
BIN
airflow/postgres/data/base/1/174
Normal file
BIN
airflow/postgres/data/base/1/174
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/175
Normal file
BIN
airflow/postgres/data/base/1/175
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2187
Normal file
BIN
airflow/postgres/data/base/1/2187
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2224
Normal file
0
airflow/postgres/data/base/1/2224
Normal file
BIN
airflow/postgres/data/base/1/2228
Normal file
BIN
airflow/postgres/data/base/1/2228
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2328
Normal file
0
airflow/postgres/data/base/1/2328
Normal file
0
airflow/postgres/data/base/1/2336
Normal file
0
airflow/postgres/data/base/1/2336
Normal file
BIN
airflow/postgres/data/base/1/2337
Normal file
BIN
airflow/postgres/data/base/1/2337
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2579
Normal file
BIN
airflow/postgres/data/base/1/2579
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2600
Normal file
BIN
airflow/postgres/data/base/1/2600
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2600_fsm
Normal file
BIN
airflow/postgres/data/base/1/2600_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2600_vm
Normal file
BIN
airflow/postgres/data/base/1/2600_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2601
Normal file
BIN
airflow/postgres/data/base/1/2601
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2601_fsm
Normal file
BIN
airflow/postgres/data/base/1/2601_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2601_vm
Normal file
BIN
airflow/postgres/data/base/1/2601_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2602
Normal file
BIN
airflow/postgres/data/base/1/2602
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2602_fsm
Normal file
BIN
airflow/postgres/data/base/1/2602_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2602_vm
Normal file
BIN
airflow/postgres/data/base/1/2602_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2603
Normal file
BIN
airflow/postgres/data/base/1/2603
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2603_fsm
Normal file
BIN
airflow/postgres/data/base/1/2603_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2603_vm
Normal file
BIN
airflow/postgres/data/base/1/2603_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2604
Normal file
0
airflow/postgres/data/base/1/2604
Normal file
BIN
airflow/postgres/data/base/1/2605
Normal file
BIN
airflow/postgres/data/base/1/2605
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2605_fsm
Normal file
BIN
airflow/postgres/data/base/1/2605_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2605_vm
Normal file
BIN
airflow/postgres/data/base/1/2605_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2606
Normal file
BIN
airflow/postgres/data/base/1/2606
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2606_fsm
Normal file
BIN
airflow/postgres/data/base/1/2606_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2606_vm
Normal file
BIN
airflow/postgres/data/base/1/2606_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2607
Normal file
BIN
airflow/postgres/data/base/1/2607
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2607_fsm
Normal file
BIN
airflow/postgres/data/base/1/2607_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2607_vm
Normal file
BIN
airflow/postgres/data/base/1/2607_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2608
Normal file
BIN
airflow/postgres/data/base/1/2608
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2608_fsm
Normal file
BIN
airflow/postgres/data/base/1/2608_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2608_vm
Normal file
BIN
airflow/postgres/data/base/1/2608_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2609
Normal file
BIN
airflow/postgres/data/base/1/2609
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2609_fsm
Normal file
BIN
airflow/postgres/data/base/1/2609_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2609_vm
Normal file
BIN
airflow/postgres/data/base/1/2609_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2610
Normal file
BIN
airflow/postgres/data/base/1/2610
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2610_fsm
Normal file
BIN
airflow/postgres/data/base/1/2610_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2610_vm
Normal file
BIN
airflow/postgres/data/base/1/2610_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2611
Normal file
0
airflow/postgres/data/base/1/2611
Normal file
BIN
airflow/postgres/data/base/1/2612
Normal file
BIN
airflow/postgres/data/base/1/2612
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2612_fsm
Normal file
BIN
airflow/postgres/data/base/1/2612_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2612_vm
Normal file
BIN
airflow/postgres/data/base/1/2612_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2613
Normal file
0
airflow/postgres/data/base/1/2613
Normal file
BIN
airflow/postgres/data/base/1/2615
Normal file
BIN
airflow/postgres/data/base/1/2615
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2615_fsm
Normal file
BIN
airflow/postgres/data/base/1/2615_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2615_vm
Normal file
BIN
airflow/postgres/data/base/1/2615_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2616
Normal file
BIN
airflow/postgres/data/base/1/2616
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2616_fsm
Normal file
BIN
airflow/postgres/data/base/1/2616_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2616_vm
Normal file
BIN
airflow/postgres/data/base/1/2616_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2617
Normal file
BIN
airflow/postgres/data/base/1/2617
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2617_fsm
Normal file
BIN
airflow/postgres/data/base/1/2617_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2617_vm
Normal file
BIN
airflow/postgres/data/base/1/2617_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2618
Normal file
BIN
airflow/postgres/data/base/1/2618
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2618_fsm
Normal file
BIN
airflow/postgres/data/base/1/2618_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2618_vm
Normal file
BIN
airflow/postgres/data/base/1/2618_vm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2619
Normal file
BIN
airflow/postgres/data/base/1/2619
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2619_fsm
Normal file
BIN
airflow/postgres/data/base/1/2619_fsm
Normal file
Binary file not shown.
BIN
airflow/postgres/data/base/1/2619_vm
Normal file
BIN
airflow/postgres/data/base/1/2619_vm
Normal file
Binary file not shown.
0
airflow/postgres/data/base/1/2620
Normal file
0
airflow/postgres/data/base/1/2620
Normal file
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue