chaostoolkit-spring


Namechaostoolkit-spring JSON
Version 0.3.2 PyPI version JSON
download
home_pagehttp://chaostoolkit.org
SummaryChaos Toolkit Driver for Spring Chaos.
upload_time2023-02-27 08:44:16
maintainer
docs_urlNone
authorchaostoolkit Team
requires_python>=3.7
licenseApache License Version 2.0
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
             # [Chaos Toolkit Driver for Spring Chaos](https://chaostoolkit.org/drivers/spring/)

[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-spring.svg)](https://www.python.org/) [![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-spring.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-spring)


This project is a collection of [actions][] and [probes][], gathered as an
extension to the [Chaos Toolkit][chaostoolkit].

[actions]: http://chaostoolkit.org/reference/api/experiment/#action
[probes]: http://chaostoolkit.org/reference/api/experiment/#probe
[chaostoolkit]: http://chaostoolkit.org

## Install

This package requires Python 3.6+

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

```
$ pip install -U chaostoolkit-spring
```

## Usage

Currently this driver supports interactions with a [Spring Boot-based](https://spring.io/projects/spring-boot) service that has included the [2.0.0.-SNAPSHOT](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/) release of the [Chaos Monkey for Spring Boot](https://github.com/codecentric/chaos-monkey-spring-boot). This snapshot includes the necessary Spring Boot Actuator HTTP endpoints so that the Chaos Toolkit to interact with the chaos features at runtime.

Once you have [added the Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#getting-started) and [enabled the Spring Boot Actuator HTTP endpoints](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#endpoints) you can then use the probes and actions from this driver.

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

```json
{
    "name": "enable_chaosmonkey",
    "provider": {
        "arguments": {
            "base_url": "http://localhost:8080/actuator"
        },
        "func": "enable_chaosmonkey",
        "module": "chaosspring.actions",
        "type": "python"
    },
    "type": "action"
}
```

This will interact with the specified service and enable the Chaos Monkey features. You can also turn off the Chaos Monkey if you wish by specifying the following action:

```json
{
    "name": "disable_chaosmonkey",
    "provider": {
        "arguments": {
            "base_url": "http://localhost:8080/actuator"
        },
        "func": "disable_chaosmonkey",
        "module": "chaosspring.actions",
        "type": "python"
    },
    "type": "action"
}
```

You can then manipulate the [Chaos Monkey assaults](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#assaults) active on your service by specifing the following action:

```json
{
    "name": "configure_assaults",
    "provider": {
        "arguments": {
            "base_url": "http://localhost:8080/actuator",
            "assaults_configuration": {
                "level": 5,
                "latencyRangeStart": 2000,
                "latencyRangeEnd": 5000,
                "latencyActive": false,
                "exceptionsActive": false,
                "killApplicationActive": true,
                "restartApplicationActive": false
            }
        },
        "func": "change_assaults_configuration",
        "module": "chaosspring.actions",
        "type": "python"
    },
    "type": "action"
}
```

That's it!

Please explore the code to use further probes and actions.

### SSL Verification

If you do not wish to have SSL Verification performed during your actions/probes
then you can pass the argument `"verify_ssl": false` to the individual activities.

If you wish to provide a `CA_BUNDLE` or directory of trusted CAs certificates,
provide the environment variables specified in the `requests` documentation here:
[Requests SSL Cert Verification](https://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification).

## Contribute

If you wish to contribute more functions to this package, you are more than
welcome to do so. Please, fork this project, write unit tests to cover the proposed changes,
implement the changes, ensure they meet the formatting standards set out by `black`,
`flake8`, and `isort`, and then raise a PR to the repository for review.

Please refer to the [formatting](#formatting-and-linting) section for more information
on the formatting standards.

The Chaos Toolkit projects require all contributors must sign a
[Developer Certificate of Origin][dco] 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.

[dco]: https://github.com/probot/dco#how-it-works

### Develop

If you wish to develop on this project, make sure to install the development
dependencies. But first, [create a virtual environment][venv] and then install
those dependencies.

[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment

```console
$ make install-dev
```

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

### Tests

To run the tests for the project execute the following:

```console
$ make tests
```

### Formatting and Linting

We use a combination of [`black`][black], [`flake8`][flake8], and [`isort`][isort] to both
lint and format this repositories code.

[black]: https://github.com/psf/black
[flake8]: https://github.com/PyCQA/flake8
[isort]: https://github.com/PyCQA/isort

Before raising a Pull Request, we recommend you run formatting against your code with:

```console
$ make format
```

This will automatically format any code that doesn't adhere to the formatting standards.

As some things are not picked up by the formatting, we also recommend you run:

```console
$ make lint
```

To ensure that any unused import statements/strings that are too long, etc. are also picked up.

            

Raw data

            {
    "_id": null,
    "home_page": "http://chaostoolkit.org",
    "name": "chaostoolkit-spring",
    "maintainer": "",
    "docs_url": null,
    "requires_python": ">=3.7",
    "maintainer_email": "",
    "keywords": "",
    "author": "chaostoolkit Team",
    "author_email": "contact@chaostoolkit.org",
    "download_url": "https://files.pythonhosted.org/packages/23/9f/dc0d23ebb60dbb2a209708d942e49b6f22eff895bd0657304f0a897fdd24/chaostoolkit-spring-0.3.2.tar.gz",
    "platform": null,
    "description": " # [Chaos Toolkit Driver for Spring Chaos](https://chaostoolkit.org/drivers/spring/)\n\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-spring.svg)](https://www.python.org/) [![Build Status](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-spring.svg?branch=master)](https://travis-ci.org/chaostoolkit-incubator/chaostoolkit-spring)\n\n\nThis project is a collection of [actions][] and [probes][], gathered as an\nextension to the [Chaos Toolkit][chaostoolkit].\n\n[actions]: http://chaostoolkit.org/reference/api/experiment/#action\n[probes]: http://chaostoolkit.org/reference/api/experiment/#probe\n[chaostoolkit]: http://chaostoolkit.org\n\n## Install\n\nThis package requires Python 3.6+\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n```\n$ pip install -U chaostoolkit-spring\n```\n\n## Usage\n\nCurrently this driver supports interactions with a [Spring Boot-based](https://spring.io/projects/spring-boot) service that has included the [2.0.0.-SNAPSHOT](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/) release of the [Chaos Monkey for Spring Boot](https://github.com/codecentric/chaos-monkey-spring-boot). This snapshot includes the necessary Spring Boot Actuator HTTP endpoints so that the Chaos Toolkit to interact with the chaos features at runtime.\n\nOnce you have [added the Chaos Monkey for Spring Boot](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#getting-started) and [enabled the Spring Boot Actuator HTTP endpoints](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#endpoints) you can then use the probes and actions from this driver.\n\nTo use the probes and actions from this package, add the following to your\nexperiment file:\n\n```json\n{\n    \"name\": \"enable_chaosmonkey\",\n    \"provider\": {\n        \"arguments\": {\n            \"base_url\": \"http://localhost:8080/actuator\"\n        },\n        \"func\": \"enable_chaosmonkey\",\n        \"module\": \"chaosspring.actions\",\n        \"type\": \"python\"\n    },\n    \"type\": \"action\"\n}\n```\n\nThis will interact with the specified service and enable the Chaos Monkey features. You can also turn off the Chaos Monkey if you wish by specifying the following action:\n\n```json\n{\n    \"name\": \"disable_chaosmonkey\",\n    \"provider\": {\n        \"arguments\": {\n            \"base_url\": \"http://localhost:8080/actuator\"\n        },\n        \"func\": \"disable_chaosmonkey\",\n        \"module\": \"chaosspring.actions\",\n        \"type\": \"python\"\n    },\n    \"type\": \"action\"\n}\n```\n\nYou can then manipulate the [Chaos Monkey assaults](https://codecentric.github.io/chaos-monkey-spring-boot/2.0.0-SNAPSHOT/#assaults) active on your service by specifing the following action:\n\n```json\n{\n    \"name\": \"configure_assaults\",\n    \"provider\": {\n        \"arguments\": {\n            \"base_url\": \"http://localhost:8080/actuator\",\n            \"assaults_configuration\": {\n                \"level\": 5,\n                \"latencyRangeStart\": 2000,\n                \"latencyRangeEnd\": 5000,\n                \"latencyActive\": false,\n                \"exceptionsActive\": false,\n                \"killApplicationActive\": true,\n                \"restartApplicationActive\": false\n            }\n        },\n        \"func\": \"change_assaults_configuration\",\n        \"module\": \"chaosspring.actions\",\n        \"type\": \"python\"\n    },\n    \"type\": \"action\"\n}\n```\n\nThat's it!\n\nPlease explore the code to use further probes and actions.\n\n### SSL Verification\n\nIf you do not wish to have SSL Verification performed during your actions/probes\nthen you can pass the argument `\"verify_ssl\": false` to the individual activities.\n\nIf you wish to provide a `CA_BUNDLE` or directory of trusted CAs certificates,\nprovide the environment variables specified in the `requests` documentation here:\n[Requests SSL Cert Verification](https://docs.python-requests.org/en/latest/user/advanced/#ssl-cert-verification).\n\n## Contribute\n\nIf you wish to contribute more functions to this package, you are more than\nwelcome to do so. Please, fork this project, write unit tests to cover the proposed changes,\nimplement the changes, ensure they meet the formatting standards set out by `black`,\n`flake8`, and `isort`, and then raise a PR to the repository for review.\n\nPlease refer to the [formatting](#formatting-and-linting) section for more information\non the formatting standards.\n\nThe Chaos Toolkit projects require all contributors must sign a\n[Developer Certificate of Origin][dco] on each commit they would like to merge\ninto the master branch of the repository. Please, make sure you can abide by\nthe rules of the DCO before submitting a PR.\n\n[dco]: https://github.com/probot/dco#how-it-works\n\n### Develop\n\nIf you wish to develop on this project, make sure to install the development\ndependencies. But first, [create a virtual environment][venv] and then install\nthose dependencies.\n\n[venv]: http://chaostoolkit.org/reference/usage/install/#create-a-virtual-environment\n\n```console\n$ make install-dev\n```\n\nNow, you can edit the files and they will be automatically be seen by your\nenvironment, even when running from the `chaos` command locally.\n\n### Tests\n\nTo run the tests for the project execute the following:\n\n```console\n$ make tests\n```\n\n### Formatting and Linting\n\nWe use a combination of [`black`][black], [`flake8`][flake8], and [`isort`][isort] to both\nlint and format this repositories code.\n\n[black]: https://github.com/psf/black\n[flake8]: https://github.com/PyCQA/flake8\n[isort]: https://github.com/PyCQA/isort\n\nBefore raising a Pull Request, we recommend you run formatting against your code with:\n\n```console\n$ make format\n```\n\nThis will automatically format any code that doesn't adhere to the formatting standards.\n\nAs some things are not picked up by the formatting, we also recommend you run:\n\n```console\n$ make lint\n```\n\nTo ensure that any unused import statements/strings that are too long, etc. are also picked up.\n",
    "bugtrack_url": null,
    "license": "Apache License Version 2.0",
    "summary": "Chaos Toolkit Driver for Spring Chaos.",
    "version": "0.3.2",
    "project_urls": {
        "Homepage": "http://chaostoolkit.org"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "c22fe139e6628aa12c05ca98c606567ce344a5f6bb30eaafd895d250c48efd3a",
                "md5": "50705d7163016a58cff091f46f4781cf",
                "sha256": "cd911c2154952b9ca87d554f0f16ba4c2dec487da20ba656622c948efcbb82dc"
            },
            "downloads": -1,
            "filename": "chaostoolkit_spring-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "50705d7163016a58cff091f46f4781cf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7",
            "size": 10292,
            "upload_time": "2023-02-27T08:44:14",
            "upload_time_iso_8601": "2023-02-27T08:44:14.839550Z",
            "url": "https://files.pythonhosted.org/packages/c2/2f/e139e6628aa12c05ca98c606567ce344a5f6bb30eaafd895d250c48efd3a/chaostoolkit_spring-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "239fdc0d23ebb60dbb2a209708d942e49b6f22eff895bd0657304f0a897fdd24",
                "md5": "de6195717a6fa1dbe59575408f7d3a8c",
                "sha256": "8d23cbfbfaeedee719457c118eb8520a2f56f5f1e83a4ec78537228c96700da7"
            },
            "downloads": -1,
            "filename": "chaostoolkit-spring-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "de6195717a6fa1dbe59575408f7d3a8c",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7",
            "size": 11886,
            "upload_time": "2023-02-27T08:44:16",
            "upload_time_iso_8601": "2023-02-27T08:44:16.469376Z",
            "url": "https://files.pythonhosted.org/packages/23/9f/dc0d23ebb60dbb2a209708d942e49b6f22eff895bd0657304f0a897fdd24/chaostoolkit-spring-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-02-27 08:44:16",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "chaostoolkit-spring"
}
        
Elapsed time: 0.16603s