Skip to main content

Chaos Toolkit Cloud Foundry Extension

Build Status Python versions Requirements Status Has wheel

This extension package provides probes and actions for Chaos Engineering experiments against a Cloud Foundry instance using the Chaos Toolkit.

Install

This package requires Python 3.7+

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

$ pip install -U chaostoolkit-cloud-foundry

Usage

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

{
    "type": "action",
    "name": "terminate-random-instance",
    "provider": {
        "type": "python",
        "module": "chaoscf.probes",
        "func": "terminate_some_random_instance",
        "arguments": {
            "name": "my-app",
            "org_name": "my-org",
            "space_name": "my-space"
        }
    }
},
{
    "type": "probe",
    "name": "fetch-app-statistics",
    "provider": {
        "type": "python",
        "module": "chaoscf.probes",
        "func": "get_app_stats",
        "arguments": {
            "name": "my-app",
            "org_name": "my-org",
            "space_name": "my-space"
        }
    }
}

That's it!

Please explore the code to see existing probes and actions.

Discovery

You may use the Chaos Toolkit to discover the capabilities of this extension:

$ chaos discover chaostoolkit-cloud-foundry --no-install

If you have logged in against a Cloud Foundry environment, this will discover information about it along the way.

Configuration

This extension to the Chaos Toolkit need credentials to a Cloud Foundry account with appropriate scopes. Please add the following sections to your experiment file:

{
    "configuration": {
        "cf_api_url": "https://api.local.pcfdev.io",
        "cf_verify_ssl": false
    },
    "secrets": {
        "cloudfoundry": {
            "cf_username": "user",
            "cf_password": "pass"
        }
    }
}

You may leave "cf_verifiy_ssl" out of the configuration when you want to verify TLS certificates. Usually, local environments are self-signed so it may be useful to disable that check in that case.

You may also specify the "cf_client_id" and "cf_client_secret" secrets when you need. Their default values are "cf" and "" respectively. These work well against a local PCF dev install.

Then in your probe or action:

{
    "type": "probe",
    "name": "fetch-app-statistics",
    "provider": {
        "type": "python",
        "secrets": ["cloudfoundry"],
        "module": "chaoscf.probes",
        "func": "get_app_stats",
        "arguments": {
            "name": "my-app",
            "org_name": "my-org",
            "space_name": "my-space"
        }
    }
}

Test

To run the tests for the project execute the following:

$ pip install -r requirements-dev.txt
$ pytest

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 project requires 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. But first, create a virtual environment and then install those dependencies.

$ pip install -r requirements-dev.txt -r requirements.txt 

Then, point your environment to this directory:

$ python setup.py develop

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:

$ python setup.py test

Metadata

Release files for chaostoolkit-cloud-foundry 0.7.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for chaostoolkit-cloud-foundry 0.7.3
File Size Uploaded Provenance Actions
chaostoolkit-cloud-foundry-0.7.3.tar.gz 17.5 kB Without provenance Details for chaostoolkit-cloud-foundry-0.7.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for chaostoolkit-cloud-foundry 0.7.3
File Interpreter ABI Platform Actions
chaostoolkit_cloud_foundry-0.7.3-py3-none-any.whl Python 3 none any Details for chaostoolkit_cloud_foundry-0.7.3-py3-none-any.whl

Total release size: 31.1 kB

Release files / chaostoolkit-cloud-foundry-0.7.3.tar.gz

Download URL chaostoolkit-cloud-foundry-0.7.3.tar.gz
Size 17.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7587fd40adf308bfea337dc6b4a12e0b7a4d9ed51ba89265504f52213aa4e2c5
BLAKE2b-256 checksum
How to use checksums
0adc3cd5456b54800d0be8fc2b24761466605864c29b871fd1649c070920b77a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.15

Release files / chaostoolkit_cloud_foundry-0.7.3-py3-none-any.whl

Download URL chaostoolkit_cloud_foundry-0.7.3-py3-none-any.whl
Size 13.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7fe8898956be863d9bac9bc6a0e210b422e5e90b88997504e3d9fbe1d436f38b
BLAKE2b-256 checksum
How to use checksums
37bf0ad0ff2f0ccc40fd0b2ea57bf5ce0a840182c351881485bba4e837d93892
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.7.15

Security for chaostoolkit-cloud-foundry 0.7.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page