-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Add support for multiple Celery worker groups with queue-specific configurations in Helm chart #56589
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
Add support for multiple Celery worker groups with queue-specific configurations in Helm chart #56589
Conversation
|
We have this exact use case where we want to define different queues for different celery workers, potentially with different labels and tolerations. Thanks for the PR! |
|
Hi @HsiuChuanHsu, thanks for this PR! I personally planned to work on this feature somewhere in the future. I have one question: some time ago, I merged the split of the |
|
Hi @Miretpl, |
20ae869 to
085a66f
Compare
085a66f to
1e38b5d
Compare
ashb
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please add some tests in helm-tests/tests/helm-tests/ folder for this change.
1e38b5d to
4ac1805
Compare
|
Thanks for the review! I've summarized the improvements below.
|
4ac1805 to
34a881f
Compare
jscheffl
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From my view this PR is a usable extension and review comments have been mostly addressed.
If KEDA and HPA is not usable in parallel with the worker groups we should mention it in the docs as (current) clear limitation.
One potentially missing this is what I saw that all worker groups take the same celery command line definition, so this means if I want to define different --concurrency per worker type I need to make this via env, correct? Maybe also worth noting in the docs (e.g. schema in line 2664).
Approving and would be happy about the small docs adjustments and if no other objection would merge then after.
34a881f to
0cc0b75
Compare
|
Thanks for your review! Summary of changes:
Agree that this limitation must be clearly documented.
Next Steps: Will continue working on enableing support for HPA & KEDA.
Yes, your understanding is correct.
|
Added workers.celeryQueueGroups in values.yaml to define worker groups. Refactored worker-deployment.yaml to support multiple worker groups using a range loop. Fixed context reference issues (. to $).
0cc0b75 to
8b76366
Compare
|
Note: Functionality overlaps with #58547 and even though this was before it is lagging KEDA and HPA support and is more complex. Would it be OK to favor the other PR or is there a missing piece which would be needed to the other? |

Summary
This PR adds support for multiple Celery worker groups. Each group can now be independently configured to target specific queues and use distinct resource settings
Changes
New Configuration:
workers.celeryQueueGroupsAdded support for defining multiple worker deployments through the
workers.celeryQueueGroupsconfiguration. Each group can specify:name: (required) Unique name for the worker groupqueues: (required) Comma-separated list of Celery queuesreplicas: (required) Number of worker replicasnodeSelector: (optional)affinity: (optional)tolerations: (optional)topologySpreadConstraints: (optional)resources: (optional)labels: (optional)podAnnotations: (optional)priorityClassName: (optional)env: (optional)worker-deployment.yamlLogicceleryQueueGroupsdefined), the template maintains original setup using existingworkers.* configurationexec airflow celery worker --queues <group-queues>worker-service.yamlLogicworker-grouplabel selector{{ airflow.fullname }}-worker-<group-name>closes: #56591
^ Add meaningful description above
Read the Pull Request Guidelines for more information.
In case of fundamental code changes, an Airflow Improvement Proposal (AIP) is needed.
In case of a new dependency, check compliance with the ASF 3rd Party License Policy.
In case of backwards incompatible changes please leave a note in a newsfragment file, named
{pr_number}.significant.rstor{issue_number}.significant.rst, in airflow-core/newsfragments.