{ "info": { "author": "chaostoolkit Team", "author_email": "contact@chaostoolkit.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: Freely Distributable", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: Implementation", "Programming Language :: Python :: Implementation :: CPython" ], "description": "# Chaos Toolkit Extension for Service Fabric\n\n[![Python versions](https://img.shields.io/pypi/pyversions/chaostoolkit-service-fabric.svg)](https://www.python.org/)\n\nThis project is a collection of [actions][] and [probes][], gathered as an\nextension to the [Chaos Toolkit][chaostoolkit]. It targets the\n[Microsoft Service Fabric][servicefabric] platform.\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[servicefabric]: https://azure.microsoft.com/en-us/services/service-fabric/\n\n## Install\n\nThis package requires Python 3.5+\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-service-fabric\n```\n\n## Usage\n\nTo use the probes and actions from this package, add the following to your\nexperiment file:\n\n```json\n{\n \"type\": \"action\",\n \"name\": \"start-service-factory-chaos\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaosservicefabric.factory.actions\",\n \"func\": \"start_chaos\",\n \"secrets\": [\"azure\"],\n \"arguments\": {\n \"parameters\": {\n \"TimeToRunInSeconds\": 45\n }\n }\n }\n},\n{\n \"type\": \"action\",\n \"name\": \"stop-service-factory-chaos\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaosservicefabric.factory.actions\",\n \"func\": \"stop_chaos\",\n \"secrets\": [\"azure\"]\n }\n}\n```\n\nThat's it!\n\nPlease explore the code to see existing probes and actions.\n\n\n\n## Configuration\n\n### Credentials\n\nThis extension uses the [requests][] library under the hood. The requests library\nexpects that you have a PFX certificate, converted as to the PEM format, that allows you to \nauthenticate with the [Service Factory][sf] endpoint.\n\n[sf]: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-controlled-chaos\n[creds]: https://docs.microsoft.com/en-us/azure/service-fabric/service-fabric-connect-to-secure-cluster\n[requests]: http://docs.python-requests.org/en/master/\n[sdk]: https://github.com/Azure/azure-sdk-for-python\n\nGenerally speaking, there are two ways of doing this:\n\n* you have [created][creds] a configuration file where you will run the\n experiment from (so with a `~/.sfctl/config` file)\n* you explicitly pass the correct environment variables to the experiment\n definition as follows:\n\n Configuration section:\n\n ```json\n {\n \"endpoint\": \"https://XYZ.westus.cloudapp.azure.com:19080\",\n \"verify_tls\": false,\n \"use_ca\": false\n }\n ```\n\n Secrets section:\n\n ```json\n {\n \"azure\": {\n \"security\": \"pem\",\n \"pem_path\": \"./cluster-client-cert.pem\"\n }\n }\n ```\n\n The PEM can also be passed as an environment variable:\n\n ```json\n {\n \"azure\": {\n \"security\": \"pem\",\n \"pem_content\": {\n \"type\": \"env\",\n \"key\": \"AZURE_PEM\"\n }\n }\n }\n ```\n\n The environment variable name can be anything.\n\n### Putting it all together\n\nHere is a full example:\n\n```json\n{\n \"version\": \"1.0.0\",\n \"title\": \"...\",\n \"description\": \"...\",\n \"configuration\": {\n \"endpoint\": \"https://XYZ.westus.cloudapp.azure.com:19080\",\n \"verify_tls\": false,\n \"use_ca\": false\n },\n \"secrets\": {\n \"azure\": {\n \"security\": \"pem\",\n \"pem_path\": \"./cluster-client-cert.pem\"\n }\n },\n \"steady-state-hypothesis\": {\n \"title\": \"Services is healthy\",\n \"probes\": [\n {\n \"type\": \"probe\",\n \"name\": \"application-must-respond\",\n \"tolerance\": 200,\n \"provider\": {\n \"type\": \"http\",\n \"verify_tls\": false,\n \"url\": \"https://some-url-in-cluster/\"\n }\n }\n ]\n },\n \"method\": [\n {\n \"type\": \"action\",\n \"name\": \"start-service-factory-chaos\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaosservicefabric.factory.actions\",\n \"func\": \"start_chaos\",\n \"secrets\": [\"azure\"],\n \"arguments\": {\n \"parameters\": {\n \"TimeToRunInSeconds\": 45\n }\n }\n },\n \"pauses\": {\n \"after\": 30\n }\n },\n {\n \"type\": \"probe\",\n \"ref\": \"application-must-respond\"\n },\n {\n \"type\": \"action\",\n \"name\": \"stop-service-factory-chaos\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaosservicefabric.factory.actions\",\n \"func\": \"stop_chaos\",\n \"secrets\": [\"azure\"]\n },\n \"pauses\": {\n \"after\": 5\n }\n },\n {\n \"type\": \"probe\",\n \"name\": \"get-service-factory-chaos-report\",\n \"provider\": {\n \"type\": \"python\",\n \"module\": \"chaosservicefabric.factory.probes\",\n \"func\": \"chaos_report\",\n \"secrets\": [\"azure\"],\n \"arguments\": {\n \"start_time_utc\": \"1 minute ago\",\n \"end_time_utc\": \"now\"\n }\n }\n }\n ]\n}\n```\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, make your changes following the\nusual [PEP 8][pep8] code style, sprinkling with tests and submit a PR for\nreview.\n\n[pep8]: https://pycodestyle.readthedocs.io/en/latest/\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$ pip install -r requirements-dev.txt -r requirements.txt \n```\n\nThen, point your environment to this directory:\n\n```console\n$ python setup.py develop\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### Test\n\nTo run the tests for the project execute the following:\n\n```\n$ pytest\n```\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://chaostoolkit.org", "keywords": "", "license": "Apache License Version 2.0", "maintainer": "", "maintainer_email": "", "name": "chaostoolkit-service-fabric", "package_url": "https://pypi.org/project/chaostoolkit-service-fabric/", "platform": "", "project_url": "https://pypi.org/project/chaostoolkit-service-fabric/", "project_urls": { "Homepage": "http://chaostoolkit.org" }, "release_url": "https://pypi.org/project/chaostoolkit-service-fabric/0.1.0/", "requires_dist": [ "chaostoolkit-lib (>=1.1.0)", "dateparser", "logzero", "requests" ], "requires_python": ">=3.5.*", "summary": "Chaos Toolkit Extension for Microsoft Service Fabric", "version": "0.1.0" }, "last_serial": 5033234, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6dc9b5f996c84fed80beab9b87dc41ac", "sha256": "128549c7072fe41bf105865fdda7d9a310a95c697d6e3e9335c01dca912b4c69" }, "downloads": -1, "filename": "chaostoolkit_service_fabric-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6dc9b5f996c84fed80beab9b87dc41ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 8474, "upload_time": "2019-04-01T16:39:38", "url": "https://files.pythonhosted.org/packages/cc/3d/2594a43177fbf310a4c2156384274a587280424af2d40b585a0cf0defd0f/chaostoolkit_service_fabric-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77869bdf6b3d15d9e8526072ebd1800b", "sha256": "96c483394b2565e6e95c57e5f049761328262e3b07286494dcc128154e476e92" }, "downloads": -1, "filename": "chaostoolkit-service-fabric-0.1.0.tar.gz", "has_sig": false, "md5_digest": "77869bdf6b3d15d9e8526072ebd1800b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 11691, "upload_time": "2019-04-01T16:39:40", "url": "https://files.pythonhosted.org/packages/93/8a/3e7939d94f2f164a700714b1a8bd122a0db93e837e50055a903a780bf60f/chaostoolkit-service-fabric-0.1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "6dc9b5f996c84fed80beab9b87dc41ac", "sha256": "128549c7072fe41bf105865fdda7d9a310a95c697d6e3e9335c01dca912b4c69" }, "downloads": -1, "filename": "chaostoolkit_service_fabric-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6dc9b5f996c84fed80beab9b87dc41ac", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3.5.*", "size": 8474, "upload_time": "2019-04-01T16:39:38", "url": "https://files.pythonhosted.org/packages/cc/3d/2594a43177fbf310a4c2156384274a587280424af2d40b585a0cf0defd0f/chaostoolkit_service_fabric-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "77869bdf6b3d15d9e8526072ebd1800b", "sha256": "96c483394b2565e6e95c57e5f049761328262e3b07286494dcc128154e476e92" }, "downloads": -1, "filename": "chaostoolkit-service-fabric-0.1.0.tar.gz", "has_sig": false, "md5_digest": "77869bdf6b3d15d9e8526072ebd1800b", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3.5.*", "size": 11691, "upload_time": "2019-04-01T16:39:40", "url": "https://files.pythonhosted.org/packages/93/8a/3e7939d94f2f164a700714b1a8bd122a0db93e837e50055a903a780bf60f/chaostoolkit-service-fabric-0.1.0.tar.gz" } ] }