{ "info": { "author": "Cuttlesoft, LLC", "author_email": "engineering@cuttlesoft.com", "bugtrack_url": null, "classifiers": [], "description": "=============\necs-deploy.py\n=============\n\n.. image:: https://img.shields.io/pypi/v/ecs-deploy-py.svg\n :target: https://pypi.python.org/pypi/ecs-deploy-py\n\n.. image:: https://travis-ci.org/cuttlesoft/ecs-deploy.py.svg?branch=master\n\t:target: https://travis-ci.org/cuttlesoft/ecs-deploy.py\n\n.. image:: https://coveralls.io/repos/github/cuttlesoft/ecs-deploy.py/badge.svg\n :target: https://coveralls.io/github/cuttlesoft/ecs-deploy.py\n\n-----\n\nPython script to instigate an automatic blue/green deployment using the Task Definition and Service entities in Amazon's ECS.\n\nUsage\n-----\n\nThe script is installed as an executable with::\n\n\t\t$ pip install ecs-deploy-py\n\nTo run the script::\n\n\t\t$ ecs-deploy-py \n\n.. code-block::\n\n\tEither one of the following is required:\n\t\t -n | --service-name Name of service to deploy\n\t\t -d | --task-definition Name of task definition to deploy\n \tRequired arguments:\n\t\t -k | --aws-access-key AWS Access Key ID. May also be set as environment variable AWS_ACCESS_KEY_ID\n\t\t -s | --aws-secret-key AWS Secret Access Key. May also be set as environment variable AWS_SECRET_ACCESS_KEY\n\t\t -r | --region AWS Region Name. May also be set as environment variable AWS_DEFAULT_REGION\n\t\t -p | --profile AWS Profile to use - If you set this aws-access-key, aws-secret-key and region are needed\n\t\t -c | --cluster Name of ECS cluster\n\t\t -i | --image Name of Docker image to run, ex: repo/image:latest\n Format: [domain][:port][/repo][/][image][:tag]\n Examples: mariadb, mariadb:latest, silintl/mariadb, silintl/mariadb:latest, private.registry.com:8000/repo/image:tag\n\tOptional arguments:\n\t\t -D | --desired-count The number of instantiations of the task to place and keep running in your service.\n\t\t -m | --min minumumHealthyPercent: The lower limit on the number of running tasks during a deployment.\n\t\t -M | --max maximumPercent: The upper limit on the number of running tasks during a deployment.\n\t\t -t | --timeout Default is 90s. Script monitors ECS Service for new task definition to be running.\n\t\t -v | --verbose Verbose output\n\n Examples:\n Simple (Using env vars for AWS settings):\n\n \t$ ecs-deploy-py -c production1 -n doorman-service -i docker.repo.com/doorman:latest\n\n All options:\n\n \t$ ecs-deploy-py -k ABC123 -s SECRETKEY -r us-east-1 -c production1 -n doorman-service -i docker.repo.com/doorman -m 50 -M 100 -t 240 -D 2 -v\n\n Using profiles (for STS delegated credentials, for instance):\n\n \t$ ecs-deploy-py -p PROFILE -c production1 -n doorman-service -i docker.repo.com/doorman -m 50 -M 100 -t 240 -v\n\n Notes:\n \t- If a tag is not found in image, it will default the tag to \"latest\"\n\n\nAbout\n-----\nIn EC2 Container Service, the relationship of containers which together provide a useful application (e.g. a database, \\\nweb frontend, and perhaps some for maintenance/cron) is specified in a Task Definition. The Task Definition then acts a \\\nsort of template for actually running the containers in that group. That resulting group of containers is known as a Task.\n\nTask Definitions are automatically version controlled---the actual name of a Task Definition is composed of two parts, \\\nthe Family name, and a version number, like so: ``phpMyAdmin:3``.\n\nAmazon uses another configuration entity, Services, to manage the number of Tasks running at any given time. As Tasks are \\\njust instantiations of Task Definitions, a Service is just a binding between a specified revision of a Task Definition, \\\nand the number of Tasks which should be run from it.\n\nConveniently, Amazon allows this binding to be updated, either to change the number of Tasks running or to change the Task \\\nDefinition they are built from. In the former case, the Service will respond by building or killing Tasks to bring the \\\ncount to specifications. In the latter case, however, it will do a blue/green deployment, that is, before killing any of \\\nthe old Tasks, it will first ensure that a new Task is brought up and ready to use, so that there is no loss of service.\n\nConsequently, all that is needed to deploy a new version of an application is to update the Service which is running its \\\nTasks to point at a new version of the Task Definition. ecs-deploy uses the python aws utility to do this. It:\n\n - Pulls the JSON representation of the in-use Task Definition\n - Edits it\n - Defines a new version, with the changes\n - Updates the Service to use the new version\n - Waits, querying Amazon's API to make sure that the Service has been able to create a new Task\n\nThe second step merits more explanation: since a Task Definition [may] define multiple containers, the question arises, \\\n\"what must be changed to create a new revision?\" Empirically, the surprising answer is nothing; Amazon allows you to create \\\na new but identical version of a Task Definition, and the Service will still do a blue/green deployment of identical tasks.\n\nNevertheless, since the system uses docker, the assumption is that improvements to the application are built into its \\\ncontainer images, which are then pushed into a repository (public or private), to then be pulled down for use by ECS. This \\\nscript therefore uses the specified image parameter as a modification key to change the tag used by a container's image. It \\\nlooks for images with the same repository name as the specified parameter, and updates its tag to the one in the specified parameter.\n\nThis script inspired by: SIL International's `ecs-deploy`_.\n\n.. _ecs-deploy: https://github.com/silinternational/ecs-deploy\n\nContributing\n------------\nIf you're interested in contributing to ecs-deploy.py, get started by creating an issue `here`_. Thanks!\n\n.. _here: https://github.com/cuttlesoft/ecs-deploy.py/issues", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/cuttlesoft/ecs-deploy.py", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ecs-deploy-py", "package_url": "https://pypi.org/project/ecs-deploy-py/", "platform": "any", "project_url": "https://pypi.org/project/ecs-deploy-py/", "project_urls": { "Homepage": "http://github.com/cuttlesoft/ecs-deploy.py" }, "release_url": "https://pypi.org/project/ecs-deploy-py/0.1.3/", "requires_dist": null, "requires_python": "", "summary": "Python script to instigate an automatic blue/green deployment using Task Definition and Service entities in Amazon's ECS", "version": "0.1.3" }, "last_serial": 2380451, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "eb8c8856811a973c70992228c1315230", "sha256": "fecb91daae9fb9ba988ce5cf22a35c10129610d1cc5696db719ffc918b049170" }, "downloads": -1, "filename": "ecs-deploy-py-0.1.0.tar.gz", "has_sig": false, "md5_digest": "eb8c8856811a973c70992228c1315230", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6847, "upload_time": "2016-09-30T02:01:50", "url": "https://files.pythonhosted.org/packages/c2/f0/f162d77e49a3ee15dafbdb7be545ad3fff23917a79934019eef6762fd6ff/ecs-deploy-py-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "7f29058134757160720a821d37fabd07", "sha256": "89b5089d01eb470f6b107c36dcd70657272e91e046456b3661558e35652512c2" }, "downloads": -1, "filename": "ecs-deploy-py-0.1.1.tar.gz", "has_sig": false, "md5_digest": "7f29058134757160720a821d37fabd07", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9192, "upload_time": "2016-10-04T15:45:34", "url": "https://files.pythonhosted.org/packages/43/a7/f16d6019204cb21c9441fe1dddb55d08ccd5c599a3900145b46baeac16ef/ecs-deploy-py-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "314408f5644efe06d49589a14468b553", "sha256": "90549998747dc63de017014cdfd7451142969cd4ed912102bbed6a8e03362b72" }, "downloads": -1, "filename": "ecs-deploy-py-0.1.2.tar.gz", "has_sig": false, "md5_digest": "314408f5644efe06d49589a14468b553", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9213, "upload_time": "2016-10-04T16:22:27", "url": "https://files.pythonhosted.org/packages/c9/e3/11793d5386c49ff34585c99c07bd2ca0bb03595ff0c6d86b9b503c152886/ecs-deploy-py-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "407aca762111a5522356df38d3e1e95f", "sha256": "ac2d670ac0369e9c3355bb1ca20cd6e414bd4d8fea21fbd2fccf2a4f0795fc8a" }, "downloads": -1, "filename": "ecs-deploy-py-0.1.3.tar.gz", "has_sig": false, "md5_digest": "407aca762111a5522356df38d3e1e95f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9218, "upload_time": "2016-10-04T19:03:55", "url": "https://files.pythonhosted.org/packages/cb/b8/9fa07c1ef25691c6738aafd6f31e8eb1e72952f3bfa85d8f970c8c2c3fd9/ecs-deploy-py-0.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "407aca762111a5522356df38d3e1e95f", "sha256": "ac2d670ac0369e9c3355bb1ca20cd6e414bd4d8fea21fbd2fccf2a4f0795fc8a" }, "downloads": -1, "filename": "ecs-deploy-py-0.1.3.tar.gz", "has_sig": false, "md5_digest": "407aca762111a5522356df38d3e1e95f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9218, "upload_time": "2016-10-04T19:03:55", "url": "https://files.pythonhosted.org/packages/cb/b8/9fa07c1ef25691c6738aafd6f31e8eb1e72952f3bfa85d8f970c8c2c3fd9/ecs-deploy-py-0.1.3.tar.gz" } ] }