[galaxy-dev] need help on extra servers

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

[galaxy-dev] need help on extra servers

Davide Cittaro
Hi again, I'm trying to implement what has been showed at the devcon, the extra servers stuff...
There's only a slide about that (in the scalable galaxy talk), but seems should be pretty easy by adding 

[server:ROLE_ID]
port = XXXX



where role is... web or runner? 
Is this the correct syntax: 

[server:web_0]
port = 8081
[server:web_1]
port = 8082

[server:runner_0]
port = 8100
[server:runner_1]
port = 8101
[server:runner_2]
port = 8102
[server:runner_3]
port = 8103
[server:runner_4]
port = 8104

Anyway, added those to the universe file, netstat says there are not additional ports opened...

Thanks

d
/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Nate Coraor (nate@bx.psu.edu)
Davide Cittaro wrote:
> Hi again, I'm trying to implement what has been showed at the devcon,
> the extra servers stuff...

Hi!  Great meeting you at the conference.

> There's only a slide about that (in the scalable galaxy talk), but seems
> should be pretty easy by adding
>
> [server:ROLE_ID]
> port = XXXX
>
>
>
> where role is... web or runner?
> Is this the correct syntax:
>
> [server:web_0]
> port = 8081
> [server:web_1]
> port = 8082
>
> [server:runner_0]
> port = 8100
> [server:runner_1]
> port = 8101
> [server:runner_2]
> port = 8102
> [server:runner_3]
> port = 8103
> [server:runner_4]
> port = 8104
>
> Anyway, added those to the universe file, netstat says there are not
> additional ports opened...

Those were slimmed down examples for slide-friendliness.  You'll need to
make two copies of your config file.  I do this as:

% cp universe_wsgi.ini universe_wsgi.webapp.ini
% mv universe_wsgi.ini universe_wsgi.runner.ini

Then edit universe_wsgi.webapp.ini, and add as many web servers as you need:

[server:web0]

use = egg:Paste#http
port = 9980
host = 127.0.0.1
use_threadpool = true
threadpool_workers = 10

[server:web1]

use = egg:Paste#http
port = 9981
host = 127.0.0.1
use_threadpool = true
threadpool_workers = 10

These should completely replace the existing [server:main] section.
Then set the following in the [app:main] section:

enable_job_running = False

Save and exit.




Next, open universe_wsgi.runner.ini and set the server name and port:

[server:runner0]

use = egg:Paste#http
port = 9880
host = 127.0.0.1
use_threadpool = true
threadpool_workers = 5

Then under [app:main], set:

enable_job_running = True
track_jobs_in_database = True

Save and exit.



Now that it's configured, you need to start and stop each server.  This
is best done with a script, but the individual commands for the examples
shown above will look like this:

python ./scripts/paster.py serve universe_wsgi.webapp.ini
--server-name=test_web0 --pid-file=test_web0.pid
--log-file=test_web0.log --daemon

python ./scripts/paster.py serve universe_wsgi.webapp.ini
--server-name=test_web1 --pid-file=test_web1.pid
--log-file=test_web1.log --daemon

python ./scripts/paster.py serve universe_wsgi.runner.ini
--server-name=test_runner0 --pid-file=test_runner0.pid
--log-file=test_runner0.log --daemon

To make this easier, I just committed a 'multiprocess.sh' in Galaxy's
contrib/ subdirectory that should be copied, modified for the number of
servers and names you used, and run like 'run.sh'.

That's the short version, longer documentation in the wiki is forthcoming.

--nate

>
> Thanks
>
> d
> /*
> Davide Cittaro
>
> Cogentech - Consortium for Genomic Technologies
> via adamello, 16
> 20139 Milano
> Italy
>
> tel.: +39(02)574303007
> e-mail: [hidden email]
> <mailto:[hidden email]>
> */
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> galaxy-dev mailing list
> [hidden email]
> http://lists.bx.psu.edu/listinfo/galaxy-dev

_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Davide Cittaro
Hi Nate, 

Those were slimmed down examples for slide-friendliness.  You'll need to make two copies of your config file.  I do this as:

% cp universe_wsgi.ini universe_wsgi.webapp.ini
% mv universe_wsgi.ini universe_wsgi.runner.ini


Doh! I forgot you told me that during the last session... 


To make this easier, I just committed a 'multiprocess.sh' in Galaxy's contrib/ subdirectory that should be copied, modified for the number of servers and names you used, and run like 'run.sh'.

That's the short version, longer documentation in the wiki is forthcoming.

Great, thanks, trying it ASAP.

d

/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Davide Cittaro

On May 21, 2010, at 9:40 AM, Davide Cittaro wrote:

Great, thanks, trying it ASAP.


Doesn't work as it looks for universe_wgsi.ini while initialization in lib/galaxy/eggs/__init__.py:

class GalaxyConfig( object ):
    config_file = os.path.join( galaxy_dir, "universe_wsgi.ini" )
    always_conditional = ( 'GeneTrack', 'pysam' )
    def __init__( self ):
        self.config = ConfigParser.ConfigParser()
        if self.config.read( GalaxyConfig.config_file ) == []:
            raise Exception( "error: unable to read Galaxy config from %s" % GalaxyConfig.config_file )

I'm now looking where and how the config file is passed to galaxy from command line...

d

d

/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/



_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev

/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Davide Cittaro

On May 21, 2010, at 10:13 AM, Davide Cittaro wrote:
I'm now looking where and how the config file is passed to galaxy from command line...


It works after this:

$ hg diff lib/galaxy/eggs/__init__.py
diff -r 48432330228e lib/galaxy/eggs/__init__.py
--- a/lib/galaxy/eggs/__init__.py       Fri May 14 10:37:36 2010 -0400
+++ b/lib/galaxy/eggs/__init__.py       Fri May 21 10:30:59 2010 +0200
@@ -288,7 +288,7 @@
             raise EggNotFetchable( missing )
 
 class GalaxyConfig( object ):
-    config_file = os.path.join( galaxy_dir, "universe_wsgi.ini" )
+    config_file = os.path.join( galaxy_dir, sys.argv[2] )
     always_conditional = ( 'GeneTrack', 'pysam' )
     def __init__( self ):
         self.config = ConfigParser.ConfigParser()

Of course, this assumes that the config file is always the second argument (which is seems mandatory to me...)


d

/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Davide Cittaro

On May 22, 2010, at 3:28 AM, Edward Kirton wrote:

Hi Davide,

I'm trying to get this working too but applying your patch gives me an error


Nevermind, I think galaxy team should work on this :-)
Even if you had the patch working you may get some errors when a tool tries to read the config file. Apparently this is defined somewhere else too... I've been trying to import some data from UCSC and this is what I've got (after my patch):

Traceback (most recent call last):
  File "/data/galaxy_dist/tools/data_source/data_source.py", line 6, in 
    from galaxy.util import gzip_magic
  File "/data/galaxy_dist/lib/galaxy/util/__init__.py", line 21, in 
    pkg_resources.require( 'docutils' )
  File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 337, in require
    c = Crate()
  File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 197, in __init__
    self.galaxy_config = GalaxyConfig()
  File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 299, in __init__
    raise Exception( "error: unable to read Galaxy config from %s" % GalaxyConfig.config_file )
Exception: error: unable to read Galaxy config from /data/galaxy_dist/0

As you can see the config file name is passed here as "0", that means that the tool is reading it somewhere where is not defined (or it should be defined as universe_wsgi.ini)... 
I'll ask the audience :-)

d



Traceback (most recent call last):
  File "./scripts/check_eggs.py", line 20, in <module>
    from galaxy.eggs import Crate
  File "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line 290, in <module>
    class GalaxyConfig( object ):
  File "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line 291, in GalaxyConfig
    config_file = os.path.join( galaxy_dir, sys.argv[2] )
IndexError: list index out of range
Some eggs are out of date, attempting to fetch...
Traceback (most recent call last):
  File "./scripts/fetch_eggs.py", line 21, in <module>
    from galaxy.eggs import Crate, EggNotFetchable
  File "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line 290, in <module>
    class GalaxyConfig( object ):
  File "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line 291, in GalaxyConfig
    config_file = os.path.join( galaxy_dir, sys.argv[2] )
IndexError: list index out of range
Fetch failed.

I've got IT coming by to help me next week; I'll be sure to pass-along anything I learn.

Cheers!
Ed


On Fri, May 21, 2010 at 1:32 AM, Davide Cittaro <[hidden email]> wrote:

On May 21, 2010, at 10:13 AM, Davide Cittaro wrote:
I'm now looking where and how the config file is passed to galaxy from command line...


It works after this:

$ hg diff lib/galaxy/eggs/__init__.py
diff -r 48432330228e lib/galaxy/eggs/__init__.py
--- a/lib/galaxy/eggs/__init__.py       Fri May 14 10:37:36 2010 -0400
+++ b/lib/galaxy/eggs/__init__.py       Fri May 21 10:30:59 2010 +0200
@@ -288,7 +288,7 @@
             raise EggNotFetchable( missing )
 
 class GalaxyConfig( object ):
-    config_file = os.path.join( galaxy_dir, "universe_wsgi.ini" )
+    config_file = os.path.join( galaxy_dir, sys.argv[2] )
     always_conditional = ( 'GeneTrack', 'pysam' )
     def __init__( self ):
         self.config = ConfigParser.ConfigParser()

Of course, this assumes that the config file is always the second argument (which is seems mandatory to me...)


d

/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
e-mail: [hidden email]
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev



/*
Davide Cittaro

Cogentech - Consortium for Genomic Technologies
via adamello, 16
20139 Milano
Italy

tel.: +39(02)574303007
*/




_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev
Reply | Threaded
Open this post in threaded view
|

Re: [galaxy-dev] need help on extra servers

Nate Coraor (nate@bx.psu.edu)
Davide Cittaro wrote:

