-
Notifications
You must be signed in to change notification settings - Fork 16
Adds celery.toml
for loading custom Celery config [#821]
#865
Conversation
celery.toml
for loading custom Celery config
celery.toml
for loading custom Celery configcelery.toml
for loading custom Celery config [#821]
data/config/celery.toml
Outdated
@@ -0,0 +1,2 @@ | |||
event_queue_prefix = "fidesops_worker" | |||
default_queue_name = "fidesops" |
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.
A quirk of this implementation is that Celery will add any variable specified here to the config, not throw an error if the variable is not specified in the config spec. Celery then ignores the extra vars.
@@ -39,8 +39,6 @@ class ExecutionSettings(FidesSettings): | |||
TASK_RETRY_BACKOFF: int | |||
REQUIRE_MANUAL_REQUEST_APPROVAL: bool = False | |||
MASKING_STRICT: bool = True | |||
CELERY_BROKER_URL: Optional[str] = None | |||
CELERY_RESULT_BACKEND: Optional[str] = None | |||
WORKER_ENABLED: bool = True |
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.
I've intentionally left WORKER_ENABLED
in here, as whether the implementation is deploying a separate worker, and whether it's overriding the Celery config are two separate concerns.
@seanpreston can you lowercase the new values so it matches with #871 ? |
@ThomasLaPiana if it's OK with you I'll do this in a follow-up, since I'd like to get this merged and into a minor release today, and we won't have the changes from #871 in that release. |
* adds option to configure EVENT_QUEUE_PREFIX for celery * provide the option to specify a default queue name too * update celery config to load in from its own config toml file * updates changelog * update value for event_queue_prefix * test celery config overrides * include config_path arg * add type def * add config path to execution settings * correct values
Purpose
This PR provides a way for a user to override any element of the Celery config. Originally this ticket was only to investigate overriding the
event_queue_prefix
var, however I would anticipate customising Celery config to be a relatively common use case given the variety of implementations.Changes
celery.toml
to store celery config overrides based on the new lowercase settings.celery.toml
when instantiating thecelery_app
on the worker.Checklist
CHANGELOG.md
fileCHANGELOG.md
file is being appended toUnreleased
section in an appropriate category. Add a new category from the list at the top of the file if the needed one isn't already there.Run Unsafe PR Checks
label has been applied, and checks have passed, if this PR touches any external servicesTicket
Fixes #821