-
Notifications
You must be signed in to change notification settings - Fork 11
fix: For the openedx-events broker, use kafka _everywhere_ instead of redis #142
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -449,7 +449,7 @@ services: | |
|
|
||
| lms: | ||
| # Switch to `--settings devstack_with_worker` if you want to use lms-worker | ||
| command: bash -c 'source /edx/app/edxapp/edxapp_env && while true; do python /edx/app/edxapp/edx-platform/manage.py lms runserver 0.0.0.0:18000 --settings devstack; sleep 2; done' | ||
| command: bash -c 'source /edx/app/edxapp/edxapp_env && (pip install -r /edx/private_requirements.txt; while true; do python /edx/app/edxapp/edx-platform/manage.py lms runserver 0.0.0.0:18000 --settings devstack; sleep 2; done)' | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Semi-related to my comment/question around LMS
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Here are several loosely related facts which are required to understand the situation:
So, basically I needed a way to install extra Kafka python requirements into the edxapp container without modifying the edxapp image. The images Devstack pulls are all the standard openedx images published to docker hub, and there's no pre-existing pipeline to build 2u-devstack-specific images, so adding a docker-compose step to install additional requirements seemed appropriate. |
||
| container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.lms" | ||
| hostname: lms.devstack.edx | ||
| depends_on: | ||
|
|
@@ -638,7 +638,7 @@ services: | |
|
|
||
| cms: | ||
| # Switch to `--settings devstack_with_worker` if you want to use cms-worker | ||
| command: bash -c 'source /edx/app/edxapp/edxapp_env && while true; do python /edx/app/edxapp/edx-platform/manage.py cms runserver 0.0.0.0:18010 --settings devstack; sleep 2; done' | ||
| command: bash -c 'source /edx/app/edxapp/edxapp_env && (pip install -r /edx/private_requirements.txt; while true; do python /edx/app/edxapp/edx-platform/manage.py lms runserver 0.0.0.0:18000 --settings devstack; sleep 2; done)' | ||
| container_name: "edx.${COMPOSE_PROJECT_NAME:-devstack}.cms" | ||
| hostname: cms.devstack.edx | ||
| depends_on: | ||
|
|
@@ -905,6 +905,22 @@ services: | |
| volumes: | ||
| - /edx/var/enterprise-subsidy | ||
|
|
||
| enterprise-subsidy-consume_learner_credit_course_enrollment_lifecycle: | ||
| image: edxops/enterprise-subsidy-dev | ||
| container_name: edx.devstack.enterprise-subsidy-consume_learner_credit_course_enrollment_lifecycle | ||
| depends_on: | ||
| - mysql80 | ||
| - memcached | ||
| command: >- | ||
| bash -c 'while true; do python /edx/app/enterprise-subsidy/manage.py consume_events -t learner-credit-course-enrollment-lifecycle -g enterprise_subsidy_dev; sleep 2; done' | ||
| tty: true | ||
| environment: | ||
| DJANGO_SETTINGS_MODULE: enterprise_subsidy.settings.devstack | ||
| working_dir: /edx/app/enterprise-subsidy | ||
| ports: | ||
| - "18281:18281" | ||
| stdin_open: true | ||
|
|
||
| # ========================================================================== | ||
| # edX Microfrontends | ||
| # | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -90,7 +90,7 @@ | |
|
|
||
| ################################ DEBUG TOOLBAR ################################ | ||
|
|
||
| INSTALLED_APPS += ['debug_toolbar'] | ||
| INSTALLED_APPS += ('debug_toolbar',) | ||
|
|
||
| MIDDLEWARE.append('debug_toolbar.middleware.DebugToolbarMiddleware') | ||
| INTERNAL_IPS = ('127.0.0.1',) | ||
|
|
@@ -296,11 +296,12 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing | |
| ] | ||
|
|
||
| #################### Event bus backend ######################## | ||
|
|
||
| EVENT_BUS_PRODUCER = 'edx_event_bus_redis.create_producer' | ||
| EVENT_BUS_REDIS_CONNECTION_URL = 'redis://:[email protected]:6379/' | ||
| INSTALLED_APPS += ('edx_event_bus_kafka',) | ||
| EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' | ||
| EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' | ||
| EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' | ||
| EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' | ||
| EVENT_BUS_TOPIC_PREFIX = 'dev' | ||
| EVENT_BUS_CONSUMER = 'edx_event_bus_redis.RedisEventConsumer' | ||
|
|
||
| course_catalog_event_setting = EVENT_BUS_PRODUCER_CONFIG['org.openedx.content_authoring.course.catalog_info.changed.v1'] | ||
| course_catalog_event_setting['course-catalog-info-changed']['enabled'] = True | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,9 +86,12 @@ | |
|
|
||
| CELERY_TASK_ALWAYS_EAGER = False | ||
|
|
||
| EVENT_BUS_CONSUMER = 'edx_event_bus_redis.RedisEventConsumer' | ||
| EVENT_BUS_PRODUCER = 'edx_event_bus_redis.create_producer' | ||
| EVENT_BUS_REDIS_CONNECTION_URL = 'redis://:[email protected]:6379/' | ||
| #################### Event bus backend ######################## | ||
| INSTALLED_APPS += ('edx_event_bus_kafka',) | ||
| EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' | ||
| EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' | ||
| EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' | ||
| EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' | ||
| EVENT_BUS_TOPIC_PREFIX = 'dev' | ||
|
|
||
| ##################################################################### | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -80,7 +80,7 @@ | |
|
|
||
| ################################ DEBUG TOOLBAR ################################ | ||
|
|
||
| INSTALLED_APPS += ['debug_toolbar'] | ||
| INSTALLED_APPS += ('debug_toolbar',) | ||
| MIDDLEWARE += [ | ||
| 'lms.djangoapps.discussion.django_comment_client.utils.QueryCountDebugMiddleware', | ||
| 'debug_toolbar.middleware.DebugToolbarMiddleware', | ||
|
|
@@ -504,10 +504,12 @@ def should_show_debug_toolbar(request): # lint-amnesty, pylint: disable=missing | |
| CLOSEST_CLIENT_IP_FROM_HEADERS = [] | ||
|
|
||
| #################### Event bus backend ######################## | ||
| EVENT_BUS_PRODUCER = 'edx_event_bus_redis.create_producer' | ||
| EVENT_BUS_REDIS_CONNECTION_URL = 'redis://:[email protected]:6379/' | ||
| INSTALLED_APPS += ('edx_event_bus_kafka',) | ||
| EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' | ||
| EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' | ||
| EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' | ||
| EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' | ||
|
Comment on lines
+508
to
+511
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🥳 |
||
| EVENT_BUS_TOPIC_PREFIX = 'dev' | ||
| EVENT_BUS_CONSUMER = 'edx_event_bus_redis.RedisEventConsumer' | ||
|
|
||
| certificate_revoked_event_config = EVENT_BUS_PRODUCER_CONFIG['org.openedx.learning.certificate.revoked.v1'] | ||
| certificate_revoked_event_config['learning-certificate-lifecycle']['enabled'] = True | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| confluent-kafka[avro,schema-registry]==2.10.0 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| confluent-kafka[avro,schema-registry]==2.10.0 |
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.
[curious] Are there no
private_requirements.txtfor the LMS?For example, is there an equivalent like the following needed:
Uh oh!
There was an error while loading. Please reload this page.
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.
Honestly, I don't know why settings are installed for both cms and lms for both images. But, in this case for requirements it would be redundant because they go to the same destination path inside the container.