send all tower work to a user-hidden queue

* Before, we had a special group, tower, that ran any async work that
tower needed done. This allowed users fine grain control over which
nodes did background work. However, this granularity was too complicated
for users. So now, all tower system work goes to a special non-user
exposed celery queue. Tower remains the fallback instance group to
execute jobs on. The tower group will be created upon install and
protected from deletion.
This commit is contained in:
chris meyers
2018-04-17 09:14:56 -04:00
parent 6595515987
commit a56771c8f0
11 changed files with 38 additions and 92 deletions
+10 -5
View File
@@ -6,9 +6,9 @@ import re # noqa
import sys
import ldap
import djcelery
import six
from datetime import timedelta
from kombu import Queue, Exchange
from kombu.common import Broadcast
# global settings
@@ -451,7 +451,7 @@ djcelery.setup_loader()
BROKER_POOL_LIMIT = None
BROKER_URL = 'amqp://guest:guest@localhost:5672//'
CELERY_EVENT_QUEUE_TTL = 5
CELERY_DEFAULT_QUEUE = 'tower'
CELERY_DEFAULT_QUEUE = 'awx_private_queue'
CELERY_TASK_SERIALIZER = 'json'
CELERY_RESULT_SERIALIZER = 'json'
CELERY_ACCEPT_CONTENT = ['json']
@@ -463,8 +463,7 @@ CELERYD_AUTOSCALER = 'awx.main.utils.autoscale:DynamicAutoScaler'
CELERY_RESULT_BACKEND = 'djcelery.backends.database:DatabaseBackend'
CELERY_IMPORTS = ('awx.main.scheduler.tasks',)
CELERY_QUEUES = (
Queue('tower', Exchange('tower'), routing_key='tower'),
Broadcast('tower_broadcast_all')
Broadcast('tower_broadcast_all'),
)
CELERY_ROUTES = {}
@@ -515,7 +514,13 @@ AWX_INCONSISTENT_TASK_INTERVAL = 60 * 3
# Celery queues that will always be listened to by celery workers
# Note: Broadcast queues have unique, auto-generated names, with the alias
# property value of the original queue name.
AWX_CELERY_QUEUES_STATIC = ['tower_broadcast_all',]
AWX_CELERY_QUEUES_STATIC = [
six.text_type(CELERY_DEFAULT_QUEUE),
]
AWX_CELERY_BCAST_QUEUES_STATIC = [
six.text_type('tower_broadcast_all'),
]
ASGI_AMQP = {
'INIT_FUNC': 'awx.prepare_env',