Skip to content

Allow for dynamic concurrency limit for generate artifacts in Prefect#9353

Draft
ogenstad wants to merge 1 commit into
developfrom
pog-prefect-concurrency-setup
Draft

Allow for dynamic concurrency limit for generate artifacts in Prefect#9353
ogenstad wants to merge 1 commit into
developfrom
pog-prefect-concurrency-setup

Conversation

@ogenstad
Copy link
Copy Markdown
Contributor

@ogenstad ogenstad commented May 26, 2026

Why

A very high number of concurrent requests to regenerate artefacts could overwhelm the system, this PR introduces a way to configure a limit when it comes to concurrent tasks of this type.

While the initial target is for artifacts it can be expanded to include other jobs as well.

What changed

How to review

How to test

# Commands to validate

Impact & rollout

  • Backward compatibility:
  • Performance:
  • Config/env changes:
  • Deployment notes:

Checklist

  • Tests added/updated
  • Changelog entry added (uv run towncrier create ...)
  • External docs updated (if user-facing or ops-facing change)
  • Internal .md docs updated (internal knowledge and AI code tools knowledge)
  • I have reviewed AI generated content

Summary by cubic

Adds an operator-configurable concurrency cap for the artifact-generate workflow in Prefect deployments to prevent overload. Default cap is 10; set to 0 for no cap.

  • New Features

    • Introduced WorkflowConcurrencyLimits with artifact_generate limit (default 10).
    • Resolved at deploy time: artifact-generate links to this setting via ConcurrencyLimitConfig; 0 becomes None (unlimited) on the deployment.
    • Added env var INFRAHUB_WORKFLOW_CONCURRENCY_LIMIT_ARTIFACT_GENERATE and wired it in docker-compose.yml.
    • Included unit tests covering resolution and validation.
  • Migration

    • No breaking changes; default behavior now caps artifact-generate at 10.
    • To change: set INFRAHUB_WORKFLOW_CONCURRENCY_LIMIT_ARTIFACT_GENERATE=<int>.
    • To disable the cap: set INFRAHUB_WORKFLOW_CONCURRENCY_LIMIT_ARTIFACT_GENERATE=0.

Written for commit 91587e4. Summary will update on new commits. Review in cubic

Copy link
Copy Markdown
Contributor

@cubic-dev-ai cubic-dev-ai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 7 files

Confidence score: 5/5

  • Automated review surfaced no issues in the provided summaries.
  • No files require special attention.

Shadow auto-approve: would auto-approve. This PR adds a configurable concurrency cap for the artifact-generate workflow with a safe default of 10, fully tested via unit tests, and follows existing patterns without altering core business logic, data, or infrastructure.

Re-trigger cubic

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant