Prefect Deployments FAQ (PDF)

How can I get started with deployments?

Discourse - getting started recipes incl. AWS, GCP and Azure specific setup

How to deploy all flows from a project at once? (both locally and from CI/CD)

This Discourse topic includes plenty of practical deployment CLI commands:
https://discourse.prefect.io/t/how-to-deploy-all-flows-from-a-project-at-once/1566

Docs

Blog posts

Getting started repositories with sample project structure

How to use the deployment CLI?

Can I re-upload my code without recreating a deployment?

Yes, but only if the parameter schema for the flow remains unchanged!

This is why the manifest file exists - to detect changes that could break a deployment.

Why does the build step need to evaluate the flow object?

To extract parameter schema and import paths for the entrypoint.

Can the apply step be executed from an environment that doesn’t have access to the flow code?

Yes, e.g., from a CI/CD tool or build server, as long as the YAML file has been already generated.

Do I need to keep and version-control the YAML file?

Storing the YAML file in your project repository with flows is entirely optional. If you want to, you can version-control those YAML files as a scaffold of deployment information for each flow.

One common use case we anticipate is using the YAML files as build artifacts of the CI/CD process, and relying purely on blocks and CLI as a way to continuously send deployment metadata to the Prefect backend.

How can I build a CI/CD pipeline for my flow deployments?

Can I specify deployments using Python code rather than CLI?

What is the relationship between an agent, work queue and a deployment?

I’m getting an error “File system … could not be created. You are likely missing a Python module required to use the given storage protocol” - how to solve that issue?

What happens when agent picks up a deployed flow run from a work queue?

https://discourse.prefect.io/t/what-happens-when-agent-picks-up-a-deployed-flow-run-from-a-work-queue/1464

What is the single source of truth for my deployment definition?

TL;DR it’s the state of flow deployment on the API backend, not the YAML file, Python declaration, or CLI command - those are only used to create or modify a deployment, but the API representation is the single source of truth.

https://discourse.prefect.io/t/i-created-a-deployment-then-i-added-a-schedule-from-the-ui-when-i-then-reran-the-build-step-the-yaml-file-had-the-same-schedule-as-i-defined-from-the-ui-even-though-i-didn-t-specify-that-schedule-manually-from-cli-or-in-yaml-why-is-that-happening/1460

How can I run my flow in a Docker container?

How to build deployments with flow code and dependencies being baked into a Docker image?

How can I delete all deployments to clear my workspace?

https://discourse.prefect.io/t/how-to-use-prefect-client-to-delete-all-deployments/1335

How can I toggle the schedule off for my flow deployment? (pause a schedule)

https://discourse.prefect.io/t/how-can-i-toggle-the-schedule-off-for-my-flow-deployment-pause-a-schedule/1474

Do I need to schedule my flows, or can I run those based on events?

How to run my flows from AWS Lambda?

How to deploy my flow as a continuous real-time streaming service to AWS?

How can I orchestrate multiple deployments in a flow of flows (orchestrator pattern)?

How to implement a manual approval

https://discourse.prefect.io/t/implementing-waiting-for-approval-in-prefect-2/1558

Scheduling FAQ

https://discourse.prefect.io/t/if-i-toggle-my-deployment-off-set-schedule-inactive-and-then-trigger-an-ad-hoc-flow-run-will-this-ad-hoc-run-be-executed/1769

4 Likes