Hey I was using a Prefect2's sdk func `build_from_...
# prefect-getting-started
n
Hey I was using a Prefect2's sdk func
build_from_flow
to deploy a flow by passing
entrypoint
and `path`:
Copy code
build_deployment = await Deployment.build_from_flow(
        flow=hello_world_flow,
        name=name, 
        ...
        entrypoint=entrypoint,
        path=path)
Im starting now on 3.0 but now build_from_flow is missing:
Copy code
prefect.exceptions.PrefectImportError: `prefect.deployments:Deployment` has been removed. Use `flow.serve()`, `flow.deploy()`, or `prefect deploy` instead.
Docs mention this args but it is unclear with no examples. Does someone know how to pass entrypoint & path when creating deployment from a flow?
j
Hi Nikolay. Check out the Quickstart for an example of using
.deploy
to create a deployment with an entrypoint. See more discussion about flow code storage here.
n
this section of the docs specifically address moving from
build_from_flow
to
.deploy
https://docs.prefect.io/3.0/resources/upgrade-agents-to-workers#use-flow-deploy
n
Thanks for the quick reply will look into it.
👍 1
f
@Nikolay Tsvetanov if you were using
S3Bucket
from
prefect-aws
extension this is a demo which is working for me. It’s still latest
v2
but I’m quite sure that would be the way
v3
deployments work
n
Hey I am not but thanks, I got it working using Nate’s docs info