{ "info": { "author": "clintval", "author_email": "valentine.clint@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "# reticle\n\n[![Testing Status](https://travis-ci.org/clintval/reticle.svg?branch=master)](https://travis-ci.org/clintval/reticle)\n[![codecov](https://codecov.io/gh/clintval/reticle/branch/master/graph/badge.svg)](https://codecov.io/gh/clintval/reticle)\n[![Documentation Build Status](https://readthedocs.org/projects/reticle/badge/?version=latest)](https://reticle.readthedocs.io/en/latest/?badge=latest)\n[![PyPi Release](https://badge.fury.io/py/reticle.svg)](https://badge.fury.io/py/reticle)\n[![Python Versions](https://img.shields.io/pypi/pyversions/reticle.svg)](https://pypi.python.org/pypi/reticle/)\n[![MyPy Checked](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)\n[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n\nPython 3.6+ library for submitting to AWS Batch interactively.\n\n```bash\n\u276f pip install reticle\n```\n\nFeatures:\n\n- Submit Batch jobs\n\nRead the documentation at: [reticle.readthedocs.io](https://reticle.readthedocs.io/en/latest/)\n\n\n## End-to-end Example\n\nThe principle object for deploying jobs to AWS Batch is the Batch job definition.\nEvery Batch job definition has a name, parameters, and some form of optional parameter validation.\n\n```python\nfrom reticle.aws.batch import JobDefinition\nfrom reticle.aws.s3 import S3Uri\n\nclass DemoJobDefinition(JobDefinition):\n \"\"\"A Batch job definition for demonstrating our API.\n\n Args:\n input_object: The S3 URI to the input object.\n\n \"\"\"\n def __init__(self, input_object: S3Uri):\n self.input_object = input_object\n\n @property\n def name(self) -> str:\n \"\"\"Return the job definition name.\"\"\"\n return 'demo-job'\n\n def validate(self) -> None:\n \"\"\"Validate this parameterized job definition.\"\"\"\n if not self.input_object.object_exists():\n raise f'S3 object does not exist: {self.input_object}'\n```\n\nWe can now wrap the parameterized job definition in a Batch job and set a specific revision.\n\n```python\nfrom reticle.aws.batch import BatchJob\n\ndefinition = DemoJobDefinition(input_object='s3://bucket/object')\ndefinition.at_revision('6')\n\njob = BatchJob(definition)\n```\n\nSubmitting this Batch job is easy, and introspection can be performed immediately:\n\n```python\nresponse = job.submit(queue='prod')\n```\n\nWhen the job is in a `RUNNING` state we can access the job's Cloudwatch logs:\n\n```python\nfor log_event in job.log_stream_events():\n print(log_event)\n\"\"\"\nLogEvent(timestamp=\"1543809952329\", message=\"You have started up this demo job\", ingestion_time=\"1543809957080\")\nLogEvent(timestamp=\"1543809955437\", message=\"Configuration, we are loading from...\", ingestion_time=\"1543809957080\")\nLogEvent(timestamp=\"1543809955437\", message=\"Defaulting to approximate values\", ingestion_time=\"1543809957080\")\nLogEvent(timestamp=\"1543809955437\", message=\"Setting up logger, nothing to see here\", ingestion_time=\"1543809957080\")\n\"\"\"\n```\n\nAnd if we must, we can cancel the job as long as we provide a reason:\n\n```python\njob.terminate(reason='I was just testing!')\n```", "description_content_type": "text/markdown", "docs_url": null, "download_url": "https://github.com/clintval/reticle/archive/v0.1.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/clintval/reticle", "keywords": "AWS Batch job submission", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "reticle", "package_url": "https://pypi.org/project/reticle/", "platform": "", "project_url": "https://pypi.org/project/reticle/", "project_urls": { "Documentation": "https://reticle.readthedocs.io", "Download": "https://github.com/clintval/reticle/archive/v0.1.0.tar.gz", "Homepage": "https://github.com/clintval/reticle", "Issue-Tracker": "https://github.com/clintval/reticle/issues" }, "release_url": "https://pypi.org/project/reticle/0.1.0/", "requires_dist": null, "requires_python": "", "summary": "Python 3.6+ library for submitting to AWS Batch interactively.", "version": "0.1.0" }, "last_serial": 4554350, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "dc3435deb53ef85b8732f99e184abd60", "sha256": "0f220b7dd54ad05b53f0737f5fe9053896cf530cc80c6d43b0c05dbc59e72c06" }, "downloads": -1, "filename": "reticle-0.0.2.tar.gz", "has_sig": false, "md5_digest": "dc3435deb53ef85b8732f99e184abd60", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4052, "upload_time": "2018-12-03T02:51:55", "url": "https://files.pythonhosted.org/packages/76/88/0031520d34cb30a4c468ddb7ed8ed9d602dc247f5718bf59eaab3e55f87f/reticle-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5eb2c6e8a3b4746ee73336341f845166", "sha256": "4860d9c98d24ad879d2636ea760cfbbbd0f906ee59b3dc71e90d889fbd8d890b" }, "downloads": -1, "filename": "reticle-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5eb2c6e8a3b4746ee73336341f845166", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4233, "upload_time": "2018-12-03T02:59:54", "url": "https://files.pythonhosted.org/packages/78/ed/cedc5c9bbb4be9f10991694e9be5cf84ca68e2b3e0fa15cd9ce241fccbf3/reticle-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "8b17b17991f5d6844ea99c2abb2e71c2", "sha256": "3a2f928d77afe028a9292a915b4648eed7c1d1cc2b05e906b01ec91e8770efb9" }, "downloads": -1, "filename": "reticle-0.0.4.tar.gz", "has_sig": false, "md5_digest": "8b17b17991f5d6844ea99c2abb2e71c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5399, "upload_time": "2018-12-03T04:32:22", "url": "https://files.pythonhosted.org/packages/5e/1f/6844530d7f4d5a9c85c10ec84d06df9fcedce1e07a7a05c34559e0bde25f/reticle-0.0.4.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "8c3bf840734af645e97a09c384baecd8", "sha256": "3936d1d75b19b77d9ea66ebd9609ca04bbed76f4866cbd4ff98420faaa60787c" }, "downloads": -1, "filename": "reticle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8c3bf840734af645e97a09c384baecd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5375, "upload_time": "2018-12-03T04:41:48", "url": "https://files.pythonhosted.org/packages/a5/b1/7e4935dcfd1bf5707203e074e52ef31d248744e2aa9cabc74984c18c9779/reticle-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8c3bf840734af645e97a09c384baecd8", "sha256": "3936d1d75b19b77d9ea66ebd9609ca04bbed76f4866cbd4ff98420faaa60787c" }, "downloads": -1, "filename": "reticle-0.1.0.tar.gz", "has_sig": false, "md5_digest": "8c3bf840734af645e97a09c384baecd8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5375, "upload_time": "2018-12-03T04:41:48", "url": "https://files.pythonhosted.org/packages/a5/b1/7e4935dcfd1bf5707203e074e52ef31d248744e2aa9cabc74984c18c9779/reticle-0.1.0.tar.gz" } ] }