-
Notifications
You must be signed in to change notification settings - Fork 10
/
Copy pathdeployments.py
32 lines (27 loc) · 965 Bytes
/
deployments.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
# from prefect.flow_runners import SubprocessFlowRunner
from datetime import datetime, timedelta
from prefect.deployments import Deployment, FlowScript
from prefect.orion.schemas.schedules import CronSchedule, IntervalSchedule
date_str = datetime.today().strftime("%Y-%m-%d")
Deployment(
name="deploy-mlflow-training",
schedule=IntervalSchedule(interval=timedelta(minutes=10080)),
flow=FlowScript(path="./main.py", name="mlflow-training"),
parameters={
"train_file": "202204-capitalbikeshare-tripdata.zip",
"valid_file": "202205-capitalbikeshare-tripdata.zip",
},
tags=["ml-training"],
)
Deployment(
name="deploy-mlflow-staging",
schedule=CronSchedule(
cron="0 9 1 * *",
),
flow=FlowScript(path="./stage.py", name="mlflow-staging"),
parameters={
"tracking_uri": "http://127.0.0.1:5000",
"experiment_name": f"citibikes-experiment-{date_str}",
},
tags=["ml-staging"],
)