Skip to content

Commit

Permalink
fix: allow to disable multiqueue tuning
Browse files Browse the repository at this point in the history
  • Loading branch information
Ian2012 committed Aug 13, 2024
1 parent 211c58b commit 43f3f1d
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 2 deletions.
3 changes: 2 additions & 1 deletion tutorcelery/patches/k8s-deployments
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if CELERY_MULTIQUEUE_ENABLED %}
{% for service, variants in CELERY_WORKER_VARIANTS.items() %}
{% for variant in variants%}
{% set deployment = service + "-" + "worker" + "-" + variant.replace("_", "-") %}
Expand Down Expand Up @@ -52,7 +53,7 @@ spec:
name: openedx-config
{% endfor %}
{% endfor %}

{% endif %}
{% if CELERY_FLOWER -%}
---
apiVersion: apps/v1
Expand Down
2 changes: 2 additions & 0 deletions tutorcelery/patches/k8s-override
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{% if CELERY_MULTIQUEUE_ENABLED %}
{% for service in ["lms", "cms"] %}
---
apiVersion: apps/v1
Expand All @@ -18,3 +19,4 @@ spec:
- "--max-tasks-per-child=100"
- "--queues=edx.{{service}}.core.default"
{% endfor %}
{% endif %}
3 changes: 2 additions & 1 deletion tutorcelery/patches/openedx-cms-production-settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{% if CELERY_MULTIQUEUE_ENABLED %}
try:
EXPLICIT_QUEUES.update({{CELERY_CMS_EXPLICIT_QUEUES}})
except NameError:
EXPLICIT_QUEUES = {{CELERY_CMS_EXPLICIT_QUEUES}}

{% endif %}
# Prevents losing tasks when workers are shutdown
CELERY_ACKS_LATE = True
2 changes: 2 additions & 0 deletions tutorcelery/patches/openedx-lms-production-settings
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
{% if CELERY_MULTIQUEUE_ENABLED %}
try:
EXPLICIT_QUEUES.update({{CELERY_LMS_EXPLICIT_QUEUES}})
except NameError:
EXPLICIT_QUEUES = {{CELERY_LMS_EXPLICIT_QUEUES}}
{% endif %}

# Prevents losing tasks when workers are shutdown
CELERY_ACKS_LATE = True
1 change: 1 addition & 0 deletions tutorcelery/plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
("CELERY_FLOWER", False),
("CELERY_FLOWER_HOST", "flower.{{LMS_HOST}}"),
("CELERY_FLOWER_DOCKER_IMAGE", "docker.io/mher/flower:2.0.1"),
("CELERY_MULTIQUEUE_ENABLED", False),
]
)

Expand Down

0 comments on commit 43f3f1d

Please sign in to comment.