|
|
|
@@ -18,7 +18,6 @@ import ( |
|
|
|
|
|
|
|
const ( |
|
|
|
Command = `pip3 install jupyterlab==2.2.5 -i https://pypi.tuna.tsinghua.edu.cn/simple;service ssh stop;jupyter lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --LabApp.token="" --LabApp.allow_origin="self https://cloudbrain.pcl.ac.cn"` |
|
|
|
//Command = `service ssh stop;jupyter lab --no-browser --ip=0.0.0.0 --allow-root --notebook-dir="/code" --port=80 --LabApp.token="" --LabApp.allow_origin="self https://cloudbrain.pcl.ac.cn"` |
|
|
|
//CommandBenchmark = `echo "start benchmark";python /code/test.py;echo "end benchmark"` |
|
|
|
CommandBenchmark = `echo "start benchmark";cd /benchmark && bash run_bk.sh;echo "end benchmark"` |
|
|
|
CodeMountPath = "/code" |
|
|
|
@@ -30,6 +29,8 @@ const ( |
|
|
|
Snn4imagenetMountPath = "/snn4imagenet" |
|
|
|
BrainScoreMountPath = "/brainscore" |
|
|
|
TaskInfoName = "/taskInfo" |
|
|
|
Snn4imagenetCommand = `/opt/conda/bin/python /snn4imagenet/testSNN_script.py --modelname '%s' --modelpath '/dataset' --modeldescription '%s'` |
|
|
|
BrainScoreCommand = `bash /brainscore/brainscore_test_par4shSrcipt.sh -b '%s' -n '%s' -p '/dataset' -d '%s'` |
|
|
|
|
|
|
|
SubTaskName = "task1" |
|
|
|
|
|
|
|
@@ -348,7 +349,7 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, |
|
|
|
} |
|
|
|
stringId := strconv.FormatInt(task.ID, 10) |
|
|
|
|
|
|
|
if string(models.JobTypeBenchmark) == jobType { |
|
|
|
if IsBenchmarkJob(jobType) { |
|
|
|
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, stringId, displayJobName, models.ActionCreateBenchMarkTask) |
|
|
|
} else if string(models.JobTypeTrain) == jobType { |
|
|
|
notification.NotifyOtherTask(ctx.User, ctx.Repo.Repository, jobID, displayJobName, models.ActionCreateGPUTrainTask) |
|
|
|
@@ -359,6 +360,10 @@ func GenerateTask(ctx *context.Context, displayJobName, jobName, image, command, |
|
|
|
return nil |
|
|
|
} |
|
|
|
|
|
|
|
func IsBenchmarkJob(jobType string) bool { |
|
|
|
return string(models.JobTypeBenchmark) == jobType || string(models.JobTypeBrainScore) == jobType || string(models.JobTypeSnn4imagenet) == jobType |
|
|
|
} |
|
|
|
|
|
|
|
func RestartTask(ctx *context.Context, task *models.Cloudbrain, newID *string) error { |
|
|
|
dataActualPath := setting.Attachment.Minio.RealPath + |
|
|
|
setting.Attachment.Minio.Bucket + "/" + |
|
|
|
|