{ "info": { "author": "Daniel Nephin", "author_email": "dnephin@gmail.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "\ndocker-compose addons\n=====================\n\nA set of command line tools to supplement the features already available\nin docker-compose. These tools generally focus on development or testing\nenvironment use-cases.\n\n.. image:: https://img.shields.io/pypi/v/compose-addons.svg\n :target: https://pypi.python.org/pypi/compose-addons\n :alt: Latest PyPI version\n\n.. image:: https://travis-ci.org/dnephin/compose-addons.svg?branch=master\n :target: https://travis-ci.org/dnephin/compose-addons\n :alt: Travis CI\n\n\n.. contents::\n :backlinks: none\n\n\nInstall\n-------\n\nCurrently the only install option is pip\n\n.. code:: sh\n\n pip install compose-addons\n\n\ndcao-include\n------------\n\nGiven a docker-compose.yml file, fetch each configuration in the include\nsection and merge it into a base docker-compose.yml. If any of the included\nfiles have include sections continue to fetch and merge each of them until\nthere are no more files to include.\n\nUse Cases\n~~~~~~~~~\n\n- If you have a service-oriented architecture, where each of your services\n is developed and deployed in a separate code repo, and each has its own\n docker-compose.yml. When you want to create a full testing or development\n environment for an individual service, you need to include all the\n downstream services. Instead of duplicating the topology of each\n downstream service, you can include the ``docker-compose.yml`` from the\n downstream service. Including (instead of duplicating) this topology\n allows you to change dependencies in a single place without worrying\n about breaking the test suite of dependent services.\n- If the scope of your composition can change based on the task you're\n performing. Your application might have a \"core\" set of services that are\n always run, and some adhoc, or administrative services that are only run\n sometimes. You can split your composition into two (or more) files.\n The core ``docker-compose.yml`` would only contain the core services. The\n ``compose-admin.yml`` would include the ``docker-compose.yml`` and add\n extra services which could link to or use volumes from the core services,\n without having to duplicate any of the service configuration.\n- If your composition varies by environment (dev vs prod). Similar to the\n case above, the core ``docker-compose.yml`` would remain the same for all\n environments, but ``docker-compose-dev.yml`` could include the \"core\"\n services, and add additional service, like database or proxies.\n\nWorking with Includes\n~~~~~~~~~~~~~~~~~~~~~\n\n``dcao-include`` works with a configuration that is different from the\n``docker-compose`` config in a few ways:\n\n- an optional top level ``include`` key, which contains a list of urls (which\n may be local file paths, http(s) urls, or s3 paths)\n- a required top level ``namespace`` key, which is used by a config to link\n to services in an included file. For example, if a config includes\n http://example.com/compositions/servicea.yaml which has a ``namespace``\n of ``servicea``, all \"public\" services in ``servicea.yaml`` should start\n with ``servicea.``.\n- since configuration can be included from a remote url, or different\n directories, the configuration should not include anything that depends\n on the host. There should be no ``build`` keys in any service, and no\n host volumes.\n\nExample\n~~~~~~~\n\nAn example composition file with includes:\n\n.. code:: yaml\n\n include:\n - http://example.com/compositions/servicea.yaml\n - http://example.com/compositions/serviceb.yaml\n\n namespace: core\n\n web:\n image: example/service_a:latest\n links: ['servicea.web', 'serviceb.api']\n\n**servicea.yaml** might look something like this\n\n.. code:: yaml\n\n namespace: servicea\n\n servicea.web:\n image: services/a:latest\n\n**serviceb.yaml** might look something like this\n\n.. code:: yaml\n\n namespace: serviceb\n\n serviceb.api:\n image: services/b:latest\n\nUsage\n~~~~~\n\nTo use ``dcao-include`` with ``docker-compose`` you have a couple options:\n\nUse it with a pipe to stdin:\n\n.. code:: sh\n\n dcao-include compose-with-includes.yml | docker-compose -f - up -d\n\n\nUse it once to generate a new file:\n\n.. code:: sh\n\n dcao-include -o docker-compose.yml compose-with-includes.yml\n docker-compose up -d\n docker-compose ps\n\n\ndcao-namespace\n--------------\n\nGiven a standard ``docker-compose.yml`` file, add a namespace key, and prefix\nall instances of service names with that namespace. This command is used to\nprepare a standard ``docker-compose.yml`` file for being used as an include\nby ``dcao-include``. This could be considered the \"export\" step required\nbefore a compose file can be included by another project.\n\n\nExample\n~~~~~~~\n\nGiven a ``docker-compose.yml``:\n\n.. code:: yaml\n\n web:\n image: example.com/web:latest\n links: ['db']\n volumes_from: ['configs']\n db:\n image: example.com/db:latest\n configs:\n image: example.com/configs:latest\n\nrunning ``dcao-namespace docker-compose.yml myservice`` would produce\n\n.. code:: yaml\n\n namespace: myservice\n myservice.web:\n image: example.com/web:latest\n links: ['myservice.db:db']\n volumes_from: ['myservice.configs']\n myservice.db:\n image: example.com/db:latest\n myservice.configs:\n image: example.com/configs:latest\n\n\nUsage\n~~~~~\n\nFirst generate the namespaced config\n\n.. code:: sh\n\n dcao-namespace -o myservice.yml docker-compose.yml myservice\n\nNext you'll want to make ``myservice.yml`` available to other services. In this\nexample we'll assume we're using an s3 bucket\n\n.. code:: sh\n\n aws s3 cp myservice.yml s3://some-bucket/compose-registry/myservice.yml\n\n\nNow we can use that configuration as an include in another service. In a\ndifferent services ``compose-with-includes.yml`` (which will be consumed by\n``dcao-include``)\n\n.. code:: sh\n\n include:\n - s3://some-bucket/compose-registry/myservice.yml\n\n\ndcao-merge\n----------\n\nMerge ``docker-compose.yml`` configuration files by overriding values in the\nbase configuration with values from other files. It is used to transform a\nconfiguration without having to duplicate any fields that should remain\nconsistent.\n\nUse Cases\n~~~~~~~~~\n\n- Often in development you'll want to include code using a volume for faster\n iteration, but for testing on a CI you want to include the source in the\n container with ``ADD`` (or ``COPY``). You could use an ``overrides-dev.yml`` to add\n volumes to the configuration, and skip that step during CI.\n- If the composition is running on a shared host each developer needs to use a\n different host port. This variation can be included in a file maintained by\n each developer outside of version control.\n- If a ``docker-compose.yml`` contains ``build`` directives for local\n development, but needs ``image`` directives in other environments (testing,\n stage, prod, etc), merge can be used to rewrite ``build`` to ``image`` with\n the correct image tag.\n\n\nUsage\n~~~~~\n\nTo rewrite a configuration to use image instead of build, and remove any host\nspecific configuration:\n\n.. code:: sh\n\n dcao-merge -o export.yml docker-compose.yml compose-overrides.yml\n\nWhere ``docker-compose.yml`` is:\n\n.. code:: yaml\n\n web:\n build: .\n links: ['db']\n volumes: ['./logs:/app/logs']\n db:\n build: database/\n\nand ``compose-overrides.yml``:\n\n.. code:: yaml\n\n web:\n image: example.com/web:latest\n volumes: []\n db:\n image: example.com/db:latest\n\nwould produce an ``export.yml``\n\n.. code:: yaml\n\n web:\n image: example.com/web:latest\n links: ['db']\n volumes: []\n db:\n image: example.com/db:latest\n", "description_content_type": null, "docs_url": null, "download_url": null, "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/dnephin/compose-addons", "keywords": null, "license": "Apache License 2.0", "maintainer": null, "maintainer_email": null, "name": "compose-addons", "package_url": "https://pypi.org/project/compose-addons/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/compose-addons/", "project_urls": { "Homepage": "http://github.com/dnephin/compose-addons" }, "release_url": "https://pypi.org/project/compose-addons/0.2.1/", "requires_dist": null, "requires_python": null, "summary": "Tools to supplement", "version": "0.2.1" }, "last_serial": 1686380, "releases": { "0.2.0": [ { "comment_text": "", "digests": { "md5": "599c868d273d5ba6c5674bc17144f77e", "sha256": "fca750c574ae55ec85c6eed631bdfdb785120dba205e4979faadfdd4a848c79b" }, "downloads": -1, "filename": "compose-addons-0.2.0.tar.gz", "has_sig": false, "md5_digest": "599c868d273d5ba6c5674bc17144f77e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6303, "upload_time": "2015-08-13T20:42:53", "url": "https://files.pythonhosted.org/packages/ed/ba/5ddedbfd2d95758da8e30641187708eee43753d59013d31bccb83f810df9/compose-addons-0.2.0.tar.gz" } ], "0.2.1": [ { "comment_text": "", "digests": { "md5": "e6c6f0eabdeb6794ffbb612e0e288505", "sha256": "946a3eeae4e812dcc5d5c0e32b8546885e38f97828fc0ab1c4990700acd0a6f4" }, "downloads": -1, "filename": "compose-addons-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e6c6f0eabdeb6794ffbb612e0e288505", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6849, "upload_time": "2015-08-20T20:57:58", "url": "https://files.pythonhosted.org/packages/b7/c3/dfa4412549cc9da0e417effde648fb5045f7f47772e2cf96afb646bb2f1b/compose-addons-0.2.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e6c6f0eabdeb6794ffbb612e0e288505", "sha256": "946a3eeae4e812dcc5d5c0e32b8546885e38f97828fc0ab1c4990700acd0a6f4" }, "downloads": -1, "filename": "compose-addons-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e6c6f0eabdeb6794ffbb612e0e288505", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6849, "upload_time": "2015-08-20T20:57:58", "url": "https://files.pythonhosted.org/packages/b7/c3/dfa4412549cc9da0e417effde648fb5045f7f47772e2cf96afb646bb2f1b/compose-addons-0.2.1.tar.gz" } ] }