|
|
|
@@ -208,7 +208,27 @@ func (o *OpenI) SubmitTask(ctx context.Context, imageId string, cmd string, envs |
|
|
|
branchName = codePaths[1] |
|
|
|
bootFile = codePaths[2] |
|
|
|
|
|
|
|
//params := "{\"parameter\":[{\"label\":\"a\",\"value\":\"1\"},{\"label\":\"b\",\"value\":\"2\"}]}" |
|
|
|
// params |
|
|
|
var parameters struct { |
|
|
|
Parameter []struct { |
|
|
|
Label string `json:"label"` |
|
|
|
Value string `json:"value"` |
|
|
|
} `json:"parameter"` |
|
|
|
} |
|
|
|
|
|
|
|
for _, param := range params { |
|
|
|
s := strings.Split(param, COMMA) |
|
|
|
st := struct { |
|
|
|
Label string `json:"label"` |
|
|
|
Value string `json:"value"` |
|
|
|
}{ |
|
|
|
Label: s[0], |
|
|
|
Value: s[1], |
|
|
|
} |
|
|
|
parameters.Parameter = append(parameters.Parameter, st) |
|
|
|
} |
|
|
|
|
|
|
|
paramStr, _ := json.Marshal(parameters) |
|
|
|
|
|
|
|
// choose imageId and imageUrl |
|
|
|
imgId, imgUrl, err := swapImageIdAndImageUrl(imageId) |
|
|
|
@@ -227,6 +247,7 @@ func (o *OpenI) SubmitTask(ctx context.Context, imageId string, cmd string, envs |
|
|
|
ImageId: imgId, |
|
|
|
ImageUrl: imgUrl, |
|
|
|
DatasetUuidStr: datasetsId, |
|
|
|
Params: string(paramStr), |
|
|
|
BootFile: bootFile, |
|
|
|
HasInternet: 2, // 0 不限制;1 不需要互联网;2 需要互联网 |
|
|
|
WorkServerNumber: 1, // 运行节点数 |
|
|
|
|