-
Notifications
You must be signed in to change notification settings - Fork 1
/
workflow.py
39 lines (35 loc) · 980 Bytes
/
workflow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from datetime import timedelta
from prefect import serve
from pipeline.dashboard import deploy_dashboard
from pipeline.data import generate_data
from pipeline.preprocess import compact_tables, json_to_parquet
from pipeline.reduce import query_reduce
if __name__ == "__main__":
data = generate_data.to_deployment(
name="generate_data",
interval=timedelta(minutes=15),
)
preprocess = json_to_parquet.to_deployment(
name="preprocess",
interval=timedelta(minutes=15),
)
compact = compact_tables.to_deployment(
name="compact",
interval=timedelta(hours=6),
)
reduce = query_reduce.to_deployment(
name="reduce",
interval=timedelta(days=1),
)
dashboard = deploy_dashboard.to_deployment(
name="dashboard",
interval=timedelta(minutes=5),
)
deploy_dashboard()
serve(
data,
preprocess,
compact,
reduce,
dashboard,
)