|
|
|
@@ -5,8 +5,10 @@ import ( |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/api/internal/svc" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/models" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-coordinator/pkg/utils/timeutils" |
|
|
|
"gitlink.org.cn/jcce-pcm/pcm-participant-octopus/octopus" |
|
|
|
"strings" |
|
|
|
"time" |
|
|
|
) |
|
|
|
|
|
|
|
type OctopusLink struct { |
|
|
|
@@ -20,7 +22,7 @@ type OctopusLink struct { |
|
|
|
const ( |
|
|
|
IMG_NAME_PREFIX = "oct_" |
|
|
|
IMG_VERSION_PREFIX = "version_" |
|
|
|
TASK_NAME_PREFIX = "trainJob_" |
|
|
|
TASK_NAME_PREFIX = "trainJob" |
|
|
|
RESOURCE_POOL = "common-pool" |
|
|
|
) |
|
|
|
|
|
|
|
@@ -120,11 +122,13 @@ func (o *OctopusLink) SubmitTask(imageId string, cmd string, params []string, re |
|
|
|
prms = append(prms, &p) |
|
|
|
} |
|
|
|
|
|
|
|
dateStr := timeutils.UnixTimeToString(time.Now().Unix()) |
|
|
|
|
|
|
|
req := &octopus.CreateTrainJobReq{ |
|
|
|
Platform: o.participant.Name, |
|
|
|
Params: &octopus.CreateTrainJobParam{ |
|
|
|
ImageId: imageId, |
|
|
|
Name: TASK_NAME_PREFIX + utils.RandomString(7), |
|
|
|
Name: TASK_NAME_PREFIX + UNDERSCORE + utils.RandomString(7) + UNDERSCORE + dateStr, |
|
|
|
ResourcePool: RESOURCE_POOL, |
|
|
|
Config: []*octopus.Config{ |
|
|
|
{ |
|
|
|
|