Skip to content
This repository was archived by the owner on Aug 3, 2026. It is now read-only.

[SE-4860] cherry-pick configuration/pull/6586 - #186

Merged
gabor-boros merged 6 commits into
opencraft-release/lilac.2from
gabor/backport-singlebeat-changes-lilac
Apr 27, 2022
Merged

[SE-4860] cherry-pick configuration/pull/6586#186
gabor-boros merged 6 commits into
opencraft-release/lilac.2from
gabor/backport-singlebeat-changes-lilac

Conversation

@gabor-boros

Copy link
Copy Markdown

Description

Cherry-pick of openedx-unsupported#6586

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.

Other squashed commit messages:

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
refactor: remove celery<5 adjustments
fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
(cherry picked from commit d0550581cfd6309c61aaf751ea88a6f1c54c143c)
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
@gabor-boros
gabor-boros deleted the gabor/backport-singlebeat-changes-lilac branch March 14, 2022 06:04
@gabor-boros
gabor-boros restored the gabor/backport-singlebeat-changes-lilac branch March 15, 2022 08:20
@gabor-boros gabor-boros reopened this Mar 15, 2022
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

@Agrendalath Agrendalath left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

  • I tested this: verified that grade reports work on the test instance
  • I read through the code
  • I checked for accessibility issues: n/a
  • Includes documentation
  • I made sure any change in configuration variables is reflected in the corresponding client's configuration-secure repository

@gabor-boros
gabor-boros merged commit 7e34794 into opencraft-release/lilac.2 Apr 27, 2022
@gabor-boros
gabor-boros deleted the gabor/backport-singlebeat-changes-lilac branch April 27, 2022 17:59
farhaanbukhsh pushed a commit that referenced this pull request Jun 16, 2022
* feat: make SINGLE_BEAT_IDENTIFIER configurable

Other squashed commit messages:

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
refactor: remove celery<5 adjustments
fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
(cherry picked from commit d0550581cfd6309c61aaf751ea88a6f1c54c143c)
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: bump setuptools

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

* fix: reset setuptools

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

* Update openedx_native.yml

* revert custom extra requirements

* fix: add safe directory config and use escalated privileges with git clean

(cherry picked from commit 1f4ff35)

Co-authored-by: nadeemshahzad <nshahzad@edx.org>
0x29a pushed a commit that referenced this pull request Jun 17, 2022
* feat: make SINGLE_BEAT_IDENTIFIER configurable

Other squashed commit messages:

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
refactor: remove celery<5 adjustments
fix: set single-beat autorestart

Signed-off-by: Gabor Boros <gabor.brs@gmail.com>
(cherry picked from commit d0550581cfd6309c61aaf751ea88a6f1c54c143c)
Signed-off-by: Gabor Boros <gabor.brs@gmail.com>

* fix: bump setuptools

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

* fix: reset setuptools

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

* Update openedx_native.yml

* revert custom extra requirements

* fix: add safe directory config and use escalated privileges with git clean

(cherry picked from commit 1f4ff35)

Co-authored-by: nadeemshahzad <nshahzad@edx.org>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants