Giter VIP home page Giter VIP logo

chaostoolkit-gremlin's Introduction

chaostoolkit-gremlin

Build Status

Gremlin, Inc support for the Chaos Toolkit.

Install

To be used from your experiment, this package must be installed in the Python environment where chaostoolkit already lives.

$ pip install chaostoolkit-gremlin

Usage

To use this package, you must create an account with Gremlin, Inc. Once registered, create a new organisation (formerly known as team). You may have to ask your Gremlin administrator to do this for you.

Once this is done, you must set the following environmental variables so the Chaos Toolkit can pick up them:

  • GREMLIN_EMAIL: the email used to register to Gremlin and associated to that organisation
  • GREMLIN_PWD: your password
  • GREMLIN_ORG_NAME: the oprganisation's name you created

Note that 2FA is not yet implemented in this package.

Next you need to specify to load those variables and inject them into this package's activities. At the top of the experiment file, add the following object:

{
    "secrets": {
        "gremlin": {
            "email": {
                "type": "env",
                "key": "GREMLIN_EMAIL"
            },
            "password": {
                "type": "env",
                "key": "GREMLIN_PWD"
            },
            "org_name": {
                "type": "env",
                "key": "GREMLIN_ORG_NAME"
            }
        }
    }
}

Finally, in all activities where you call a function from this package, make sure to add the following property:

"secrets": ["gremlin"]

Here is a full example of running a CPU attack experiment:

{
    "title": "Can our system handle a node being CPU-busy?",
    "description": "CPU-usage may be impactful on our response time",
    "secrets": {
        "gremlin": {
            "email": {
                "type": "env",
                "key": "GREMLIN_EMAIL"
            },
            "password": {
                "type": "env",
                "key": "GREMLIN_PWD"
            },
            "org_name": {
                "type": "env",
                "key": "GREMLIN_ORG_NAME"
            }
        }
    },
    "method": [
        {
            "title": "attack-on-cpu",
            "type": "action",
            "background": true,
            "provider": {
                "type": "python",
                "module": "chaosgremlin.actions",
                "secrets": ["gremlin"],
                "func": "attack",
                "arguments": {
                    "command": {
                        "type": "cpu"
                    },
                    "target": {
                        "type": "Random"
                    }
                }
            }
        }
    ]
}

Contribute

If you wish to contribute more functions to this package, you are more than welcome to do so. Please, fork this project, make your changes following the usual PEP 8 code style, sprinkling with tests and submit a PR for review.

chaostoolkit-gremlin's People

Contributors

lawouach avatar ksolie avatar russmiles 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.