Skip to content

Commit 6754120

Browse files
committed
add configuration in readme
1 parent e4e8445 commit 6754120

File tree

1 file changed

+34
-1
lines changed

1 file changed

+34
-1
lines changed

README.md

+34-1
Original file line numberDiff line numberDiff line change
@@ -77,12 +77,45 @@ with DAG(
7777

7878
## Example DAG: [`airflow-config`](https://github.com/airflow-laminar/airflow-config)
7979

80-
```yaml
8180

81+
```yaml
82+
# @package _global_
83+
_target_: airflow_config.Configuration
84+
default_args:
85+
_target_: airflow_config.DefaultArgs
86+
retries: 0
87+
depends_on_past: false
88+
all_dags:
89+
_target_: airflow_config.DagArgs
90+
start_date: "2024-01-01"
91+
catchup: false
92+
extensions:
93+
supervisor:
94+
_target_: airflow_supervisor.SupervisorAirflowConfiguration
95+
airflow:
96+
_target_: airflow_supervisor.AirflowConfiguration
97+
port: "*:9091"
98+
working_dir: "/data/airflow/supervisor"
99+
config_path: "/data/airflow/supervisor/supervisor.conf"
100+
program:
101+
test:
102+
_target_: airflow_supervisor.ProgramConfiguration
103+
command: "bash -c 'sleep 14400; exit 1'"
82104
```
83105
84106
```python
107+
from datetime import timedelta
108+
from airflow_config import load_config, DAG
109+
from airflow_supervisor import Supervisor
85110

111+
config = load_config(config_name="airflow")
112+
113+
with DAG(
114+
dag_id="test-supervisor",
115+
schedule=timedelta(days=1),
116+
config=config,
117+
) as dag:
118+
supervisor = Supervisor(dag=dag, cfg=config.extensions["supervisor"])
86119
```
87120
88121
## How To: Use as a supervisord configuration frontend

0 commit comments

Comments
 (0)