From 7962402ee1a10b1548c05f4cb3229336494bf549 Mon Sep 17 00:00:00 2001 From: Ubuntu Date: Sun, 31 Jan 2021 22:14:18 +0200 Subject: [PATCH] Fixed but with existing image upload (missing instructions) --- controllers/SoftwareController.php | 1 - models/SoftwareUploadExisting.php | 8 +++++--- scheduler_files/existingImageUploader.py | 3 ++- views/software/software_upload.php | 2 +- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/controllers/SoftwareController.php b/controllers/SoftwareController.php index 2d4ebf6..b2433a5 100644 --- a/controllers/SoftwareController.php +++ b/controllers/SoftwareController.php @@ -883,7 +883,6 @@ public function actionEditSoftware($name, $version) 'public'=>'Everyone', 'private' => 'Only me',]; - $model->dois=array_filter(explode('|', $model->dois)); if ($model->load(Yii::$app->request->post()) && $model->validate()) diff --git a/models/SoftwareUploadExisting.php b/models/SoftwareUploadExisting.php index 930afc3..d251df0 100644 --- a/models/SoftwareUploadExisting.php +++ b/models/SoftwareUploadExisting.php @@ -123,6 +123,7 @@ public function upload() $original=$this->quotes($original); $this->covid19=($this->covid19=='1') ? "'t'" : "'f'"; $this->biotools=$this->quotes($this->biotools); + $this->instructions=$this->quotes($this->instructions); //add dois string in a file and pass it on to python $dataFolder=Yii::$app->params['tmpImagePath'] . $username . '/' . str_replace(' ','-',$this->name) . '/' . str_replace(' ','-',$this->version) . '/'; @@ -167,9 +168,10 @@ public function upload() $mpi=($this->mpi=='1') ? $this->quotes('t') : $this->quotes('f'); $username=$this->quotes($username); - $arguments=[$this->name, $this->version, $this->image, $cwlFileName, - $username, $this->visibility, $this->imountpoint, $this->omountpoint, $this->commandRetrieval, - $this->description, $this->biotools, $doiFile, $mpi, $workingdir,$original,$dockerhub,$this->covid19 ]; + $arguments=[ + $this->name, $this->version, $this->image, $cwlFileName, + $username, $this->visibility, $this->imountpoint, $this->omountpoint, $this->commandRetrieval, + $this->description, $this->biotools, $doiFile, $mpi, $workingdir,$original,$dockerhub,$this->covid19, $this->instructions]; // $command="sudo -u user /data/www/schema_test/scheduler_files/imageUploader.py "; $command="sudo -u ". Yii::$app->params['systemUser'] . " " . Yii::$app->params['scriptsFolder'] . "existingImageUploader.py "; diff --git a/scheduler_files/existingImageUploader.py b/scheduler_files/existingImageUploader.py index edd6d54..b46aa41 100755 --- a/scheduler_files/existingImageUploader.py +++ b/scheduler_files/existingImageUploader.py @@ -24,6 +24,7 @@ original=sys.argv[15] docker_or_local=sys.argv[16] covid19=sys.argv[17] +instructions=sys.argv[18] def quoteEnclose(string): return "'" + string + "'" @@ -56,7 +57,7 @@ def quoteEnclose(string): workingDir='/' uf.imageStoreAndClassify(softName,softVersion, image,script,user,visibility, - workingDir,imountPoint,omountPoint,description,cwlPath,biotools,doiFile,mpi,original,docker_or_local,covid19) + workingDir,imountPoint,omountPoint,description,cwlPath,biotools,doiFile,mpi,original,docker_or_local,covid19,instructions) if 'inputs' not in cwlContent: cwlContent['inputs']=[]; diff --git a/views/software/software_upload.php b/views/software/software_upload.php index e604c24..fe20a33 100644 --- a/views/software/software_upload.php +++ b/views/software/software_upload.php @@ -92,7 +92,7 @@ 'options' => ['rows' => 4], 'preset' => 'basic' ]); - ?> + ?>

'btn btn-primary']) ?>