Skip to main content

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 uses Docker containers 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 the full documentation for details.

Embargo features:

  • A flexible YAML format to describe the containers in your application

  • Support for dependencies between containers, using named links

  • A CLI tool for managing and querying the status of your embargo

  • Creation of arbitrary partitions between containers

  • Giving 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 excellent Jepsen series.

Requirements

  • docker (>= 1.4.0 due to docker-py)

  • iproute2 tools (ip and tc specifically)

Configuration

Embargo expects a embargo.yaml file 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_image
    command: /bin/myapp
    volumes:
      "/opt/myapp": "/opt/myapp_host"
    expose: [80]
    environment:
      "IS_MASTER": 1
    ports:
      81: 80

  c2:
    image: my_docker_image
    command: /bin/myapp
    volumes: ["/data"]
    expose: [80]
    links:
      c1: master

  c3:
    image: my_docker_image
    command: /bin/myapp
    expose: [80]
    links:
      c1: master

network:
  flaky: 30%
  slow: 75ms 100ms distribution normal

Embargo stores transient information in a local .embargo/ directory. This directory will be cleaned up automatically when you run the embargo destroy command.

Usage

Embargo may be used from the command line manually. The commands are also intended to be easy to wrap and automate within tests, etc.

Commands

embargo up

Start the containers and link them together, if necessary.

embargo destroy

Destroys all containers and restore networks.

embargo status

Print the status of the containers and embargo.

embargo flaky n1

embargo flaky n1 n2

Make network flaky to one or more containers.

embargo slow n1

Make network slow to one or more containers.

embargo duplicate n1

Toggle sporadic duplicate packets in the network of one or more containers.

embargo fast n1

Restore network speed and reliability to one or more containers.

embargo partition n1,n2

embargo partition n1,n2 n3,n4

Create 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 join

Remove all partitions between containers.

embargo random-partition

Introduce one or many random partitions among the configured nodes.

License

Embargo is offered under the Apache License 2.0.

Development

Install test dependencies with pip install embargo[test].

You can run integration tests in a Vagrant VM using the included Vagrantfile. Run vagrant up and Docker will be installed in your VM and tests run. You can rerun them with vagrant provision, or SSH into the VM and run them yourself, from /vagrant.

Embargo documentation is built with Sphinx and is found under docs/. To build:

$ pip install -r requirements_docs.txt
$ cd docs/
$ make html

HTML output will be under docs/_build/html/.

The documentation is also hosted online.

Changelog

0.1.1 (2019-05-01)

  • Added updated maintainers.

  • Refactored code (renamed blockade to embargo in code).

  • Updated README.md

0.1.0 (2019-05-01)

  • Initial release of Embargo!

Metadata

Release files for embargo 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for embargo 0.1.1
File Size Uploaded Provenance Actions
embargo-0.1.1.tar.gz 51.2 kB Without provenance Details for embargo-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for embargo 0.1.1
File Interpreter ABI Platform Actions
embargo-0.1.1-py3-none-any.whl Python 3 none any Details for embargo-0.1.1-py3-none-any.whl

Total release size: 117.4 kB

Release files / embargo-0.1.1.tar.gz

Download URL embargo-0.1.1.tar.gz
Size 51.2 kB
Tags Source
SHA-256 checksum
How to use checksums
f00f56da0cef34ec0923e14856ec31ee2534e7e0bd76f5eb5c64058569871201
BLAKE2b-256 checksum
How to use checksums
92acdb9b713561ad89968fe240454000ec57efce9c30592c742ac430be13bb53
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Release files / embargo-0.1.1-py3-none-any.whl

Download URL embargo-0.1.1-py3-none-any.whl
Size 66.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a7ec25b6f49aaddc9830cc7f66c74df43e23377c22e7a6a2b123288acfdca553
BLAKE2b-256 checksum
How to use checksums
d8e3442c67b8861f28c4fc368247055e3ff3dec958aa1e562a55456be4f7ffba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/41.0.1 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.3

Security for embargo 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page