Giter Site home page Giter Site logo

chaostoolkit-turbulence's Introduction

chaostoolkit-turbulence

This is an extension for Chaos Toolkit which adds support for Turbulence attacks.

Setup

Install

To be used from your experiment, this package must first be installed in the Python environment where chaostoolkit already exists. This package requires at least Python version 3.5, so translate python as python3 or pyhton3.5 as appropriate for your operating system.

From within the source, run:

sudo python setup.py install

Or to install for just your user:

python setup.py install --user

Now you should be able to import the package.

import chaosturbulence
print(chaosturbulence.__version__)

Turbulence Deployment

Before this plugin can be used, you need to have Turbulence deployed in a BOSH environment and have the api accessible form your system. Once this is ready, specify the needed information in the configuration section of the attack. See the docs for more information on how to deploy Turbulence.

Usage

If you have not installed the chaosturbulence package, then make sure you run Chaos Toolkit from this directory (the root of this repository) using pyhton -m chaostoolkit run exp.json or else the chaosturbulence module will not be found. Otherwise just use chaos run exp.json from any directory.

To use, you will need to specify in the configuration:

  • turb_api_url: The URL of the Turbulence API which POST requests will be sent to. This should be in the form https://user:password@address:port.
  • turb_verify_ssl: Whether the SSL certificate should be verified. It will default to true.

Then, to write an attack simply specify the task type and the selector to use. More information about the tasks and selectors can be found in the Turbulence API docs.

A sample experiment for Turbulence integration with Chaos Toolkit:

{
    "version": "1.0.0",
    "title": "What is the impact of killing one random diego cell?",
    "description": "If a diego-cell dies, then it should be restarted automatically and any applications on it should be relocated temporarily",
    "tags": ["tls"],
    "steady-state-hypothesis": {
        "title": "Application responds",
        "probes": []
    },
	"configuration": {
		"turb_api_url": "https://turbulence:[email protected]:8080",
		"turb_verify_ssl": false
	},
    "method": [
        {
			"type": "action",
			"name": "terminate-diego-cells",
			"provider": {
				"type": "python",
				"module": "chaosturbulence.actions",
				"func": "attack",
				"arguments": {
					"task": { "Type": "Kill" },
					"selector": {
						"Deployment": {"Name": "cf"},
						"Group": {"Name": "diego-cell"},
						"ID": {"Limit": 1}
					}
				}
			}
		}
    ],
    "rollbacks": []
}

Because Turbulence has its own rollbacks setup based on the timeout, you may want to set "pauses": {"after": timeout} where timeout is a number of seconds and pauses is a field in an action object. You can read more in the experiment documentation.

chaostoolkit-turbulence's People

Contributors

mattiekat avatar ncriss avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.