Learn how to use Prefect push work pools to schedule work on serverless infrastructure without having to run a worker.
prefect work-pool create
CLI command with the --provision-infra
flag.
This approach greatly simplifies the setup process.prefect work-pool create
CLI command with the --provision-infra
flag to automatically provision your
serverless cloud resources and set up your Prefect workspace to use a new push pool.
--provision-infra
flag automatically sets up your default AWS account to execute
flows with ECS tasks.
In your AWS account, this command creates a new IAM user, IAM policy, and
ECS cluster that uses AWS Fargate, VPC, and ECR repository (if they don’t already exist).
In your Prefect workspace, this command creates an
AWSCredentials
block for storing the generated credentials.Here’s an abbreviated example output from running the command:<ecr-registry-url>/my-image:latest
and push it to the registry.Your image name needs to match the name of the repository created with your work pool. You can create
new repositories in the ECR console.prefect work-pool create my-work-pool --provision-infra
looks when existing Azure resources are detected:
provision-infra
sub-command to provision the infrastructure for that work pool.
For example, you can run the following command if you have a work pool named “my-work-pool”.
my-work-pool
work pool and provides you with a summary
of the changes:
--provision-infra
flag in the CLI command.
In the examples below, you’ll create a push work pool through the Prefect Cloud UI.
prefect.yaml
file, the deployment would contain:
my-push-pool
work pool ensures that runs that are ready for execution are
submitted immediately—without the need for a worker to poll for them.
linux/arm64
architecture. If using Prefect to build your image,
you can change the image architecture through the platform
keyword (for example, platform="linux/amd64"
).