|
|
|
@@ -15,7 +15,7 @@ const ( |
|
|
|
ProcessorTypeNPU = "npu.huawei.com/NPU" |
|
|
|
ProcessorTypeGPU = "nvidia.com/gpu" |
|
|
|
|
|
|
|
CommandPrepareScript = "pwd;cd /tmp;mkdir -p output;mkdir -p code;mkdir -p dataset;wget -q https://git.openi.org.cn/OpenIOSSG/script_for_grampus/archive/master.zip;" + |
|
|
|
CommandPrepareScript = "pwd;cd /cache;mkdir -p output;mkdir -p code;mkdir -p dataset;wget -q https://git.openi.org.cn/OpenIOSSG/script_for_grampus/archive/master.zip;" + |
|
|
|
"unzip -q master.zip;cd script_for_grampus;chmod 777 downloader_for_obs uploader_for_obs downloader_for_minio uploader_for_minio;" |
|
|
|
|
|
|
|
//CommandPrepareScript = "bash;pwd;apt-get -y update;apt-get -y upgrade;apt-get -y install wget;apt-get -y install unzip;" + |
|
|
|
@@ -72,7 +72,9 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error |
|
|
|
ResourceSpecId: req.ResourceSpecId, |
|
|
|
ImageId: req.ImageId, |
|
|
|
ImageUrl: req.ImageUrl, |
|
|
|
ReplicaNum: 0, |
|
|
|
ReplicaNum: 1, |
|
|
|
CenterName: []string{"成都智算"}, |
|
|
|
CenterID: []string{"chengdu"}, |
|
|
|
}, |
|
|
|
}, |
|
|
|
}) |
|
|
|
@@ -111,6 +113,7 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error |
|
|
|
TotalVersionCount: req.TotalVersionCount, |
|
|
|
CreatedUnix: createTime, |
|
|
|
UpdatedUnix: createTime, |
|
|
|
AiCenter: jobResult.JobInfo.Tasks[0].CenterID[0] + "+" + jobResult.JobInfo.Tasks[0].CenterName[0], |
|
|
|
}) |
|
|
|
|
|
|
|
if err != nil { |
|
|
|
@@ -130,8 +133,8 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (err error |
|
|
|
} |
|
|
|
|
|
|
|
func TransTrainJobStatus(status string) string { |
|
|
|
if status == "pending" { |
|
|
|
status = "waiting" |
|
|
|
if status == models.GrampusStatusPending { |
|
|
|
status = models.GrampusStatusWaiting |
|
|
|
} |
|
|
|
|
|
|
|
return strings.ToUpper(status) |
|
|
|
|