Hi everyone! I’m trying to figure out what’s the n...
# ask-community
g
Hi everyone! I’m trying to figure out what’s the new way of deploying a flow in Prefect 2.19.7 because prefect.deployments.Deployment has been deprecated. So far I was doing
Copy code
d = Deployment.build_from_flow(flow, deployment_name, skip_upload=True)
d.work_queue_name = work_queue_name
d.infrastructure = Process()
d.storage = S3.load(storage)
if schedule:
    d.schedules = [DeploymentScheduleCreate(schedule=CronSchedule(cron=schedule, timezone="UTC"), active=True)]
d.parameters = parameters
d.tags = tags
d.description = flow.description
d.path = path
d.apply()
d.upload_to_storage(ignore_file=None)
The python code in prefect package suggests flow.deploy and Marvin suggests flow.serve. The problem is that none of these 2 methods has the parameters like path, storage, infrastructure. Can anyone put some light on this?
I believe I do not want flow.serve as I understood it would wait and stop the execution of the deployment script. Still flow.deploy does not have some parameters. How should I provide infrastructure, storage and path?