{"id":13586159,"url":"https://github.com/worstcase/blockade","last_synced_at":"2025-04-08T12:07:37.488Z","repository":{"id":14038870,"uuid":"16741340","full_name":"worstcase/blockade","owner":"worstcase","description":"Docker-based utility for testing network failures and partitions in distributed applications","archived":false,"fork":false,"pushed_at":"2021-03-29T17:53:14.000Z","size":340,"stargazers_count":909,"open_issues_count":27,"forks_count":72,"subscribers_count":33,"default_branch":"main","last_synced_at":"2025-04-01T11:03:15.850Z","etag":null,"topics":["chaos","chaos-monkey","distributed-systems","docker","python"],"latest_commit_sha":null,"homepage":"http://blockade.readthedocs.org","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/worstcase.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGES.rst","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-02-11T18:54:46.000Z","updated_at":"2025-03-30T05:42:05.000Z","dependencies_parsed_at":"2022-07-20T12:17:29.688Z","dependency_job_id":null,"html_url":"https://github.com/worstcase/blockade","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worstcase%2Fblockade","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worstcase%2Fblockade/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worstcase%2Fblockade/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/worstcase%2Fblockade/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/worstcase","download_url":"https://codeload.github.com/worstcase/blockade/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247838444,"owners_count":21004580,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaos","chaos-monkey","distributed-systems","docker","python"],"created_at":"2024-08-01T15:05:21.696Z","updated_at":"2025-04-08T12:07:37.466Z","avatar_url":"https://github.com/worstcase.png","language":"Python","funding_links":[],"categories":["Python","python","Notable Tools","3. Fault Injection"],"sub_categories":["Containers \u0026 Orchestrators"],"readme":"********\nBlockade\n********\n\n.. image:: https://travis-ci.org/worstcase/blockade.png?branch=master\n        :target: https://travis-ci.org/worstcase/blockade\n\nBlockade is a utility for testing network failures and partitions in\ndistributed applications. Blockade uses `Docker \u003chttp://www.docker.io\u003e`_\ncontainers to run application processes and manages the network from\nthe host system to create various failure scenarios.\n\nA common use is to run a distributed application such as a database\nor cluster and create network partitions, then observe the behavior of\nthe nodes. For example in a leader election system, you could partition\nthe leader away from the other nodes and ensure that the leader steps\ndown and that another node emerges as leader.\n\nCheck out the `full documentation \u003chttp://blockade.readthedocs.org\u003e`_\nfor details.\n\nBlockade features:\n\n* A flexible YAML format to describe the containers in your application\n* Support for dependencies between containers, using named links\n* A CLI tool for managing and querying the status of your blockade\n* Creation of arbitrary partitions between containers\n* Giving a container a flaky network connection to others (drop packets)\n* Giving a container a slow network connection to others (latency)\n* While under partition or network failure control, containers can\n  freely communicate with the host system -- so you can still grab logs\n  and monitor the application.\n\nBlockade was originally developed by the Dell Cloud Manager\n(formerly Enstratius) team. Blockade was inspired by the excellent\n`Jepsen \u003chttp://aphyr.com/tags/jepsen\u003e`_ series.\n\n\nRequirements\n============\n\n* docker (\u003e= 1.4.0 due to docker-py)\n* iproute2 tools (``ip`` and ``tc`` specifically)\n\n\nConfiguration\n=============\n\nBlockade expects a ``blockade.yaml`` file in the current directory which\ndescribes the containers to launch, how they are linked, and various\nparameters for the blockade modes. Example:\n\n.. code-block:: yaml\n\n    containers:\n      c1:\n        image: my_docker_image\n        command: /bin/myapp\n        volumes:\n          \"/opt/myapp_host\": \"/opt/myapp\"\n        expose: [80]\n        environment:\n          \"IS_MASTER\": 1\n        ports:\n          81: 80\n\n      c2:\n        image: my_docker_image\n        command: /bin/myapp\n        volumes: [\"/data\"]\n        expose: [80]\n        links:\n          c1: master\n\n      c3:\n        image: my_docker_image\n        command: /bin/myapp\n        expose: [80]\n        links:\n          c1: master\n\n    network:\n      flaky: 30%\n      slow: 75ms 100ms distribution normal\n\n\nBlockade stores transient information in a local ``.blockade/`` directory.\nThis directory will be cleaned up automatically when you run the\n``blockade destroy`` command.\n\n\nUsage\n=====\n\nBlockade may be used from the command line manually. The commands are also\nintended to be easy to wrap and automate within tests, etc.\n\n\nCommands\n========\n\n``blockade up``\n\nStart the containers and link them together, if necessary.\n\n\n``blockade destroy``\n\nDestroys all containers and restore networks.\n\n\n``blockade status``\n\nPrint the status of the containers and blockade.\n\n\n``blockade flaky n1``\n\n``blockade flaky n1 n2``\n\nMake network flaky to one or more containers.\n\n\n``blockade slow n1``\n\nMake network slow to one or more containers.\n\n\n``blockade duplicate n1``\n\nToggle sporadic duplicate packets in the network of one or more containers.\n\n\n``blockade fast n1``\n\nRestore network speed and reliability to one or more containers.\n\n\n``blockade partition n1,n2``\n\n``blockade partition n1,n2 n3,n4``\n\nCreate one or more network partitions. Each partition is specified as a\ncomma-separated list. Containers may not exist in more than one partition.\nContainers not specified are grouped into an implicit partition. Each\npartition command replaces any previous partition or block rules.\n\n\n``blockade join``\n\nRemove all partitions between containers.\n\n``blockade random-partition``\n\nIntroduce one or many random partitions among the configured nodes.\n\n\nLicense\n=======\n\nBlockade is offered under the Apache License 2.0.\n\n\nDevelopment\n===========\n\nInstall test dependencies with ``pip install blockade[test]``.\n\nYou can run integration tests in a Vagrant VM using the included Vagrantfile.\nRun ``vagrant up`` and Docker will be installed in your VM and tests run.\nYou can rerun them with ``vagrant provision``, or SSH into the VM and run\nthem yourself, from ``/vagrant``.\n\nBlockade documentation is built with Sphinx and is found under ``docs/``.\nTo build:\n\n.. code-block:: bash\n\n    $ pip install -r requirements_docs.txt\n    $ cd docs/\n    $ make html\n\nHTML output will be under ``docs/_build/html/``.\n\nThe documentation is also `hosted online \u003chttp://blockade.readthedocs.org\u003e`_.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworstcase%2Fblockade","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fworstcase%2Fblockade","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fworstcase%2Fblockade/lists"}