Skip to content

Commit

Permalink
Merge pull request apache#5 in TP/incubator-airflow from feature/DATA…
Browse files Browse the repository at this point in the history
…-2817 to develop

* commit '768ee500963cab7b5e2172b871cfe0889da7a257':
  Bump version to 1.8.0-up1.2.0
  DATA-2817: support celery worker --hostname arg
  • Loading branch information
Daniel Huang committed Mar 31, 2017
2 parents 4962d73 + 768ee50 commit afb3823
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
10 changes: 8 additions & 2 deletions airflow/bin/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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",
Expand Down
2 changes: 1 addition & 1 deletion airflow/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
# limitations under the License.
#

version = '1.8.0-up1.1.0'
version = '1.8.0-up1.2.0'
35 changes: 35 additions & 0 deletions patches/DATA-2817.patch
Original file line number Diff line number Diff line change
@@ -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",
4 changes: 4 additions & 0 deletions upsight/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit afb3823

Please sign in to comment.