{ "info": { "author": "Paul Triantafyllou, Eric Zavesky", "author_email": "trianta@research.att.com, ezavesky@research.att.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": ".. ===============LICENSE_START=======================================================\n.. Acumos CC-BY-4.0\n.. ===================================================================================\n.. Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.\n.. ===================================================================================\n.. This Acumos documentation file is distributed by AT&T and Tech Mahindra\n.. under the Creative Commons Attribution 4.0 International License (the \"License\");\n.. you may not use this file except in compliance with the License.\n.. You may obtain a copy of the License at\n..\n.. http://creativecommons.org/licenses/by/4.0\n..\n.. This file is distributed on an \"AS IS\" BASIS,\n.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n.. See the License for the specific language governing permissions and\n.. limitations under the License.\n.. ===============LICENSE_END=========================================================\n\n=====================================\nAcumos Python Model Runner User Guide\n=====================================\n\n|Build Status|\n\n.. |Build Status| image:: https://jenkins.acumos.org/buildStatus/icon?job=python-model-runner-tox-verify-master\n :target: https://jenkins.acumos.org/job/python-model-runner-tox-verify-master/\n\nThe ``acumos_model_runner`` package installs a command line tool ``acumos_model_runner`` for running models created by the `Acumos Python client library `__.\n\nThe model runner provides an HTTP API for invoking model methods, as well as a `Swagger UI `__ for documentation. See the tutorial for more information on usage.\n\nInstallation\n============\n\nYou will need a Python 3.4+ environment in order to install ``acumos_model_runner``.\nYou can use `Anaconda `__\n(preferred) or `pyenv `__ to install and\nmanage Python environments.\n\nThe ``acumos_model_runner`` package can be installed with pip:\n\n.. code:: bash\n\n $ pip install acumos_model_runner\n\nCommand Line Usage\n==================\n\n.. code:: bash\n\n usage: acumos_model_runner [-h] [--host HOST] [--port PORT]\n [--workers WORKERS] [--timeout TIMEOUT]\n [--cors CORS]\n model_dir\n\n positional arguments:\n model_dir Directory containing a dumped Acumos Python model\n\n optional arguments:\n -h, --help show this help message and exit\n --host HOST The interface to bind to\n --port PORT The port to bind to\n --workers WORKERS The number of gunicorn workers to spawn\n --timeout TIMEOUT Time to wait (seconds) before a frozen worker is\n restarted\n --cors CORS Enables CORS if provided. Can be a domain, comma-\n separated list of domains, or *\n\n.. ===============LICENSE_START=======================================================\n.. Acumos CC-BY-4.0\n.. ===================================================================================\n.. Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.\n.. ===================================================================================\n.. This Acumos documentation file is distributed by AT&T and Tech Mahindra\n.. under the Creative Commons Attribution 4.0 International License (the \"License\");\n.. you may not use this file except in compliance with the License.\n.. You may obtain a copy of the License at\n..\n.. http://creativecommons.org/licenses/by/4.0\n..\n.. This file is distributed on an \"AS IS\" BASIS,\n.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n.. See the License for the specific language governing permissions and\n.. limitations under the License.\n.. ===============LICENSE_END=========================================================\n\n===================================\nAcumos Python Model Runner Tutorial\n===================================\n\nThis tutorial demonstrates how to use the Acumos Python model runner with an example model.\n\nCreating A Model\n================\n\nAn Acumos model must first be defined using the `Acumos Python client library `__. For illustrative purposes, a simple model with deterministic methods is defined below.\n\n.. code:: python\n\n # example_model.py\n from collections import Counter\n\n from acumos.session import AcumosSession\n from acumos.modeling import Model, List, Dict\n\n def add(x: int, y: int) -> int:\n '''Adds two numbers'''\n return x + y\n\n def count(strings: List[str]) -> Dict[str, int]:\n '''Counts the occurrences of words in `strings`'''\n return Counter(strings)\n\n model = Model(add=add, count=count)\n\n session = AcumosSession()\n session.dump(model, 'example-model', '.')\n\nExecuting ``example_model.py`` results in the following directory:\n\n.. code:: python\n\n .\n \u251c\u2500\u2500 example_model.py\n \u2514\u2500\u2500 example-model\n\n\nRunning A Model\n===============\n\nNow the ``acumos_model_runner`` command line tool can be used to run the saved model.\n\n.. code:: bash\n\n $ acumos_model_runner example-model/\n [2018-08-08 12:16:57 -0400] [61113] [INFO] Starting gunicorn 19.9.0\n [2018-08-08 12:16:57 -0400] [61113] [INFO] Listening at: http://0.0.0.0:3330 (61113)\n [2018-08-08 12:16:57 -0400] [61113] [INFO] Using worker: sync\n [2018-08-08 12:16:57 -0400] [61151] [INFO] Booting worker with pid: 61151\n\nUsing A Model\n=============\n\nThe model HTTP API can be explored via its generated Swagger UI. The Swagger UI of ``example-model`` above can be accessed by navigating to ``http://localhost:3330`` in your web browser.\n\nBelow are some screenshots of the Swagger UI for ``example-model``.\n\nModel APIs\n----------\n\nThe Swagger UI enumerates model method APIs, as well as APIs for accessing model artifacts. Below, the APIs corresponding to the ``add`` and ``count`` methods are listed under the ``methods`` tag.\n\n|Model APIs|\n\n.. |Model APIs| image:: https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git;a=blob_plain;f=docs/tutorial/example-model-apis.png;hb=HEAD\n\nCount Method API\n----------------\n\nExpanding the documentation for the ``count`` method reveals more information on how to invoke the API.\n\n|Model Method|\n\n.. |Model Method| image:: https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git;a=blob_plain;f=docs/tutorial/example-model-method.png;hb=HEAD\n\nCount Method Request\n--------------------\n\nThe Swagger UI provides an input form that can be used to try out the ``count`` API with sample data.\n\n|Model Method Request|\n\n.. |Model Method Request| image:: https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git;a=blob_plain;f=docs/tutorial/example-model-request.png;hb=HEAD\n\nCount Method Response\n---------------------\n\nThe response from the ``count`` API shows that everything is working as expected!\n\n|Model Method Response|\n\n.. |Model Method Response| image:: https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git;a=blob_plain;f=docs/tutorial/example-model-response.png;hb=HEAD\n\n.. ===============LICENSE_START============================================================\n.. Acumos CC-BY-4.0\n.. ========================================================================================\n.. Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.\n.. ========================================================================================\n.. This Acumos documentation file is distributed by AT&T and Tech Mahindra\n.. under the Creative Commons Attribution 4.0 International License (the \"License\");\n.. you may not use this file except in compliance with the License.\n.. You may obtain a copy of the License at\n..\n.. http://creativecommons.org/licenses/by/4.0\n..\n.. This file is distributed on an \"AS IS\" BASIS,\n.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n.. See the License for the specific language governing permissions and\n.. limitations under the License.\n.. ===============LICENSE_END==============================================================\n\n========================================\nAcumos Python Model Runner Release Notes\n========================================\n\nv0.2.2\n======\n- Fixed 404 bug for model artifact resources caused by relative model directory\n- Fixed incorrect media type for protobuf resource\n\nv0.2.1\n======\n- Upgraded Swagger UI from v2 to v3\n\nv0.2.0\n======\n- Overhaul of model runner API\n- Added support for ``application/json`` via ``Content-Type`` and ``Accept`` headers\n- Added automatic generation of `OpenAPI Specification `__ and `Swagger UI `__\n- Added support for CORS\n\nv0.1.0\n======\n- Model runner implementation split off from `Acumos Python client `__ project\n\n.. ===============LICENSE_START=======================================================\n.. Acumos CC-BY-4.0\n.. ===================================================================================\n.. Copyright (C) 2017-2018 AT&T Intellectual Property & Tech Mahindra. All rights reserved.\n.. ===================================================================================\n.. This Acumos documentation file is distributed by AT&T and Tech Mahindra\n.. under the Creative Commons Attribution 4.0 International License (the \"License\");\n.. you may not use this file except in compliance with the License.\n.. You may obtain a copy of the License at\n..\n.. http://creativecommons.org/licenses/by/4.0\n..\n.. This file is distributed on an \"AS IS\" BASIS,\n.. WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n.. See the License for the specific language governing permissions and\n.. limitations under the License.\n.. ===============LICENSE_END=========================================================\n\n==========================================\nAcumos Python Model Runner Developer Guide\n==========================================\n\nTesting\n=======\n\nWe use a combination of ``tox``, ``pytest``, and ``flake8`` to test\n``acumos_model_runner``. Code which is not PEP8 compliant (aside from E501) will be\nconsidered a failing test. You can use tools like ``autopep8`` to\n\u201cclean\u201d your code as follows:\n\n.. code:: bash\n\n $ pip install autopep8\n $ cd python-model-runner\n $ autopep8 -r --in-place --ignore E501 acumos_model_runner/ testing/ examples/\n\nRun tox directly:\n\n.. code:: bash\n\n $ cd python-model-runner\n $ tox\n\nYou can also specify certain tox environments to test:\n\n.. code:: bash\n\n $ tox -e py34 # only test against Python 3.4\n $ tox -e flake8 # only lint code\n\nAnd finally, you can run pytest directly in your environment *(recommended starting place)*:\n\n.. code:: bash\n\n $ pytest\n $ pytest -s # verbose output\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git", "keywords": "acumos machine learning model runner server protobuf ml ai", "license": "Apache License 2.0", "maintainer": "", "maintainer_email": "", "name": "acumos-model-runner", "package_url": "https://pypi.org/project/acumos-model-runner/", "platform": "", "project_url": "https://pypi.org/project/acumos-model-runner/", "project_urls": { "Homepage": "https://gerrit.acumos.org/r/gitweb?p=python-model-runner.git" }, "release_url": "https://pypi.org/project/acumos-model-runner/0.2.2/", "requires_dist": [ "acumos (>=0.5.3)", "connexion (<2.0.0)", "flask-cors", "gunicorn", "jinja2", "lark-parser", "protobuf", "pyyaml", "swagger-ui-bundle" ], "requires_python": ">=3.4", "summary": "Acumos model runner for Python models", "version": "0.2.2" }, "last_serial": 4416434, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "cb6a6e2c7396f62289b291e17f7d578b", "sha256": "2e38559004f52f9adfed4afbff8200db61a85e9f2d301aca6c940eb251995820" }, "downloads": -1, "filename": "acumos_model_runner-0.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "cb6a6e2c7396f62289b291e17f7d578b", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16609, "upload_time": "2018-08-10T20:00:46", "url": "https://files.pythonhosted.org/packages/81/c2/c0b5dfc50dd581d2d6c0b8872a96c87ce3ac2fb3fd6537d8209ceaaa7da6/acumos_model_runner-0.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "12fa36108992a6a913588d310004485a", "sha256": "4bd9650c229127a3aff17f019394f20aecd3da58e545b42ac85373e70d9ddd3e" }, "downloads": -1, "filename": "acumos_model_runner-0.2.0.tar.gz", "has_sig": false, "md5_digest": "12fa36108992a6a913588d310004485a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13178, "upload_time": "2018-08-10T20:00:48", "url": "https://files.pythonhosted.org/packages/78/82/d3fbd453f7f58c14fc0cadb24a8c504a24c1e4a0169f5cd64bf8a7025f36/acumos_model_runner-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "f3e2b6aa2e9de3aeade5509097768344", "sha256": "15e72c080abfa7527a91712e6fab0d975983db27f03a325a55a03d81e543b315" }, "downloads": -1, "filename": "acumos_model_runner-0.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f3e2b6aa2e9de3aeade5509097768344", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 16921, "upload_time": "2018-08-13T20:03:41", "url": "https://files.pythonhosted.org/packages/cc/90/cb9dfd90073c84f18665b8f44f848c9d1b7f9c3e21d1c13d0559ca61602a/acumos_model_runner-0.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0ad31878d7d63038e1960fe34675ce67", "sha256": "825685aac25b373a365e162cf3f99de03348dd6731377f907ff22922b28465a5" }, "downloads": -1, "filename": "acumos_model_runner-0.2.1.tar.gz", "has_sig": false, "md5_digest": "0ad31878d7d63038e1960fe34675ce67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13982, "upload_time": "2018-08-13T20:03:43", "url": "https://files.pythonhosted.org/packages/88/91/215c1e997cc3828d5ad750473600a3a242223f5baee4852384f68eff2133/acumos_model_runner-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "e25b047737633e629e92e8afc4e5a9ae", "sha256": "824698322ab3be963d3ae8940003e6b6070da6b6bdc055cb0c45328f9ee44882" }, "downloads": -1, "filename": "acumos_model_runner-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e25b047737633e629e92e8afc4e5a9ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.4", "size": 21049, "upload_time": "2018-10-25T19:18:59", "url": "https://files.pythonhosted.org/packages/2f/c0/76b784eddc784749db036c5f452744ca3ba11976199671c24dc96e2e7130/acumos_model_runner-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0712373aa271a048ca7e98e56e0c264", "sha256": "7821576922d62267da4eab8dbc0c615dc471e4fdb12485417c077b5feae1889f" }, "downloads": -1, "filename": "acumos_model_runner-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e0712373aa271a048ca7e98e56e0c264", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 14104, "upload_time": "2018-10-25T19:19:01", "url": "https://files.pythonhosted.org/packages/18/9e/2b180ce1967d89abb212019066cdd74507dbdd235d0eebe0c307d7e20530/acumos_model_runner-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e25b047737633e629e92e8afc4e5a9ae", "sha256": "824698322ab3be963d3ae8940003e6b6070da6b6bdc055cb0c45328f9ee44882" }, "downloads": -1, "filename": "acumos_model_runner-0.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "e25b047737633e629e92e8afc4e5a9ae", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": ">=3.4", "size": 21049, "upload_time": "2018-10-25T19:18:59", "url": "https://files.pythonhosted.org/packages/2f/c0/76b784eddc784749db036c5f452744ca3ba11976199671c24dc96e2e7130/acumos_model_runner-0.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e0712373aa271a048ca7e98e56e0c264", "sha256": "7821576922d62267da4eab8dbc0c615dc471e4fdb12485417c077b5feae1889f" }, "downloads": -1, "filename": "acumos_model_runner-0.2.2.tar.gz", "has_sig": false, "md5_digest": "e0712373aa271a048ca7e98e56e0c264", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.4", "size": 14104, "upload_time": "2018-10-25T19:19:01", "url": "https://files.pythonhosted.org/packages/18/9e/2b180ce1967d89abb212019066cdd74507dbdd235d0eebe0c307d7e20530/acumos_model_runner-0.2.2.tar.gz" } ] }