mirror of
https://github.com/coder/coder.git
synced 2026-06-03 21:18:24 +00:00
d17dd5d787
Relates to https://github.com/coder/internal/issues/934 This PR provides a mechanism to filter provisioner jobs according to who initiated the job. This will be used to find pending prebuild jobs when prebuilds have overwhelmed the provisioner job queue. They can then be canceled. If prebuilds are overwhelming provisioners, the following steps will be taken: ```bash # pause prebuild reconciliation to limit provisioner queue pollution: coder prebuilds pause # cancel pending provisioner jobs to clear the queue coder provisioner jobs list --initiator="prebuilds" --status="pending" | jq ... | xargs -n1 -I{} coder provisioner jobs cancel {} # push a fixed template and wait for the import to complete coder templates push ... # push a fixed template # resume prebuild reconciliation coder prebuilds resume ``` This interface differs somewhat from what was specified in the issue, but still provides a mechanism that addresses the issue. The original proposal was made by myself and this simpler implementation makes sense. I might add a `--search` parameter in a follow-up if there is appetite for it. Potential follow ups: * Support for this usage: `coder provisioner jobs list --search "initiator:prebuilds status:pending"` * Adding the same parameters to `coder provisioner jobs cancel` as a convenience feature so that operators don't have to pipe through `jq` and `xargs`
3.5 KiB
Generated
3.5 KiB
Generated
provisioner jobs list
List provisioner jobs
Aliases:
- ls
Usage
coder provisioner jobs list [flags]
Options
-s, --status
| Type | [pending|running|succeeded|canceling|canceled|failed|unknown] |
| Environment | $CODER_PROVISIONER_JOB_LIST_STATUS |
Filter by job status.
-l, --limit
| Type | int |
| Environment | $CODER_PROVISIONER_JOB_LIST_LIMIT |
| Default | 50 |
Limit the number of jobs returned.
-i, --initiator
| Type | string |
| Environment | $CODER_PROVISIONER_JOB_LIST_INITIATOR |
Filter by initiator (user ID or username).
-O, --org
| Type | string |
| Environment | $CODER_ORGANIZATION |
Select which organization (uuid or name) to use.
-c, --column
| Type | [id|created at|started at|completed at|canceled at|error|error code|status|worker id|worker name|file id|tags|queue position|queue size|organization id|initiator id|template version id|workspace build id|type|available workers|template version name|template id|template name|template display name|template icon|workspace id|workspace name|logs overflowed|organization|queue] |
| Default | created at,id,type,template display name,status,queue,tags |
Columns to display in table output.
-o, --output
| Type | table|json |
| Default | table |
Output format.