Skip to content

Commit

Permalink
feat: allow to pass extra parameters for celery workers
Browse files Browse the repository at this point in the history
(cherry picked from commit c858d5d)
  • Loading branch information
Ian2012 committed Oct 3, 2024
1 parent c7732e5 commit 4282cc6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions tutorcelery/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class CELERY_WORKERS_ATTRS_TYPE(TypedDict):
max_replicas: NotRequired[int]
list_length: NotRequired[int]
enable_keda: bool
extra_params: NotRequired[dict[str, str]]


CELERY_WORKERS_CONFIG: Filter[dict[str, dict[str, CELERY_WORKERS_ATTRS_TYPE]], []] = (
Expand Down
3 changes: 3 additions & 0 deletions tutorcelery/patches/k8s-deployments
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ spec:
- "--hostname=edx.{{service}}.core.{{variant}}.%%h"
- "--max-tasks-per-child=100"
- "--queues=edx.{{service}}.core.{{variant}}"
{% for setting, value in config.get("extra_params", {}).items() %}
- "--{{setting}}={{value}}"
{% endfor %}
env:
- name: SERVICE_VARIANT
value: {{service}}
Expand Down
3 changes: 3 additions & 0 deletions tutorcelery/patches/k8s-override
Original file line number Diff line number Diff line change
Expand Up @@ -23,4 +23,7 @@ spec:
{% else -%}
- "--exclude-queues=edx.{{exclude}}.core.default"
{% endif -%}
{% for setting, value in config.get("extra_params", {}).items() %}
- "--{{setting}}={{value}}"
{% endfor %}
{% endfor %}

0 comments on commit 4282cc6

Please sign in to comment.