Giter Club home page Giter Club logo

chaostoolkit-google-cloud-platform's Introduction


Google Cloud Platform Extension for the Chaos Toolkit

Release Build GitHub issues License Python version

Community โ€ข ChangeLog


Welcome to the Google Cloud Platform (GCP) extension for Chaos Toolkit. The package aggregates activities to target your GCP projects and explore your resilience via Chaos Engineering experiments.

Install

This package requires Python 3.8+

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

$ pip install -U chaostoolkit-google-cloud-platform

Usage

To use the probes and actions from this package, add the following to your experiment file:

{
  "version": "1.0.0",
  "title": "Our users should not be impacted by increased latency from our services",
  "description": "Use traffic shaping from the load Balancer to explore the impact of latency on our users",
  "method": [
    {
      "name": "add-delay-to-traffic",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosgcp.lb.actions",
        "func": "inject_traffic_delay",
        "arguments": {
          "url_map": "my-service",
          "target_name": "all-paths",
          "target_path": "/*",
          "delay_in_seconds": 1,
          "impacted_percentage": 80
        }
      },
      "pauses": {
        "after": 180
      }
    }
  ],
  "rollbacks": [
    {
      "name": "remove-traffic-delay",
      "type": "action",
      "provider": {
        "type": "python",
        "module": "chaosgcp.lb.actions",
        "func": "remove_fault_injection_traffic_policy",
        "arguments": {
          "url_map": "my-service",
          "target_name": "all-paths",
          "target_path": "/*"
        }
      }
    }
  ]
}

That's it! You can now run it as chaos run experiment.json

Please explore the code to see existing probes and actions.

The extension picks up the credentials found on the machine running the experiment as describe in the official Python GCP client.

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.

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.

Develop

If you wish to develop on this project, make sure to install the development dependencies. You will need to install PDM.

$ pdm install --dev

Whenever you need to make contribution, ensure to run the linter as follows:

$ pdm run format
$ pdm run lint

Now, you can edit the files and they will be automatically be seen by your environment, even when running from the chaos command locally.

Test

To run the tests for the project execute the following:

$ pdm run test

chaostoolkit-google-cloud-platform's People

Contributors

ashishjain2412 avatar dmartin35 avatar elenamares avatar lawouach avatar lkolluru05 avatar thesatyasingh avatar yujunliang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

chaostoolkit-google-cloud-platform's Issues

Drop Kubernetes extension from requirements

Idea:
It would be best to have only GCP related activities in that extension.
Hence we could remove all chaosk8s functions call from this extension, and then removes the chaostoolkit-kubernetesextension from the requirements.txt

Impact:
This would imply to deprecate the swap_node_pool function, because it uses the drain_nodes function from the chaosk8s package. This call shall be defined as an activity in the experiment (rather than being embedded in another extension)

Storage object from URI

currently we fetch a storage object from a bucket using the tuple (bucket name, object name).

as a shortcut/for compliance with other probes/actions that requires the object URI,
we could handle both cases, supporting the gs://bucketName/objectName URI format.

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.