diff --git a/desc/hpc/pcm-hpc.api b/desc/hpc/pcm-hpc.api index 32155d6c..fed84746 100644 --- a/desc/hpc/pcm-hpc.api +++ b/desc/hpc/pcm-hpc.api @@ -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"` } ) diff --git a/internal/scheduler/service/hpc/slurm.go b/internal/scheduler/service/hpc/slurm.go index f31768e1..2aca3010 100644 --- a/internal/scheduler/service/hpc/slurm.go +++ b/internal/scheduler/service/hpc/slurm.go @@ -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 { diff --git a/internal/types/types.go b/internal/types/types.go index b3786d26..9680aad2 100644 --- a/internal/types/types.go +++ b/internal/types/types.go @@ -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 {