diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py index 662452eb9cc39..0f0598d3827dc 100755 --- a/airflow/bin/cli.py +++ b/airflow/bin/cli.py @@ -894,6 +894,9 @@ def worker(args): 'concurrency': args.concurrency, } + if args.hostname: + options['hostname'] = args.hostname + if args.daemon: pid, stdout, stderr, log_file = setup_locations("worker", args.pid, args.stdout, args.stderr, args.log_file) handle = setup_logging(log_file) @@ -1405,6 +1408,9 @@ class CLIFactory(object): type=int, help="The number of worker processes", default=conf.get('celery', 'celeryd_concurrency')), + 'worker_hostname': Arg( + ('-hn', '--hostname'), + help="Set custom worker hostname"), # flower 'broker_api': Arg(("-a", "--broker_api"), help="Broker api"), 'flower_hostname': Arg( @@ -1564,8 +1570,8 @@ class CLIFactory(object): }, { 'func': worker, 'help': "Start a Celery worker node", - 'args': ('do_pickle', 'queues', 'concurrency', - 'pid', 'daemon', 'stdout', 'stderr', 'log_file'), + 'args': ('do_pickle', 'queues', 'concurrency', 'pid', 'daemon', + 'stdout', 'stderr', 'log_file', 'worker_hostname'), }, { 'func': flower, 'help': "Start a Celery Flower", diff --git a/airflow/version.py b/airflow/version.py index 0d3ae29c993b6..9fd2406d2570d 100644 --- a/airflow/version.py +++ b/airflow/version.py @@ -13,4 +13,4 @@ # limitations under the License. # -version = '1.8.0-up1.1.0' +version = '1.8.0-up1.2.0' diff --git a/patches/DATA-2817.patch b/patches/DATA-2817.patch new file mode 100644 index 0000000000000..8c2e195c5d8d4 --- /dev/null +++ b/patches/DATA-2817.patch @@ -0,0 +1,35 @@ +diff --git a/airflow/bin/cli.py b/airflow/bin/cli.py +index 662452e..0f0598d 100755 +--- a/airflow/bin/cli.py ++++ b/airflow/bin/cli.py +@@ -894,6 +894,9 @@ def worker(args): + 'concurrency': args.concurrency, + } + ++ if args.hostname: ++ options['hostname'] = args.hostname ++ + if args.daemon: + pid, stdout, stderr, log_file = setup_locations("worker", args.pid, args.stdout, args.stderr, args.log_file) + handle = setup_logging(log_file) +@@ -1405,6 +1408,9 @@ class CLIFactory(object): + type=int, + help="The number of worker processes", + default=conf.get('celery', 'celeryd_concurrency')), ++ 'worker_hostname': Arg( ++ ('-hn', '--hostname'), ++ help="Set custom worker hostname"), + # flower + 'broker_api': Arg(("-a", "--broker_api"), help="Broker api"), + 'flower_hostname': Arg( +@@ -1564,8 +1570,8 @@ class CLIFactory(object): + }, { + 'func': worker, + 'help': "Start a Celery worker node", +- 'args': ('do_pickle', 'queues', 'concurrency', +- 'pid', 'daemon', 'stdout', 'stderr', 'log_file'), ++ 'args': ('do_pickle', 'queues', 'concurrency', 'pid', 'daemon', ++ 'stdout', 'stderr', 'log_file', 'worker_hostname'), + }, { + 'func': flower, + 'help': "Start a Celery Flower", diff --git a/upsight/CHANGELOG.md b/upsight/CHANGELOG.md index ffc07694e6470..12e3a84b3f5fe 100644 --- a/upsight/CHANGELOG.md +++ b/upsight/CHANGELOG.md @@ -2,6 +2,10 @@ ## Next release (in development) +## 1.8.0-up1.2.0 + +* Added support for `--hostname` when running worker ([DATA-2817](https://kontagent.jira.com/browse/DATA-2817)) + ## 1.8.0-up1.1.0 * Pulled in airflow-1.8.0 (no changes from rc5)