{ "info": { "author": "Surreal AI team", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Console", "Programming Language :: Python :: 3", "Topic :: Scientific/Engineering :: Artificial Intelligence" ], "description": "Symphony: An orchestrating Library Supporting Multiple Backends\n===============================================================\n\nSymphony aims to ease the process of launching and monitoring\nmulti-process / multi-node computation tasks. It provides a simple\nabstraction for launching multiple processes in a centralized place and\nsupports multiple backends (e.g. tmux and kubernetes). It also provides\na set of essential commandline interfaces to monitor the status of the\nprocesses involved.\n\nIndex\n=====\n\n| `Motivation <#motivation>`__\n| `Concepts <#processes-experiments-clusters>`__\n| `Networking <#networking>`__\n| `Monitoring <#monitoring-through-the-commandline>`__\n| `Config <#config>`__\n| `Using Symphony for your\n project <#using-symphony-as-part-of-your-project>`__\n\nreplay\\_host = os.environ['SYMPH\\_REPLAY\\_SERVER\\_HOST'] replay\\_port =\nos.environ['SYMPH\\_REPLAY\\_SERVER\\_PORT'] server =\nReplayServer(host=replay\\_host, port=replay\\_port) ... \\`\\`\\` And\nsimilarly you can connect to this address in agent.\n\nA process can declare networking in three ways: ``bind``, ``connect``,\n``expose``. \\* ``process.bind('service')`` tells symphony to assign a\nport to ``service-1`` and expose both DNS address and port so that other\nprocesses can connect to the binding process. All pocesses will have\naccess to environment variables ``SYMPH_SERVICE_1_HOST`` and\n``SYMPH_SERVICE_1_PORT``. One can also do\n``process.bind({'tensorboard': 6006})`` where a specific port is\nassigned. \\* ``connect`` to something (e.g. ``service-1``) declares that\nthe process expects some other process to ``bind`` to it. While the\nenvorinment variables for the host/port will still be provided at run\ntime (assuming that you did bind) even if you didn't call ``connect``,\nit is recommended as connecting to some non-existent name will be caught\nand cause the program to fail during declaration, before the experiment\neven starts. \\* ``expose`` is used when you are running experiments on a\ncloud. It tells symphony to expose this port to a global ip. If you have\na process expose ``tensorboard`` you can later use\n``symphony visit tensorboard`` to retrieve an ip and open a browser for\nit. There will also be environment variables ``SYMPH_TENSORBOARD_HOST``\nand ``SYMPH_TENSORBOARD_PORT``.\n\nMonitoring Through the Commandline.\n===================================\n\nAfter you start running and experiment, symphony provides a convenient\ncommandline interface to know how each of the processes are running. The\nscript installed with symphony is mainly used for demonstration and\nprototyping. For your own project, you can merge the interface with your\npython script easily. See #\\ `this\nexample `__.\n\n- ``symphony process`` or ``symphony p`` lists the status of processes\n in an experiment.\n\n .. code:: bash\n\n $> symphony p\n Group Name Ready Restarts State \n agent-0 1 0 running: 23.2h \n eval-0 1 0 running: 23.2h \n ...\n\n- ``symphony logs `` retrieves logs from a given process.\n\n .. code:: bash\n\n $> symphony logs agent-0\n Agent starting ...\n\n- ``symphony list-experiments`` (``symphony ls``) lists all running\n experiments.\n\n .. code:: bash\n\n $> symphony ls\n experiment-0\n experiment-1\n ...\n\n- ``symphony delete`` (``symphony d``), ``symphony delete-batch``\n (``symphony db``) terminates experiments.\n- ``symphony visit [exposed_service]`` (``symphony vi``) opens a web\n browser to the exposed service (Use ``--url-only`` to only get the\n url).\n- Other convenient functionalities can be used for some clusters, (e.g.\n Kubernetes). ``exec, ssh, scp``.\n- If you are using a process group and that process names are not\n unique, use ``process_group/process`` in place of ``process``.\n\nConfig\n======\n\nSymphony provides several optional functionalities to help organize\nexperiments. They are controlled by ``SymphonyConfig`` singleton.\n\n.. code:: python\n\n from symphony.engine import SymphonyConfig\n\n- ``set_username(name)`` makes all subsequently created experiments\n prepend username\n\n .. code:: python\n\n SymphonyConfig().set_username('sarah')\n cluster = Cluster.new('tmux') # cluster is a TmuxCluster\n exp1 = cluster.new_experiment('rl') # exp is a TmuxExperimentSpec\n print(exp1.name) # 'sarah-rl' \n\n- ``set_experiment_folder(directory)`` saves all subsequently launched\n experiment specs to ``directory``. You can retrieve your declaration\n of experiments later. It also allows the cluster to complain to you\n if you are going to overwrite an existing experiment. (You can still\n pass 'force=True' to force overwrite)\n\n .. code:: python\n\n SymphonyConfig().set_experiment_folder('~/foo')\n cluster = Cluster.new('tmux') # cluster is a TmuxCluster\n exp1 = cluster.new_experiment('rl') # exp is a TmuxExperimentSpec\n cluster.launch(exp1) \n # information about this experiment will be saved to ~/foo/rl\n\nUsing symphony as part of your project\n======================================\n\nTo use symphony for your own project, the easiest way is to extend the\nprovided parser. You only need to do three things in a class that\nextends ``SymphonyParser``: 1. Overwrite ``create_cluster(self)``,\ndefine the backend that you want to use 2. Overwrite ``setup(self)``,\nadd a new subcommand for launch (so you can launch things) and\n(optionally) set configs 3. Declare your experiment and launch it. (Here\nwe show how to add it as another subcommand of the script.)\n\n.. code:: python\n\n # myproject.py\n from symphony.commandline import SymphonyParser\n from symphony.engine import Cluster\n from symphony.kube import KubeCluster\n import sys\n\n class MyProjectParser(SymphonyParser):\n def create_cluster(self): # step 1\n return Cluster.new('kube')\n\n def setup(self): # step 2\n super().setup()\n SymphonyConfig().set_username('sarah')\n parser = self.add_subparser('create') \n # add subcommand: `python myproject.py create`\n # This subcommand is mapped to self.action_create(args)\n parser.add_argument(...)\n\n def action_create(self, args): # step 3\n exp = self.cluster.new_experiment('foo')\n p = exp.new_process(...)\n ...\n self.cluster.launch(exp)\n\n if __name__ == '__main__':\n MyProjectParser().main()\n\nNow not only can you do ``python myproject.py create`` to launch an\nexperiment, but you can also use ``python myproject.py process`` to\nmonitor the processes of your experiment.\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/SurrealAI/symphony", "keywords": "Orchestration,Kubernetes,Tmux", "license": "GPLv3", "maintainer": "", "maintainer_email": "", "name": "symphony", "package_url": "https://pypi.org/project/symphony/", "platform": "", "project_url": "https://pypi.org/project/symphony/", "project_urls": { "Homepage": "https://github.com/SurrealAI/symphony" }, "release_url": "https://pypi.org/project/symphony/0.10/", "requires_dist": [ "libtmux", "nanolog", "docker", "pyyaml", "benedict (>=0.3)", "nanolog" ], "requires_python": ">=3.5", "summary": "a distributed process orchestration platform that supports both laptop and major cloud providers", "version": "0.10" }, "last_serial": 4705388, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "4df04a1862c0314b14b3f0e386f90b80", "sha256": "2ed5170164d01076edf74349a32acf91def7d7be822f82e9a7217df2423a4963" }, "downloads": -1, "filename": "symphony-0.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "4df04a1862c0314b14b3f0e386f90b80", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 2434, "upload_time": "2018-03-13T07:37:17", "url": "https://files.pythonhosted.org/packages/ea/a4/c1fcfc767504b25751bab549e6b6d8bdba316e476d2b1811049426ffc467/symphony-0.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "fc65f81acf3701141bf88d1dcf9255eb", "sha256": "8dcf34ecfc928bce4b3a9dbfb4a11b2f9a39613e97ba794d86282ed156b563b2" }, "downloads": -1, "filename": "symphony-0.0.0.tar.gz", "has_sig": false, "md5_digest": "fc65f81acf3701141bf88d1dcf9255eb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1048, "upload_time": "2018-03-13T07:37:18", "url": "https://files.pythonhosted.org/packages/d3/43/80fd4b4c342c7162ba9f02ffeb2aa4a6fe104ed8cbfa8f4e0d65799b1c24/symphony-0.0.0.tar.gz" } ], "0.10": [ { "comment_text": "", "digests": { "md5": "52a26a10406ac7270996084b5903b283", "sha256": "d49f589535f4fd2e7d91b1127e57e0d7860782af317666d7877e779ed4b8138e" }, "downloads": -1, "filename": "symphony-0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "52a26a10406ac7270996084b5903b283", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 67195, "upload_time": "2019-01-16T22:43:15", "url": "https://files.pythonhosted.org/packages/7a/ad/0328ef392dd107ed620f3b4e14f52754b276384f0baaaad620b0ea66b7e5/symphony-0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba327b9cfa911ff600b94a625f7045f8", "sha256": "3974cf9e14e556e382507058b0037bb5608bfa3217fb3806fd234f2a26b8776a" }, "downloads": -1, "filename": "symphony-0.10.tar.gz", "has_sig": false, "md5_digest": "ba327b9cfa911ff600b94a625f7045f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 55014, "upload_time": "2019-01-16T22:43:17", "url": "https://files.pythonhosted.org/packages/6c/8a/2b2ffc0f4c1590e68f443f6254b487391f9474fb28d63be6bc0b5cc212a0/symphony-0.10.tar.gz" } ], "0.9": [ { "comment_text": "", "digests": { "md5": "7ef5128835ec3986b864f851b49129f4", "sha256": "eaf371b85fa8310466a03ea96c4bafed7ddc7c43f8a15c1fa86b5da3c0aa4fbe" }, "downloads": -1, "filename": "symphony-0.9-py3-none-any.whl", "has_sig": false, "md5_digest": "7ef5128835ec3986b864f851b49129f4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 62073, "upload_time": "2018-10-14T04:53:03", "url": "https://files.pythonhosted.org/packages/5c/6f/ecad7f8e901da1c8079f028936328b2ffa79ab6940cd8d22ee994f8fc8ce/symphony-0.9-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0dd550f4e6c1fb047fe2e93f49d469ce", "sha256": "133a6482de1510b11fd00f856b4d6baf0fc95003cf0258b46cd2e8d962f20673" }, "downloads": -1, "filename": "symphony-0.9.tar.gz", "has_sig": false, "md5_digest": "0dd550f4e6c1fb047fe2e93f49d469ce", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 55257, "upload_time": "2018-10-14T04:53:04", "url": "https://files.pythonhosted.org/packages/ee/3f/5ea0a68cf116dd59878e1f4a06778407e31a73f8a0f96579b2d182e6c00f/symphony-0.9.tar.gz" } ], "0.9.1": [ { "comment_text": "", "digests": { "md5": "f989b1471f43f6d86c4754fa965afc18", "sha256": "e82ac018cab22236169487f02086300541ce626af81709f9c375eeafe81f6acc" }, "downloads": -1, "filename": "symphony-0.9.1-py3-none-any.whl", "has_sig": false, "md5_digest": "f989b1471f43f6d86c4754fa965afc18", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 60092, "upload_time": "2018-10-28T21:54:16", "url": "https://files.pythonhosted.org/packages/6d/54/bbbc52c6862975cbd68c636d8ed912a916b05c8d37f1dcf887770e5cd85e/symphony-0.9.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8ef512956f02c272b7f9ef2827b842fd", "sha256": "cd4687458ca476dd7c24c4906d52d54bbba342c4c17fc7d4aedc01d9de0cd60d" }, "downloads": -1, "filename": "symphony-0.9.1.tar.gz", "has_sig": false, "md5_digest": "8ef512956f02c272b7f9ef2827b842fd", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 51977, "upload_time": "2018-10-28T21:54:17", "url": "https://files.pythonhosted.org/packages/b2/9d/6efa063a9569a3e1546bf554bc566a299395522a339c47cdd123240e10c1/symphony-0.9.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "52a26a10406ac7270996084b5903b283", "sha256": "d49f589535f4fd2e7d91b1127e57e0d7860782af317666d7877e779ed4b8138e" }, "downloads": -1, "filename": "symphony-0.10-py3-none-any.whl", "has_sig": false, "md5_digest": "52a26a10406ac7270996084b5903b283", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5", "size": 67195, "upload_time": "2019-01-16T22:43:15", "url": "https://files.pythonhosted.org/packages/7a/ad/0328ef392dd107ed620f3b4e14f52754b276384f0baaaad620b0ea66b7e5/symphony-0.10-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ba327b9cfa911ff600b94a625f7045f8", "sha256": "3974cf9e14e556e382507058b0037bb5608bfa3217fb3806fd234f2a26b8776a" }, "downloads": -1, "filename": "symphony-0.10.tar.gz", "has_sig": false, "md5_digest": "ba327b9cfa911ff600b94a625f7045f8", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5", "size": 55014, "upload_time": "2019-01-16T22:43:17", "url": "https://files.pythonhosted.org/packages/6c/8a/2b2ffc0f4c1590e68f443f6254b487391f9474fb28d63be6bc0b5cc212a0/symphony-0.10.tar.gz" } ] }