Skip to content
This repository has been archived by the owner on Jun 14, 2022. It is now read-only.

Talk: Resilience Testing with Docker for Mac & `tc`

License

Notifications You must be signed in to change notification settings

dreadwarrior/talk-resilience-dfm-tc

Repository files navigation

Resilience Testing with Docker for Mac & tc

Synopsis

This repository contains a macOS Keynote presentation about how to perform resilience tests under Docker for Mac with tc. It focuses on delaying the (isolated) service and client network in order to test and detect connection and R/W timeout problems.

Guide

  1. Run the following command from the project root. This will install all dependencies.

    script/bootstrap
    
  2. Checkout the commit tagged start

  3. Demonstration:

    docker-compose up
    
  4. Run the presentation from apps/resilience-talk/res/

  5. Stop demo

    Ctrl + C
    docker-compose down -v
    
  6. Accompany presentation with commits starting with "ACT-"

How to...

...add / delete a delay on the slownet network?

While running the demo, screen into Docker for Mac VM and investigate the networks:

Note: > denote output examples.

# show id of network "slownet"
(host) docker network ls | grep slownet
(host) > f5c43d88f2b6        playground_slownet      bridge              local

# screen tunnel into the xhyve VM
(vm) screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

# find network
(vm) ifconfig | grep <id from first command>
(vm) > br-f5c43d88f2b6 Link encap:Ethernet  HWaddr 02:42:E7:82:DF:BA

# add a delay rule to the network interface
(vm) tc qdisc add dev br-c0aca63f9c15 root netem delay 500ms
    
# remove delay rule from the network interface
(vm) tc qdisc del dev br-f5c43d88f2b6 root netem

...manage screen sessions?

# disconnect from session but leave it open in the background
Ctrl-a d
# list sessions still running in the background
screen -ls
# reconnect to a session
screen -r <session id>
# kill the current active session
Ctrl-a k

Links