From c2dd17f8f8d6cb4d3115fd33d2b1b488ac41c03c Mon Sep 17 00:00:00 2001 From: michaelroytman Date: Fri, 22 Sep 2023 09:40:30 -0400 Subject: [PATCH 1/3] feat: add openedx_events and edx_event_bus_kafka to INSTALLED_APPS --- edx_exams/settings/base.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/edx_exams/settings/base.py b/edx_exams/settings/base.py index 91d93a7c..c4c86c17 100644 --- a/edx_exams/settings/base.py +++ b/edx_exams/settings/base.py @@ -28,11 +28,13 @@ def root(*path_fragments): 'django.contrib.sessions', 'django.contrib.messages', 'django.contrib.staticfiles', + 'edx_event_bus_kafka', 'release_util', 'drf_yasg', 'edx_api_doc_tools', 'lti_consumer.apps.LTIConsumerApp', 'token_utils', + 'openedx_events', ) THIRD_PARTY_APPS = ( From 3c5ca59c2a991cbf40b1b49025f23eb52a6b0a3c Mon Sep 17 00:00:00 2001 From: michaelroytman Date: Fri, 22 Sep 2023 09:54:21 -0400 Subject: [PATCH 2/3] feat: install confluent_kafka[avro,schema-registry] for use with edx-event-bus-kafka --- requirements/base.in | 9 ++++++ requirements/base.txt | 33 ++++++++++++--------- requirements/ci.txt | 6 ++-- requirements/dev.txt | 58 ++++++++++++++++++++---------------- requirements/doc.txt | 54 ++++++++++++++++++--------------- requirements/pip-tools.txt | 2 +- requirements/pip.txt | 2 +- requirements/production.txt | 34 ++++++++++++--------- requirements/quality.txt | 54 ++++++++++++++++++--------------- requirements/test.txt | 43 +++++++++++++++------------ requirements/validation.txt | 59 ++++++++++++++++++++++--------------- 11 files changed, 204 insertions(+), 150 deletions(-) diff --git a/requirements/base.in b/requirements/base.in index f4f97910..0fc122b5 100644 --- a/requirements/base.in +++ b/requirements/base.in @@ -1,6 +1,15 @@ # Core requirements for using this application -c constraints.txt +# The confluent_kafka[avro,schema-registry] dependencies should eventually be moved to some form of optional +# dependency management because the installation of confluent_kafka poses issues for users of Tutor on M1 Macs, which +# includes many in the Open edX community. +# For now, we will keep this as an explicit dependency until we plan to move edx-exams to the openedx GitHub +# organization. +# For more details, please see https://github.com/openedx/event-bus-kafka/blob/main/docs/decisions/ +# 0005-optional-import-of-confluent-kafka.rst. +# TODO: Move confluent_kafka to optional dependency management: https://2u-internal.atlassian.net/browse/MST-2160 +confluent_kafka[avro,schema-registry] Django # Web application framework django-cors-headers django-extensions diff --git a/requirements/base.txt b/requirements/base.txt index 860280f3..ffe3afbe 100644 --- a/requirements/base.txt +++ b/requirements/base.txt @@ -12,11 +12,13 @@ attrs==23.1.0 # via # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via confluent-kafka bleach==6.0.0 # via lti-consumer-xblock -boto3==1.28.42 +boto3==1.28.52 # via fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # boto3 # s3transfer @@ -34,13 +36,15 @@ click==8.1.7 # edx-django-utils code-annotations==1.5.0 # via edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/base.in coreapi==2.3.3 # via # django-rest-swagger # openapi-codec coreschema==0.0.4 # via coreapi -cryptography==41.0.3 +cryptography==41.0.4 # via # pyjwt # social-auth-core @@ -80,7 +84,7 @@ django==3.2.21 # social-auth-app-django django-appconf==1.0.5 # via django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via lti-consumer-xblock django-cors-headers==4.2.0 # via -r requirements/base.in @@ -90,7 +94,7 @@ django-crum==0.7.9 # edx-toggles django-extensions==3.2.3 # via -r requirements/base.in -django-filter==23.2 +django-filter==23.3 # via lti-consumer-xblock django-model-utils==4.3.1 # via -r requirements/base.in @@ -137,11 +141,11 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/base.in -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/base.in -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.in # edx-ccx-keys @@ -155,7 +159,9 @@ edx-toggles==5.1.0 edx-token-utils==0.2.1 # via -r requirements/base.in fastavro==1.8.3 - # via openedx-events + # via + # confluent-kafka + # openedx-events fs==2.4.16 # via # fs-s3fs @@ -181,7 +187,7 @@ jmespath==1.0.1 # botocore jsonfield==3.1.0 # via lti-consumer-xblock -lazy==1.5 +lazy==1.6 # via # lti-consumer-xblock # xblock @@ -229,7 +235,7 @@ psutil==5.9.5 # via edx-django-utils pycparser==2.21 # via cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # lti-consumer-xblock # pyjwkest @@ -251,7 +257,6 @@ pynacl==1.5.0 python-dateutil==2.8.2 # via # botocore - # edx-drf-extensions # xblock python-slugify==8.0.1 # via code-annotations @@ -272,6 +277,7 @@ pyyaml==6.0.1 # xblock requests==2.31.0 # via + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -295,7 +301,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # fs # fs-s3fs # pyjwkest @@ -317,7 +322,7 @@ stevedore==5.1.0 # edx-opaque-keys text-unidecode==1.3 # via python-slugify -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # asgiref # edx-opaque-keys diff --git a/requirements/ci.txt b/requirements/ci.txt index 901751c3..57563091 100644 --- a/requirements/ci.txt +++ b/requirements/ci.txt @@ -6,7 +6,7 @@ # distlib==0.3.7 # via virtualenv -filelock==3.12.3 +filelock==3.12.4 # via # tox # virtualenv @@ -26,7 +26,5 @@ tox==3.28.0 # via # -c https://raw.githubusercontent.com/edx/edx-lint/master/edx_lint/files/common_constraints.txt # -r requirements/ci.in -typing-extensions==4.7.1 - # via filelock -virtualenv==20.24.4 +virtualenv==20.24.5 # via tox diff --git a/requirements/dev.txt b/requirements/dev.txt index 7b4488fc..5d846abe 100644 --- a/requirements/dev.txt +++ b/requirements/dev.txt @@ -22,16 +22,19 @@ attrs==23.1.0 # -r requirements/validation.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/validation.txt + # confluent-kafka bleach==6.0.0 # via # -r requirements/validation.txt # lti-consumer-xblock - # readme-renderer -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/validation.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/validation.txt # boto3 @@ -73,6 +76,8 @@ code-annotations==1.5.0 # -r requirements/validation.txt # edx-lint # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/validation.txt coreapi==2.3.3 # via # -r requirements/validation.txt @@ -86,7 +91,7 @@ coverage[toml]==7.3.1 # via # -r requirements/validation.txt # pytest-cov -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/validation.txt # pyjwt @@ -143,7 +148,7 @@ django-appconf==1.0.5 # via # -r requirements/validation.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/validation.txt # lti-consumer-xblock @@ -156,11 +161,11 @@ django-crum==0.7.9 # edx-toggles django-debug-toolbar==4.2.0 # via -r requirements/dev.in -django-dynamic-fixture==4.0.0 +django-dynamic-fixture==4.0.1 # via -r requirements/validation.txt django-extensions==3.2.3 # via -r requirements/validation.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/validation.txt # lti-consumer-xblock @@ -219,15 +224,15 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/validation.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/validation.txt -edx-i18n-tools==1.1.0 +edx-i18n-tools==1.2.0 # via -r requirements/dev.in edx-lint==5.3.4 # via -r requirements/validation.txt -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/validation.txt # edx-ccx-keys @@ -248,15 +253,16 @@ exceptiongroup==1.1.3 # pytest factory-boy==3.3.0 # via -r requirements/validation.txt -faker==19.4.0 +faker==19.6.2 # via # -r requirements/validation.txt # factory-boy fastavro==1.8.3 # via # -r requirements/validation.txt + # confluent-kafka # openedx-events -filelock==3.12.3 +filelock==3.12.4 # via # -r requirements/validation.txt # tox @@ -288,7 +294,7 @@ importlib-metadata==6.8.0 # build # keyring # twine -importlib-resources==6.0.1 +importlib-resources==6.1.0 # via # -r requirements/validation.txt # keyring @@ -331,7 +337,7 @@ keyring==24.2.0 # via # -r requirements/validation.txt # twine -lazy==1.5 +lazy==1.6 # via # -r requirements/validation.txt # lti-consumer-xblock @@ -382,6 +388,10 @@ newrelic==9.0.0 # via # -r requirements/validation.txt # edx-django-utils +nh3==0.2.14 + # via + # -r requirements/validation.txt + # readme-renderer oauthlib==3.2.2 # via # -r requirements/validation.txt @@ -452,7 +462,7 @@ pycparser==2.21 # via # -r requirements/validation.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/validation.txt # lti-consumer-xblock @@ -510,7 +520,7 @@ pyproject-hooks==1.0.0 # via # -r requirements/pip-tools.txt # build -pytest==7.4.1 +pytest==7.4.2 # via # -r requirements/validation.txt # pytest-cov @@ -523,7 +533,6 @@ python-dateutil==2.8.2 # via # -r requirements/validation.txt # botocore - # edx-drf-extensions # faker # freezegun # xblock @@ -551,13 +560,14 @@ pyyaml==6.0.1 # edx-i18n-tools # responses # xblock -readme-renderer==41.0 +readme-renderer==42.0 # via # -r requirements/validation.txt # twine requests==2.31.0 # via # -r requirements/validation.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -582,7 +592,7 @@ rfc3986==2.0.0 # via # -r requirements/validation.txt # twine -rich==13.5.2 +rich==13.5.3 # via # -r requirements/validation.txt # twine @@ -606,7 +616,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # edx-lint # fs # fs-s3fs @@ -668,14 +677,13 @@ types-pyyaml==6.0.12.11 # via # -r requirements/validation.txt # responses -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/validation.txt # asgiref # astroid # edx-opaque-keys # faker - # filelock # pylint # rich uritemplate==4.1.1 @@ -690,7 +698,7 @@ urllib3==1.26.16 # requests # responses # twine -virtualenv==20.24.4 +virtualenv==20.24.5 # via # -r requirements/validation.txt # tox @@ -724,7 +732,7 @@ xblock-utils==3.4.1 # via # -r requirements/validation.txt # lti-consumer-xblock -zipp==3.16.2 +zipp==3.17.0 # via # -r requirements/pip-tools.txt # -r requirements/validation.txt diff --git a/requirements/doc.txt b/requirements/doc.txt index 67330d00..5e25e1f1 100644 --- a/requirements/doc.txt +++ b/requirements/doc.txt @@ -24,18 +24,21 @@ attrs==23.1.0 # -r requirements/test.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/test.txt + # confluent-kafka babel==2.12.1 # via sphinx bleach==6.0.0 # via # -r requirements/test.txt # lti-consumer-xblock - # readme-renderer -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/test.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/test.txt # boto3 @@ -71,6 +74,8 @@ code-annotations==1.5.0 # -r requirements/test.txt # edx-lint # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/test.txt coreapi==2.3.3 # via # -r requirements/test.txt @@ -84,7 +89,7 @@ coverage[toml]==7.3.1 # via # -r requirements/test.txt # pytest-cov -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/test.txt # pyjwt @@ -138,7 +143,7 @@ django-appconf==1.0.5 # via # -r requirements/test.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/test.txt # lti-consumer-xblock @@ -149,11 +154,11 @@ django-crum==0.7.9 # -r requirements/test.txt # edx-django-utils # edx-toggles -django-dynamic-fixture==4.0.0 +django-dynamic-fixture==4.0.1 # via -r requirements/test.txt django-extensions==3.2.3 # via -r requirements/test.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/test.txt # lti-consumer-xblock @@ -218,13 +223,13 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/test.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/test.txt edx-lint==5.3.4 # via -r requirements/test.txt -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/test.txt # edx-ccx-keys @@ -247,15 +252,16 @@ exceptiongroup==1.1.3 # pytest factory-boy==3.3.0 # via -r requirements/test.txt -faker==19.4.0 +faker==19.6.2 # via # -r requirements/test.txt # factory-boy fastavro==1.8.3 # via # -r requirements/test.txt + # confluent-kafka # openedx-events -filelock==3.12.3 +filelock==3.12.4 # via # -r requirements/test.txt # tox @@ -288,7 +294,7 @@ importlib-metadata==6.8.0 # keyring # sphinx # twine -importlib-resources==6.0.1 +importlib-resources==6.1.0 # via keyring inflection==0.5.1 # via @@ -325,7 +331,7 @@ jsonfield==3.1.0 # lti-consumer-xblock keyring==24.2.0 # via twine -lazy==1.5 +lazy==1.6 # via # -r requirements/test.txt # lti-consumer-xblock @@ -370,6 +376,8 @@ newrelic==9.0.0 # via # -r requirements/test.txt # edx-django-utils +nh3==0.2.14 + # via readme-renderer oauthlib==3.2.2 # via # -r requirements/test.txt @@ -429,7 +437,7 @@ pycparser==2.21 # via # -r requirements/test.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/test.txt # lti-consumer-xblock @@ -483,7 +491,7 @@ pynacl==1.5.0 # edx-django-utils pyproject-hooks==1.0.0 # via build -pytest==7.4.1 +pytest==7.4.2 # via # -r requirements/test.txt # pytest-cov @@ -496,7 +504,6 @@ python-dateutil==2.8.2 # via # -r requirements/test.txt # botocore - # edx-drf-extensions # faker # freezegun # xblock @@ -524,11 +531,12 @@ pyyaml==6.0.1 # edx-django-release-util # responses # xblock -readme-renderer==41.0 +readme-renderer==42.0 # via twine requests==2.31.0 # via # -r requirements/test.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -552,7 +560,7 @@ restructuredtext-lint==1.4.0 # via doc8 rfc3986==2.0.0 # via twine -rich==13.5.2 +rich==13.5.3 # via twine s3transfer==0.6.2 # via @@ -574,7 +582,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # edx-lint # edx-sphinx-theme # fs @@ -652,14 +659,13 @@ types-pyyaml==6.0.12.11 # via # -r requirements/test.txt # responses -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/test.txt # asgiref # astroid # edx-opaque-keys # faker - # filelock # pylint # rich uritemplate==4.1.1 @@ -674,7 +680,7 @@ urllib3==1.26.16 # requests # responses # twine -virtualenv==20.24.4 +virtualenv==20.24.5 # via # -r requirements/test.txt # tox @@ -704,7 +710,7 @@ xblock-utils==3.4.1 # via # -r requirements/test.txt # lti-consumer-xblock -zipp==3.16.2 +zipp==3.17.0 # via # importlib-metadata # importlib-resources diff --git a/requirements/pip-tools.txt b/requirements/pip-tools.txt index d2e8e4e5..894fa179 100644 --- a/requirements/pip-tools.txt +++ b/requirements/pip-tools.txt @@ -23,7 +23,7 @@ tomli==2.0.1 # pyproject-hooks wheel==0.41.2 # via pip-tools -zipp==3.16.2 +zipp==3.17.0 # via importlib-metadata # The following packages are considered to be unsafe in a requirements file: diff --git a/requirements/pip.txt b/requirements/pip.txt index da0741c5..3e7d8f4a 100644 --- a/requirements/pip.txt +++ b/requirements/pip.txt @@ -10,5 +10,5 @@ wheel==0.41.2 # The following packages are considered to be unsafe in a requirements file: pip==23.2.1 # via -r requirements/pip.in -setuptools==68.2.0 +setuptools==68.2.2 # via -r requirements/pip.in diff --git a/requirements/production.txt b/requirements/production.txt index 897e808f..5a90800a 100644 --- a/requirements/production.txt +++ b/requirements/production.txt @@ -17,15 +17,19 @@ attrs==23.1.0 # -r requirements/base.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/base.txt + # confluent-kafka bleach==6.0.0 # via # -r requirements/base.txt # lti-consumer-xblock -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/base.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/base.txt # boto3 @@ -52,6 +56,8 @@ code-annotations==1.5.0 # via # -r requirements/base.txt # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/base.txt coreapi==2.3.3 # via # -r requirements/base.txt @@ -61,7 +67,7 @@ coreschema==0.0.4 # via # -r requirements/base.txt # coreapi -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/base.txt # pyjwt @@ -104,7 +110,7 @@ django-appconf==1.0.5 # via # -r requirements/base.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/base.txt # lti-consumer-xblock @@ -117,7 +123,7 @@ django-crum==0.7.9 # edx-toggles django-extensions==3.2.3 # via -r requirements/base.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/base.txt # lti-consumer-xblock @@ -172,11 +178,11 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/base.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/base.txt -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.txt # edx-ccx-keys @@ -194,6 +200,7 @@ edx-token-utils==0.2.1 fastavro==1.8.3 # via # -r requirements/base.txt + # confluent-kafka # openedx-events fs==2.4.16 # via @@ -209,7 +216,7 @@ future==0.18.3 # via # -r requirements/base.txt # pyjwkest -gevent==23.9.0.post1 +gevent==23.9.1 # via -r requirements/production.in greenlet==2.0.2 # via gevent @@ -241,7 +248,7 @@ jsonfield==3.1.0 # via # -r requirements/base.txt # lti-consumer-xblock -lazy==1.5 +lazy==1.6 # via # -r requirements/base.txt # lti-consumer-xblock @@ -312,7 +319,7 @@ pycparser==2.21 # via # -r requirements/base.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/base.txt # lti-consumer-xblock @@ -342,7 +349,6 @@ python-dateutil==2.8.2 # via # -r requirements/base.txt # botocore - # edx-drf-extensions # xblock python-memcached==1.59 # via -r requirements/production.in @@ -372,6 +378,7 @@ pyyaml==6.0.1 requests==2.31.0 # via # -r requirements/base.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -403,7 +410,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # fs # fs-s3fs # pyjwkest @@ -436,7 +442,7 @@ text-unidecode==1.3 # via # -r requirements/base.txt # python-slugify -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/base.txt # asgiref diff --git a/requirements/quality.txt b/requirements/quality.txt index 7c03db68..959d6d66 100644 --- a/requirements/quality.txt +++ b/requirements/quality.txt @@ -22,16 +22,19 @@ attrs==23.1.0 # -r requirements/test.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/test.txt + # confluent-kafka bleach==6.0.0 # via # -r requirements/test.txt # lti-consumer-xblock - # readme-renderer -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/test.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/test.txt # boto3 @@ -65,6 +68,8 @@ code-annotations==1.5.0 # -r requirements/test.txt # edx-lint # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/test.txt coreapi==2.3.3 # via # -r requirements/test.txt @@ -78,7 +83,7 @@ coverage[toml]==7.3.1 # via # -r requirements/test.txt # pytest-cov -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/test.txt # pyjwt @@ -132,7 +137,7 @@ django-appconf==1.0.5 # via # -r requirements/test.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/test.txt # lti-consumer-xblock @@ -143,11 +148,11 @@ django-crum==0.7.9 # -r requirements/test.txt # edx-django-utils # edx-toggles -django-dynamic-fixture==4.0.0 +django-dynamic-fixture==4.0.1 # via -r requirements/test.txt django-extensions==3.2.3 # via -r requirements/test.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/test.txt # lti-consumer-xblock @@ -206,15 +211,15 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/test.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/test.txt edx-lint==5.3.4 # via # -r requirements/quality.in # -r requirements/test.txt -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/test.txt # edx-ccx-keys @@ -235,15 +240,16 @@ exceptiongroup==1.1.3 # pytest factory-boy==3.3.0 # via -r requirements/test.txt -faker==19.4.0 +faker==19.6.2 # via # -r requirements/test.txt # factory-boy fastavro==1.8.3 # via # -r requirements/test.txt + # confluent-kafka # openedx-events -filelock==3.12.3 +filelock==3.12.4 # via # -r requirements/test.txt # tox @@ -272,7 +278,7 @@ importlib-metadata==6.8.0 # via # keyring # twine -importlib-resources==6.0.1 +importlib-resources==6.1.0 # via keyring inflection==0.5.1 # via @@ -309,7 +315,7 @@ jsonfield==3.1.0 # lti-consumer-xblock keyring==24.2.0 # via twine -lazy==1.5 +lazy==1.6 # via # -r requirements/test.txt # lti-consumer-xblock @@ -354,6 +360,8 @@ newrelic==9.0.0 # via # -r requirements/test.txt # edx-django-utils +nh3==0.2.14 + # via readme-renderer oauthlib==3.2.2 # via # -r requirements/test.txt @@ -413,7 +421,7 @@ pycparser==2.21 # via # -r requirements/test.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/test.txt # lti-consumer-xblock @@ -465,7 +473,7 @@ pynacl==1.5.0 # via # -r requirements/test.txt # edx-django-utils -pytest==7.4.1 +pytest==7.4.2 # via # -r requirements/test.txt # pytest-cov @@ -478,7 +486,6 @@ python-dateutil==2.8.2 # via # -r requirements/test.txt # botocore - # edx-drf-extensions # faker # freezegun # xblock @@ -505,11 +512,12 @@ pyyaml==6.0.1 # edx-django-release-util # responses # xblock -readme-renderer==41.0 +readme-renderer==42.0 # via twine requests==2.31.0 # via # -r requirements/test.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -530,7 +538,7 @@ responses==0.23.3 # via -r requirements/test.txt rfc3986==2.0.0 # via twine -rich==13.5.2 +rich==13.5.3 # via twine s3transfer==0.6.2 # via @@ -552,7 +560,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # edx-lint # fs # fs-s3fs @@ -609,14 +616,13 @@ types-pyyaml==6.0.12.11 # via # -r requirements/test.txt # responses -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/test.txt # asgiref # astroid # edx-opaque-keys # faker - # filelock # pylint # rich uritemplate==4.1.1 @@ -631,7 +637,7 @@ urllib3==1.26.16 # requests # responses # twine -virtualenv==20.24.4 +virtualenv==20.24.5 # via # -r requirements/test.txt # tox @@ -661,7 +667,7 @@ xblock-utils==3.4.1 # via # -r requirements/test.txt # lti-consumer-xblock -zipp==3.16.2 +zipp==3.17.0 # via # importlib-metadata # importlib-resources diff --git a/requirements/test.txt b/requirements/test.txt index 683e7424..c48a5431 100644 --- a/requirements/test.txt +++ b/requirements/test.txt @@ -21,15 +21,19 @@ attrs==23.1.0 # -r requirements/base.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/base.txt + # confluent-kafka bleach==6.0.0 # via # -r requirements/base.txt # lti-consumer-xblock -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/base.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/base.txt # boto3 @@ -62,6 +66,8 @@ code-annotations==1.5.0 # -r requirements/test.in # edx-lint # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via -r requirements/base.txt coreapi==2.3.3 # via # -r requirements/base.txt @@ -75,7 +81,7 @@ coverage[toml]==7.3.1 # via # -r requirements/test.in # pytest-cov -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/base.txt # pyjwt @@ -124,7 +130,7 @@ django-appconf==1.0.5 # via # -r requirements/base.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/base.txt # lti-consumer-xblock @@ -135,11 +141,11 @@ django-crum==0.7.9 # -r requirements/base.txt # edx-django-utils # edx-toggles -django-dynamic-fixture==4.0.0 +django-dynamic-fixture==4.0.1 # via -r requirements/test.in django-extensions==3.2.3 # via -r requirements/base.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/base.txt # lti-consumer-xblock @@ -196,13 +202,13 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via -r requirements/base.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via -r requirements/base.txt edx-lint==5.3.4 # via -r requirements/test.in -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/base.txt # edx-ccx-keys @@ -221,13 +227,14 @@ exceptiongroup==1.1.3 # via pytest factory-boy==3.3.0 # via -r requirements/test.in -faker==19.4.0 +faker==19.6.2 # via factory-boy fastavro==1.8.3 # via # -r requirements/base.txt + # confluent-kafka # openedx-events -filelock==3.12.3 +filelock==3.12.4 # via # tox # virtualenv @@ -277,7 +284,7 @@ jsonfield==3.1.0 # via # -r requirements/base.txt # lti-consumer-xblock -lazy==1.5 +lazy==1.6 # via # -r requirements/base.txt # lti-consumer-xblock @@ -363,7 +370,7 @@ pycparser==2.21 # via # -r requirements/base.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/base.txt # lti-consumer-xblock @@ -403,7 +410,7 @@ pynacl==1.5.0 # via # -r requirements/base.txt # edx-django-utils -pytest==7.4.1 +pytest==7.4.2 # via # pytest-cov # pytest-django @@ -415,7 +422,6 @@ python-dateutil==2.8.2 # via # -r requirements/base.txt # botocore - # edx-drf-extensions # faker # freezegun # xblock @@ -445,6 +451,7 @@ pyyaml==6.0.1 requests==2.31.0 # via # -r requirements/base.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -479,7 +486,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # edx-lint # fs # fs-s3fs @@ -527,14 +533,13 @@ tox==3.28.0 # -r requirements/test.in types-pyyaml==6.0.12.11 # via responses -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/base.txt # asgiref # astroid # edx-opaque-keys # faker - # filelock # pylint uritemplate==4.1.1 # via @@ -547,7 +552,7 @@ urllib3==1.26.16 # botocore # requests # responses -virtualenv==20.24.4 +virtualenv==20.24.5 # via tox web-fragments==2.1.0 # via diff --git a/requirements/validation.txt b/requirements/validation.txt index b69077ac..f3b2fcad 100644 --- a/requirements/validation.txt +++ b/requirements/validation.txt @@ -26,18 +26,22 @@ attrs==23.1.0 # -r requirements/test.txt # lti-consumer-xblock # openedx-events +avro==1.11.2 + # via + # -r requirements/quality.txt + # -r requirements/test.txt + # confluent-kafka bleach==6.0.0 # via # -r requirements/quality.txt # -r requirements/test.txt # lti-consumer-xblock - # readme-renderer -boto3==1.28.42 +boto3==1.28.52 # via # -r requirements/quality.txt # -r requirements/test.txt # fs-s3fs -botocore==1.31.42 +botocore==1.31.52 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -78,6 +82,10 @@ code-annotations==1.5.0 # -r requirements/test.txt # edx-lint # edx-toggles +confluent-kafka[avro,schema-registry]==2.2.0 + # via + # -r requirements/quality.txt + # -r requirements/test.txt coreapi==2.3.3 # via # -r requirements/quality.txt @@ -94,7 +102,7 @@ coverage[toml]==7.3.1 # -r requirements/quality.txt # -r requirements/test.txt # pytest-cov -cryptography==41.0.3 +cryptography==41.0.4 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -155,7 +163,7 @@ django-appconf==1.0.5 # -r requirements/quality.txt # -r requirements/test.txt # django-statici18n -django-config-models==2.5.0 +django-config-models==2.5.1 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -170,7 +178,7 @@ django-crum==0.7.9 # -r requirements/test.txt # edx-django-utils # edx-toggles -django-dynamic-fixture==4.0.0 +django-dynamic-fixture==4.0.1 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -178,7 +186,7 @@ django-extensions==3.2.3 # via # -r requirements/quality.txt # -r requirements/test.txt -django-filter==23.2 +django-filter==23.3 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -257,11 +265,11 @@ edx-django-utils==5.7.0 # edx-event-bus-kafka # edx-rest-api-client # edx-toggles -edx-drf-extensions==8.9.2 +edx-drf-extensions==8.10.0 # via # -r requirements/quality.txt # -r requirements/test.txt -edx-event-bus-kafka==5.4.0 +edx-event-bus-kafka==5.5.0 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -269,7 +277,7 @@ edx-lint==5.3.4 # via # -r requirements/quality.txt # -r requirements/test.txt -edx-opaque-keys[django]==2.5.0 +edx-opaque-keys[django]==2.5.1 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -299,7 +307,7 @@ factory-boy==3.3.0 # via # -r requirements/quality.txt # -r requirements/test.txt -faker==19.4.0 +faker==19.6.2 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -308,8 +316,9 @@ fastavro==1.8.3 # via # -r requirements/quality.txt # -r requirements/test.txt + # confluent-kafka # openedx-events -filelock==3.12.3 +filelock==3.12.4 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -346,7 +355,7 @@ importlib-metadata==6.8.0 # -r requirements/quality.txt # keyring # twine -importlib-resources==6.0.1 +importlib-resources==6.1.0 # via # -r requirements/quality.txt # keyring @@ -395,7 +404,7 @@ keyring==24.2.0 # via # -r requirements/quality.txt # twine -lazy==1.5 +lazy==1.6 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -459,6 +468,10 @@ newrelic==9.0.0 # -r requirements/quality.txt # -r requirements/test.txt # edx-django-utils +nh3==0.2.14 + # via + # -r requirements/quality.txt + # readme-renderer oauthlib==3.2.2 # via # -r requirements/quality.txt @@ -532,7 +545,7 @@ pycparser==2.21 # -r requirements/quality.txt # -r requirements/test.txt # cffi -pycryptodomex==3.18.0 +pycryptodomex==3.19.0 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -594,7 +607,7 @@ pynacl==1.5.0 # -r requirements/quality.txt # -r requirements/test.txt # edx-django-utils -pytest==7.4.1 +pytest==7.4.2 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -613,7 +626,6 @@ python-dateutil==2.8.2 # -r requirements/quality.txt # -r requirements/test.txt # botocore - # edx-drf-extensions # faker # freezegun # xblock @@ -644,7 +656,7 @@ pyyaml==6.0.1 # edx-django-release-util # responses # xblock -readme-renderer==41.0 +readme-renderer==42.0 # via # -r requirements/quality.txt # twine @@ -652,6 +664,7 @@ requests==2.31.0 # via # -r requirements/quality.txt # -r requirements/test.txt + # confluent-kafka # coreapi # edx-drf-extensions # edx-rest-api-client @@ -679,7 +692,7 @@ rfc3986==2.0.0 # via # -r requirements/quality.txt # twine -rich==13.5.2 +rich==13.5.3 # via # -r requirements/quality.txt # twine @@ -707,7 +720,6 @@ six==1.16.0 # edx-auth-backends # edx-ccx-keys # edx-django-release-util - # edx-drf-extensions # edx-lint # fs # fs-s3fs @@ -775,7 +787,7 @@ types-pyyaml==6.0.12.11 # -r requirements/quality.txt # -r requirements/test.txt # responses -typing-extensions==4.7.1 +typing-extensions==4.8.0 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -783,7 +795,6 @@ typing-extensions==4.7.1 # astroid # edx-opaque-keys # faker - # filelock # pylint # rich uritemplate==4.1.1 @@ -800,7 +811,7 @@ urllib3==1.26.16 # requests # responses # twine -virtualenv==20.24.4 +virtualenv==20.24.5 # via # -r requirements/quality.txt # -r requirements/test.txt @@ -837,7 +848,7 @@ xblock-utils==3.4.1 # -r requirements/quality.txt # -r requirements/test.txt # lti-consumer-xblock -zipp==3.16.2 +zipp==3.17.0 # via # -r requirements/quality.txt # importlib-metadata From 4128c055c3b42bb5698c3c68794dc8c979fdd21e Mon Sep 17 00:00:00 2001 From: michaelroytman Date: Thu, 28 Sep 2023 16:48:19 -0400 Subject: [PATCH 3/3] feat: add event bus and Kafka Django settings --- edx_exams/settings/devstack.py | 12 ++++++++++++ edx_exams/settings/local.py | 12 ++++++++++++ 2 files changed, 24 insertions(+) diff --git a/edx_exams/settings/devstack.py b/edx_exams/settings/devstack.py index 8208b6c3..2da411bd 100644 --- a/edx_exams/settings/devstack.py +++ b/edx_exams/settings/devstack.py @@ -52,3 +52,15 @@ }) LMS_ROOT_URL = 'http://edx.devstack.lms:18000' + +EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' +EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' +EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' +EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' +EVENT_BUS_TOPIC_PREFIX = 'dev' + +# The EVENT_BUS_PRODUCER_CONFIG Django setting introduced in openedx-events 8.6.0 does not work properly. +# In order to unblock development, EVENT_BUS_PRODUCER_CONFIG should be set to the empty object. Signal handlers +# should be added as before (i.e. versions <8.6.0). +# Once openedx-events 8.6.0 is corrected, this Django setting should be set. +EVENT_BUS_PRODUCER_CONFIG = {} diff --git a/edx_exams/settings/local.py b/edx_exams/settings/local.py index 22d5cabd..81c7fcaa 100644 --- a/edx_exams/settings/local.py +++ b/edx_exams/settings/local.py @@ -134,3 +134,15 @@ # Lastly, see if the developer has any local overrides. if os.path.isfile(join(dirname(abspath(__file__)), 'private.py')): from .private import * # pylint: disable=import-error + +EVENT_BUS_PRODUCER = 'edx_event_bus_kafka.create_producer' +EVENT_BUS_CONSUMER = 'edx_event_bus_kafka.KafkaEventConsumer' +EVENT_BUS_KAFKA_SCHEMA_REGISTRY_URL = 'http://edx.devstack.schema-registry:8081' +EVENT_BUS_KAFKA_BOOTSTRAP_SERVERS = 'edx.devstack.kafka:29092' +EVENT_BUS_TOPIC_PREFIX = 'dev' + +# The EVENT_BUS_PRODUCER_CONFIG Django setting introduced in openedx-events 8.6.0 does not work properly. +# In order to unblock development, EVENT_BUS_PRODUCER_CONFIG should be set to the empty object. Signal handlers +# should be added as before (i.e. versions <8.6.0). +# Once openedx-events 8.6.0 is corrected, this Django setting should be set. +EVENT_BUS_PRODUCER_CONFIG = {}