> Nevermind, I think galaxy team should work on this :-)
> Even if you had the patch working you may get some errors when a tool
> tries to read the config file. Apparently this is defined somewhere else
> too... I've been trying to import some data from UCSC and this is what
> I've got (after my patch):

As a simple solution, just copy from universe_wsgi.ini to the two config
files, as opposed to my original instruction to move the file.  The
universe_wsgi.ini file won't be consulted for actual config values, but
it'll prevent this error from occuring.

> Traceback (most recent call last):
>   File "/data/galaxy_dist/tools/data_source/data_source.py", line 6, in
>     from galaxy.util import gzip_magic
>   File "/data/galaxy_dist/lib/galaxy/util/__init__.py", line 21, in
>     pkg_resources.require( 'docutils' )
>   File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 337, in require
>     c = Crate()
>   File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 197, in
> __init__
>     self.galaxy_config = GalaxyConfig()
>   File "/data/galaxy_dist/lib/galaxy/eggs/__init__.py", line 299, in
> __init__
>     raise Exception( "error: unable to read Galaxy config from %s" %
> GalaxyConfig.config_file )
> Exception: error: unable to read Galaxy config from /data/galaxy_dist/0
>
> As you can see the config file name is passed here as "0", that means
> that the tool is reading it somewhere where is not defined (or it should
> be defined as universe_wsgi.ini)...
> I'll ask the audience :-)
>
> d
>
>
>
>> Traceback (most recent call last):
>>   File "./scripts/check_eggs.py", line 20, in <module>
>>     from galaxy.eggs import Crate
>>   File
>> "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line
>> 290, in <module>
>>     class GalaxyConfig( object ):
>>   File
>> "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line
>> 291, in GalaxyConfig
>>     config_file = os.path.join( galaxy_dir, sys.argv[2] )
>> IndexError: list index out of range
>> Some eggs are out of date, attempting to fetch...
>> Traceback (most recent call last):
>>   File "./scripts/fetch_eggs.py", line 21, in <module>
>>     from galaxy.eggs import Crate, EggNotFetchable
>>   File
>> "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line
>> 290, in <module>
>>     class GalaxyConfig( object ):
>>   File
>> "/house/tooldirs/galaxy/galaxy-jgi/lib/galaxy/eggs/__init__.py", line
>> 291, in GalaxyConfig
>>     config_file = os.path.join( galaxy_dir, sys.argv[2] )
>> IndexError: list index out of range
>> Fetch failed.
>>
>> I've got IT coming by to help me next week; I'll be sure to pass-along
>> anything I learn.
>>
>> Cheers!
>> Ed
>>
>>
>> On Fri, May 21, 2010 at 1:32 AM, Davide Cittaro
>> <[hidden email]
>> <mailto:[hidden email]>> wrote:
>>
>>
>>     On May 21, 2010, at 10:13 AM, Davide Cittaro wrote:
>>>     I'm now looking where and how the config file is passed to galaxy
>>>     from command line...
>>>
>>
>>     It works after this:
>>
>>     $ hg diff lib/galaxy/eggs/__init__.py
>>     diff -r 48432330228e lib/galaxy/eggs/__init__.py
>>     --- a/lib/galaxy/eggs/__init__.py       Fri May 14 10:37:36 2010 -0400
>>     +++ b/lib/galaxy/eggs/__init__.py       Fri May 21 10:30:59 2010 +0200
>>     @@ -288,7 +288,7 @@
>>                  raise EggNotFetchable( missing )
>>      
>>      class GalaxyConfig( object ):
>>     -    config_file = os.path.join( galaxy_dir, "universe_wsgi.ini" )
>>     +    config_file = os.path.join( galaxy_dir, sys.argv[2] )
>>          always_conditional = ( 'GeneTrack', 'pysam' )
>>          def __init__( self ):
>>              self.config = ConfigParser.ConfigParser()
>>
>>     Of course, this assumes that the config file is always the second
>>     argument (which is seems mandatory to me...)
>>
>>
>>     d
>>
>>     /*
>>     Davide Cittaro
>>
>>     Cogentech - Consortium for Genomic Technologies
>>     via adamello, 16
>>     20139 Milano
>>     Italy
>>
>>     tel.: +39(02)574303007
>>     e-mail: [hidden email]
>>     <mailto:[hidden email]>
>>     */
>>
>>
>>
>>
>>     _______________________________________________
>>     galaxy-dev mailing list
>>     [hidden email] <mailto:[hidden email]>
>>     http://lists.bx.psu.edu/listinfo/galaxy-dev
>>
>>
>
> /*
> Davide Cittaro
>
> Cogentech - Consortium for Genomic Technologies
> via adamello, 16
> 20139 Milano
> Italy
>
> tel.: +39(02)574303007
> e-mail: [hidden email]
> <mailto:[hidden email]>
> */
>
>
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> galaxy-dev mailing list
> [hidden email]
> http://lists.bx.psu.edu/listinfo/galaxy-dev

_______________________________________________
galaxy-dev mailing list
[hidden email]
http://lists.bx.psu.edu/listinfo/galaxy-dev