Git Product home page Git Product logo

chaostoolkit-lib's Introduction

chaostoolkit-lib

Version License

Build Status codecov Python versions Requirements Status

The Chaos Toolkit core library.

Purpose

The purpose of this library is to provide the core of the Chaos Toolkit model and functions it needs to render its services.

Unless you wish to create your own toolkit, you will likely not use directly this library.

Features

The library provides the followings features:

  • discover capabilities from extensions Allows you to explore the support from an extension that would help you initialize an experiment against the system this extension targets

  • validate a given experiment syntax The validation looks at various keys in the experiment and raises errors whenever something doesn't look right. As a nice addition, when a probe calls a Python function with arguments, it tries to validate the given argument list matches the signature of the function to apply.

  • run your steady state before and after the method. The former as a gate to decide if the experiment can be executed. The latter to see if the system deviated from normal.

  • run probes and actions declared in an experiment It runs the steps in a experiment method sequentially, applying first steady probes, then actions and finally close probes.

    A journal, as a JSON payload, is return of the experiment run.

    The library supports running probes and actions defined as Python functions, from importable Python modules, processes and HTTP calls.

  • run experiment's rollbacks when provided

  • Load secrets from the experiments, the environ or vault

  • Provides event notification from Chaos Toolkit flow (although the actual events are published by the CLI itself, not from this library), supported events are:

    • on experiment validation: started, failed or completed
    • on discovery: started, failed or completed
    • on initialization of experiments: started, failed or completed
    • on experiment runs: started, failed or completed

    For each event, the according payload is part of the event as well as a UTC timestamp.

Install

If you are user of the Chaos Toolkit, you probably do not need to install this package yourself as it comes along with the chaostoolkit cli.

However, should you wish to integrate this library in your own Python code, please install it as usual:

$ pip install -U chaostoolkit-lib

Specific dependencies

In addition to essential dependencies, the package can install a couple of other extra dependencies for specific use-cases. They are not mandatory and the library will warn you if you try to use a feature that requires them.

If you need Vault support to read secrets from, run the following command:

$ pip install -U chaostoolkit-lib[vault]

If you need JSON Path support for tolerance probes in the hypothesis, also run the following command:

$ pip install -U chaostoolkit-lib[jsonpath]

When using a process activity, the standard output end error streams are logged into the chaostoolkit.log file. The default encoding used is utf-8 to decode those streams. Sometimes, this is not the right encoding, so you can install the chardet or cchardet packages to attempt the detection of the right encoding.

$ pip install -U chaostoolkit-lib[decoders]

Contribute

Contributors to this project are welcome as this is an open-source effort that seeks discussions and continuous improvement.

From a code perspective, if you wish to contribute, you will need to run a Python 3.5+ environment. Then, fork this repository and submit a PR. The project cares for code readability and checks the code style to match best practices defined in PEP8. Please also make sure you provide tests whenever you submit a PR so we keep the code reliable.

The Chaos Toolkit projects require all contributors must sign a Developer Certificate of Origin on each commit they would like to merge into the master branch of the repository. Please, make sure you can abide by the rules of the DCO before submitting a PR.

chaostoolkit-lib's People

Contributors

lawouach avatar russmiles avatar twuyts avatar claymccoy avatar alexshemeshwix avatar

Watchers

James Cloos 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.