Skip to content
This repository was archived by the owner on May 6, 2024. It is now read-only.

[SE-4860] make SINGLE_BEAT_IDENTIFIER configurable - #6586

Merged
pomegranited merged 10 commits into
openedx-unsupported:masterfrom
open-craft:gabor/add-single-beat-auth
Dec 7, 2021
Merged

[SE-4860] make SINGLE_BEAT_IDENTIFIER configurable#6586
pomegranited merged 10 commits into
openedx-unsupported:masterfrom
open-craft:gabor/add-single-beat-auth

Conversation

@gabor-boros

@gabor-boros gabor-boros commented Oct 18, 2021

Copy link
Copy Markdown
Contributor

Description

This PR allows setting separate users for single-beat and celery brokers, allows authentication, and setting the single-beat identifier for future fine-grained access control using Redis ACLs.

Also, we are replacing the source url of the package, hence the original code became outdated and akachanov:master is ahead of the original repo by fixing issues and removing incompatible code.

Supporting information

Some months ago edX platform was not capable of doing periodic scheduling of celery tasks. Therefore we added celerybeat to the platform. The only issue with celerybeat is that it cannot run more than once. If multiple celerybeat schedulers are running at the same time, the same task can be scheduled multiple times resulting in unwanted behaviours. Here comes single-beat into picture that ensures (using redis) that no more than one celerybeat processes are running.

Can you explain what it is in akachanov's fork that's critical to us here?

Akachanov removed Tornadis that was published in 2018 for the last time and broke with the newest Celery. Using Akachanov's fork ensures that single-beat is still working with the newest Celery and he also seems to fixed some reconnect issues -- I assume hence the celerybeat process restarts, since I cannot see any errors and periodically scheduled tasks are processed as expected.

Dependencies

Related to https://github.com/edx/edx-platform/pull/29046, which upgrades celery in edx-platform.

Sandbox

https://pr29046.sandbox.opencraft.hosting

Testing instructions

Deadline

ASAP

Other information

N/A

@openedx-webhooks

Copy link
Copy Markdown

Thanks for the pull request, @gabor-boros! I've created OSPR-6145 to keep track of it in JIRA, where we prioritize reviews. 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.

@natabene

Copy link
Copy Markdown
Contributor

@gabor-boros Thank you for your contribution. Please let me know once this is ready for our review.

@pomegranited pomegranited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@gabor-boros This change seems to do more than just make SINGLE_BEAT_IDENTIFIER configurable.. Have asked for clarity, and suggested some changes.

Comment thread playbooks/roles/edxapp/defaults/main.yml
Comment thread playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 Outdated

@pomegranited pomegranited left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

  • I tested this on the PR sandbox.
  • I read through the code
  • I checked for accessibility issues N/A
  • Includes documentation N/A -- as per the PR template checklist, this PR does not add any defaults which need to be overridden, so no CHANGELOG entry is necessary.
  • I made sure any change in configuration variables is reflected in the corresponding
    client's configuration-secure repository.
    N/A

@jmbowman Can you confirm that edX is not using celerybeat and so this change should not affect you guys?

I'll merge this as core commiter in 2 days if there are no objections on your side. CC @natabene

@pomegranited pomegranited added cc-reviewer and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Nov 24, 2021

@Agrendalath Agrendalath left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

👍

  • I tested this: I've checked heartbeats and periodic tasks in the sandbox
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation: no ⚠️
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository: n/a

Comment thread playbooks/roles/ecomworker/templates/edx/app/ecomworker/ecomworker.sh.j2 Outdated
Comment thread playbooks/roles/edxapp/defaults/main.yml
@openedx-webhooks openedx-webhooks added the waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. label Nov 26, 2021
@gabor-boros
gabor-boros force-pushed the gabor/add-single-beat-auth branch from b62c528 to f7a5fc9 Compare November 30, 2021 14:18
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
@gabor-boros

Copy link
Copy Markdown
Contributor Author

@Agrendalath I believe all the requested changes are addressed. The app server is provisioning with the new changes.

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
@gabor-boros
gabor-boros force-pushed the gabor/add-single-beat-auth branch from e71f18b to a8fd3f8 Compare December 1, 2021 10:53
@pomegranited
pomegranited merged commit b8ab26c into openedx-unsupported:master Dec 7, 2021
@openedx-webhooks openedx-webhooks added merged and removed waiting on author PR author needs to resolve review requests, answer questions, fix tests, etc. labels Dec 7, 2021
@openedx-webhooks

Copy link
Copy Markdown

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

@pomegranited
pomegranited deleted the gabor/add-single-beat-auth branch December 7, 2021 00:32
@pomegranited pomegranited self-assigned this Dec 8, 2021
@gabor-boros
gabor-boros restored the gabor/add-single-beat-auth branch March 13, 2022 20:48
@Agrendalath
Agrendalath deleted the gabor/add-single-beat-auth branch May 13, 2022 11:24
navinkarkera pushed a commit to open-craft/configuration that referenced this pull request May 23, 2022
…ed#6586)

* feat: make SINGLE_BEAT_IDENTIFIER configurable

* fix: celery 5.0+ does not support --app as a worker flag

* refactor: remove duplicated app declaration

* fix: --config flag is global since Celery 5.0+

* fix: replace single-beat with an updated version

* fix: add missing comma

* fix: replace maxtasksperchild worker flag

* refactor: address PR review comments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* refactor: remove celery<5 adjustments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
navinkarkera pushed a commit to open-craft/configuration that referenced this pull request Jun 8, 2022
…ed#6586)

* feat: make SINGLE_BEAT_IDENTIFIER configurable

* fix: celery 5.0+ does not support --app as a worker flag

* refactor: remove duplicated app declaration

* fix: --config flag is global since Celery 5.0+

* fix: replace single-beat with an updated version

* fix: add missing comma

* fix: replace maxtasksperchild worker flag

* refactor: address PR review comments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* refactor: remove celery<5 adjustments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
navinkarkera pushed a commit to open-craft/configuration that referenced this pull request Jun 8, 2022
…upported#6586)

* feat: make SINGLE_BEAT_IDENTIFIER configurable

* fix: celery 5.0+ does not support --app as a worker flag

* refactor: remove duplicated app declaration

* fix: --config flag is global since Celery 5.0+

* fix: replace single-beat with an updated version

* fix: add missing comma

* fix: replace maxtasksperchild worker flag

* refactor: address PR review comments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* refactor: remove celery<5 adjustments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
Agrendalath pushed a commit to open-craft/configuration that referenced this pull request Jun 13, 2022
…upported#6586)

* feat: make SINGLE_BEAT_IDENTIFIER configurable

* fix: celery 5.0+ does not support --app as a worker flag

* refactor: remove duplicated app declaration

* fix: --config flag is global since Celery 5.0+

* fix: replace single-beat with an updated version

* fix: add missing comma

* fix: replace maxtasksperchild worker flag

* refactor: address PR review comments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* refactor: remove celery<5 adjustments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
kaustavb12 pushed a commit to open-craft/configuration that referenced this pull request Aug 29, 2022
…upported#6586)

* feat: make SINGLE_BEAT_IDENTIFIER configurable

* fix: celery 5.0+ does not support --app as a worker flag

* refactor: remove duplicated app declaration

* fix: --config flag is global since Celery 5.0+

* fix: replace single-beat with an updated version

* fix: add missing comma

* fix: replace maxtasksperchild worker flag

* refactor: address PR review comments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* refactor: remove celery<5 adjustments

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants