Skip to content

Commit

Permalink
Fixed but with existing image upload (missing instructions)
Browse files Browse the repository at this point in the history
  • Loading branch information
zagganas committed Jan 31, 2021
1 parent 91c3771 commit 7962402
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 6 deletions.
1 change: 0 additions & 1 deletion controllers/SoftwareController.php
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand Down
8 changes: 5 additions & 3 deletions models/SoftwareUploadExisting.php
Original file line number Diff line number Diff line change
Expand Up @@ -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) . '/';
Expand Down Expand Up @@ -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 ";
Expand Down
3 changes: 2 additions & 1 deletion scheduler_files/existingImageUploader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 + "'"
Expand Down Expand Up @@ -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']=[];
Expand Down
2 changes: 1 addition & 1 deletion views/software/software_upload.php
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
'options' => ['rows' => 4],
'preset' => 'basic'
]);
?>
?>
<br /><br />
<div class="form-group">
<?= Html::submitButton("$submit_icon Submit", ['class' => 'btn btn-primary']) ?>
Expand Down

0 comments on commit 7962402

Please sign in to comment.