混沌工具包Gremlin,Inc.支持
chaostoolkit-gremlin的Python项目详细描述
#小精灵![构建状态](https://travis-ci.org/chaostoolkit/chaostoolkit-gremlin.svg?branch=master)(https://travis ci.org/chaos toolkit/chaostoolkit gremlin)
[gremlin,inc][gremlin]对[Chaos工具箱][chaostoolkit]的支持。
[gremlin]:https://gremlininc.com/
[chaostoolkit]:http://chaostoolkit.org/
此包必须安装在python
环境中,其中[chaostoolkit][]已经存在。
[chaostoolkit]:https://github.com/chaostoolkit/chaostoolkit
``````
`````>$pip install chaostoolkit gremlin
````
inc][gremlin]。
注册后,创建一个新的组织(以前称为团队)。您可能需要让您的gremlin管理员为您执行此操作。
您必须设置以下环境变量
,以便Chaos工具箱可以提取它们:
*`gremlin_email`:用于向gremlin注册并与之关联的电子邮件
*`gremlin_pwd`:您的密码
*`gremlin_org_name`:您创建的操作的名称
请注意,2fa尚未在这个包。
下一步您需要指定加载那些
变量并将它们注入到这个包的活动中。在
实验文件的顶部,添加以下对象:
``json
{
“secrets”:{
“gremlin”:{
“email”:“env.gremlin_email”,
“password”:“env.gremlin_pwd”,
“org_name”:“env.gremlin_org_name”
}
}
}
`````
在从该包调用函数的所有活动中,请确保添加以下属性:
``json
“secrets”:“gremlin”
````
这里是运行CPU攻击实验的完整示例:
``json
{
“title”:“我们的系统可以处理CPU繁忙的节点吗?”,
“description”:“CPU的使用可能会影响我们的响应时间”,
“secrets”:{
“gremlin”:{
“email”:“env.gremlin_email”,
“password”:“env.gremlin_pwd”,
“org_name”:“env.gremlin_org_name”
}
“method”:[
{
“title”:“攻击CPU”,
“type”:“action”,
“background”:true,
“secrets”:“gremlin”,
“provider”:{
“type”:“python”,
“module”:“chaosgremlin.actions”,
“func”:“攻击”,
“arguments”:{
“command”:{
“type”:“cpu”
},
“target”:{
“type”:“random”
}
}
}
}
]
}
````
请,在这个项目中,按照通常的代码样式进行更改,并撒上测试,提交一个pr以供
审阅。
[pep8]:https://pycodestyle.readthedocs.io/en/latest/
[gremlin,inc][gremlin]对[Chaos工具箱][chaostoolkit]的支持。
[gremlin]:https://gremlininc.com/
[chaostoolkit]:http://chaostoolkit.org/
此包必须安装在python
环境中,其中[chaostoolkit][]已经存在。
[chaostoolkit]:https://github.com/chaostoolkit/chaostoolkit
``````
`````>$pip install chaostoolkit gremlin
````
inc][gremlin]。
注册后,创建一个新的组织(以前称为团队)。您可能需要让您的gremlin管理员为您执行此操作。
您必须设置以下环境变量
,以便Chaos工具箱可以提取它们:
*`gremlin_email`:用于向gremlin注册并与之关联的电子邮件
*`gremlin_pwd`:您的密码
*`gremlin_org_name`:您创建的操作的名称
请注意,2fa尚未在这个包。
下一步您需要指定加载那些
变量并将它们注入到这个包的活动中。在
实验文件的顶部,添加以下对象:
``json
{
“secrets”:{
“gremlin”:{
“email”:“env.gremlin_email”,
“password”:“env.gremlin_pwd”,
“org_name”:“env.gremlin_org_name”
}
}
}
`````
在从该包调用函数的所有活动中,请确保添加以下属性:
``json
“secrets”:“gremlin”
````
这里是运行CPU攻击实验的完整示例:
``json
{
“title”:“我们的系统可以处理CPU繁忙的节点吗?”,
“description”:“CPU的使用可能会影响我们的响应时间”,
“secrets”:{
“gremlin”:{
“email”:“env.gremlin_email”,
“password”:“env.gremlin_pwd”,
“org_name”:“env.gremlin_org_name”
}
“method”:[
{
“title”:“攻击CPU”,
“type”:“action”,
“background”:true,
“secrets”:“gremlin”,
“provider”:{
“type”:“python”,
“module”:“chaosgremlin.actions”,
“func”:“攻击”,
“arguments”:{
“command”:{
“type”:“cpu”
},
“target”:{
“type”:“random”
}
}
}
}
]
}
````
请,在这个项目中,按照通常的代码样式进行更改,并撒上测试,提交一个pr以供
审阅。
[pep8]:https://pycodestyle.readthedocs.io/en/latest/