Skip to content
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

feat!: update event_bus_kafka and add event_bus_redis #3907

Merged
merged 1 commit into from
May 16, 2023

Conversation

navinkarkera
Copy link
Contributor

@navinkarkera navinkarkera commented Apr 24, 2023

Checklist

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Apr 24, 2023
@openedx-webhooks
Copy link

openedx-webhooks commented Apr 24, 2023

Thanks for the pull request, @navinkarkera! Please note that it may take us up to several weeks or months to complete a review and merge your PR.

Feel free to add as much of the following information to the ticket as you can:

  • supporting documentation
  • Open edX discussion forum threads
  • timeline information ("this must be merged by XX date", and why that is)
  • partner information ("this is a course on edx.org")
  • any other information that can help Product understand the context for the PR

All technical communication about the code itself will be done via the GitHub pull request interface. As a reminder, our process documentation is here.

Please let us know once your PR is ready for our review and all tests are green.

Comment on lines +719 to +726
EVENT_BUS_PROCESSING_DELAY_SECONDS = 60
EVENT_BUS_MESSAGE_DELAY_THRESHOLD_SECONDS = 60
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changed names to make it generic

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[inform] I don't see any overrides in 2U's configuration repos, so this change should be safe to do without further coordination.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

...cancel that, there are references to the second one, EVENT_BUS_KAFKA_MESSAGE_DELAY_THRESHOLD_SECONDS. Repo owners will need to review and make some config changes in advance.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Internal PR for updating these ahead of time: https://github.com/edx/edx-internal/pull/8376

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, the configs have been updated to use the new generic name, so we should be unblocked here.

requirements/local.in Outdated Show resolved Hide resolved
@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from 1c971e9 to e2c6a7d Compare May 2, 2023 07:30
requirements/base.in Outdated Show resolved Hide resolved
@navinkarkera navinkarkera changed the title feat: remove hard coded kafka consumer feat: udpate event_bus_kafka and add event_bus_redis May 2, 2023
@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from e2c6a7d to 73f3f21 Compare May 3, 2023 07:02
@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from 73f3f21 to 4cf1605 Compare May 11, 2023 06:30
@navinkarkera navinkarkera marked this pull request as ready for review May 11, 2023 06:31
@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch 2 times, most recently from 1580668 to 7739f32 Compare May 12, 2023 13:23
@timmc-edx
Copy link
Contributor

Commit/PR title has typo "udpate"; should also use feat!: to indicate breaking change in how course-discovery is configured.

@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from 7739f32 to c9d5c0b Compare May 15, 2023 03:24
@navinkarkera navinkarkera changed the title feat: udpate event_bus_kafka and add event_bus_redis feat!: update event_bus_kafka and add event_bus_redis May 15, 2023
@navinkarkera
Copy link
Contributor Author

@timmc-edx Updated the title.

@timmc-edx
Copy link
Contributor

OK, just needs rebase or merge to resolve any conflicts with the master branch -- and someone from the owning team to review and approve. (Doesn't look like I can do it.)

Copy link
Contributor

@Ali-D-Akbar Ali-D-Akbar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of questions to be addressed.

Comment on lines +725 to +726
EVENT_BUS_PROCESSING_DELAY_SECONDS = 60
EVENT_BUS_MESSAGE_DELAY_THRESHOLD_SECONDS = 60
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So we're removing kafka config from edx-internal and keeping them only in Discovery? Are these settings not going to change?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nothing is being removed here, just renamed. The goal is to remove all Kafka references from the course-discovery source code so that deployers can choose to use event-bus-redis or other Event Bus implementations.

My understanding is that these delay settings aren't specific to Kafka, but are needed for any Event Bus implementation. I've already added the new name here, copying the value:

https://github.com/edx/edx-internal/pull/8376/files#diff-5e0513d8ace97560c1f17a81784c4d90cb5159626173cc2ffbc2e1fd05bd28b7R40 (private repo PR)

The next PR would remove the Kafka-specific name. The actual behavior shouldn't change at all.

# edx-event-bus-kafka 3.7.0 introduces `reset_offsets_and_sleep_indefinitely`
edx-event-bus-kafka>=3.7.1
# edx-event-bus-kafka 4.0.0 adds support for configurable consumer API
edx-event-bus-kafka>=4.0.1
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can't we just remove this constraint? make upgrade will always find the latest version anyways.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a pattern we've been following in some repos in order to prevent accidental regressions -- when we depend on a new API from some library, we bump the min-version constraint. We've occasionally seen unintended downgrades when a transitive dependency conflict occurs, and the pip constraint solver decides that the right answer is to downgrade some other dependencies. It's not essential to use this, though, and I'd be OK with removing it.

I'll also note that it's also a tool people sometimes use in order to do a "surgical upgrade" of one library, like the new make upgrade-package in edx-platform. (You bump the min-version constraint, then run make compile-requirements.) Arch-BOM is looking into how we can add upgrade-package to more repos, which would remove one of the reasons for setting a min-constraint.

@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from c9d5c0b to 2c6ab4c Compare May 16, 2023 06:54
@navinkarkera
Copy link
Contributor Author

@timmc-edx Thanks, rebased with master.

feat: add event bus redis as dependency

refactor: add openedx_events in installed apps to use consume_events command

chore: upgrade dependencies
@navinkarkera navinkarkera force-pushed the navin/event_bus_redis branch from 2c6ab4c to 1faa3c0 Compare May 16, 2023 13:49
@dianakhuang dianakhuang merged commit b547f8a into openedx:master May 16, 2023
@openedx-webhooks
Copy link

@navinkarkera 🎉 Your pull request was merged! Please take a moment to answer a two question survey so we can improve your experience in the future.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

5 participants