move broadcast websocket out into its own process

This commit is contained in:
chris meyers
2020-02-14 16:12:04 -05:00
committed by Ryan Petrello
parent f5193e5ea5
commit 3c5c9c6fde
13 changed files with 76 additions and 57 deletions

View File

@@ -87,11 +87,10 @@ if os.getenv("DATABASE_SSLMODE", False):
BROKER_URL = 'redis://{}:{}'.format(
os.getenv("REDIS_HOST", None),
os.getenv("REDIS_PORT", "6379"),
os.getenv("REDIS_PORT", "6379"),)
CHANNEL_LAYERS = {
'default': {'BACKEND': 'asgi_amqp.AMQPChannelLayer',
'ROUTING': 'awx.main.routing.channel_routing',
'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [(os.getenv("REDIS_HOST", None), int(os.getenv("REDIS_PORT", 6379)))]}}
}

View File

@@ -35,8 +35,19 @@ stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[program:wsbroadcast]
command = awx-manage run_wsbroadcast
directory = /var/lib/awx
autostart = true
autorestart = true
stopwaitsecs = 5
stdout_logfile=/dev/stdout
stdout_logfile_maxbytes=0
stderr_logfile=/dev/stderr
stderr_logfile_maxbytes=0
[group:tower-processes]
programs=nginx,uwsgi,daphne
programs=nginx,uwsgi,daphne,wsbroadcast
priority=5
# TODO: Exit Handler

View File

@@ -18,6 +18,6 @@ BROKER_URL = 'redis://{}:{}/'.format(
"{{ kubernetes_redis_port }}",)
CHANNEL_LAYERS = {
'default': {'BACKEND': 'awx.main.channels.RedisGroupBroadcastChannelLayer',
'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [("{{ kubernetes_redis_hostname }}", {{ kubernetes_redis_port|int }})]}}
}
}

View File

@@ -15,7 +15,7 @@ BROKER_URL = 'redis://{}:{}/'.format(
"{{ redis_port }}",)
CHANNEL_LAYERS = {
'default': {'BACKEND': 'awx.main.channels.RedisGroupBroadcastChannelLayer',
'default': {'BACKEND': 'channels_redis.core.RedisChannelLayer',
'CONFIG': {'hosts': [("{{ redis_hostname }}", {{ redis_port|int }})]}}
}