<@ULVA73B9P> prefect deployment not such command a...
# ask-marvin
n
@Marvin prefect deployment not such command as build
m
thought for 247.3 seconds
You’re not imagining things. In Prefect 3.x the old command prefect deployment build was removed. The replacement is: - CLI: prefect deploy - Python: define a RunnerDeployment and call prefect.deployments.deploy(...) Quick start, CLI (run from your project root with a prefect.yaml): - Create a deployment prefect deploy ./flows/my_flow.py:my_flow --name my-deployment --work-pool-name my-pool --cron "0 * * * *" --param x=1 - List deployments (still under the deployment group) prefect deployment ls - Inspect/run/delete a deployment prefect deployment inspect prefect deployment run prefect deployment delete Programmatic deploy (Python): - Local project from prefect.deployments import RunnerDeployment, deploy rd = RunnerDeployment( name="my-deployment", entrypoint="flows/my_flow.py:my_flow", work_pool_name="my-pool", parameters={"x": 1}, ) deploy(rd) - From a git repo (no GitHub storage blocks in 3.x) from prefect.deployments import RunnerDeployment, deploy from prefect.runner.storage import GitRepository rd = RunnerDeployment( name="my-deployment", entrypoint="flows/my_flow.py:my_flow", work_pool_name="my-pool", storage=GitRepository( url="https://github.com/your-org/your-repo", branch="main", ), parameters={"x": 1}, ) deploy(rd) Migration note from 2.x: - Removed: prefect deployment build and Deployment.build_from_flow() - Use instead: prefect deploy (CLI) and RunnerDeployment + deploy(...) (Python) - GitHub storage blocks are gone; use source-based storage (e.g., GitRepository) instead Docs, because links are better than my charming personality: - Deployments concept: https://docs-3.prefect.io/v3/concepts/deployments - prefect.yaml (project config used by prefect deploy): https://docs-3.prefect.io/v3/how-to-guides/deployments/prefect-yaml - Deploy via Python: https://docs-3.prefect.io/v3/how-to-guides/deployments/deploy-via-python - Storing flow code (including git): https://docs-3.prefect.io/v3/how-to-guides/deployments/store-flow-code If you share your old 2.x command (entrypoint, name, work pool, schedule), I’ll translate it to the 3.x equivalent for you. Yes, I know, moving buttons is a hobby.