|
|
@@ -71,10 +71,6 @@ const ( |
|
|
|
SortByCreateTime = "create_time" |
|
|
|
ConfigTypeCustom = "custom" |
|
|
|
TotalVersionCount = 1 |
|
|
|
|
|
|
|
ShareAddr = "192.168.0.30:/" |
|
|
|
MountPath = "/cache/sfs" |
|
|
|
NasType = "nfs" |
|
|
|
) |
|
|
|
|
|
|
|
var ( |
|
|
@@ -285,7 +281,7 @@ func GenerateTask(ctx *context.Context, jobName, uuid, description, flavor strin |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, description, imageId string, spec *models.Specification, bootFile string,autoStopDurationInMs int64) (string, error) { |
|
|
|
func GenerateNotebook2(ctx *context.Context, displayJobName, jobName, uuid, description, imageId string, spec *models.Specification, bootFile string, autoStopDurationInMs int64) (string, error) { |
|
|
|
if poolInfos == nil { |
|
|
|
json.Unmarshal([]byte(setting.PoolInfos), &poolInfos) |
|
|
|
} |
|
|
@@ -383,9 +379,9 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str |
|
|
|
Parameter: req.Parameters, |
|
|
|
UserImageUrl: req.UserImageUrl, |
|
|
|
UserCommand: req.UserCommand, |
|
|
|
ShareAddr: ShareAddr, |
|
|
|
MountPath: MountPath, |
|
|
|
NasType: NasType, |
|
|
|
ShareAddr: setting.ModelArtsShareAddr, |
|
|
|
MountPath: setting.ModelArtsMountPath, |
|
|
|
NasType: setting.ModelArtsNasType, |
|
|
|
}, |
|
|
|
}) |
|
|
|
} else { |
|
|
@@ -406,9 +402,9 @@ func GenerateTrainJob(ctx *context.Context, req *GenerateTrainJobReq) (jobId str |
|
|
|
Code: req.Spec.SourceSpecId, |
|
|
|
}, |
|
|
|
Parameter: req.Parameters, |
|
|
|
ShareAddr: ShareAddr, |
|
|
|
MountPath: MountPath, |
|
|
|
NasType: NasType, |
|
|
|
ShareAddr: setting.ModelArtsShareAddr, |
|
|
|
MountPath: setting.ModelArtsMountPath, |
|
|
|
NasType: setting.ModelArtsNasType, |
|
|
|
}, |
|
|
|
}) |
|
|
|
} |
|
|
@@ -527,9 +523,9 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, job |
|
|
|
PreVersionId: req.PreVersionId, |
|
|
|
UserImageUrl: req.UserImageUrl, |
|
|
|
UserCommand: req.UserCommand, |
|
|
|
ShareAddr: ShareAddr, |
|
|
|
MountPath: MountPath, |
|
|
|
NasType: NasType, |
|
|
|
ShareAddr: setting.ModelArtsShareAddr, |
|
|
|
MountPath: setting.ModelArtsMountPath, |
|
|
|
NasType: setting.ModelArtsNasType, |
|
|
|
}, |
|
|
|
}, jobId) |
|
|
|
} else { |
|
|
@@ -549,9 +545,9 @@ func GenerateTrainJobVersion(ctx *context.Context, req *GenerateTrainJobReq, job |
|
|
|
}, |
|
|
|
Parameter: req.Parameters, |
|
|
|
PreVersionId: req.PreVersionId, |
|
|
|
ShareAddr: ShareAddr, |
|
|
|
MountPath: MountPath, |
|
|
|
NasType: NasType, |
|
|
|
ShareAddr: setting.ModelArtsShareAddr, |
|
|
|
MountPath: setting.ModelArtsMountPath, |
|
|
|
NasType: setting.ModelArtsNasType, |
|
|
|
}, |
|
|
|
}, jobId) |
|
|
|
} |
|
|
@@ -988,14 +984,14 @@ func getJupyterBaseUrl(url string) string { |
|
|
|
} |
|
|
|
|
|
|
|
func getCookiesAndCsrf(jupyterUrl string) ([]*http.Cookie, string) { |
|
|
|
log.Info("jupyter url:"+jupyterUrl) |
|
|
|
log.Info("jupyter url:" + jupyterUrl) |
|
|
|
var cookies []*http.Cookie |
|
|
|
const retryTimes = 10 |
|
|
|
for i := 0; i < retryTimes; i++ { |
|
|
|
res, err := http.Get(jupyterUrl) |
|
|
|
if err != nil { |
|
|
|
log.Error("browser jupyterUrl failed.",err) |
|
|
|
if i==retryTimes-1{ |
|
|
|
log.Error("browser jupyterUrl failed.", err) |
|
|
|
if i == retryTimes-1 { |
|
|
|
return cookies, "" |
|
|
|
} |
|
|
|
|
|
|
|