[cli] Deprecating gunicorn/flower dependencies (#4451)

This commit is contained in:
John Bodley
2018-03-30 09:28:16 -07:00
committed by GitHub
parent e25535c693
commit b3442a7b53
4 changed files with 36 additions and 22 deletions

View File

@@ -48,15 +48,15 @@ def init():
@manager.option(
'-w', '--workers',
default=config.get('SUPERSET_WORKERS', 2),
help='Number of gunicorn web server workers to fire up')
help='Number of gunicorn web server workers to fire up [DEPRECATED]')
@manager.option(
'-t', '--timeout', default=config.get('SUPERSET_WEBSERVER_TIMEOUT'),
help='Specify the timeout (seconds) for the gunicorn web server')
help='Specify the timeout (seconds) for the gunicorn web server [DEPRECATED]')
@manager.option(
'-s', '--socket', default=config.get('SUPERSET_WEBSERVER_SOCKET'),
help='Path to a UNIX socket as an alternative to address:port, e.g. '
'/var/run/superset.sock. '
'Will override the address and port values.')
'Will override the address and port values. [DEPRECATED]')
def runserver(debug, use_reloader, address, port, timeout, workers, socket):
"""Starts a Superset web server."""
debug = debug or config.get('DEBUG')
@@ -75,6 +75,9 @@ def runserver(debug, use_reloader, address, port, timeout, workers, socket):
debug=True,
use_reloader=use_reloader)
else:
logging.info(
"The Gunicorn 'superset runserver' command is deprecated. Please "
"use the 'gunicorn' command instead.")
addr_str = ' unix:{socket} ' if socket else' {address}:{port} '
cmd = (
'gunicorn '
@@ -285,6 +288,9 @@ def update_datasources_cache():
help='Number of celery server workers to fire up')
def worker(workers):
"""Starts a Superset worker for async SQL query execution."""
logging.info(
"The 'superset worker' command is deprecated. Please use the 'celery "
"worker' command instead.")
if workers:
celery_app.conf.update(CELERYD_CONCURRENCY=workers)
elif config.get('SUPERSET_CELERY_WORKERS'):
@@ -315,6 +321,9 @@ def flower(port, address):
'--port={port} '
'--address={address} '
).format(**locals())
logging.info(
"The 'superset flower' command is deprecated. Please use the 'celery "
"flower' command instead.")
print(Fore.GREEN + 'Starting a Celery Flower instance')
print(Fore.BLUE + '-=' * 40)
print(Fore.YELLOW + cmd)