yzhernand / VNTRseek

This repository is now deprecated. Please visit the official repository at https://github.com/Benson-Genomics-Lab/VNTRseek. VNTRSeek is a computational pipeline for the detection of VNTRs. It was developed by Yevgeniy Gelfand et al in Dr. Gary Benson's Laboratory for Biocomputing and Informatics at Boston University.
http://orca.bu.edu/vntrseek/
GNU General Public License v3.0
1 stars 2 forks source link

Specifying port for mysql and/or ability to specify a socket. #10

Closed griznog closed 5 years ago

griznog commented 5 years ago

Hi,

I'm trying to run vntrseek with multiple copies on each node in our cluster and across multiple nodes. To do this we are running one mysqld per vntrseek job, which requires using higher level ports. In most places this works as is by specifying

HOST=127.0.0.1:$PORT

in the config, but it breaks the system() calls to the mysql client in vntrseek.pl. To work around this I used these changes:

--- vntrseek-scg.pl 2019-02-23 10:09:42.652371611 -0800
+++ vntrseek.pl 2019-02-23 12:01:06.717409634 -0800
@@ -667,8 +667,13 @@

     write_mysql( $DBNAME, $opts{TMPDIR} );

+    my ($db_host, $db_port) = split(/:/, $opts{HOST});
+    if ($db_port ne "") {
+        $db_port = "--port $db_port";
+    }
+
     my $exstring
-        = "mysql -u $opts{LOGIN} --password=$opts{PASS} -h $opts{HOST} < $opts{TMPDIR}/${DBNAME}.sql";
+        = "mysql -u $opts{LOGIN} --password=$opts{PASS} -h ${db_host} ${db_port} < $opts{TMPDIR}/${DBNAME}.sql";
     system($exstring);

     $exstring = "rm -f $opts{TMPDIR}/${DBNAME}.sql";
@@ -1099,8 +1104,13 @@
         }
     }

+    my ($db_host, $db_port) = split(/:/, $opts{HOST});
+    if ($db_port ne "") {
+        $db_port = "--port $db_port";
+    }
+
     $exstring
-        = "mysql -u $opts{LOGIN} --password=$opts{PASS} -h $opts{HOST} --local-infile=1 $DBNAME < $opts{TMPDIR}/${DBNAME}_2.sql";
+        = "mysql -u $opts{LOGIN} --password=$opts{PASS} -h $db_host $db_port --local-infile=1 $DBNAME < $opts{TMPDIR}/${DBNAME}_2.sql";
     system($exstring);
     if ( $? == -1 ) {
         SetError( $STEP, "command failed: $!", -1 );

Could support for specifying the port be added and, bonus if we could specify a socket and run mysql with skip-network.

griznog

yzhernand commented 5 years ago

Hi griznog,

Thanks for providing the code for your changes. So you just want to be able to specify the port or socket.

I'll add it to our TODO list, but I should note that I do not plan on maintaining the 1.09.x branch of VNTRseek apart from simple bug fixes as we have moved on to using SQLite in our development branch. Using SQLite saved us going over the network as well and brought on a whole set of other advantages that we have found useful.

Best, Yozen

griznog commented 5 years ago

Switching to SQLite is by far the preferred solution, no need to change any older releases. I've installed 1.10 rc2 and am making some test runs with it now. Thanks for the quick response!

Best,

griznog

yzhernand commented 5 years ago

Be warned that there are dragons there! I'm actively testing it and things may go wrong or be wrong!

But if you do encounter any issues, please let me know!