Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docs update for PR #14 on Promptless/prefect-test #19

Closed
wants to merge 13 commits into from
4 changes: 4 additions & 0 deletions docs/3.0/deploy/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -421,3 +421,7 @@ configuration, and prepares the runtime environment for workflow execution.
Pull steps allow users to highly decouple their workflow architecture.
For example, a common use of pull steps is to dynamically pull code from remote filesystems such as
GitHub with each run of their deployment.

- **`worker_status_filter`**: (Optional) A filter to determine active workers within the work pool.
This field can be used to prevent unnecessary worker setup instructions during deployment if active workers are present.

33 changes: 1 addition & 32 deletions docs/3.0/deploy/infrastructure-concepts/work-pools.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -83,38 +83,6 @@ flowchart LR
E -.-> F
```

### Work pool configuration

You can configure work pools by using any of the following:

- Prefect UI
- Prefect CLI commands
- [Prefect REST API](/3.0/api-ref/rest-api/)
- [Terraform provider for Prefect Cloud](https://registry.terraform.io/providers/PrefectHQ/prefect/latest/docs/resources/work_pool)

To manage work pools in the UI, click the **Work Pools** icon. This displays a list of currently configured work pools.

![The UI displays a list of configured work pools](/3.0/img/ui/work-pool-list.png)

Select the **+** button to create a new work pool. You can specify the details about infrastructure created for this work pool.

To create a work pool through the Prefect CLI, use the `prefect work-pool create` command:

```bash
prefect work-pool create [OPTIONS] NAME
```

`NAME` is a required, unique name for the work pool.

Optional configuration parameters to filter work on the pool include:

| Option | Description |
| -------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `--paused` | If provided, the work pool is created in a paused state. |
| `--type` | The type of infrastructure that can execute runs from this work pool. |
| `--set-as-default` | Whether to use the created work pool as the local default for deployment. |
| <span class="no-wrap">`--base-job-template`</span> | The path to a JSON file containing the base job template to use. If unspecified, Prefect uses the default base job template for the given worker type. |

To update a work pool through the Prefect CLI, use the `prefect work-pool update` command:

```bash
Expand All @@ -130,6 +98,7 @@ Optional configuration parameters you can specify to update the work pool includ
| <span class="no-wrap">`--base-job-template`</span> | The path to a JSON file containing the base job template to use. If unspecified, Prefect uses the default base job template for the given worker type. |
| `--description` | A description of the work pool. |
| `--concurrency-limit` | The maximum number of flow runs to run simultaneously in the work pool. |
| `--worker-filter-status` | Filter workers based on their status using `any_` or `not_any_` fields. |

<Tip>
**Managing work pools in CI/CD**
Expand Down
7 changes: 7 additions & 0 deletions docs/3.0/deploy/infrastructure-concepts/workers.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,12 @@ execute a flow run.
with the `Worker` role, which you can configure by setting the `PREFECT_API_KEY`.
</Tip>

<Tip>
**Active Worker Check**

Before starting a new worker, the system checks for active workers in the specified work pool. If active workers are detected, the system may not suggest starting a new worker, thereby optimizing the deployment process.
</Tip>

### Worker status

Workers have two statuses: `ONLINE` and `OFFLINE`. A worker is online if it sends regular heartbeat messages to the Prefect API.
Expand Down Expand Up @@ -143,6 +149,7 @@ For example, to limit a worker to five concurrent flow runs:
prefect worker start --pool "my-pool" --limit 5
```

If there are already active workers in the work pool, Prefect will not suggest starting new workers. This avoids unnecessary duplication and optimizes resource usage.
### Configure prefetch

By default, the worker submits flow runs a short time (10 seconds) before they are scheduled to run.
Expand Down
5 changes: 1 addition & 4 deletions docs/3.0/deploy/infrastructure-examples/docker.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,7 @@ Run the following command in this new terminal to start the worker:
prefect worker start --pool my-docker-pool
```

You should see the worker start.
It's now polling the Prefect API to check for any scheduled flow runs it should pick up and then submit for execution.
You'll see your new worker listed in the UI under the **Workers** tab of the Work Pools page with a recent last polled date.
The work pool should have a `Ready` status indicator.
If there are no active workers in the work pool, you should see the worker start. It's now polling the Prefect API to check for any scheduled flow runs it should pick up and then submit for execution. You'll see your new worker listed in the UI under the **Workers** tab of the Work Pools page with a recent last polled date. The work pool should have a `Ready` status indicator.

<Tip>
**Pro Tip:**
Expand Down
13 changes: 1 addition & 12 deletions docs/3.0/deploy/infrastructure-examples/managed.mdx
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
---
title: Run flows on Prefect Managed infrastructure
description: Learn how Prefect runs deployments on Prefect's infrastructure.
---

<span class="badge cloud"></span> Prefect Cloud can run your flows on your behalf with Prefect Managed work pools.

Flows that run with this work pool do not require a worker or cloud provider
account—Prefect handles the infrastructure and code execution for you.

Managed execution is a great option for users who want to get started quickly, with no infrastructure setup.

## Create a managed deployment

Expand Down Expand Up @@ -43,7 +32,7 @@ Managed execution is a great option for users who want to get started quickly, w

1. Run the deployment from the UI or from the CLI.

This process runs a flow on remote infrastructure without any infrastructure setup, starting a worker, or requiring a cloud provider account.
This process runs a flow on remote infrastructure without any infrastructure setup, and it will only suggest starting a new worker if no active workers are found in the work pool.

## Add dependencies

Expand Down
Loading
Loading