Browse Source

fix hpc

Signed-off-by: jagger <cossjie@foxmail.com>
pull/464/head
jagger 7 months ago
parent
commit
e08af3984a
3 changed files with 11 additions and 16 deletions
  1. +1
    -0
      desc/hpc/pcm-hpc.api
  2. +1
    -8
      internal/scheduler/service/hpc/slurm.go
  3. +9
    -8
      internal/types/types.go

+ 1
- 0
desc/hpc/pcm-hpc.api View File

@@ -18,6 +18,7 @@ type (
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
ScriptContent string `json:"scriptContent,optional"`
}
)



+ 1
- 8
internal/scheduler/service/hpc/slurm.go View File

@@ -76,14 +76,7 @@ func (c *ParticipantHpc) SubmitTask(ctx context.Context, req types.CommitHpcTask
resp := types.CommitHpcTaskResp{}
httpClient := resty.New().R()
_, err := httpClient.SetHeader("Content-Type", "application/json").
SetBody(map[string]interface{}{
"name": req.Name, // 应用名称: BWA/lammps
"backend": req.Backend, // 后端类型:slurm/sugonac
"app": req.App, // 超算应用: bwa/lammps
"operateType": req.OperateType, // 应用内操作类型: bwa:构建索引/对比序列
"parameters": req.Parameters, // 通用参数
"customParams": req.CustomParams, // 各平台自定义参数
}).
SetBody(req).
SetResult(&resp).
Post(reqUrl)
if err != nil {


+ 9
- 8
internal/types/types.go View File

@@ -1307,14 +1307,15 @@ type ResourceCostRecord struct {
}

type CommitHpcTaskReq struct {
Name string `json:"name"`
Backend string `json:"backend"`
ClusterId string `json:"clusterId"`
App string `json:"app"`
Description string `json:"description,optional"`
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
Name string `json:"name"`
Backend string `json:"backend"`
ClusterId string `json:"clusterId"`
App string `json:"app"`
Description string `json:"description,optional"`
OperateType string `json:"operateType,optional"`
Parameters map[string]string `json:"parameters"`
CustomParams map[string]string `json:"customParams"`
ScriptContent string `json:"scriptContent,optional"`
}

type CommitHpcTaskResp struct {


Loading…
Cancel
Save