From e781d0c880b02b25b690cbe0f9d45811983a2fc2 Mon Sep 17 00:00:00 2001 From: vicente Date: Mon, 5 Dec 2022 09:46:15 -0500 Subject: [PATCH 1/6] added match documentation --- docs/concepts/work-queues.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index aa013f8abd2c..58ec6a7b7438 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -49,6 +49,7 @@ Configuration parameters you can specify when starting an agent include: | --run-once | Only run agent polling once. By default, the agent runs forever. | | --prefetch-seconds | The amount of time before a flow run's scheduled start time to begin submission. Default is the value of `PREFECT_AGENT_PREFETCH_SECONDS`. | | --hide-welcome | Do not display the startup ASCII art for the agent process. | +| --match | Start all queues that match the given match string You must start an agent within an environment that can access or create the infrastructure needed to execute flow runs. Your agent will deploy flow runs to the infrastructure specified by the deployment. @@ -62,13 +63,12 @@ You must start an agent within an environment that can access or create the infr ### Starting an agent -Use the `prefect agent start` CLI command to start an agent. You must pass at least one work queue name that the agent will poll for work. If the work queue does not exist, it will be created. +Use the `prefect agent start` CLI command to start an agent. You must pass at least one work queue name or match string that the agent will poll for work. If the work queue does not exist, it will be created. + -
```bash $ prefect agent start -q [work queue name] ``` -
For example: @@ -94,6 +94,17 @@ In this case, Prefect automatically created a new `my-queue` work queue. By default, the agent polls the API specified by the `PREFECT_API_URL` environment variable. To configure the agent to poll from a different server location, use the `--api` flag, specifying the URL of the server. +In addition, Agents can match multiple work queues by providing a --match string instead of specifying all of the work queues. The agent will poll every work queue with a name that starts with the given string. + +For example: +
+ +```bash +$ prefect agent start --match "foo-" +``` +
+This example will poll every work queue that starts with "foo-" + ### Configuring prefetch By default, the agent begins submission of flow runs a short time (10 seconds) before they are scheduled to run. This allows time for the infrastructure to be created, so the flow run can start on time. In some cases, infrastructure will take longer than this to actually start the flow run. In these cases, the prefetch can be increased using the `--prefetch-seconds` option or the `PREFECT_AGENT_PREFETCH_SECONDS` setting. Submission can begin an arbitrary amount of time before the flow run is scheduled to start. If this value is _larger_ than the amount of time it takes for the infrastructure to start, the flow run will _wait_ until its scheduled start time. This allows flow runs to start exactly on time. From 2e71277c6fb1cf9d71c103b30707615771786a3c Mon Sep 17 00:00:00 2001 From: vicente Date: Mon, 5 Dec 2022 14:18:02 -0500 Subject: [PATCH 2/6] added back divs --- docs/concepts/work-queues.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index 58ec6a7b7438..5f7219b5102c 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -65,11 +65,14 @@ You must start an agent within an environment that can access or create the infr Use the `prefect agent start` CLI command to start an agent. You must pass at least one work queue name or match string that the agent will poll for work. If the work queue does not exist, it will be created. +
```bash $ prefect agent start -q [work queue name] ``` +
+ For example:
From 88170a288f5f73c1c23164a63180f30ef4a42d4c Mon Sep 17 00:00:00 2001 From: vicente Date: Mon, 5 Dec 2022 14:25:58 -0500 Subject: [PATCH 3/6] added punctuation --- docs/concepts/work-queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index 5f7219b5102c..044efc86889c 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -106,7 +106,7 @@ For example: $ prefect agent start --match "foo-" ```
-This example will poll every work queue that starts with "foo-" +This example will poll every work queue that starts with "foo-". ### Configuring prefetch From 47bf9ebf1af134ea735ca06f9eaf09df0656a531 Mon Sep 17 00:00:00 2001 From: vicente Date: Sat, 10 Dec 2022 22:36:45 +0100 Subject: [PATCH 4/6] addressed comments --- docs/concepts/work-queues.md | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index 044efc86889c..ad13ab109556 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -42,14 +42,14 @@ Agents are configured to pull work from one or more work queues. If the agent re Configuration parameters you can specify when starting an agent include: -| Option | Description | -| --- | --- | -| -q, --work-queue | One or more work queues that the agent will poll for work. | -| --api TEXT | The API URL for the Prefect Orion server. Default is the value of `PREFECT_API_URL`. | -| --run-once | Only run agent polling once. By default, the agent runs forever. | -| --prefetch-seconds | The amount of time before a flow run's scheduled start time to begin submission. Default is the value of `PREFECT_AGENT_PREFETCH_SECONDS`. | -| --hide-welcome | Do not display the startup ASCII art for the agent process. | -| --match | Start all queues that match the given match string +| Option | Description | +|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| -q, --work-queue | One or more work queues that the agent will poll for work. | +| --api TEXT | The API URL for the Prefect Orion server. Default is the value of `PREFECT_API_URL`. | +| --run-once | Only run agent polling once. By default, the agent runs forever. | +| --prefetch-seconds | The amount of time before a flow run's scheduled start time to begin submission. Default is the value of `PREFECT_AGENT_PREFETCH_SECONDS`. | +| --hide-welcome | Do not display the startup ASCII art for the agent process. | +| --match QUEUE_PREFIX | Polls for queues matching the given QUEUE_PREFIX. Note: this option overrides anything passed with `-q` or `--work-queue`. | You must start an agent within an environment that can access or create the infrastructure needed to execute flow runs. Your agent will deploy flow runs to the infrastructure specified by the deployment. @@ -97,7 +97,7 @@ In this case, Prefect automatically created a new `my-queue` work queue. By default, the agent polls the API specified by the `PREFECT_API_URL` environment variable. To configure the agent to poll from a different server location, use the `--api` flag, specifying the URL of the server. -In addition, Agents can match multiple work queues by providing a --match string instead of specifying all of the work queues. The agent will poll every work queue with a name that starts with the given string. +In addition, agents can match multiple work queues by providing a --match string instead of specifying all of the work queues. The agent will poll every work queue with a name that starts with the given string. New queues matching this prefix will be found by the agent without needing to restart it. For example:
@@ -105,7 +105,9 @@ For example: ```bash $ prefect agent start --match "foo-" ``` +
+ This example will poll every work queue that starts with "foo-". ### Configuring prefetch From c183387184f4349fd6105e5ad9d0529191863e42 Mon Sep 17 00:00:00 2001 From: vicente Date: Sat, 10 Dec 2022 22:37:39 +0100 Subject: [PATCH 5/6] fixed spacing --- docs/concepts/work-queues.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index ad13ab109556..958eff93e44d 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -49,7 +49,7 @@ Configuration parameters you can specify when starting an agent include: | --run-once | Only run agent polling once. By default, the agent runs forever. | | --prefetch-seconds | The amount of time before a flow run's scheduled start time to begin submission. Default is the value of `PREFECT_AGENT_PREFETCH_SECONDS`. | | --hide-welcome | Do not display the startup ASCII art for the agent process. | -| --match QUEUE_PREFIX | Polls for queues matching the given QUEUE_PREFIX. Note: this option overrides anything passed with `-q` or `--work-queue`. | +| --match QUEUE_PREFIX | Polls for queues matching the given QUEUE_PREFIX. Note: this option overrides anything passed with `-q` or `--work-queue`. | You must start an agent within an environment that can access or create the infrastructure needed to execute flow runs. Your agent will deploy flow runs to the infrastructure specified by the deployment. From 59327e61d2a3b57552f661c7b517f9be19a03921 Mon Sep 17 00:00:00 2001 From: Michael Adkins Date: Fri, 6 Jan 2023 14:15:43 -0600 Subject: [PATCH 6/6] Apply suggestions from code review Co-authored-by: Terrence Dorsey --- docs/concepts/work-queues.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/concepts/work-queues.md b/docs/concepts/work-queues.md index 958eff93e44d..b22a90e91b0c 100644 --- a/docs/concepts/work-queues.md +++ b/docs/concepts/work-queues.md @@ -42,8 +42,8 @@ Agents are configured to pull work from one or more work queues. If the agent re Configuration parameters you can specify when starting an agent include: -| Option | Description | -|----------------------|--------------------------------------------------------------------------------------------------------------------------------------------| +| Option | Description | +|---|---| | -q, --work-queue | One or more work queues that the agent will poll for work. | | --api TEXT | The API URL for the Prefect Orion server. Default is the value of `PREFECT_API_URL`. | | --run-once | Only run agent polling once. By default, the agent runs forever. | @@ -97,7 +97,7 @@ In this case, Prefect automatically created a new `my-queue` work queue. By default, the agent polls the API specified by the `PREFECT_API_URL` environment variable. To configure the agent to poll from a different server location, use the `--api` flag, specifying the URL of the server. -In addition, agents can match multiple work queues by providing a --match string instead of specifying all of the work queues. The agent will poll every work queue with a name that starts with the given string. New queues matching this prefix will be found by the agent without needing to restart it. +In addition, agents can match multiple work queues by providing a `--match` string instead of specifying all of the work queues. The agent will poll every work queue with a name that starts with the given string. New queues matching this prefix will be found by the agent without needing to restart it. For example: