{ "info": { "author": "Thomas Buchberger", "author_email": "t.buchberger@4teamwork.ch", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout :: Recipe", "Intended Audience :: Developers", "License :: OSI Approved :: GNU General Public License (GPL)", "Programming Language :: Python", "Topic :: Software Development :: Build Tools", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": ".. contents::\n\nIntroduction\n============\n\nThis recipe installs Celery and creates a ``celeryconfig.py`` module with\nthe specified configuration options. It helps managing multiple configurations\n(e.g. development and production) using buildout.\n\nYou can use it in a part like this::\n\n [celery]\n recipe = collective.recipe.celery\n broker-transport = sqlakombu.transport.Transport\n broker-host = sqlite:///celery_broker.db\n result-backend = database\n result-dburi = sqlite:///celery_results.db\n imports = myapp.tasks\n eggs =\n kombu-sqlalchemy\n myapp\n\nSupported options\n=================\n\nGeneral options\n---------------\n\neggs\n A list of additional eggs you want to make available to Celery. Use this to\n add additional dependencies such as ``kombu-sqlalchemy`` or the module(s)\n containing your task definitions.\n\nscripts\n Controls which scripts are generated. If the option is omitted, then all\n scripts will be generated. If no value is given, then script generation is\n disabled.\n\nconfig-path\n The location of the directory containing the ``celeryconfig.py`` module. By\n default the config module is created in the part directory.\n You can use this in other parts to include the config module::\n\n [celery]\n recipe = collective.recipe.celery\n\n [myapp]\n recipe = zc.recipe.egg\n eggs = myapp\n extra-paths = ${celery:config-path}\n\nCelery options\n--------------\n\nThe following configuration options are supported. See Celery documentation for\nmore details.\n\nbroker-transport\n The Kombu transport to use. You can use a custom transport class name, or\n select one of the built-in transports: ``amqplib``, ``pika``, ``redis``, \n ``beanstalk``, ``sqlalchemy``, ``django``, ``mongodb``, ``couchdb``.\n\nbroker-host\n The hostname of the broker.\n\nbroker-port\n The port number of the broker.\n\nbroker-user\n The username to connect as.\n\nbroker-password\n The password to connect with.\n\nbroker-vhost\n The virtual host.\n\nresult-backend\n The backend used to store task results. Can be one of ``database``,\n ``cache``, ``mongodb``, ``redis``, ``tyrant`` or ``amqp``.\n\nresult-dburi\n Connection string for the database result backend.\n\nimports\n A list of modules to import when the celery daemon starts. Specify one\n module per line.\n\nceleryd-log-file\n The filename where the celery daemon logs messages to.\n\nceleryd-log-level\n The log level, can be one of ``DEBUG``, ``INFO``, ``WARNING``, ``ERROR`` or\n ``CRITICAL``.\n\nceleryd-concurrency\n The number of concurrent worker processes/threads/green threads, executing\n tasks.\n\nadditional-config\n Any additional configuration directives can be added using the\n ``additional-config`` option.\n \n Example::\n \n additional-config =\n CELERY_TASK_PUBLISH_RETRY=True\n CELERY_TASK_PUBLISH_RETRY_POLICY={\"max_retries\": 2,\n \"interval_start\": 10,\n \"interval_step\": 0,\n \"interval_max\": 10}\n\nChangelog\n=========\n\n1.0 (2011-08-15)\n----------------\n\n- Initial release. \n [buchi]\n\nExample usage\n=============\n\nWe'll start by creating a buildout that uses the recipe::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... broker-transport = sqlakombu.transport.Transport\n ... broker-host = sqlite:///celery_broker.db\n ... result-backend = database\n ... result-dburi = sqlite:///celery_results.db\n ... imports = myapp.tasks\n ... \"\"\"% dict(server=link_server))\n\nRunning the buildout gives us::\n\n >>> print system(buildout)\n Installing celery.\n celery: Creating directory /sample-buildout/parts/celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n Getting distribution for 'celery'.\n Got celery 2.3.1.\n Generated script '/sample-buildout/bin/celeryctl'.\n Generated script '/sample-buildout/bin/celeryd'.\n \n\nCheck that we have the celery scripts::\n\n >>> ls(sample_buildout, 'bin')\n - buildout\n - celeryctl\n - celeryd\n\nCheck that we got a celery config file::\n\n >>> ls(sample_buildout, 'parts', 'celery')\n - celeryconfig.py\n\nIf we run the celeryd script, it prints out the config data::\n\n >>> print(system(join(sample_buildout, 'bin', 'celeryd')))\n BROKER_HOST='sqlite:///celery_broker.db'\n BROKER_TRANSPORT='sqlakombu.transport.Transport'\n CELERY_IMPORTS=('myapp.tasks',)\n CELERY_RESULT_BACKEND='database'\n CELERY_RESULT_DBURI='sqlite:///celery_results.db'\n \n\nWe can include additional eggs using the eggs option::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... eggs =\n ... other\n ... \"\"\"% dict(server=link_server))\n\n >>> print system(buildout),\n Uninstalling celery.\n Installing celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n Getting distribution for 'other'.\n Got other 1.0.\n Generated script '/sample-buildout/bin/celeryctl'.\n Generated script '/sample-buildout/bin/celeryd'.\n\nWe can control which scripts are generated using the scripts option.\nIf no value is given, then script generation is disabled::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... scripts =\n ... \"\"\"% dict(server=link_server))\n\n >>> print system(buildout),\n Uninstalling celery.\n Installing celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n\n >>> ls(sample_buildout, 'bin')\n - buildout\n\nLet's create the celeryd script only::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... scripts =\n ... celeryd\n ... \"\"\"% dict(server=link_server))\n\n >>> print system(buildout),\n Uninstalling celery.\n Installing celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n Generated script '/sample-buildout/bin/celeryd'.\n\n >>> ls(sample_buildout, 'bin')\n - buildout\n - celeryd\n\nThe supported configuration directives may be of various types including\nstrings, integers and tuples::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... broker-port = 8080\n ... broker-user = guest\n ... imports =\n ... myapp.tasks\n ... other.tasks\n ... \"\"\"% dict(server=link_server))\n\n >>> print system(buildout),\n Uninstalling celery.\n Installing celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n Generated script '/sample-buildout/bin/celeryctl'.\n Generated script '/sample-buildout/bin/celeryd'.\n\nLet's verify the generated config data::\n\n >>> cat(sample_buildout, 'parts', 'celery', 'celeryconfig.py')\n BROKER_PORT = 8080\n BROKER_USER = 'guest'\n CELERY_IMPORTS = ('myapp.tasks', 'other.tasks')\n \n\nThe recipe supports a limited set of celery's configuration directives. Any\nadditional directives can be added using the additional-config option::\n\n >>> write(sample_buildout, 'buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = celery\n ... index = %(server)s/index\n ... find-links = %(server)s\n ... \n ... [celery]\n ... recipe = collective.recipe.celery\n ... additional-config =\n ... CELERY_TASK_PUBLISH_RETRY = True\n ... CELERY_TASK_PUBLISH_RETRY_POLICY = {\"max_retries\": 2,\n ... \"interval_start\": 10,\n ... \"interval_step\": 0,\n ... \"interval_max\": 10}\n ... \"\"\"% dict(server=link_server))\n\n >>> print system(buildout),\n Uninstalling celery.\n Installing celery.\n celery: Generated config file /sample-buildout/parts/celery/celeryconfig.py.\n Generated script '/sample-buildout/bin/celeryctl'.\n Generated script '/sample-buildout/bin/celeryd'.\n\nLet's verify the generated config data::\n\n >>> cat(sample_buildout, 'parts', 'celery', 'celeryconfig.py')\n CELERY_TASK_PUBLISH_RETRY = True\n CELERY_TASK_PUBLISH_RETRY_POLICY = {\"max_retries\": 2,\n \"interval_start\": 10,\n \"interval_step\": 0,\n \"interval_max\": 10}\n ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/collective/collective.recipe.celery", "keywords": "", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "collective.recipe.celery", "package_url": "https://pypi.org/project/collective.recipe.celery/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/collective.recipe.celery/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/collective/collective.recipe.celery" }, "release_url": "https://pypi.org/project/collective.recipe.celery/1.0/", "requires_dist": null, "requires_python": null, "summary": "A buildout recipe to install and configure Celery", "version": "1.0" }, "last_serial": 5823622, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "36aa5e1ea0dc7e730fc906911c3284b2", "sha256": "dbc42e203b3f735520a6f5c2ce7a4e6a3d64ea41917c39ef6b0195ba6c08e0b8" }, "downloads": -1, "filename": "collective.recipe.celery-1.0.tar.gz", "has_sig": false, "md5_digest": "36aa5e1ea0dc7e730fc906911c3284b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17380, "upload_time": "2011-08-15T15:54:57", "url": "https://files.pythonhosted.org/packages/17/a6/a64c016b63f32e7191246d9b8537634221545945331b75b50edf79c4fc81/collective.recipe.celery-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "36aa5e1ea0dc7e730fc906911c3284b2", "sha256": "dbc42e203b3f735520a6f5c2ce7a4e6a3d64ea41917c39ef6b0195ba6c08e0b8" }, "downloads": -1, "filename": "collective.recipe.celery-1.0.tar.gz", "has_sig": false, "md5_digest": "36aa5e1ea0dc7e730fc906911c3284b2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17380, "upload_time": "2011-08-15T15:54:57", "url": "https://files.pythonhosted.org/packages/17/a6/a64c016b63f32e7191246d9b8537634221545945331b75b50edf79c4fc81/collective.recipe.celery-1.0.tar.gz" } ] }