在线压测接口
StressTest
接收运维平台的在线压测请求,将指定训练任务的指定节点下发压测操作,该接口需要等待训练任务已经成功运行,出迭代以后再调用,保证任务已经注册到ClusterD。在线压测接口属于人工运维操作,调用接口前请先确保服务器环境正常。
Note
请在训练正常迭代后,再进行在线压测指令的下发。
rpc StressTest(StressTestParam) returns (Status) {}
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| StressTestParam | message StressTestParam { string jobID = 1; map<string, StressOpList> stressParam = 2; repeated int64 allNodesOps = 3; }message StressOpList { repeated int64 ops = 1; } |
StressTestParam.jobID:任务ID。 StressTestParam.stressParam:用户下发压测指令的节点与操作。key为node name,value为该节点要执行的压测操作。 StressTestParam.allNodesOps:若用户要对任务的所有节点进行压测,则该字段表示所有节点要执行的压测操作。allNodesOps字段优先级高于stressParam。其中,0表示“aic”压测;1表示“p2p”压测。 StressOpList.ops:该节点要执行的压测操作。0表示“aic”压测;1表示“p2p”压测。 |
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| Status | message Status{ int32 code = 1; string info = 2; } |
Status.code:返回码。
|
SubscribeStressTestResponse
运维平台查询压测结果的接口。当运维人员下发在线压测指令成功后,可通过该接口查询结果。
rpc SubscribeStressTestResponse(StressTestRequest) returns (stream StressTestResponse) {}
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| StressTestRequest | message StressTestRequest{ string jobID = 1; } |
StressTestRequest.jobID:任务ID。 |
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| StressTestResponse | message StressTestResponse { string jobID; string msg; } |
StressTestResponse.jobID:任务ID。 StressTestResponse.msg:压测的执行结果。 |
SubscribeNotifyExecStressTest
接收客户端订阅在线压测信号请求。服务端为每一个任务分配一个消息队列,并侦听消息队列是否存在待发送的消息,若存在则通过gRPC stream发送给客户端。
rpc SubscribeNotifyExecStressTest(ClientInfo) returns (stream StressTestRankParams) {}
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| ClientInfo | message ClientInfo{ string jobId = 1; string role = 2; } |
ClientInfo.jobId:任务ID。 ClientInfo.role:客户端角色。 |
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| StressTestRankParams | message StressTestRankParams { map<string, StressOpList> stressParam = 1; string jobId = 2; } |
StressTestRankParams.stressParam:key为该节点上要执行压测的global RankID,value为对应的压测操作,0表示“aic”压测;1表示“p2p”压测。 StressTestRankParams.jobId:任务ID。 |
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| stream | gRPC stream |
|
ReplyStressTestResult
客户端向ClusterD返回在线压测结果的接口。
rpc ReplyStressTestResult(StressTestResult) returns (Status) {}
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| StressTestResult | message StressTestResult { string jobId = 1; map<string, StressTestRankResult> stressResult = 2; }message StressTestRankResult { map<string, StressTestOpResult> rankResult = 1; }message StressTestOpResult { string code = 1; string result = 2; } |
StressTestResult.jobId:任务ID。 StressTestResult.stressResult:指令执行的结果。key为执行压测的global rankID;value为执行压测的结果。 StressTestRankResult.rankResult:某张卡执行压测的结果。key为压测的操作,0表示“aic”压测;1表示“p2p”压测。value为对应的结果。 StressTestOpResult.code:压测结果的错误码。
StressTestOpResult.result:压测结果的描述信息。 |
| 参数 | 类型(Protobuf定义) | 说明 |
|---|---|---|
| Status | message Status{ int32 code = 1; string info =2; } |
Status.code:返回码。
|