-
Notifications
You must be signed in to change notification settings - Fork 269
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
Add worker queue support to job class and model #2421
Conversation
…obot/nautobot into gas-2064-job-queue-class-definition
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.
:%s/worker.queue/task.queue/g
:%s/Worker queue/Task queue/g
@@ -649,6 +649,9 @@ | |||
# Instruct celery to report the started status of a job, instead of just `pending`, `finished`, or `failed` | |||
CELERY_TASK_TRACK_STARTED = True | |||
|
|||
# Default celery queue name that will be used by workers and tasks if no queue is specified | |||
CELERY_TASK_DEFAULT_QUEUE = os.getenv("NAUTOBOT_CELERY_TASK_DEFAULT_QUEUE", "default") |
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.
Worth calling out explicitly in the release-notes?
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 added a section in the release notes overview on this feature and it includes an important
admonition calling out this changed setting.
|
||
Environment Variable: `NAUTOBOT_CELERY_TASK_DEFAULT_QUEUE` | ||
|
||
Default: `'default'` |
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.
Is this a change from prior releases? It was celery
before, right? Is there anything we need to call out in the release-notes about the upgrade changing this?
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 added a section to the release notes overview. See comment above
Closes #2064, Closes #2065
What's Changed
Add new job model and class property named
task_queues
to present a list of supported queues for each job. This property defaults to an empty list which only allows the job to run on the default queue. The property may be defined on the class and can be overridden similar to other job properties likeread_only
andapproval_required
. The list of queues will be presented in the job run form to select the queue the job will be sent to. The queue can also optionally be specified in an api job run request, defaulting to the first queue in the list if theworker_queue
parameter is not passed to the api call.CELERY_TASK_DEFAULT_QUEUE
with a default value ofdefault
to nautobot configtask_queues
job class meta propertytask_queues
job model fieldtask_queues_override
job model fieldtask_queue
field to job run API endpointtask_queue
toJobResult.job_kwargs
to store the queue for populating the form when clicking re-run on a job resultJob Run form
Job Edit form
Job Detail
TODO