{"id":22048916,"url":"https://github.com/chaostoolkit-incubator/chaostoolkit-gremlin","last_synced_at":"2025-05-08T23:07:03.918Z","repository":{"id":25758839,"uuid":"106418253","full_name":"chaostoolkit-incubator/chaostoolkit-gremlin","owner":"chaostoolkit-incubator","description":"Gremlin attack support for the Chaos Toolkit","archived":false,"fork":false,"pushed_at":"2022-03-21T12:54:50.000Z","size":22,"stargazers_count":9,"open_issues_count":4,"forks_count":5,"subscribers_count":2,"default_branch":"master","last_synced_at":"2023-02-27T17:51:57.319Z","etag":null,"topics":["chaos-engineering","chaostoolkit-extension","chaostoolkit-gremlin","gremlin"],"latest_commit_sha":null,"homepage":"http://chaostoolkit.org/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/chaostoolkit-incubator.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-10-10T13:05:52.000Z","updated_at":"2022-03-21T12:54:54.000Z","dependencies_parsed_at":"2022-08-07T11:15:59.237Z","dependency_job_id":null,"html_url":"https://github.com/chaostoolkit-incubator/chaostoolkit-gremlin","commit_stats":null,"previous_names":[],"tags_count":null,"template":null,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-gremlin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-gremlin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-gremlin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/chaostoolkit-incubator%2Fchaostoolkit-gremlin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/chaostoolkit-incubator","download_url":"https://codeload.github.com/chaostoolkit-incubator/chaostoolkit-gremlin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":227351639,"owners_count":17768412,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["chaos-engineering","chaostoolkit-extension","chaostoolkit-gremlin","gremlin"],"created_at":"2024-11-30T14:13:42.054Z","updated_at":"2024-11-30T14:13:42.151Z","avatar_url":"https://github.com/chaostoolkit-incubator.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# chaostoolkit-gremlin\n\n[![Build Status](https://travis-ci.org/chaostoolkit/chaostoolkit-gremlin.svg?branch=master)](https://travis-ci.org/chaostoolkit/chaostoolkit-gremlin)\n\n[Gremlin, Inc][gremlin] support for the [Chaos Toolkit][chaostoolkit].\n\n[gremlin]: https://www.gremlin.com/\n[chaostoolkit]: http://chaostoolkit.org/\n\n## Install\n\nTo be used from your experiment, this package must be installed in the Python\nenvironment where [chaostoolkit][] already lives.\n\n[chaostoolkit]: https://github.com/chaostoolkit/chaostoolkit\n\n```\n$ pip install chaostoolkit-gremlin\n```\n\n## Usage\n\nTo use this package, you must create an account with [Gremlin, Inc][gremlin].\nOnce registered, create a new organisation (formerly known as team). You may\nhave to ask your Gremlin administrator to do this for you.\n\nOnce this is done, you must set the following environmental variables\nso the Chaos Toolkit can pick up them:\n\n* `GREMLIN_EMAIL`: the email used to register to Gremlin and associated to that\n  organisation\n* `GREMLIN_PWD`: your password\n* `GREMLIN_ORG_NAME`: the organisation's name you created\n\nNote that 2FA is not yet implemented in this package.\n\nNext you need to specify to load those\nvariables and inject them into this package's activities. At the top of the\nexperiment file, add the following object:\n\n```json\n{\n    \"secrets\": {\n        \"gremlin\": {\n            \"email\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_EMAIL\"\n            },\n            \"password\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_PWD\"\n            },\n            \"org_name\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_ORG_NAME\"\n            }\n        }\n    }\n}\n```\n\nFinally, in all activities where you call a function from this package, make\nsure to add the following property:\n\n```json\n\"secrets\": [\"gremlin\"]\n```\n\nHere is a full example of running a CPU attack experiment:\n\n```json\n{\n    \"title\": \"Can our system handle a node being CPU-busy?\",\n    \"description\": \"CPU-usage may be impactful on our response time\",\n    \"secrets\": {\n        \"gremlin\": {\n            \"email\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_EMAIL\"\n            },\n            \"password\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_PWD\"\n            },\n            \"org_name\": {\n                \"type\": \"env\",\n                \"key\": \"GREMLIN_ORG_NAME\"\n            }\n        }\n    },\n    \"method\": [\n        {\n            \"name\": \"attack-on-cpu\",\n            \"type\": \"action\",\n            \"background\": true,\n            \"provider\": {\n                \"type\": \"python\",\n                \"module\": \"chaosgremlin.actions\",\n                \"func\": \"attack\",\n                \"secrets\": [\"gremlin\"],\n                \"arguments\": {\n                    \"command\": {\n                        \"type\": \"cpu\"\n                    },\n                    \"target\": {\n                        \"type\": \"Random\"\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n\n### API Key Authentication\n\nIn order to use an API Key as your method of authentication, you'll have to set it as an environment variable: `$GREMLIN_API_KEY`.\nYou can construct your experiments the same as before, but with the `secrets` section omitted. When `secrets` is not present, chaostoolkit-gremlin will grab your pre-registered Gremlin API Key and bundle it with your experiment at runtime. \nHere's an example of the above CPU attack, with API Key authentication:\n```json\n{\n    \"title\": \"Can our system handle a node being CPU-busy?\",\n    \"description\": \"CPU-usage may be impactful on our response time\",\n    \"method\": [\n        {\n            \"name\": \"attack-on-cpu\",\n            \"type\": \"action\",\n            \"background\": true,\n            \"provider\": {\n                \"type\": \"python\",\n                \"module\": \"chaosgremlin.actions\",\n                \"func\": \"attack\",\n                \"arguments\": {\n                    \"command\": {\n                        \"type\": \"cpu\"\n                    },\n                    \"target\": {\n                        \"type\": \"Random\"\n                    }\n                }\n            }\n        }\n    ]\n}\n```\n**Note:** When using API Key authentication, your Team ID must also be set as an environment variable: `$GREMLIN_TEAM_ID`. When using email/password authentication and you do not set a specific Team ID, the first Team ID associated with your authenticated `session` will be used. \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","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-gremlin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-gremlin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fchaostoolkit-incubator%2Fchaostoolkit-gremlin/lists"}