{ "info": { "author": "Daniel Pope", "author_email": "mauve@mauveweb.co.uk", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: System Administrators", "License :: OSI Approved :: Apache Software License", "Operating System :: POSIX", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: System :: Systems Administration" ], "description": "Chopsticks\n==========\n\n.. image:: https://badges.gitter.im/chopsticks-chat/Lobby.svg\n :alt: Join the chat at https://gitter.im/chopsticks-chat/Lobby\n :target: https://gitter.im/chopsticks-chat/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge\n\nChopsticks is an orchestration library: it lets you manage and configure\nremote hosts over SSH.\n\nNaturally this is agentless and nothing needs to be installed on the remote\nhost except Python and an SSH agent.\n\nIt also has support for executing code in Docker containers.\n\nIt's perhaps best compared to Ansible or Fabric, but has some clever transport\nmagic which means it's very easy to develop with: you just write Python\nfunctions that can be called from the orchestration host. No invoking bash\ncommands (eg. Fabric) or writing self-contained scripts with constrained input\nand output formats (eg. Ansible).\n\nOne might also draw a comparison with Python's built-in ``multiprocessing``\nlibrary, but instead of calling code in subprocesses on the same host, the\ncode may be run on remote hosts.\n\nExample\n-------\n\nWith chopsticks you can simply import functions and hand them to the remote\nhost to be executed.\n\nFirst stand up an SSH Tunnel::\n\n from chopsticks.tunnel import Tunnel\n tun = Tunnel('troy.example.com')\n\nThen you can pass a function, to be called on the remote host::\n\n import time\n print('Time on %s:' % tun.host, tun.call(time.time))\n\nYou can use any pure-Python function in the current codebase, meaning you can\ncreate your own libraries of orchestration functions to call on remote hosts\n(as well as functions that call out to remote hosts using Chopsticks).\n\n``Tunnel`` provides support for executing on a single host; there is also a\n``Group`` that can execute a callable on a number of hosts in parallel::\n\n from chopsticks.group import Group\n\n group = Group([\n 'web1.example.com',\n 'web2.example.com',\n 'web3.example.com',\n ])\n for host, addr in group.call(ip).successful():\n print('%s ip:' % host, addr)\n\nSubclasses of tunnels allow connecting using streams other than SSH, such as\nusing ``sudo``, or to fresh Docker containers for sandboxing::\n\n from chopsticks.tunnel import Docker\n from chopsticks.group import Group\n from chopsticks.facts import python_version\n\n group = Group([\n Docker('worker-1', image='python:3.4'),\n Docker('worker-2', image='python:3.5'),\n Docker('worker-3', image='python:3.6'),\n ])\n\n for host, python_version in group.call(python_version).items():\n print('%s Python version:' % host, python_version)\n\nTunnels and Groups connect lazily (or you can connect them proactively by\ncalling ``connect()``). They are also usable as context managers::\n\n # Explictly connect and disconnect\n group.connect()\n group.call(time.time)\n group.close()\n\n # Reconnect and disconnect as context manager\n with group:\n group.call(time.time)\n\n # Implicit reconnect\n group.call(time.time)\n\n # Disconnect when destroyed\n del group\n\nNaturally, any remote state (imports, globals, etc) is lost when the\nTunnel/Group is closed.\n\nInstallation\n------------\n\nChopsticks can be used directly from a clone of the repo; or installed with\npip::\n\n $ pip install chopsticks\n\n\nAPI\n---\n\nSee `the full documentation`__ on Read The Docs.\n\n.. __: https://chopsticks.readthedocs.io/\n\n\nPython 2/3\n----------\n\nChopsticks supports both Python 2 and Python 3.\n\nBecause Chopsticks takes the view that agents run out of the same codebase as\nthe controller, agents will attempt to use a similar Python interpreter to the\none for the controller process:\n\n* ``/usr/bin/python2`` if the controller process is (any) Python 2.\n* ``/usr/bin/python3`` if the controller process is (any) Python 3.\n\n\nHow it works\n------------\n\nThe SSH tunnel invokes the ``python`` binary on the remote host, and feeds it a\nbootstrap script via stdin.\n\nOnce bootstrapped, the remote \"agent\" sets up bi-directional communication over\nthe stdin/stdout of the tunnel. This communication is used (currently) for two\npurposes:\n\n* An RPC system to invoke arbitrary callables within the remote agent and pass\n the returned values back to the controller.\n* A PEP-302 import hook system, allowing the remote agent to import pure-Python\n code from the controller (NB. the controller can only serve Python modules\n that live within the filesystem - import hooks such as zipimport/compressed\n eggs are not currently supported).\n\n``stderr`` is echoed to the controlling console, prefixed with a hostname to\nidentify which Tunnel it issued from. This can therefore be used to feed\ndebugging information back to the orchestration host.\n\nLicense\n-------\n\n`Apache License 2.0`__\n\n.. __: http://www.apache.org/licenses/LICENSE-2.0\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/lordmauve/chopsticks", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "chopsticks", "package_url": "https://pypi.org/project/chopsticks/", "platform": "", "project_url": "https://pypi.org/project/chopsticks/", "project_urls": { "Homepage": "https://github.com/lordmauve/chopsticks" }, "release_url": "https://pypi.org/project/chopsticks/1.0/", "requires_dist": null, "requires_python": "", "summary": "Chopsticks is an orchestration library: it lets you manage and configure remote hosts over SSH.", "version": "1.0" }, "last_serial": 3002338, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "feb3190d969dae2ffce94bf12001abb8", "sha256": "682f6571d6df70dec079754a54f4047d72928d444ffefd358197ad5de0f85fe9" }, "downloads": -1, "filename": "chopsticks-0.1.tar.gz", "has_sig": false, "md5_digest": "feb3190d969dae2ffce94bf12001abb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5182, "upload_time": "2016-07-12T13:30:43", "url": "https://files.pythonhosted.org/packages/04/75/9cb02fe6f3e68da63105f866831ae36fde2ddb9573753d9be09228855890/chopsticks-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "064b8616e390f3c6cb97043a22e708bb", "sha256": "e2a4b68954edd6cfafa937a07bc6d964144c976af8b2cf3d5ace9e7f99b25fd6" }, "downloads": -1, "filename": "chopsticks-0.2.tar.gz", "has_sig": false, "md5_digest": "064b8616e390f3c6cb97043a22e708bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7603, "upload_time": "2016-07-12T23:32:39", "url": "https://files.pythonhosted.org/packages/53/01/0caf9c9a4b24ba1508626563c790ad1c07df7fcb1fb9007b0e0d70a549b0/chopsticks-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "5f13a9f5a6c81769738e872a4135b53c", "sha256": "38515b8cf47f62d9550006e1c5f0aac97403620799b96489c7f934cdc96f0ef2" }, "downloads": -1, "filename": "chopsticks-0.3.tar.gz", "has_sig": false, "md5_digest": "5f13a9f5a6c81769738e872a4135b53c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10796, "upload_time": "2016-07-15T00:23:49", "url": "https://files.pythonhosted.org/packages/4e/c9/4bccdced7cac6cb56b8615612f42e35f95d65d25a8468e73be18b758ea3a/chopsticks-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "d805f886662ad347bcbdbbd142eba3a9", "sha256": "a7d6853cc4ab83eb0697f10f8ed3d452addc657dd476c2605580a26bb392ee66" }, "downloads": -1, "filename": "chopsticks-0.4.tar.gz", "has_sig": false, "md5_digest": "d805f886662ad347bcbdbbd142eba3a9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18268, "upload_time": "2016-07-24T11:28:40", "url": "https://files.pythonhosted.org/packages/ac/c2/5b992edbde0515a084cd260b79cff70e9e778011c39cf9966bb47e96502d/chopsticks-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "a27735fa7554977fb9fc6d3064b7420b", "sha256": "1f420bc40d89a23f5abd9c0f12a580c64f07d8128bd03c91e8a84d8ec3829ba0" }, "downloads": -1, "filename": "chopsticks-0.5.tar.gz", "has_sig": false, "md5_digest": "a27735fa7554977fb9fc6d3064b7420b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 21446, "upload_time": "2016-08-07T23:04:58", "url": "https://files.pythonhosted.org/packages/b7/ca/819323e112699fb763f50a9baa62bb5bd5bc17925d99dc78da3defb6879d/chopsticks-0.5.tar.gz" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "faebeeb99a6129d29e4f5efb4898bc8a", "sha256": "9c84876c76e79c006651018f90be7c318e8e9531280bee9571a87bd11725a13f" }, "downloads": -1, "filename": "chopsticks-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "faebeeb99a6129d29e4f5efb4898bc8a", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 28490, "upload_time": "2017-07-06T00:54:11", "url": "https://files.pythonhosted.org/packages/95/33/566b001375f673ca245d1e57f1fbf77a4ad1ea8bc38601f18888f8aeff80/chopsticks-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8559fa6f0069fc5e3b39706d987797c2", "sha256": "b85856e7757884a3e866d8925d8c8949aa1fe8b9849fe9bfc1a50a5ff7c4e817" }, "downloads": -1, "filename": "chopsticks-1.0.tar.gz", "has_sig": false, "md5_digest": "8559fa6f0069fc5e3b39706d987797c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57429, "upload_time": "2017-07-06T00:54:09", "url": "https://files.pythonhosted.org/packages/9f/81/d6c21092db5e57a5114cce9c88955558bad1d8b42b5f0f815a9b7a9eba60/chopsticks-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "faebeeb99a6129d29e4f5efb4898bc8a", "sha256": "9c84876c76e79c006651018f90be7c318e8e9531280bee9571a87bd11725a13f" }, "downloads": -1, "filename": "chopsticks-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "faebeeb99a6129d29e4f5efb4898bc8a", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 28490, "upload_time": "2017-07-06T00:54:11", "url": "https://files.pythonhosted.org/packages/95/33/566b001375f673ca245d1e57f1fbf77a4ad1ea8bc38601f18888f8aeff80/chopsticks-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8559fa6f0069fc5e3b39706d987797c2", "sha256": "b85856e7757884a3e866d8925d8c8949aa1fe8b9849fe9bfc1a50a5ff7c4e817" }, "downloads": -1, "filename": "chopsticks-1.0.tar.gz", "has_sig": false, "md5_digest": "8559fa6f0069fc5e3b39706d987797c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 57429, "upload_time": "2017-07-06T00:54:09", "url": "https://files.pythonhosted.org/packages/9f/81/d6c21092db5e57a5114cce9c88955558bad1d8b42b5f0f815a9b7a9eba60/chopsticks-1.0.tar.gz" } ] }