{ "info": { "author": "Borislav Ivanov", "author_email": "borogl@gmail.com", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": "[![Latest PyPI version](https://img.shields.io/pypi/v/ecstools.svg)](https://pypi.python.org/pypi/ecstools)\n[![Build Status](https://travis-ci.org/boroivanov/ecs-tools.svg)](https://travis-ci.org/boroivanov/ecs-tools)\n[![Maintainability](https://api.codeclimate.com/v1/badges/2ac1865c995f49ee2eed/maintainability)](https://codeclimate.com/github/boroivanov/ecs-tools/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/2ac1865c995f49ee2eed/test_coverage)](https://codeclimate.com/github/boroivanov/ecs-tools/test_coverage)\n\n# ecstools\nECS Tools cli aims to make deploying to ECS Fargate easier. It also provides an easy way to scale\nand update environment variables.\n\n![Demo_gif](https://raw.githubusercontent.com/boroivanov/ecs-tools/master/images/ecs-tools-watcher.gif)\n\n# Install\n```bash\npip install ecstools\n```\n*NOTE: Python 2 is not supported as of version 0.1.7*\n\n# Usage\n\n## Config File\nAs of v0.1.6 the cli supports an INI config file. The cli will read config files from `~/.ecstools` and `$(pwd)/.ecstools`. The latter one will override settings from the former one. Hence, we can have config files per project and a global config to failback to. The config file can be used to set command aliases and/or service groups for multi-service deployments. An example config:\n```ini\n[alias]\ncls = cluster ls\ntd = task-definition ls\n\nls = service ls\nlsa = service ls -a\nenv = service env\ndeploy = service deploy\ndesc = service desc\nscale = service scale\ntop = service top\n\n# Example: Deploy service group to production cluster\ndp = service deploy production app1 -g\n\n[service-group]\napp1 = app1 app1-worker1 app1-worker2\n```\n\n\n## Listing\n**List clusters**\n```bash\n$ ecs cluster ls\n```\n**List services**\n```bash\n# List services in a cluster\n$ ecs service ls \n\n# List service in a cluster with task definition info\n$ ecs service ls -a\n```\n**List task definition families**\n```bash\n$ ecs task-definition ls\n```\n**List task definition revisions with CPU, memory, and container information.**\n```bash\n# List the last 3 task definition revisions\n$ ecs task-definition ls \napp1-task-def:3 cpu: 1024 memory: 2048\n - container1 0 - container1:docker-tag3\n - container2 0 - container2:latest\napp1-task-def:2 cpu: 1024 memory: 2048\n - container1 0 - creator:v1.2.3\n - container2 0 - container2:latest\napp1-task-def:1 cpu: 1024 memory: 2048\n - container1 0 - container1:v0.0.1\n\n\n# List more revisions\n$ ecs task-definition ls -n 123\n```\n\n\n## Deploying\nThe deployments work by specifying cluster, service, and a docker tag.\n\nThe cli is going to check the current active task definition associated with the service and get the container name. Then it will create a new task definition revision with the new docker tag and deploy it. If the docker tag passed to the cli is the same as in the current task definition, a new deployment will be forced with the current task definition and containers will be recycled. This covers cases where we are deploying tag 'latest' but the tag was reassigned to a new image.\n\n### Deploying - Service with multiple containers (Experimental)\nAs of v0.1.6 deploying a service with multiple containers is support in single-service deployment only. The cli doesn't yet support multi-service deployments with multiple containers.\n\nTo deploy multiple containers we need to pass the container tags in the same order the containers are defined in the task definition. If we have containers defined as [container1, container2] the deployment command will be:\n```bash\necs service deploy cluster1 app1 container1-tag container2-tag\n```\n\n### Deploying - Deploying Multiple Services\nAs of v0.1.6 the cli supports deploying multiple services at the same time. Once a service group has been configured in `~/.ecstools` we can trigger a group deployment by passing `-g`. See the [Config File](#config-file)\n\n### Deploying - Auto-update Monitor\nThe cli output auto-updates during a deployment. We get almost real-time information about all deployments for the service (there could be more that one). The output includes information about:\n\n- the name of the containers and their docker tags.\n- the number of containers in each deployment and their status.\n- the number of containers in an ALB/NLB (if one is configured for the service) and their registration status.\n- the last two events from the ECS service.\n\n### Deploying - Scaling during deployment\nThe cli will assume we are trying to deploy as many containers as there are in the current task definition for the service. If we pass the `-c` flag, we can scale in or out during the deployment.\n\n### Deploying - Verbose Mode\nWe can turn verbose mode on with `-v` to get additional information before the deployment begins.\n\n### Deploying - Post Deployment Monitoring\nOnce the cli triggers the deploy and gets to the auto-update screen we can cancel the command if we want with Ctrl-C. The deployment is going to continue. We can always go back to monitor it with `ecs service top `\n\n### Deploying - Examples\n```bash\n# Example of deploying a single service\n$ ecs service deploy cluster1 app1 tag-new-123\nElapsed: 00:00:04\nInProgress cluster1 app1 0/1 LB: [healthy: 1]\n\nCtrl-C to quit the watcher. No deployments will be interrupted.\n\n# Example of deploying a service group\n$ grep -B 1 app1 ~/.ecstools\n[service-group]\nocto = octo octo-worker1 octo-worker2\n\n$ ecs service deploy octo octo:awscp-5513185 -g\n...\n```\n![Demo_gif](https://raw.githubusercontent.com/boroivanov/ecs-tools/master/images/ecs-tools-watcher.gif)\n\nDeploying and scaling at the same time.\n```bash\n# To scale during a deployment pass `-c N`\n$ ecs service deploy cluster1 app1 tag1 -c 123\n```\n\n## Scaling\nScaling works by specifying cluster, service, and the number of desired containers. The cli auto-updates so we can see how many containers there are and what their ECS and ALB/NLB status is.\n\nOnce the cli triggers the scaling and gets to the auto-update screen we can cancel the command if we want with Ctrl-C. The scaling is going to continue. We can always go back to monitor it with `ecs service top `\n\n```bash\n$ ecs service scale 123\n```\n\n## Updating environment variables\n\nUpdating environment variables works by specifying cluster, service, and pairs of KEY=VALUE.\n\nThe cli will get the current task definition for the service and then compare its environment variables with the ones that were passed. The cli will print a git-style diff so we can review the changes. Then it will prompt if we want to register a new task definition and deploy it. Finally, the cli starts printing the default deployment auto-update output.\n\nOnce the cli triggers the deploy and gets to the auto-update screen we can cancel the command if we want. The deployment is going to continue. We can always go back to monitor it with `ecs service top `\n\n```bash\n# List environment variables\n$ ecs service env \n\n# Set/Update environment variables from a file\n$ ecs service env cluster1 app1 \"$(< file.txt)\"\n\n# Set/Update environment variables\n$ ecs service env cluster1 app1 TEST1=123 TEST2=456\nCurrent task definition for cluster1 app1: app1-task-def:123\n\nContainer: app1\n+ TEST1=123\n+ TEST2=456\n\nDo you want to deploy your changes?\n\n# Deleting environment variables\n$ ecs service env cluster1 app1 TEST1=123 TEST2=456 -d\nCurrent task definition for cluster1 app1: app1-task-def:123\n\nContainer: app1\n- TEST1=123\n- TEST2=456\n\nDo you want to deploy your changes?\n```\nUpdating environment variables for multiple service via service groups.\n```bash\n$ env stage app1 -g TEST=123456\nCurrent task definition for stage app1: stage-app1:96\n1) app1\n2) nginx\n#? 1\n\n==> Container: app1\n+ TEST=123456\n\nCurrent task definition for stage app1-worker1: stage-app1-worker1:34\n\n==> Container: app1\n+ TEST=123456\n\nCurrent task definition for stage app1-worker2: stage-app1-worker2:38\n\n==> Container: app1\n+ TEST=123456\n\nDo you want to deploy your changes?\n```\n\n## Monitoring\nWe can either describe a service or \"top\" it. Both print information about the current task definition, the number of containers and their status in ECS and ALB/NLB. In addition, the describe command prints information about the subnets and security groups. On the other side, the top command auto-updates. The top command is useful if we want to monitor the progress of a deployment or a scaling event which we triggered by exited out of the deploy or scale commands.\n\n```bash\n# Describe a service\n$ ecs service desc \n\n# Live monitoring of a service\n$ ecs service top \n\n# Live monitoring of a service group\n$ ecs service top -g\n```\n\n## AWS Profile and Region\nWe can use different AWS profile by specifying `-p ` and different region with passing `-r `.\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/boroivanov/ecs-tools", "keywords": "", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "ecstools", "package_url": "https://pypi.org/project/ecstools/", "platform": "", "project_url": "https://pypi.org/project/ecstools/", "project_urls": { "Homepage": "https://github.com/boroivanov/ecs-tools" }, "release_url": "https://pypi.org/project/ecstools/0.2.2/", "requires_dist": [ "Click (>=6.0)", "boto3 (>=1.5.33)", "reprint (>=0.5.1)", "configparser (>=3.5.0)" ], "requires_python": "", "summary": "Utilities for AWS ECS", "version": "0.2.2" }, "last_serial": 5081528, "releases": { "0.1.2": [ { "comment_text": "", "digests": { "md5": "cfd80ad91c3b5843c63bb835910e2470", "sha256": "323b0f3a517670fb4f406e8002f847b3b57b95f4136907d07f0ef16e7a014631" }, "downloads": -1, "filename": "ecstools-0.1.2-py2-none-any.whl", "has_sig": false, "md5_digest": "cfd80ad91c3b5843c63bb835910e2470", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15193, "upload_time": "2018-03-09T07:47:36", "url": "https://files.pythonhosted.org/packages/e6/d3/9df8aa824068c96bc3f8363cf57e17dc1c5fd4b1d4fa7f93a0f31c359f61/ecstools-0.1.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "754ad5a72825a574ff25a1e936223eac", "sha256": "a641bed5a5d04e6dc59c245f09bb0012879840b653546a52493e6ed5b7c587c5" }, "downloads": -1, "filename": "ecstools-0.1.2.tar.gz", "has_sig": false, "md5_digest": "754ad5a72825a574ff25a1e936223eac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9064, "upload_time": "2018-03-09T07:47:38", "url": "https://files.pythonhosted.org/packages/8d/8b/dab43ef3d147b4c7a45f65e6f1b10a7438083eb0e230c889f421de920186/ecstools-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "d09487d74905ed29276c21fd4cbec08b", "sha256": "3cb1de9a585aa268dd9a89eaa1c7876733b64c80c5829f1780d510e13b059255" }, "downloads": -1, "filename": "ecstools-0.1.3-py2-none-any.whl", "has_sig": false, "md5_digest": "d09487d74905ed29276c21fd4cbec08b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14801, "upload_time": "2018-04-13T00:57:47", "url": "https://files.pythonhosted.org/packages/34/68/4e0d38b99833e5d80ea20015818a09f2306a6c8f2ea5c202767381ae4ca3/ecstools-0.1.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "54c3eb10f0b4ce2d1df7c99c5be3445a", "sha256": "aed1bd7784917f1e34ca59cb6e9d7930d536d25e1bc3e4fc93e2d4f89423c61b" }, "downloads": -1, "filename": "ecstools-0.1.3.tar.gz", "has_sig": false, "md5_digest": "54c3eb10f0b4ce2d1df7c99c5be3445a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9414, "upload_time": "2018-04-13T00:57:48", "url": "https://files.pythonhosted.org/packages/c2/c2/ae6e867a26797baa3687273214cbabfb962b19c34ac8dffaaf8795f68f2c/ecstools-0.1.3.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "77e5496701833a431415386d9acf744b", "sha256": "bb8909f3a49bc55344cf6b53cd100fd01e59d8cfe407ff44a7c6a72c16955b53" }, "downloads": -1, "filename": "ecstools-0.1.5-py2-none-any.whl", "has_sig": false, "md5_digest": "77e5496701833a431415386d9acf744b", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 14778, "upload_time": "2018-07-20T22:39:31", "url": "https://files.pythonhosted.org/packages/c9/f3/a6e7042ba2f074338040d39ce19cafabdb98a15c907a7ffa459cee10ee68/ecstools-0.1.5-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "15fea2a4d1f566313bf9f23eeba313e2", "sha256": "22c1cd2e4eae26cbcdd55d000498119f18dfc091411e5c76a5a1cb71b0c69d4e" }, "downloads": -1, "filename": "ecstools-0.1.5-py3-none-any.whl", "has_sig": false, "md5_digest": "15fea2a4d1f566313bf9f23eeba313e2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 14779, "upload_time": "2018-07-20T22:39:27", "url": "https://files.pythonhosted.org/packages/75/dd/a3c0cbcbde52b27dbac08a32e9ac52127aee0d76d8887b521d63541d5f27/ecstools-0.1.5-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "972eb4914f18c07919d7ad84441a0233", "sha256": "d2fc93d5c40dd1528a77bee3e1efa34dbb04fd7bfd1122ecefd07103e161c5c2" }, "downloads": -1, "filename": "ecstools-0.1.5.tar.gz", "has_sig": false, "md5_digest": "972eb4914f18c07919d7ad84441a0233", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10692, "upload_time": "2018-07-20T22:39:28", "url": "https://files.pythonhosted.org/packages/25/27/b9cf2e5e3d3c4800af7683f25a140ee98d9dbc7170763a5871bdf2c203d1/ecstools-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "12982ce567db6f31739ece51f8163e6c", "sha256": "eee616ecfb7f416fb149af8e2be56c6f182b68877a4499670c55d1b1ac57a12d" }, "downloads": -1, "filename": "ecstools-0.1.6-py2-none-any.whl", "has_sig": false, "md5_digest": "12982ce567db6f31739ece51f8163e6c", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 16269, "upload_time": "2018-07-30T20:36:04", "url": "https://files.pythonhosted.org/packages/51/6d/506772093e887bb5705113c2a3e8feaa8841f44ee6820cf452accf802315/ecstools-0.1.6-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d63802f93d856ece593de3599b2ffffc", "sha256": "5f341d4c124e6239ac2515fc976c6620f48799d1b918a4f209c77447a9280b5f" }, "downloads": -1, "filename": "ecstools-0.1.6-py3-none-any.whl", "has_sig": false, "md5_digest": "d63802f93d856ece593de3599b2ffffc", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 16269, "upload_time": "2018-07-30T20:36:04", "url": "https://files.pythonhosted.org/packages/be/24/f1c2df746593e326fd2fc350d5be18c0f2edfee98231f1e6e04226cb3a06/ecstools-0.1.6-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8d1bb0b7b4f016da4feca1db460956c1", "sha256": "d9ba605da5d5dbdd7bb52950d40c4cb9bb983fde4e8e074c6333493befeb6468" }, "downloads": -1, "filename": "ecstools-0.1.6.tar.gz", "has_sig": false, "md5_digest": "8d1bb0b7b4f016da4feca1db460956c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12495, "upload_time": "2018-07-30T20:36:05", "url": "https://files.pythonhosted.org/packages/df/c8/1905a9d8bf811a43df61a063cccc6acc3e658cdb6b38b30d3e5369869deb/ecstools-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "21426ce14494deb25864302b10cdc3f5", "sha256": "06421db22948d3943971ee8d9e0f2fe1aaee4e01be24567b989706ca865f4316" }, "downloads": -1, "filename": "ecstools-0.1.7-py2-none-any.whl", "has_sig": false, "md5_digest": "21426ce14494deb25864302b10cdc3f5", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 23116, "upload_time": "2018-08-06T18:18:04", "url": "https://files.pythonhosted.org/packages/ee/0d/7816cc68e6f88dfa3103799423141e058a6eb433443fa3575c965ae7488d/ecstools-0.1.7-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "f670d2eb33a3c3cf87c45ea96338e54d", "sha256": "0af5f21636cab8397fec6ff0ccaf92287f0271f317f0dfd06ef2dd590cb49682" }, "downloads": -1, "filename": "ecstools-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "f670d2eb33a3c3cf87c45ea96338e54d", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 23116, "upload_time": "2018-08-06T18:18:20", "url": "https://files.pythonhosted.org/packages/cc/ec/90f0814c9f9383806a28451ac1d7d1c4c057992d7b7c5e651a925b39bb06/ecstools-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c2493c42ba82ea0fa5ee4cc38de165c5", "sha256": "cde22776af0e47a09b9f5eae15f5d352ec8e9e5a811f1993907c3716489472cc" }, "downloads": -1, "filename": "ecstools-0.1.7.tar.gz", "has_sig": false, "md5_digest": "c2493c42ba82ea0fa5ee4cc38de165c5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15413, "upload_time": "2018-08-06T18:18:05", "url": "https://files.pythonhosted.org/packages/43/3a/97852e22b5db5df1b5afdd4944d58be53dc1f69f3fe21bbc0f2e805c760f/ecstools-0.1.7.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "75bee490139321f82e526f811143a5d8", "sha256": "e6a004663290730afe6127b40b5d140da192292f4ae9fb7388208cc0cbdb8746" }, "downloads": -1, "filename": "ecstools-0.2.0-py3-none-any.whl", "has_sig": false, "md5_digest": "75bee490139321f82e526f811143a5d8", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24445, "upload_time": "2019-03-29T22:21:09", "url": "https://files.pythonhosted.org/packages/66/53/2e5051fd067264dc97c0f8340dd9a0d9500371db5aa442194d358937182a/ecstools-0.2.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b8759b786e9c01014f4066584ea03e97", "sha256": "c0c3a7ecbbe37489dcf9693aa3f8b840af18b504a99abe9ddb5e7718d43d2957" }, "downloads": -1, "filename": "ecstools-0.2.0.tar.gz", "has_sig": false, "md5_digest": "b8759b786e9c01014f4066584ea03e97", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18507, "upload_time": "2019-03-29T22:21:10", "url": "https://files.pythonhosted.org/packages/f6/02/1fe35b4ae1ea8e182e1d14f49907550bfd0aba0cf27a0494446ff5412e03/ecstools-0.2.0.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "01299a68ecdb88594ac211088b8ad4e7", "sha256": "c536d490f2cc317144a64484ef7135d1baba4223f7654092804565f2654c690d" }, "downloads": -1, "filename": "ecstools-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "01299a68ecdb88594ac211088b8ad4e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24862, "upload_time": "2019-04-03T00:01:04", "url": "https://files.pythonhosted.org/packages/d7/3d/190d49a57d797f3e3e9691849132fa075ef5bd00c5718484012b777a4f2f/ecstools-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1582024280a0d1ddf5d8fd60be058ecc", "sha256": "2e9144a03223996439e670eb6ed310cf2646a5e48f926f4c87fe64ffd1e754f8" }, "downloads": -1, "filename": "ecstools-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1582024280a0d1ddf5d8fd60be058ecc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19011, "upload_time": "2019-04-03T00:01:05", "url": "https://files.pythonhosted.org/packages/54/00/061e0b206e64b3cd9be848c4ca1691eed24ca5b0f5375a7db4ddabb48dd8/ecstools-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "01299a68ecdb88594ac211088b8ad4e7", "sha256": "c536d490f2cc317144a64484ef7135d1baba4223f7654092804565f2654c690d" }, "downloads": -1, "filename": "ecstools-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "01299a68ecdb88594ac211088b8ad4e7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 24862, "upload_time": "2019-04-03T00:01:04", "url": "https://files.pythonhosted.org/packages/d7/3d/190d49a57d797f3e3e9691849132fa075ef5bd00c5718484012b777a4f2f/ecstools-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1582024280a0d1ddf5d8fd60be058ecc", "sha256": "2e9144a03223996439e670eb6ed310cf2646a5e48f926f4c87fe64ffd1e754f8" }, "downloads": -1, "filename": "ecstools-0.2.2.tar.gz", "has_sig": false, "md5_digest": "1582024280a0d1ddf5d8fd60be058ecc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 19011, "upload_time": "2019-04-03T00:01:05", "url": "https://files.pythonhosted.org/packages/54/00/061e0b206e64b3cd9be848c4ca1691eed24ca5b0f5375a7db4ddabb48dd8/ecstools-0.2.2.tar.gz" } ] }