Package: embargo
Embargo is a fork of blockade. We have decided to fork blockade because
the original project has not been maintained for years. The main
difference between the original and this fork is that support for python
2 is dropped and python 3.6 and 3.7 should be supported. More changes
should be on the way.Embargo is a utility for testing network failures and partitions in
distributed applications. Embargo usesDockercontainers to run application processes and manages the network from
the host system to create various failure scenarios.A common use is to run a distributed application such as a database
or cluster and create network partitions, then observe the behavior of
the nodes. For example in a leader election system, you could partition
the leader away from the other nodes and ensure that the leader steps
down and that another node emerges as leader.Check out thefull documentationfor details.Embargo features:A flexible YAML format to describe the containers in your applicationSupport for dependencies between containers, using named linksA CLI tool for managing and querying the status of your embargoCreation of arbitrary partitions between containersGiving a container a flaky network connection to others (drop packets)Giving a container a slow network connection to others (latency)While under partition or network failure control, containers can
freely communicate with the host system – so you can still grab logs
and monitor the application.Blockade was originally developed by the Dell Cloud Manager
(formerly Enstratius) team. Blockade was inspired by the excellentJepsenseries.Requirementsdocker (>= 1.4.0 due to docker-py)iproute2 tools (ipandtcspecifically)ConfigurationEmbargo expects aembargo.yamlfile in the current directory which
describes the containers to launch, how they are linked, and various
parameters for the embargo modes. Example:containers:c1:image:my_docker_imagecommand:/bin/myappvolumes:"/opt/myapp":"/opt/myapp_host"expose:[80]environment:"IS_MASTER":1ports:81:80c2:image:my_docker_imagecommand:/bin/myappvolumes:["/data"]expose:[80]links:c1:masterc3:image:my_docker_imagecommand:/bin/myappexpose:[80]links:c1:masternetwork:flaky:30%slow:75ms 100ms distribution normalEmbargo stores transient information in a local.embargo/directory.
This directory will be cleaned up automatically when you run theembargo destroycommand.UsageEmbargo may be used from the command line manually. The commands are also
intended to be easy to wrap and automate within tests, etc.Commandsembargo upStart the containers and link them together, if necessary.embargo destroyDestroys all containers and restore networks.embargo statusPrint the status of the containers and embargo.embargo flaky n1embargo flaky n1 n2Make network flaky to one or more containers.embargo slow n1Make network slow to one or more containers.embargo duplicate n1Toggle sporadic duplicate packets in the network of one or more containers.embargo fast n1Restore network speed and reliability to one or more containers.embargo partition n1,n2embargo partition n1,n2 n3,n4Create one or more network partitions. Each partition is specified as a
comma-separated list. Containers may not exist in more than one partition.
Containers not specified are grouped into an implicit partition. Each
partition command replaces any previous partition or block rules.embargo joinRemove all partitions between containers.embargorandom-partitionIntroduce one or many random partitions among the configured nodes.LicenseEmbargo is offered under the Apache License 2.0.DevelopmentInstall test dependencies withpip install embargo[test].You can run integration tests in a Vagrant VM using the included Vagrantfile.
Runvagrant upand Docker will be installed in your VM and tests run.
You can rerun them withvagrant provision, or SSH into the VM and run
them yourself, from/vagrant.Embargo documentation is built with Sphinx and is found underdocs/.
To build:$pipinstall-rrequirements_docs.txt$cddocs/$makehtmlHTML output will be underdocs/_build/html/.The documentation is alsohosted online.Changelog0.1.1 (2019-05-01)Added updated maintainers.Refactored code (renamed blockade to embargo in code).Updated README.md0.1.0 (2019-05-01)Initial release of Embargo!