Linux command
prefect 命令
文件
复制后可按需替换文件名、目录或参数。
常用示例
Start Prefect server
prefect server start
Deploy a flow
prefect deploy [flow.py:flow_name]
Run a flow locally
prefect flow-run create [flow-name]
List deployments
prefect deployment ls
Start a worker
prefect worker start -p [work-pool]
Create a work pool
prefect work-pool create [pool-name] -t [process]
View flow runs
prefect flow-run ls
Login to Prefect Cloud
prefect cloud login
说明
prefect is the CLI for Prefect, a Python workflow orchestration framework. It manages deployments, workers, and infrastructure for running data pipelines. Flows are Python functions decorated with @flow. prefect deploy packages flows for remote execution with schedules, parameters, and infrastructure settings. Workers poll work pools and execute flow runs. prefect worker start launches a worker for a specific pool. Work pool types define execution environment: process (local), Docker, or Kubernetes. prefect server start runs the API server and UI locally. For production, use Prefect Cloud or self-hosted with PostgreSQL. The UI shows flow runs, logs, and task states. Blocks store configuration like credentials, storage locations, and infrastructure templates. Register blocks with block register and reference them in deployments.
参数
- -p, --pool _name_
- Work pool name.
- -t, --type _type_
- Work pool type: process, docker, kubernetes.
- -n, --name _name_
- Deployment or resource name.
- --cron _schedule_
- Cron schedule for deployment.
- --interval _seconds_
- Interval schedule for deployment.
- --limit _count_
- Limit results.
FAQ
What is the prefect command used for?
prefect is the CLI for Prefect, a Python workflow orchestration framework. It manages deployments, workers, and infrastructure for running data pipelines. Flows are Python functions decorated with @flow. prefect deploy packages flows for remote execution with schedules, parameters, and infrastructure settings. Workers poll work pools and execute flow runs. prefect worker start launches a worker for a specific pool. Work pool types define execution environment: process (local), Docker, or Kubernetes. prefect server start runs the API server and UI locally. For production, use Prefect Cloud or self-hosted with PostgreSQL. The UI shows flow runs, logs, and task states. Blocks store configuration like credentials, storage locations, and infrastructure templates. Register blocks with block register and reference them in deployments.
How do I run a basic prefect example?
Run `prefect server start` in a terminal, then adjust file names, paths, flags, or remote targets for your system.
What does -p, --pool _name_ do in prefect?
Work pool name.