Permalink
Browse files

Renames celery.bin.celeryd to celery.bin.worker

  • Loading branch information...
1 parent d5536e0 commit 43c4406910608b24ee37d14a42c41f67d8a190cc @ask ask committed Nov 16, 2012
Showing with 296 additions and 330 deletions.
  1. +1 −1 celery/__main__.py
  2. +1 −1 celery/app/base.py
  3. +6 −5 celery/apps/worker.py
  4. +1 −1 celery/bin/celery.py
  5. +0 −16 celery/bin/celeryctl.py
  6. +3 −3 celery/bin/celeryd_detach.py
  7. 0 celery/bin/{celeryd.py → worker.py}
  8. +5 −4 celery/tests/app/test_app.py
  9. +1 −1 celery/tests/bin/test_celeryd_detach.py
  10. +3 −3 celery/tests/bin/test_events.py
  11. +8 −8 celery/tests/bin/test_multi.py
  12. +5 −5 celery/tests/bin/{test_celeryd.py → test_worker.py}
  13. +3 −3 celery/tests/functional/case.py
  14. +1 −1 celery/worker/consumer.py
  15. +6 −6 docs/configuration.rst
  16. +23 −23 docs/faq.rst
  17. +2 −1 docs/getting-started/brokers/beanstalk.rst
  18. +2 −1 docs/getting-started/brokers/couchdb.rst
  19. +1 −1 docs/getting-started/first-steps-with-celery.rst
  20. +5 −5 docs/getting-started/introduction.rst
  21. +2 −2 docs/getting-started/next-steps.rst
  22. +34 −33 docs/history/changelog-1.0.rst
  23. +26 −26 docs/history/changelog-2.0.rst
  24. +30 −30 docs/history/changelog-2.1.rst
  25. +31 −31 docs/history/changelog-2.2.rst
  26. +7 −7 docs/history/changelog-2.3.rst
  27. +15 −15 docs/history/changelog-2.4.rst
  28. +8 −8 docs/history/changelog-2.5.rst
  29. +3 −3 docs/reference/celery.bin.events.rst
  30. +3 −3 docs/reference/{celery.bin.celeryd.rst → celery.bin.worker.rst}
  31. +1 −1 docs/reference/celery.rst
  32. +1 −1 docs/reference/index.rst
  33. +24 −25 docs/tutorials/daemonizing.rst
  34. +6 −4 docs/userguide/monitoring.rst
  35. +1 −1 docs/userguide/optimizing.rst
  36. +1 −1 docs/userguide/signals.rst
  37. +2 −2 docs/userguide/workers.rst
  38. +1 −1 examples/app/myapp.py
  39. +3 −2 examples/eventlet/README.rst
  40. +2 −2 extra/centos/celeryd.init
  41. +2 −2 extra/centos/celeryd.sysconfig
  42. +4 −3 extra/mac/{org.celeryq.celerybeat.plist → org.celeryq.beat.plist}
  43. +0 −28 extra/mac/org.celeryq.celerymon.plist
  44. +4 −3 extra/mac/{org.celeryq.celeryd.plist → org.celeryq.worker.plist}
  45. +1 −1 extra/release/core-modules.txt
  46. +0 −1 extra/release/doc4allmods
  47. +7 −5 extra/supervisord/celeryd.conf
View
@@ -31,7 +31,7 @@ def main():
def _compat_worker():
maybe_patch_concurrency()
_warn_deprecated('celery worker')
- from celery.bin.celeryd import main
+ from celery.bin.worker import main
main()
View
@@ -143,7 +143,7 @@ def start(self, argv=None):
.execute_from_commandline(argv)
def worker_main(self, argv=None):
- return instantiate('celery.bin.celeryd:WorkerCommand', app=self) \
+ return instantiate('celery.bin.worker:WorkerCommand', app=self) \
.execute_from_commandline(argv)
def task(self, *args, **opts):
View
@@ -118,7 +118,8 @@ def on_start(self):
if getattr(os, 'getuid', None) and os.getuid() == 0:
warnings.warn(RuntimeWarning(
- 'Running celeryd with superuser privileges is discouraged!'))
+ 'Running the worker with superuser privileges is discouraged!',
+ ))
if self.purge:
self.purge_messages()
@@ -206,7 +207,7 @@ def install_platform_tweaks(self, worker):
# Install signal handler so SIGHUP restarts the worker.
if not self._isatty:
# only install HUP handler if detached from terminal,
- # so closing the terminal window doesn't restart celeryd
+ # so closing the terminal window doesn't restart the worker
# into the background.
if self.app.IS_OSX:
# OS X can't exec from a process using threads.
@@ -239,7 +240,7 @@ def _handle_request(signum, frame):
if current_process()._name == 'MainProcess':
if callback:
callback(worker)
- safe_say('celeryd: {0} shutdown (MainProcess)'.format(how))
+ safe_say('worker: {0} shutdown (MainProcess)'.format(how))
if active_thread_count() > 1:
setattr(state, {'Warm': 'should_stop',
'Cold': 'should_terminate'}[how], True)
@@ -259,7 +260,7 @@ def _handle_request(signum, frame):
def on_SIGINT(worker):
- safe_say('celeryd: Hitting Ctrl+C again will terminate all running tasks!')
+ safe_say('worker: Hitting Ctrl+C again will terminate all running tasks!')
install_worker_term_hard_handler(worker, sig='SIGINT')
if not is_jython:
install_worker_int_handler = partial(
@@ -279,7 +280,7 @@ def install_worker_restart_handler(worker, sig='SIGHUP'):
def restart_worker_sig_handler(*args):
"""Signal handler restarting the current python program."""
set_in_sighandler(True)
- safe_say('Restarting celeryd ({0})'.format(' '.join(sys.argv)))
+ safe_say('Restarting celery worker ({0})'.format(' '.join(sys.argv)))
import atexit
atexit.register(_clone_current_worker)
from celery.worker import state
@@ -279,7 +279,7 @@ class worker(Delegate):
celery worker --autoscale=10,0
"""
- Command = 'celery.bin.celeryd:WorkerCommand'
+ Command = 'celery.bin.worker:WorkerCommand'
def run_from_argv(self, prog_name, argv):
self.target.maybe_detach(argv)
@@ -1,16 +0,0 @@
-# -*- coding: utf-8 -*-
-"""
- celery.bin.celeryctl
- ~~~~~~~~~~~~~~~~~~~~
-
- Now replaced by the :program:`celery` command.
-
-"""
-from __future__ import absolute_import
-
-from celery.bin.celery import ( # noqa
- CeleryCommand as celeryctl, Command, main,
-)
-
-if __name__ == '__main__': # pragma: no cover
- main()
@@ -3,7 +3,7 @@
celery.bin.celeryd_detach
~~~~~~~~~~~~~~~~~~~~~~~~~
- Program used to daemonize celeryd.
+ Program used to daemonize the worker
Using :func:`os.execv` because forking and multiprocessing
leads to weird issues (it was a long time ago now, but it
@@ -104,11 +104,11 @@ class detached_celeryd(object):
option_list = OPTION_LIST
usage = '%prog [options] [celeryd options]'
version = celery.VERSION_BANNER
- description = ('Detaches Celery worker nodes. See `celeryd --help` '
+ description = ('Detaches Celery worker nodes. See `celery worker --help` '
'for the list of supported worker arguments.')
command = sys.executable
execv_path = sys.executable
- execv_argv = ['-m', 'celery.bin.celeryd']
+ execv_argv = ['-m', 'celery', 'worker']
def Parser(self, prog_name):
return PartialOptionParser(prog=prog_name,
File renamed without changes.
@@ -268,19 +268,20 @@ def test_pickle_app(self):
self.assertDictContainsSubset(changes, restored.conf)
def test_worker_main(self):
- from celery.bin import celeryd
+ from celery.bin import worker as worker_bin
- class WorkerCommand(celeryd.WorkerCommand):
+ class WorkerCommand(worker_bin.WorkerCommand):
def execute_from_commandline(self, argv):
return argv
- prev, celeryd.WorkerCommand = celeryd.WorkerCommand, WorkerCommand
+ prev, worker_bin.WorkerCommand = \
+ worker_bin.WorkerCommand, WorkerCommand
try:
ret = self.app.worker_main(argv=['--version'])
self.assertListEqual(ret, ['--version'])
finally:
- celeryd.WorkerCommand = prev
+ worker_bin.WorkerCommand = prev
def test_config_from_envvar(self):
os.environ['CELERYTEST_CONFIG_OBJECT'] = 'celery.tests.app.test_app'
@@ -87,7 +87,7 @@ def test_execute_from_commandline(self, detach, exit):
detach.assert_called_with(path=x.execv_path, uid=None, gid=None,
umask=0, fake=False,
logfile='/var/log', pidfile='celeryd.pid',
- argv=['-m', 'celery.bin.celeryd', '-c', '1', '-lDEBUG',
+ argv=['-m', 'celery', 'worker', '-c', '1', '-lDEBUG',
'--logfile=/var/log', '--pidfile=celeryd.pid',
'--', '.disable_rate_limits=1'],
)
@@ -31,7 +31,7 @@ def setUp(self):
@patch('celery.bin.events', 'set_process_title', proctitle)
def test_run_dump(self):
self.assertEqual(self.ev.run(dump=True), 'me dumper, you?')
- self.assertIn('celeryev:dump', proctitle.last[0])
+ self.assertIn('celery events:dump', proctitle.last[0])
def test_run_top(self):
try:
@@ -43,7 +43,7 @@ def test_run_top(self):
@patch('celery.bin.events', 'set_process_title', proctitle)
def _inner():
self.assertEqual(self.ev.run(), 'me top, you?')
- self.assertIn('celeryev:top', proctitle.last[0])
+ self.assertIn('celery events:top', proctitle.last[0])
return _inner()
@patch('celery.events.snapshot', 'evcam', lambda *a, **k: (a, k))
@@ -55,7 +55,7 @@ def test_run_cam(self):
self.assertIsNone(kw['maxrate'])
self.assertEqual(kw['loglevel'], 'INFO')
self.assertEqual(kw['logfile'], 'logfile')
- self.assertIn('celeryev:cam', proctitle.last[0])
+ self.assertIn('celery events:cam', proctitle.last[0])
@mpatch('celery.events.snapshot.evcam')
@mpatch('celery.bin.events.detached')
@@ -332,7 +332,7 @@ def test_shutdown_nodes(self, slepp, gethostname, Pidfile):
self.t.node_alive.return_value = False
callback = Mock()
- self.t.stop(['foo', 'bar', 'baz'], 'celeryd', callback=callback)
+ self.t.stop(['foo', 'bar', 'baz'], 'celery worker', callback=callback)
sigs = sorted(self.t.signal_node.call_args_list)
self.assertEqual(len(sigs), 2)
self.assertIn(('foo@e.com', 10, signal.SIGTERM),
@@ -341,15 +341,15 @@ def test_shutdown_nodes(self, slepp, gethostname, Pidfile):
[tup[0] for tup in sigs])
self.t.signal_node.return_value = False
self.assertTrue(callback.called)
- self.t.stop(['foo', 'bar', 'baz'], 'celeryd', callback=None)
+ self.t.stop(['foo', 'bar', 'baz'], 'celery worker', callback=None)
def on_node_alive(pid):
if node_alive.call_count > 4:
return True
return False
self.t.signal_node.return_value = True
self.t.node_alive.side_effect = on_node_alive
- self.t.stop(['foo', 'bar', 'baz'], 'celeryd', retry=True)
+ self.t.stop(['foo', 'bar', 'baz'], 'celery worker', retry=True)
@patch('os.kill')
def test_node_alive(self, kill):
@@ -387,13 +387,13 @@ def test_signal_node(self, kill):
def test_start(self):
self.t.waitexec = Mock()
self.t.waitexec.return_value = 0
- self.assertFalse(self.t.start(['foo', 'bar', 'baz'], 'celeryd'))
+ self.assertFalse(self.t.start(['foo', 'bar', 'baz'], 'celery worker'))
self.t.waitexec.return_value = 1
- self.assertFalse(self.t.start(['foo', 'bar', 'baz'], 'celeryd'))
+ self.assertFalse(self.t.start(['foo', 'bar', 'baz'], 'celery worker'))
def test_show(self):
- self.t.show(['foo', 'bar', 'baz'], 'celeryd')
+ self.t.show(['foo', 'bar', 'baz'], 'celery worker')
self.assertTrue(self.fh.getvalue())
@patch('socket.gethostname')
@@ -407,7 +407,7 @@ def test_get(self, gethostname):
@patch('socket.gethostname')
def test_names(self, gethostname):
gethostname.return_value = 'e.com'
- self.t.names(['foo', 'bar', 'baz'], 'celeryd')
+ self.t.names(['foo', 'bar', 'baz'], 'celery worker')
self.assertIn('foo@e.com\nbar@e.com\nbaz@e.com', self.fh.getvalue())
def test_execute_from_commandline(self):
@@ -438,7 +438,7 @@ def test_execute_from_commandline(self):
def test_stopwait(self):
self.t._stop_nodes = Mock()
- self.t.stopwait(['foo', 'bar', 'baz'], 'celeryd')
+ self.t.stopwait(['foo', 'bar', 'baz'], 'celery worker')
self.assertEqual(self.t._stop_nodes.call_args[1]['retry'], 2)
@patch('celery.bin.multi.MultiTool')
@@ -17,7 +17,7 @@
from celery import signals
from celery import current_app
from celery.apps import worker as cd
-from celery.bin.celeryd import WorkerCommand, main as celeryd_main
+from celery.bin.worker import WorkerCommand, main as worker_main
from celery.exceptions import ImproperlyConfigured, SystemTerminate
from celery.task import trace
from celery.utils.log import ensure_process_aware_logger
@@ -101,7 +101,7 @@ def test_setup_concurrency_very_early(self):
x = WorkerCommand()
x.run = Mock()
with self.assertRaises(ImportError):
- x.execute_from_commandline(['celeryd', '-P', 'xyzybox'])
+ x.execute_from_commandline(['worker', '-P', 'xyzybox'])
@disable_stdouts
def test_invalid_loglevel_gives_error(self):
@@ -405,15 +405,15 @@ def test_set_process_status(self):
def test_parse_options(self):
cmd = WorkerCommand()
cmd.app = current_app
- opts, args = cmd.parse_options('celeryd', ['--concurrency=512'])
+ opts, args = cmd.parse_options('worker', ['--concurrency=512'])
self.assertEqual(opts.concurrency, 512)
@disable_stdouts
def test_main(self):
p, cd.Worker = cd.Worker, Worker
- s, sys.argv = sys.argv, ['celeryd', '--discard']
+ s, sys.argv = sys.argv, ['worker', '--discard']
try:
- celeryd_main()
+ worker_main()
finally:
cd.Worker = p
sys.argv = s
@@ -52,9 +52,9 @@ def _fork_and_exec(self):
pid = os.fork()
if pid == 0:
from celery import current_app
- current_app.worker_main(['celeryd', '--loglevel=INFO',
- '-n', self.hostname,
- '-P', 'solo'])
+ current_app.worker_main(['worker', '--loglevel=INFO',
+ '-n', self.hostname,
+ '-P', 'solo'])
os._exit(0)
self.pid = pid
@@ -301,7 +301,7 @@ def info(self):
as a dict.
This is also the consumer related info returned by
- ``celeryctl stats``.
+ :program:`celery inspect stats`.
"""
conninfo = {}
@@ -1017,17 +1017,17 @@ has been executed, not *just before*, which is the default behavior.
FAQ: :ref:`faq-acks_late-vs-retry`.
-.. _conf-celeryd:
+.. _conf-worker:
-Worker: celeryd
----------------
+Worker
+------
.. setting:: CELERY_IMPORTS
CELERY_IMPORTS
~~~~~~~~~~~~~~
-A sequence of modules to import when the celery daemon starts.
+A sequence of modules to import when the worker starts.
This is used to specify the task modules to import, but also
to import signal handlers and additional remote control commands, etc.
@@ -1128,7 +1128,7 @@ Can be a relative or absolute path, but be aware that the suffix `.db`
may be appended to the file name (depending on Python version).
Can also be set via the :option:`--statedb` argument to
-:mod:`~celery.bin.celeryd`.
+:mod:`~celery.bin.worker`.
Not enabled by default.
@@ -1373,7 +1373,7 @@ CELERYD_TASK_LOG_FORMAT
~~~~~~~~~~~~~~~~~~~~~~~
The format to use for log messages logged in tasks. Can be overridden using
-the :option:`--loglevel` option to :mod:`~celery.bin.celeryd`.
+the :option:`--loglevel` option to :mod:`~celery.bin.worker`.
Default is::
Oops, something went wrong.

0 comments on commit 43c4406

Please sign in to comment.