7
0
mirror of https://github.com/ChristianLight/tutor.git synced 2024-06-29 09:43:29 +00:00
tutor/tutor/templates/local/docker-compose.yml
Régis Behmo 40a76330f6 Fix unsent activation emails and other asynchronous tasks
Half of the tasks from edx.lms.core.default celery queue were being
processed by the CMS worker. Unfortunately, this CMS worker crashes on
some of those tasks. For instance, activation emails complain of a
missing "django_markup" template tag library because "xss_utils" is not
part of the installed app in the CMS.

The problem is that we need this edx.lms.core.default queue to be part
of the CELERY_QUEUES in the cms in order to send tasks from the CMS to
the LMS. The trick to resolve this situation is to ask the CMS celery
worker to not process the tasks from this queue.

To debug this issue, run in the LMS:

    from student.tasks import send_activation_email
    send_activation_email("{}")

Then watch the logs of the lms and cms workers. If the CMS workers picks
up this task (50% of the time prior to this change) then we have an
issue.

See:
https://discuss.overhang.io/t/reset-password-email-sent-but-activation-email-dont/690
2020-06-22 12:11:15 +02:00

166 lines
5.8 KiB
YAML

version: "3.7"
services:
############# External services
{% if ACTIVATE_MEMCACHED %}
memcached:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MEMCACHED }}
restart: unless-stopped
{% endif %}
{% if ACTIVATE_MONGODB %}
mongodb:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MONGODB }}
# Use WiredTiger in all environments, just like at edx.org
command: mongod --smallfiles --nojournal --storageEngine wiredTiger
restart: unless-stopped
volumes:
- ../../data/mongodb:/data/db
{% endif %}
{% if ACTIVATE_MYSQL %}
mysql:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_MYSQL }}
command: mysqld --character-set-server=utf8 --collation-server=utf8_general_ci
restart: unless-stopped
volumes:
- ../../data/mysql:/var/lib/mysql
environment:
MYSQL_ROOT_PASSWORD: "{{ MYSQL_ROOT_PASSWORD }}"
{% endif %}
{% if ACTIVATE_ELASTICSEARCH %}
elasticsearch:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_ELASTICSEARCH }}
command: ["elasticsearch", "-Xms{{ ELASTICSEARCH_HEAP_SIZE }}", "-Xmx{{ ELASTICSEARCH_HEAP_SIZE }}", "--cluster.name=openedx", "--bootstrap.mlockall=true"]
ulimits:
memlock:
soft: -1
hard: -1
restart: unless-stopped
volumes:
- ../../data/elasticsearch:/usr/share/elasticsearch/data
{% endif %}
{% if ACTIVATE_RABBITMQ %}
rabbitmq:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_RABBITMQ }}
volumes:
- ../../data/rabbitmq:/var/lib/rabbitmq
restart: unless-stopped
{% endif %}
{% if ACTIVATE_SMTP %}
smtp:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_SMTP }}
restart: unless-stopped
{% endif %}
############# Forum
{% if ACTIVATE_FORUM %}
forum:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_FORUM }}
environment:
SEARCH_SERVER: "{{ ELASTICSEARCH_SCHEME }}://{{ ELASTICSEARCH_HOST }}:{{ ELASTICSEARCH_PORT }}"
MONGODB_AUTH: "{% if MONGODB_USERNAME and MONGODB_PASSWORD %}{{ MONGODB_USERNAME}}:{{ MONGODB_PASSWORD }}@{% endif %}"
MONGODB_HOST: "{{ MONGODB_HOST }}"
MONGODB_PORT: "{{ MONGODB_PORT }}"
restart: unless-stopped
depends_on: {{ [("elasticsearch", ACTIVATE_ELASTICSEARCH), ("mongodb", ACTIVATE_MONGODB)]|list_if }}
{% endif %}
############# LMS and CMS
{% if ACTIVATE_LMS %}
lms:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: lms
GUNICORN_WORKERS: {{ OPENEDX_LMS_GUNICORN_WORKERS }}
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/lms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- mysql
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_FORUM %}- forum{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{{ patch("local-docker-compose-lms-dependencies")|indent(6) }}
{% endif %}
{% if ACTIVATE_CMS %}
cms:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: cms
GUNICORN_WORKERS: {{ OPENEDX_CMS_GUNICORN_WORKERS }}
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/cms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- mysql
{% if ACTIVATE_ELASTICSEARCH %}- elasticsearch{% endif %}
{% if ACTIVATE_MEMCACHED %}- memcached{% endif %}
{% if ACTIVATE_MONGODB %}- mongodb{% endif %}
{% if ACTIVATE_RABBITMQ %}- rabbitmq{% endif %}
{% if ACTIVATE_SMTP %}- smtp{% endif %}
{% if ACTIVATE_LMS %}- lms{% endif %}
{{ patch("local-docker-compose-cms-dependencies")|indent(6) }}
{% endif %}
############# LMS and CMS workers
{% if ACTIVATE_LMS %}
lms-worker:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: lms
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
command: ./manage.py lms celery worker --loglevel=info --hostname=edx.lms.core.default.%%h --maxtasksperchild 100
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/lms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- lms
{% endif %}
{% if ACTIVATE_CMS %}
cms-worker:
image: {{ DOCKER_REGISTRY }}{{ DOCKER_IMAGE_OPENEDX }}
environment:
SERVICE_VARIANT: cms
SETTINGS: ${EDX_PLATFORM_SETTINGS:-tutor.production}
C_FORCE_ROOT: "1" # run celery tasks as root #nofear
command: ./manage.py cms celery worker --loglevel=info --hostname=edx.cms.core.default.%%h --maxtasksperchild 100 --exclude-queues=edx.lms.core.default
restart: unless-stopped
volumes:
- ../apps/openedx/settings/lms/:/openedx/edx-platform/lms/envs/tutor/
- ../apps/openedx/settings/cms/:/openedx/edx-platform/cms/envs/tutor/
- ../apps/openedx/config/:/openedx/config/
- ../../data/cms:/openedx/data
- ../../data/openedx-media:/openedx/media
depends_on:
- cms
{% endif %}
{{ patch("local-docker-compose-services")|indent(2) }}