{ "info": { "author": "Rafael Oliveira", "author_email": "rafaelbco@gmail.com", "bugtrack_url": null, "classifiers": [ "Framework :: Buildout", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Topic :: Software Development :: Build Tools" ], "description": ".. image:: https://travis-ci.org/collective/collective.recipe.supervisorprograms.svg?branch=master\n :target: https://travis-ci.org/collective/collective.recipe.supervisorprograms\n :alt: Build status\n\nOverview\n========\n\nThis recipe helps to configure the ``programs`` option of the `collective.recipe.supervisor`_\nrecipe.\n\nInstead of doing this::\n\n [supervisor]\n recipe = collective.recipe.supervisor\n # (...)\n programs =\n 10 process1 ${buildout:bin-directory}/process1\n 20 process2 ${buildout:bin-directory}/process2\n\nYou'll do this::\n\n [supervisor]\n recipe = collective.recipe.supervisor\n programs = ${supervisor-programs:programs}\n\n [supervisor-programs]\n recipe = collective.recipe.supervisorprograms\n\n [process1-program]\n priority = 10\n command = {buildout:bin-directory}/process1\n\n [process2-program]\n priority = 20\n command = {buildout:bin-directory}/process2\n\nAll options accepted by ``collective.recipe.supervisor`` are supported.\n\n\nConfiguring programs\n====================\n\nThe recipe will scan the buildout configuration looking for all sections with names ending in\n``-program``. Each section will specify one program to be controlled by supervisor. The\n``programs`` option of this recipe then will contain the value to be passed to the ``programs``\noption of the ``collective.recipe.supervisor`` part.\n\nThe ``*-program`` sections accepts the following options:\n\n- ``priority``\n- ``command``\n- ``args``\n- ``directory``\n- ``redirect-stderr``\n- ``user``\n\nOnly ``priority`` and ``command`` are required. The value of the ``args`` option should not be\nbetween ``[]``. Any other options will be inserted into the ``process_opts`` field of\n``collective.recipe.supervisor``.\n\nThe ``process_name`` will be extracted from the section name.\n\n\nExample usage\n=============\n\nWe'll start by creating a buildout that uses the recipe::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = fake-supervisor\n ...\n ... [fake-supervisor]\n ... recipe = collective.recipe.supervisorprograms:printer\n ... programs = ${supervisor-programs:programs}\n ...\n ... [supervisor-programs]\n ... recipe = collective.recipe.supervisorprograms\n ...\n ... [program-base]\n ... redirect-stderr = true\n ...\n ... [first-program]\n ... <= program-base\n ... priority = 10\n ... command = bin/first\n ... directory = /tmp/first\n ...\n ... [second-program]\n ... <= program-base\n ... priority = 20\n ... command = bin/second\n ... directory = /tmp/second\n ... user = www-data\n ... args = -a -b --verbose=1\n ... startsecs = 10\n ...\n ... \"\"\")\n\nThe ``:printer`` recipe is used to print out the generated ``programs`` option. We don't want\nto install supervisor just to test. In real life you would replace the ``fake-supervisor`` section\nby::\n\n [supervisor]\n recipe = collective.recipe.supervisor\n # (...)\n programs = ${supervisor-programs:programs}\n\nAlso, we're using the inheritance feature of buildout (``<= program-base``) to show how to define\ndefault parameters for all programs. Its use is optional.\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start...\n programs = 10 first bin/first /tmp/first true\n 20 second (startsecs=10) bin/second [-a -b --verbose=1] /tmp/second true www-data\n \n\n\nHandling multiple similar programs\n==================================\n\nThere are some use cases when you have multiple programs which are very similar. For example,\nit's common to have multiple Zope instances in a cluster setup.\n\nThe ``:multiplier`` recipe supports this use case in a limited but useful way. Given a base\nprogram section it clones it N times, varying only the ``command`` option by appending a\n``-{index}`` suffix. This means you can have a base program with command being ``bin/instance`` and\nmultiply it N times generating ``bin/instance-1``, ``bin/instance-2`` and so on.\n\nHere's an example::\n\n >>> write('buildout.cfg',\n ... \"\"\"\n ... [buildout]\n ... parts = program-multiplier fake-supervisor\n ...\n ... [fake-supervisor]\n ... recipe = collective.recipe.supervisorprograms:printer\n ... programs = ${supervisor-programs:programs}\n ...\n ... [supervisor-programs]\n ... recipe = collective.recipe.supervisorprograms\n ...\n ... [foo-program]\n ... priority = 10\n ... command = /path/to/foo\n ... directory = /tmp/foo\n ...\n ... [program-multiplier]\n ... recipe = collective.recipe.supervisorprograms:multiplier\n ... program-section = foo-program\n ... count = 2\n ... \"\"\")\n\nRunning the buildout gives us::\n\n >>> print 'start', system(buildout)\n start...\n programs = 10 foo /path/to/foo /tmp/foo\n 10 foo-1 /path/to/foo-1 /tmp/foo\n 10 foo-2 /path/to/foo-2 /tmp/foo\n \n\n\n.. References\n\n.. _`collective.recipe.supervisor`: http://pypi.python.org/pypi/collective.recipe.supervisor\n\n\n\n\n\n\n\n\nChangelog\n=========\n\n0.1.0 (2017-07-20)\n------------------\n\n- Added ``:multiplier`` recipe.\n- Sort programs in a meaningful way for better readability.\n\n\n0.0.1 (2016-11-24)\n------------------\n\n- First release.", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/collective.recipe.supervisorprograms", "keywords": "zc.buildout buildout recipe supervisor", "license": "GPL", "maintainer": "", "maintainer_email": "", "name": "collective.recipe.supervisorprograms", "package_url": "https://pypi.org/project/collective.recipe.supervisorprograms/", "platform": "", "project_url": "https://pypi.org/project/collective.recipe.supervisorprograms/", "project_urls": { "Homepage": "http://pypi.python.org/pypi/collective.recipe.supervisorprograms" }, "release_url": "https://pypi.org/project/collective.recipe.supervisorprograms/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Offers a new syntax to configure collective.recipe.supervisor", "version": "0.1.0" }, "last_serial": 3037028, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "ae8f17dd2a24368f46b60afedd7b87eb", "sha256": "3e2b3f95beedb3d50f618b83a6a4a2db324be26476a9bfb03d44a8bb141d25ea" }, "downloads": -1, "filename": "collective.recipe.supervisorprograms-0.0.1.tar.gz", "has_sig": false, "md5_digest": "ae8f17dd2a24368f46b60afedd7b87eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5096, "upload_time": "2016-11-24T18:04:40", "url": "https://files.pythonhosted.org/packages/c7/95/44e72e8a81148224d3d3b5cf9bb29c7fde914c3b0f9a1fae8468b8046b16/collective.recipe.supervisorprograms-0.0.1.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "0cd745afdd9e6486ad7b463863fb9bf1", "sha256": "cdf82d56aa0484dbf0cbce348e33beef4dd218f83da283bdd432e100abdc4dee" }, "downloads": -1, "filename": "collective.recipe.supervisorprograms-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0cd745afdd9e6486ad7b463863fb9bf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6203, "upload_time": "2017-07-20T14:38:43", "url": "https://files.pythonhosted.org/packages/c8/d4/b3ef038dc4cd752c54256de325c4f0cb26ad137a9722a6ee2bafa4118fc4/collective.recipe.supervisorprograms-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0cd745afdd9e6486ad7b463863fb9bf1", "sha256": "cdf82d56aa0484dbf0cbce348e33beef4dd218f83da283bdd432e100abdc4dee" }, "downloads": -1, "filename": "collective.recipe.supervisorprograms-0.1.0.tar.gz", "has_sig": false, "md5_digest": "0cd745afdd9e6486ad7b463863fb9bf1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6203, "upload_time": "2017-07-20T14:38:43", "url": "https://files.pythonhosted.org/packages/c8/d4/b3ef038dc4cd752c54256de325c4f0cb26ad137a9722a6ee2bafa4118fc4/collective.recipe.supervisorprograms-0.1.0.tar.gz" } ] }