From 8d2bb8d79584bc20976740b0483491649ea3f312 Mon Sep 17 00:00:00 2001 From: nilab Date: Sat, 19 Sep 2015 04:37:46 +0200 Subject: [PATCH 1/5] test --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 test.txt diff --git a/test.txt b/test.txt new file mode 100644 index 0000000..e69de29 From c0d9c418242ed81498fb2f32704efd7065186a7e Mon Sep 17 00:00:00 2001 From: nilab Date: Sat, 19 Sep 2015 04:43:23 +0200 Subject: [PATCH 2/5] removed uncessary test.txt --- test.txt | 0 1 file changed, 0 insertions(+), 0 deletions(-) delete mode 100644 test.txt diff --git a/test.txt b/test.txt deleted file mode 100644 index e69de29..0000000 From 9b6f43ade2770e413888daea6e306c2c54a38233 Mon Sep 17 00:00:00 2001 From: nilab Date: Wed, 23 Sep 2015 00:46:12 +0200 Subject: [PATCH 3/5] changing the name of the plugin from Neurocloud to NeuroBox in the web interface of owncloud --- appinfo/app.php | 4 ++-- appinfo/info.xml | 6 +++--- templates/settings.php | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/appinfo/app.php b/appinfo/app.php index 2304e18..6902b79 100644 --- a/appinfo/app.php +++ b/appinfo/app.php @@ -13,7 +13,7 @@ 'order' => 74, 'href' => OC_Helper::linkTo('neurocloud', 'index.php'), 'icon' => OC_Helper::imagePath('neurocloud', 'neurocloud.png'), - 'name' => 'Neurocloud')); + 'name' => 'NeuroBox')); /** * register the classpath @@ -60,4 +60,4 @@ OC_FileProxy::register(new NC_FileProxy()); -?> \ No newline at end of file +?> diff --git a/appinfo/info.xml b/appinfo/info.xml index 18d16c7..4f11430 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -1,11 +1,11 @@ neurocloud - Neurocloud - Neurocloud app description here + NeuroBox + NeurocBox app description here 1.0.0 - Neurocloud developers + NeuroBox developers 4.5 diff --git a/templates/settings.php b/templates/settings.php index 5376bcf..b87d8bd 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -22,7 +22,7 @@ function get_public_key() {
- Neurocloud users public keys + NeuroBox users public keys Date: Sun, 27 Sep 2015 21:34:04 +0200 Subject: [PATCH 4/5] changing name from neurocloud to neurobox --- index.php | 2 +- lib/common.php | 2 +- settings.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/index.php b/index.php index 0e789db..d39e468 100644 --- a/index.php +++ b/index.php @@ -12,7 +12,7 @@ OC_Util::addStyle('neurocloud', "nc"); OC_App::setActiveNavigationEntry( 'neurocloud_index'); -$tmpl = new OC_Template( 'neurocloud', 'main', 'user'); +$tmpl = new OC_Template('neurocloud', 'main', 'user'); $message = ""; $action = "launch"; diff --git a/lib/common.php b/lib/common.php index 1ae47b1..3a74fee 100644 --- a/lib/common.php +++ b/lib/common.php @@ -181,7 +181,7 @@ function get_used_space_remote() { */ function get_user_jobs($user) { include "neurocloud/config.inc.php"; - $basedir = sprintf($NC_CONFIG["local_exec_dir"],$user); + $basedir = sprintf($NC_CONFIG["local_exec_dir"], $user); $jobs = array(); if (is_dir($basedir)) { $dh = opendir($basedir); diff --git a/settings.php b/settings.php index 1429f73..52ad3ea 100644 --- a/settings.php +++ b/settings.php @@ -5,7 +5,7 @@ OC_Util::addStyle('neurocloud', "nc"); OC_Util::addScript("neurocloud", "admin"); -$tmpl = new OC_Template( 'neurocloud', 'settings'); +$tmpl = new OC_Template('neurocloud', 'settings'); return $tmpl->fetchPage(); From fa2ca21e94deb737507aad991cb81bb265ca3372 Mon Sep 17 00:00:00 2001 From: nilab Date: Tue, 29 Sep 2015 01:43:34 +0200 Subject: [PATCH 5/5] changing comment on files from # to // where appropriate --- ajax/checkrunnable.php | 2 +- ajax/getoutput.php | 2 +- ajax/inplace_update.php | 8 ++++---- ajax/job_info_row.php | 6 +++--- ajax/updateCache.php | 4 ++-- appinfo/info.xml | 4 ++-- execute.php | 24 ++++++++++++------------ lib/common.php | 20 ++++++++++---------- lib/hooks.php | 2 +- templates/main.php | 4 ++-- templates/settings.php | 2 +- 11 files changed, 39 insertions(+), 39 deletions(-) diff --git a/ajax/checkrunnable.php b/ajax/checkrunnable.php index 7e1606f..2b23243 100644 --- a/ajax/checkrunnable.php +++ b/ajax/checkrunnable.php @@ -13,7 +13,7 @@ $study=$_POST["study"]; -#error_log(print_r($_SESSION["nc_sync_paths"],true)); +//#error_log(print_r($_SESSION["nc_sync_paths"],true)); if (OC_Neurocloud::is_study_runnable($study)) { echo "1"; diff --git a/ajax/getoutput.php b/ajax/getoutput.php index c27bef5..9c5605a 100644 --- a/ajax/getoutput.php +++ b/ajax/getoutput.php @@ -17,7 +17,7 @@ /* * max size of output file, to avoid reading a very big output and clogging the network */ -$MAX_SIZE = 1024 * 512; # "512k of memory should be enough for everyone" +$MAX_SIZE = 1024 * 512; //# "512k of memory should be enough for everyone" $content = ""; if (OC_Filesystem::is_file($filename) && OC_Filesystem::is_readable($filename)) { if (OC_Filesystem::filesize($filename) > $MAX_SIZE) { diff --git a/ajax/inplace_update.php b/ajax/inplace_update.php index 1294ca4..7a6b4c3 100644 --- a/ajax/inplace_update.php +++ b/ajax/inplace_update.php @@ -27,11 +27,11 @@ $prefix = "/tmp/owncloud"; } -# backup current installation +//# backup current installation echo "Backup of current version in $datadir\n"; exec("tar czf " . $datadir . "/owncloud_bkp$(date +%Y%m%d).tar.gz $root"); -# download latest version +//# download latest version echo "Downloading last version\n"; $curl = curl_init($url); $fp = fopen("/tmp/owncloud-latest.tar.bz2", "w"); @@ -42,7 +42,7 @@ curl_close($curl); fclose($fp); -# TODO: check version MD5 +//# TODO: check version MD5 $md5_try = file_get_contents($url . ".md5"); if (strlen($md5_try) > 32) { $md5_try = substr($md5_try, 0, 32); @@ -56,7 +56,7 @@ } -# unpack latest version +//# unpack latest version echo "Unpacking last version\n"; exec("mkdir $datadir/owncloud_latest; tar -C $datadir/owncloud_latest -xjf /tmp/owncloud-latest.tar.bz2"); diff --git a/ajax/job_info_row.php b/ajax/job_info_row.php index 9a834bf..46d1603 100644 --- a/ajax/job_info_row.php +++ b/ajax/job_info_row.php @@ -20,7 +20,7 @@ $rowid = $_GET['rowid']; -# check if we have to print the elements (we do not print them if this file is called from a AJAX call +//# check if we have to print the elements (we do not print them if this file is called from a AJAX call if (isset($_GET["print_tr"])) { $print_tr = $_GET["print_tr"]; } else { @@ -80,7 +80,7 @@ $killjs = OC_Helper::linkTo("neurocloud", "ajax/kill_job.php", array("study" => $file, "jobid" => $job, "redirect" => 1)); $refreshstatusjs = "javascript:refresh_job_status('" . $rowid . "','" . $file . "','" . $job . "','" . $outputid . "')"; $showjobinfojs = "javascript:show_output('" . $outputid . "','". get_job_info_file($file, $job) . "', true)"; -#$queueinfojs = "javascript:show_queue_info('" . $outputid . "','". $jobinfo['qsub_jobname'] . "', true)"; +//#$queueinfojs = "javascript:show_queue_info('" . $outputid . "','". $jobinfo['qsub_jobname'] . "', true)"; $deletejs = "javascript:delete_results('" . $rowid . "','" . $file . "','" . $job . "')"; $script = isset($jobinfo["script"]) ? basename($jobinfo["script"]) : false; @@ -171,4 +171,4 @@ \ No newline at end of file +?> diff --git a/ajax/updateCache.php b/ajax/updateCache.php index 89e64b8..e7cdce7 100644 --- a/ajax/updateCache.php +++ b/ajax/updateCache.php @@ -9,10 +9,10 @@ */ -# first, clear the "fast" cache, to make sure that missing DB items are inserted/updated +//# first, clear the "fast" cache, to make sure that missing DB items are inserted/updated OC_Cache::clear(); -# then scan the filesystem +//# then scan the filesystem OC_FileCache::scan(""); echo 'true'; diff --git a/appinfo/info.xml b/appinfo/info.xml index 4f11430..91122da 100644 --- a/appinfo/info.xml +++ b/appinfo/info.xml @@ -2,10 +2,10 @@ neurocloud NeuroBox - NeurocBox app description here + Neurobox app description here 1.0.0 - NeuroBox developers + Neurobox developers 4.5 diff --git a/execute.php b/execute.php index 2b744de..5fc4067 100644 --- a/execute.php +++ b/execute.php @@ -11,8 +11,8 @@ require_once 'lib/common.php'; -# TODO: SUBSTITUTE WITH REAL CONFIG VALUE !!! -#OC_Config::setValue("nc_exec_env_root" ,"/tmp/neurocloud"); +//# TODO: SUBSTITUTE WITH REAL CONFIG VALUE !!! +//#OC_Config::setValue("nc_exec_env_root" ,"/tmp/neurocloud"); function create_job_id($study_name, $script_name) { @@ -57,12 +57,12 @@ function create_execution_env($study_name, $script_name) { OC_Filesystem::mkdir("$study_name/results/$jobid"); - # le dir /data e /results sono link simbolici alle vere directory del caso di studio + //# le dir /data e /results sono link simbolici alle vere directory del caso di studio mkdir($job_dir . "/pipeline"); symlink($datadir, $job_dir . "/data"); symlink($resultsdir, $job_dir . "/results"); - # creo il file in cui verrà rediretto lo standard output + //# creo il file in cui verrà rediretto lo standard output $date = date("Y-m-d H:i:s"); OC_Filesystem::file_put_contents(get_job_output_file($study_name, $jobid), "Standard output for job $jobid, run at $date\n"); @@ -70,7 +70,7 @@ function create_execution_env($study_name, $script_name) { save_job_info($study_name, $jobid, $jobinfo); - # copia gli script del caso di studio nella pipeline + //# copia gli script del caso di studio nella pipeline copy_dir($pipelinedir, $job_dir . "/pipeline"); return $jobid; @@ -87,7 +87,7 @@ function execute_script_local($workdir, $cmd, $study, $jobid) { if (chdir($workdir)) { $outfile = get_absolute_path(get_job_output_file($study, $jobid)); - # things that are needed to proc_open, see http://it2.php.net/manual/en/function.proc-open.php + //# things that are needed to proc_open, see http://it2.php.net/manual/en/function.proc-open.php $pipes = 0; $descriptors = array( 0 => array('pipe', 'r'), @@ -98,7 +98,7 @@ function execute_script_local($workdir, $cmd, $study, $jobid) { $env["HOME"] = get_local_exec_dir(OC_User::getUser()); $env["PATH"] = $_SERVER["PATH"]; - # use a UNIX command to get the current user name + //# use a UNIX command to get the current user name $env["USER"] = exec("whoami"); chmod($cmd, 0755); @@ -155,7 +155,7 @@ function execute_script_remote($study, $jobid, $workdir, $rerun, $cmd, $args = " $jobid_qsub = 'j' . str_replace(".","_", $jobid); $orig_cmd = $cmd; - # check if the command is a python script + //# check if the command is a python script if (is_python_script($cmd) !== false) { // prepend the python script with our command @@ -177,7 +177,7 @@ function execute_script_remote($study, $jobid, $workdir, $rerun, $cmd, $args = " $cmd = $NC_CONFIG["python-bin"] . " " . $cmd; } elseif (strpos($cmd, ".sh") !== false) { - #$cmd = "qsub -cwd -l mf=1.4G -N $jobid_qsub -sync y -o results/nc_stdout.log -e results/nc_stdout.log " . $cmd; + //#$cmd = "qsub -cwd -l mf=1.4G -N $jobid_qsub -sync y -o results/nc_stdout.log -e results/nc_stdout.log " . $cmd; $cmd = "/bin/bash " . $cmd; $args = $jobid_qsub; } @@ -218,7 +218,7 @@ function execute_script_remote($study, $jobid, $workdir, $rerun, $cmd, $args = " $space = get_used_space_remote(); if (is_array($space) && (int)$space['percent'] > (int)$NC_CONFIG['minimum_exec_space']) { - # Redirect to neurocloud app index , showing an error message + //# Redirect to neurocloud app index , showing an error message $link = OC_Helper::linkTo("neurocloud", "index.php", array("error" => "Cannot execute script, low free space in remote server.
Contact administration or delete old jobs")); header("Location: " . $link); exit(); @@ -248,7 +248,7 @@ function execute_script_remote($study, $jobid, $workdir, $rerun, $cmd, $args = " $exec_dir = get_job_exec_dir($job_id); $pid = execute_script_local($exec_dir, "pipeline" . DIRECTORY_SEPARATOR . $script, $study, $job_id); } - # Redirect to neurocloud app index , showing an info (or error) message + //# Redirect to neurocloud app index , showing an info (or error) message if ($pid) { $link = OC_Helper::linkTo("neurocloud", "index.php", array("jobid" => $job_id, "pid" => $pid, "action" => "launch")); } else { @@ -256,7 +256,7 @@ function execute_script_remote($study, $jobid, $workdir, $rerun, $cmd, $args = " } header("Location: " . $link); } else { - # Redirect to neurocloud app index , showing an error message + //# Redirect to neurocloud app index , showing an error message $link = OC_Helper::linkTo("neurocloud", "index.php", array("error" => "Sync is in progress, cannot execute script")); header("Location: " . $link); } diff --git a/lib/common.php b/lib/common.php index 3a74fee..7f39188 100644 --- a/lib/common.php +++ b/lib/common.php @@ -77,8 +77,8 @@ function create_ssh_command() { $host = $NC_CONFIG["remote_host"]; $key = get_private_key_file($user); - # The option BatchMode=yes is used to not asking for password - # StrictHostKeyChecking=no is used to not ask to include the host in .ssh/known_hosts file + //# The option BatchMode=yes is used to not asking for password + //# StrictHostKeyChecking=no is used to not ask to include the host in .ssh/known_hosts file return "ssh -n -i $key -o BatchMode=yes -o StrictHostKeyChecking=no $user@$host "; } @@ -156,8 +156,8 @@ function get_used_space_remote() { include "neurocloud/config.inc.php"; $cmd = create_ssh_command() . " df -h " . $NC_CONFIG['remote_mount']; $lastrow = exec($cmd); - # example of lastrow : - # korempba:/nilab0 2.0T 28G 1.9T 2% /nilab0 + //# example of lastrow : + //# korempba:/nilab0 2.0T 28G 1.9T 2% /nilab0 if (is_string($lastrow)) { $spl = preg_split("/\s+/", $lastrow); @@ -166,7 +166,7 @@ function get_used_space_remote() { $ret["total"] = $spl[1]; $ret["used"] = $spl[2]; $ret["free"] = $spl[3]; - $ret["percent"] = substr($spl[4],0,-1); # omit the % character + $ret["percent"] = substr($spl[4],0,-1); //# omit the % character return $ret; } @@ -410,25 +410,25 @@ function get_queue_info($qsub_jobname) { */ if ($xml->queue_info->job_list->count() == 0 && $xml->job_info->job_list->count() == 0) { - #$return_string = "No running SGE jobs in queue for job_id " . $qsub_jobname; + //#$return_string = "No running SGE jobs in queue for job_id " . $qsub_jobname; return $return_string; } else { - #$return_string = "Running SGE jobs:\n"; + //#$return_string = "Running SGE jobs:\n"; foreach ($xml->queue_info->job_list as $job) { // check if the SGE job name contains the generated job id for this neurocloud job if (strpos($job->JB_name, $qsub_jobname)) { - #$return_string = $return_string . $job->JB_name . "\n"; + //#$return_string = $return_string . $job->JB_name . "\n"; $return_string[1] = $return_string[1] + 1; } } - #$return_string = $return_string . "\nQueued SGE jobs:\n"; + //#$return_string = $return_string . "\nQueued SGE jobs:\n"; foreach ($xml->job_info->job_list as $job) { // check if the SGE job name contains the generated job id for this neurocloud job if (strpos($job->JB_name, $qsub_jobname)) { - #$return_string = $return_string . $job->JB_name . "\n"; + //#$return_string = $return_string . $job->JB_name . "\n"; $return_string[0] = $return_string[0] + 1; } } diff --git a/lib/hooks.php b/lib/hooks.php index c1545a7..4f0b1c2 100644 --- a/lib/hooks.php +++ b/lib/hooks.php @@ -242,7 +242,7 @@ public static function is_study_runnable($study) { $array = PersistentMap::get_paths(); foreach(array_keys($array) as $key) { if (strpos($key, $study) > 0) { - #$syncing = self::$SYNC_STATUS[$key]; + //#$syncing = self::$SYNC_STATUS[$key]; $syncing = $array[$key]; if ($syncing) { return false; diff --git a/templates/main.php b/templates/main.php index f68cb00..d92520f 100644 --- a/templates/main.php +++ b/templates/main.php @@ -72,7 +72,7 @@ @@ -90,7 +90,7 @@ Run   diff --git a/templates/settings.php b/templates/settings.php index b87d8bd..ed82a81 100644 --- a/templates/settings.php +++ b/templates/settings.php @@ -24,7 +24,7 @@ function get_public_key() {
NeuroBox users public keys