[galaxy-dev] Working with setup_ruby_environment tag

2013-10-29 Thread Ira Cooke
Hi Bjoern, 

Changing the title to reflect the proper topic

I see now that the gem executables are installed under $INSTALLDIR/bin so I 
added this to the environment for my protk install. 

That got me to the point where my executable would run ... but now I'm seeing 
that in my env.sh file I don't really have my ruby environment setup properly 
(ie RUBYLIB and GEM_HOME are not set).   This resulted in my tool running but 
it couldn't find my gem.

So I tried adding ruby explicitly as a tool dependency for my downstream tool 
(this seems wrong though ... since it is required by protk ... and if I include 
protk I should get it automatically right?).  After doing this though I was 
getting an error on installing protk about "List index out of range". 

Just to summarize, I can't see how to setup my dependencies properly so that 
the executables installed by protk get run with the correct environment. 

The repository I'm trying to install is

http://testtoolshed.g2.bx.psu.edu/view/iracooke/omssa

I'm sure I've just got muddled somewhere ... but it feels like I'm just messing 
around and getting it wrong.  I'd rather do it in the way you envisioned.

If you could give me some pointers on what I've done wrong it would help alot

Thanks
Ira




On 29/10/2013, at 8:14 PM, Bjoern Gruening  wrote:

> 
>> Ahhh ... Thanks .. I can't believe I missed that. Thanks for spotting it. 
> 
> No problem!
> 
>> I'm not sure I understand enough about how this works to answer your 
>> ruby_home question. Ill play with this more tomorrow and see how things work 
>> with my tools and maybe have more feedback then
> 
> Sure, thanks for working on that!
> 
> Here is the promised trello card: https://trello.com/c/l9ZlGa8R
> Ciao,
> Bjoern
> 
>> Cheers
>> Ira
>> 
>> 
>>> On 29 Oct 2013, at 7:17 pm, Björn Grüning 
>>>  wrote:
>>> 
>>> Hi Ira,
>>> 
>>> as far as I can see you missed the  tag. That results in no log
>>> message at all, since no action type is executed. Galaxy should probably
>>> give an error here. Or better validate that during tool upload. I will
>>> fill a Trello Card for it.
>>> 
>>> The following code snipped worked for me:
>>> 
>>> 
>>> 
>>>   
>>>   
>>>   
>>>   
>>>  >> name="package_ruby_2_0" owner="bgruening"
>>> toolshed="http://testtoolshed.g2.bx.psu.edu";>
>>>   
>>>   
>>>  protk=1.2.6.pre1
>>>   
>>>   
>>>   
>>>   
>>>   Installs version 1.2.5 of the protk rubygem from rubygems.org
>>>   
>>>   
>>> 
>>> 
>>> Keep in mind that the repository tag should be filled. If you have a
>>> actions and action tag it will be filled automatically by the TS during
>>> upload. But better to check :)
>>> 
>>> To populate the RUBY_HOME env var ... do you think its better to set it
>>> via the installation automatically? My idea was to just "require" ruby
>>> in the tool? If you want to set it in your protk definition you need to
>>> use the $ENV[] construct.
>>> 
>>> Cheers,
>>> Bjoern
>>> 
 Hi Bjoern, 
 
 Thanks ... I thought I had to do that in order to make the 
 GALAXY_RUBY_HOME variable available ... nice that it's not necessary.
 
 I've updated the tool on the test toolshed and have rerun my test but 
 unfortunately the problem is still there.
 
 Cheers
 Ira
 
 
> On 29/10/2013, at 10:06 AM, Björn Grüning 
>  wrote:
> 
> Hi Ira,
> 
> I can reproduce that error here, will try to study it tomorrow more
> deeply. For the meantime can you try to remove the following lines?
> 
>   
>  
>  
>  
>   
> 
> It's not necessary.
> Will get back to you tomorrow.
> Bjoern
> 
>> Hi All,
>> 
>> The short version of my problem is that I often seem to find myself in a 
>> situation where my tool gets stuck in the "Installing" phase ... and I 
>> don't know how to get feedback on it to see where it is failing.  What I 
>> guess I'm after is just the stdout of the tool installation .. but since 
>> the tool install never completes I can never see this.  What I usually 
>> do is try to recreate the environment that galaxy sees during tool 
>> install in a normal shell .. and then run it manually .. which sometimes 
>> tells me the problem ... but not always (see below).  
>> 
>> The longer version of my problem is below.  
>> 
>> In my case I am struggling with the following tool 
>> 
>> http://testtoolshed.g2.bx.psu.edu/view/iracooke/package_protk_1_2_5
>> 
>> Which uses the new "setup_ruby_environment" tag ... so the tool should 
>> do the following
>> 
>> (1) Install the dependency .. Ruby 2.0 ... which it does successfully
>> (2) Install my protk rubygem from rubygems.org .. which it gets stuck 
>> doing.
>> 
>> The last few lines from my gala

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-10-29 Thread Ira Cooke
Hi Bjoern, 

Ross just gave me some pointers and I realised that I could just set these 
environment variables myself by doing


$INSTALL_DIR/bin
$INSTALL_DIR/


In my protk tool definition. 

RUBYLIB isn't set ... hopefully this will not be an issue since I guess that's 
mostly just needed for Gem installation/compilation.

This part works now :)

Thanks
Ira


On 30/10/2013, at 3:51 PM, Ira Cooke  wrote:

> Hi Bjoern, 
> 
> Changing the title to reflect the proper topic
> 
> I see now that the gem executables are installed under $INSTALLDIR/bin so I 
> added this to the environment for my protk install. 
> 
> That got me to the point where my executable would run ... but now I'm seeing 
> that in my env.sh file I don't really have my ruby environment setup properly 
> (ie RUBYLIB and GEM_HOME are not set).   This resulted in my tool running but 
> it couldn't find my gem.
> 
> So I tried adding ruby explicitly as a tool dependency for my downstream tool 
> (this seems wrong though ... since it is required by protk ... and if I 
> include protk I should get it automatically right?).  After doing this though 
> I was getting an error on installing protk about "List index out of range". 
> 
> Just to summarize, I can't see how to setup my dependencies properly so that 
> the executables installed by protk get run with the correct environment. 
> 
> The repository I'm trying to install is
> 
> http://testtoolshed.g2.bx.psu.edu/view/iracooke/omssa
> 
> I'm sure I've just got muddled somewhere ... but it feels like I'm just 
> messing around and getting it wrong.  I'd rather do it in the way you 
> envisioned.
> 
> If you could give me some pointers on what I've done wrong it would help alot
> 
> Thanks
> Ira
> 
> 
> 
> 
> On 29/10/2013, at 8:14 PM, Bjoern Gruening  wrote:
> 
>> 
>>> Ahhh ... Thanks .. I can't believe I missed that. Thanks for spotting it. 
>> 
>> No problem!
>> 
>>> I'm not sure I understand enough about how this works to answer your 
>>> ruby_home question. Ill play with this more tomorrow and see how things 
>>> work with my tools and maybe have more feedback then
>> 
>> Sure, thanks for working on that!
>> 
>> Here is the promised trello card: https://trello.com/c/l9ZlGa8R
>> Ciao,
>> Bjoern
>> 
>>> Cheers
>>> Ira
>>> 
>>> 
 On 29 Oct 2013, at 7:17 pm, Björn Grüning 
  wrote:
 
 Hi Ira,
 
 as far as I can see you missed the  tag. That results in no log
 message at all, since no action type is executed. Galaxy should probably
 give an error here. Or better validate that during tool upload. I will
 fill a Trello Card for it.
 
 The following code snipped worked for me:
 
 
 
  
  
  
  
 >>> name="package_ruby_2_0" owner="bgruening"
 toolshed="http://testtoolshed.g2.bx.psu.edu";>
  
  
 protk=1.2.6.pre1
  
  
  
  
  Installs version 1.2.5 of the protk rubygem from rubygems.org
  
  
 
 
 Keep in mind that the repository tag should be filled. If you have a
 actions and action tag it will be filled automatically by the TS during
 upload. But better to check :)
 
 To populate the RUBY_HOME env var ... do you think its better to set it
 via the installation automatically? My idea was to just "require" ruby
 in the tool? If you want to set it in your protk definition you need to
 use the $ENV[] construct.
 
 Cheers,
 Bjoern
 
> Hi Bjoern, 
> 
> Thanks ... I thought I had to do that in order to make the 
> GALAXY_RUBY_HOME variable available ... nice that it's not necessary.
> 
> I've updated the tool on the test toolshed and have rerun my test but 
> unfortunately the problem is still there.
> 
> Cheers
> Ira
> 
> 
>> On 29/10/2013, at 10:06 AM, Björn Grüning 
>>  wrote:
>> 
>> Hi Ira,
>> 
>> I can reproduce that error here, will try to study it tomorrow more
>> deeply. For the meantime can you try to remove the following lines?
>> 
>>  
>> 
>> 
>> 
>>  
>> 
>> It's not necessary.
>> Will get back to you tomorrow.
>> Bjoern
>> 
>>> Hi All,
>>> 
>>> The short version of my problem is that I often seem to find myself in 
>>> a situation where my tool gets stuck in the "Installing" phase ... and 
>>> I don't know how to get feedback on it to see where it is failing.  
>>> What I guess I'm after is just the stdout of the tool installation .. 
>>> but since the tool install never completes I can never see this.  What 
>>> I usually do is try to recreate the environment that galaxy sees during 
>>> tool install in a normal shell .. and then run it manually 

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-10-30 Thread Bjoern Gruening
Hi Ira,

that is strange, because PATH and GEM_HOME should be set automatically
for you.

Please have a look at
https://github.com/bgruening/galaxytools/blob/master/orphan_tool_dependencies/package_ruby2_bioruby_1_4/tool_dependencies.xml
http://testtoolshed.g2.bx.psu.edu/view/bgruening/package_ruby2_bioruby_1_4 

That definition results on my test environment in:

GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
 export GEM_PATH
PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
 export PATH

And the code for that is here:
https://bitbucket.org/galaxy/galaxy-central/src/77d58fdd1c2e0dfde374276209279c5e94b1e4c0/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py?at=default#cl-431

Are you using the latest galaxy central?

Regarding RUBYLIB, I think we need to set it to specify the right ruby
version, because many can be installed in parallel. Some holds for
RUBYHOME or?

I see your point in having it set automatically and came with the
attached patch. Here I need to assume that package_ruby_x_x will have
RUBYLIB and RUBYHOME specified, but I think that is a save assumption.
Nevertheless, we should document it. 

With that new patch you will end up with

RUBYLIB=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/lib/;
 export RUBYLIB
RUBYHOME=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63;
 export RUBYHOME
GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
 export GEM_PATH
PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
 export PATH
PATH=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/bin:$PATH;
 export PATH


Thanks very much for your feedback. I do not have any ruby repository so
I really appropriate your testing!
Bjoern



> Hi Bjoern, 
> 
> Ross just gave me some pointers and I realised that I could just set these 
> environment variables myself by doing
> 
> 
>  name="PATH">$INSTALL_DIR/bin
>  name="GEM_HOME">$INSTALL_DIR/
> 
> 
> In my protk tool definition. 
> 
> RUBYLIB isn't set ... hopefully this will not be an issue since I guess 
> that's mostly just needed for Gem installation/compilation.
> 
> This part works now :)
> 
> Thanks
> Ira
> 
> 
> On 30/10/2013, at 3:51 PM, Ira Cooke  wrote:
> 
> > Hi Bjoern, 
> > 
> > Changing the title to reflect the proper topic
> > 
> > I see now that the gem executables are installed under $INSTALLDIR/bin so I 
> > added this to the environment for my protk install. 
> > 
> > That got me to the point where my executable would run ... but now I'm 
> > seeing that in my env.sh file I don't really have my ruby environment setup 
> > properly (ie RUBYLIB and GEM_HOME are not set).   This resulted in my tool 
> > running but it couldn't find my gem.
> > 
> > So I tried adding ruby explicitly as a tool dependency for my downstream 
> > tool (this seems wrong though ... since it is required by protk ... and if 
> > I include protk I should get it automatically right?).  After doing this 
> > though I was getting an error on installing protk about "List index out of 
> > range". 
> > 
> > Just to summarize, I can't see how to setup my dependencies properly so 
> > that the executables installed by protk get run with the correct 
> > environment. 
> > 
> > The repository I'm trying to install is
> > 
> > http://testtoolshed.g2.bx.psu.edu/view/iracooke/omssa
> > 
> > I'm sure I've just got muddled somewhere ... but it feels like I'm just 
> > messing around and getting it wrong.  I'd rather do it in the way you 
> > envisioned.
> > 
> > If you could give me some pointers on what I've done wrong it would help 
> > alot
> > 
> > Thanks
> > Ira
> > 
> > 
> > 
> > 
> > On 29/10/2013, at 8:14 PM, Bjoern Gruening  
> > wrote:
> > 
> >> 
> >>> Ahhh ... Thanks .. I can't believe I missed that. Thanks for spotting it. 
> >> 
> >> No problem!
> >> 
> >>> I'm not sure I understand enough about how this works to answer your 
> >>> ruby_home question. Ill play with this more tomorrow and see how things 
> >>> work with my tools and maybe have more feedback then
> >> 
> >> Sure, thanks for working on that!
> >> 
> >> Here is the promised trello card: https://trello.com/c/l9ZlGa8R
> >> Ciao,
> >> Bjoern
> >> 
> >>> Cheers
> >>> Ira
> >>> 
> >>> 
>  On 29 Oct 2013, at 7:17 pm, Björn Grüning 
>   wrote:
>  
>  Hi Ira,
>  
>  as far as I can see you missed the  tag. That results in no log
>  message at all, since no action type is executed. Galaxy should probably
>  give an error here. Or better validate th

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-10-30 Thread Björn Grüning
Hi Ira,

> Hi Bjoern, 
> 
> I'll test, 

thanks!

> but I wonder if the problem is that GEM_PATH is set instead of GEM_HOME.   I 
> think GEM_HOME needs to be set also.  It's  zoo of environment variables out 
> there :)!!

Mh according to 

http://stackoverflow.com/questions/11277227/whats-the-difference-between-gem-home-and-gem-path

GEM_PATH will contain GEM_HOME and GEM_HOME is used for installation,
and I use it for installation of GEMs, See the code. If you think
GEM_HOME is necessary to export I will do so. Otherwise I would not
export to much.

Thanks!
Bjoern

> Also ... I think GEM_HOME should be set using "set_to" not  "prepend_to" ... 
> 
> I am using the latest galaxy-central (default branch).
> 
> Cheers
> Ira
> 
> 
> 
> 
> On 31 Oct 2013, at 12:33 am, Bjoern Gruening  
> wrote:
> 
> > Hi Ira,
> > 
> > that is strange, because PATH and GEM_HOME should be set automatically
> > for you.
> > 
> > Please have a look at
> > https://github.com/bgruening/galaxytools/blob/master/orphan_tool_dependencies/package_ruby2_bioruby_1_4/tool_dependencies.xml
> > http://testtoolshed.g2.bx.psu.edu/view/bgruening/package_ruby2_bioruby_1_4 
> > 
> > That definition results on my test environment in:
> > 
> > GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
> >  export GEM_PATH
> > PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
> >  export PATH
> > 
> > And the code for that is here:
> > https://bitbucket.org/galaxy/galaxy-central/src/77d58fdd1c2e0dfde374276209279c5e94b1e4c0/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py?at=default#cl-431
> > 
> > Are you using the latest galaxy central?
> > 
> > Regarding RUBYLIB, I think we need to set it to specify the right ruby
> > version, because many can be installed in parallel. Some holds for
> > RUBYHOME or?
> > 
> > I see your point in having it set automatically and came with the
> > attached patch. Here I need to assume that package_ruby_x_x will have
> > RUBYLIB and RUBYHOME specified, but I think that is a save assumption.
> > Nevertheless, we should document it. 
> > 
> > With that new patch you will end up with
> > 
> > RUBYLIB=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/lib/;
> >  export RUBYLIB
> > RUBYHOME=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63;
> >  export RUBYHOME
> > GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
> >  export GEM_PATH
> > PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
> >  export PATH
> > PATH=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/bin:$PATH;
> >  export PATH
> > 
> > 
> > Thanks very much for your feedback. I do not have any ruby repository so
> > I really appropriate your testing!
> > Bjoern
> > 
> > 
> > 
> >> Hi Bjoern, 
> >> 
> >> Ross just gave me some pointers and I realised that I could just set these 
> >> environment variables myself by doing
> >> 
> >> 
> >> >> name="PATH">$INSTALL_DIR/bin
> >> >> name="GEM_HOME">$INSTALL_DIR/
> >>
> >> 
> >> In my protk tool definition. 
> >> 
> >> RUBYLIB isn't set ... hopefully this will not be an issue since I guess 
> >> that's mostly just needed for Gem installation/compilation.
> >> 
> >> This part works now :)
> >> 
> >> Thanks
> >> Ira
> >> 
> >> 
> >> On 30/10/2013, at 3:51 PM, Ira Cooke  wrote:
> >> 
> >>> Hi Bjoern, 
> >>> 
> >>> Changing the title to reflect the proper topic
> >>> 
> >>> I see now that the gem executables are installed under $INSTALLDIR/bin so 
> >>> I added this to the environment for my protk install. 
> >>> 
> >>> That got me to the point where my executable would run ... but now I'm 
> >>> seeing that in my env.sh file I don't really have my ruby environment 
> >>> setup properly (ie RUBYLIB and GEM_HOME are not set).   This resulted in 
> >>> my tool running but it couldn't find my gem.
> >>> 
> >>> So I tried adding ruby explicitly as a tool dependency for my downstream 
> >>> tool (this seems wrong though ... since it is required by protk ... and 
> >>> if I include protk I should get it automatically right?).  After doing 
> >>> this though I was getting an error on installing protk about "List index 
> >>> out of range". 
> >>> 
> >>> Just to summarize, I can't see how to setup my dependencies properly so 
> >>> that the executables installed by protk get run with the correct 
> >>> environment. 
> >>> 
> >>> The repository I'm trying to install is
> >>> 
> >>> http://testtoolshed.g2.bx.psu.edu/view/iracooke/omssa
> >>> 
> >>> I'm sure I've just got muddled somewhere ...

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-10-30 Thread Ira Cooke
Hi Bjoern, 

I'll test, but I wonder if the problem is that GEM_PATH is set instead of 
GEM_HOME.   I think GEM_HOME needs to be set also.  It's  zoo of environment 
variables out there :)!!

Also ... I think GEM_HOME should be set using "set_to" not  "prepend_to" ... 

I am using the latest galaxy-central (default branch).

Cheers
Ira




On 31 Oct 2013, at 12:33 am, Bjoern Gruening  wrote:

> Hi Ira,
> 
> that is strange, because PATH and GEM_HOME should be set automatically
> for you.
> 
> Please have a look at
> https://github.com/bgruening/galaxytools/blob/master/orphan_tool_dependencies/package_ruby2_bioruby_1_4/tool_dependencies.xml
> http://testtoolshed.g2.bx.psu.edu/view/bgruening/package_ruby2_bioruby_1_4 
> 
> That definition results on my test environment in:
> 
> GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
>  export GEM_PATH
> PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
>  export PATH
> 
> And the code for that is here:
> https://bitbucket.org/galaxy/galaxy-central/src/77d58fdd1c2e0dfde374276209279c5e94b1e4c0/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py?at=default#cl-431
> 
> Are you using the latest galaxy central?
> 
> Regarding RUBYLIB, I think we need to set it to specify the right ruby
> version, because many can be installed in parallel. Some holds for
> RUBYHOME or?
> 
> I see your point in having it set automatically and came with the
> attached patch. Here I need to assume that package_ruby_x_x will have
> RUBYLIB and RUBYHOME specified, but I think that is a save assumption.
> Nevertheless, we should document it. 
> 
> With that new patch you will end up with
> 
> RUBYLIB=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/lib/;
>  export RUBYLIB
> RUBYHOME=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63;
>  export RUBYHOME
> GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
>  export GEM_PATH
> PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
>  export PATH
> PATH=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/bin:$PATH;
>  export PATH
> 
> 
> Thanks very much for your feedback. I do not have any ruby repository so
> I really appropriate your testing!
> Bjoern
> 
> 
> 
>> Hi Bjoern, 
>> 
>> Ross just gave me some pointers and I realised that I could just set these 
>> environment variables myself by doing
>> 
>> 
>>> name="PATH">$INSTALL_DIR/bin
>>> name="GEM_HOME">$INSTALL_DIR/
>>
>> 
>> In my protk tool definition. 
>> 
>> RUBYLIB isn't set ... hopefully this will not be an issue since I guess 
>> that's mostly just needed for Gem installation/compilation.
>> 
>> This part works now :)
>> 
>> Thanks
>> Ira
>> 
>> 
>> On 30/10/2013, at 3:51 PM, Ira Cooke  wrote:
>> 
>>> Hi Bjoern, 
>>> 
>>> Changing the title to reflect the proper topic
>>> 
>>> I see now that the gem executables are installed under $INSTALLDIR/bin so I 
>>> added this to the environment for my protk install. 
>>> 
>>> That got me to the point where my executable would run ... but now I'm 
>>> seeing that in my env.sh file I don't really have my ruby environment setup 
>>> properly (ie RUBYLIB and GEM_HOME are not set).   This resulted in my tool 
>>> running but it couldn't find my gem.
>>> 
>>> So I tried adding ruby explicitly as a tool dependency for my downstream 
>>> tool (this seems wrong though ... since it is required by protk ... and if 
>>> I include protk I should get it automatically right?).  After doing this 
>>> though I was getting an error on installing protk about "List index out of 
>>> range". 
>>> 
>>> Just to summarize, I can't see how to setup my dependencies properly so 
>>> that the executables installed by protk get run with the correct 
>>> environment. 
>>> 
>>> The repository I'm trying to install is
>>> 
>>> http://testtoolshed.g2.bx.psu.edu/view/iracooke/omssa
>>> 
>>> I'm sure I've just got muddled somewhere ... but it feels like I'm just 
>>> messing around and getting it wrong.  I'd rather do it in the way you 
>>> envisioned.
>>> 
>>> If you could give me some pointers on what I've done wrong it would help 
>>> alot
>>> 
>>> Thanks
>>> Ira
>>> 
>>> 
>>> 
>>> 
>>> On 29/10/2013, at 8:14 PM, Bjoern Gruening  
>>> wrote:
>>> 
 
> Ahhh ... Thanks .. I can't believe I missed that. Thanks for spotting it. 
 
 No problem!
 
> I'm not sure I understand enough about how this works to answer your 
> ruby_home question. Ill play with this more tomorrow and see how things 
> work with my too

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-10-30 Thread Ira Cooke
Hi Bjoern, 

I've just done some more testing of my tool with a fresh install and a fresh 
checkout of galaxy.  After install of this tool

http://testtoolshed.g2.bx.psu.edu/view/iracooke/package_protk_1_2_5

I have an env.sh that looks like

GEM_PATH=/home/vagrant/tool_dependencies/protk/1.2.5/iracooke/package_protk_1_2_5/1100ac98dfd2:$GEM_PATH;
 export GEM_PATH
PATH=/home/vagrant/tool_dependencies/protk/1.2.5/iracooke/package_protk_1_2_5/1100ac98dfd2/bin:$PATH;
 export PATH

Which seems to be enough for me to run the executables in my gem.So I must 
be wrong about GEM_HOME needing to be set ... sorry for the false alarm there.

The thing that I'm now having trouble with is that all the other 
set_environment tags in my tool definition are ignored.

In my tool_dependencies.xml I have


$INSTALL_DIR/bin
$INSTALL_DIR/
FROMPATH



Admittedly some of that stuff is redundant ( I now realise ) ... but other 
stuff (eg PROTK_BLAST_ROOT ) is important ... but it gets ignored.

Is this intended?  Seems like I should be able to use the set_environment 
action as well as the setup_ruby_environment action in the same tool definition?

Hope you can clarify.

Thanks

Ira





On 31/10/2013, at 6:06 AM, Ira Cooke  wrote:

> Hi Bjoern, 
> 
> I saw the same SO post ... but it says that GEM_PATH can be multiple paths 
> but one of them should be GEM_HOME.  Under your system (I think) GEM_HOME 
> remains unset?
> 
> Anyway ... I'll test again to double check that this is required for my tool 
> to work.
> 
> Cheers
> Ira
> 
> 
> On 31 Oct 2013, at 6:00 am, Björn Grüning 
>  wrote:
> 
>> Hi Ira,
>> 
>>> Hi Bjoern, 
>>> 
>>> I'll test, 
>> 
>> thanks!
>> 
>>> but I wonder if the problem is that GEM_PATH is set instead of GEM_HOME.   
>>> I think GEM_HOME needs to be set also.  It's  zoo of environment variables 
>>> out there :)!!
>> 
>> Mh according to 
>> 
>> http://stackoverflow.com/questions/11277227/whats-the-difference-between-gem-home-and-gem-path
>> 
>> GEM_PATH will contain GEM_HOME and GEM_HOME is used for installation,
>> and I use it for installation of GEMs, See the code. If you think
>> GEM_HOME is necessary to export I will do so. Otherwise I would not
>> export to much.
>> 
>> Thanks!
>> Bjoern
>> 
>>> Also ... I think GEM_HOME should be set using "set_to" not  "prepend_to" 
>>> ... 
>>> 
>>> I am using the latest galaxy-central (default branch).
>>> 
>>> Cheers
>>> Ira
>>> 
>>> 
>>> 
>>> 
>>> On 31 Oct 2013, at 12:33 am, Bjoern Gruening  
>>> wrote:
>>> 
 Hi Ira,
 
 that is strange, because PATH and GEM_HOME should be set automatically
 for you.
 
 Please have a look at
 https://github.com/bgruening/galaxytools/blob/master/orphan_tool_dependencies/package_ruby2_bioruby_1_4/tool_dependencies.xml
 http://testtoolshed.g2.bx.psu.edu/view/bgruening/package_ruby2_bioruby_1_4 
 
 That definition results on my test environment in:
 
 GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
  export GEM_PATH
 PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
  export PATH
 
 And the code for that is here:
 https://bitbucket.org/galaxy/galaxy-central/src/77d58fdd1c2e0dfde374276209279c5e94b1e4c0/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py?at=default#cl-431
 
 Are you using the latest galaxy central?
 
 Regarding RUBYLIB, I think we need to set it to specify the right ruby
 version, because many can be installed in parallel. Some holds for
 RUBYHOME or?
 
 I see your point in having it set automatically and came with the
 attached patch. Here I need to assume that package_ruby_x_x will have
 RUBYLIB and RUBYHOME specified, but I think that is a save assumption.
 Nevertheless, we should document it. 
 
 With that new patch you will end up with
 
 RUBYLIB=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/lib/;
  export RUBYLIB
 RUBYHOME=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63;
  export RUBYHOME
 GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
  export GEM_PATH
 PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
  export PATH
 PATH=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/bin:$PATH;
  export PATH
 
 
 Thanks very much for your feedback. I do not have any ruby repository so
 I really appropriate your testing!
 Bjoern
 
 
 
>>>

Re: [galaxy-dev] Working with setup_ruby_environment tag

2013-11-01 Thread Björn Grüning
Hi Ira,

> Hi Bjoern, 
> 
> I've just done some more testing of my tool with a fresh install and a fresh 
> checkout of galaxy.  After install of this tool
> 
> http://testtoolshed.g2.bx.psu.edu/view/iracooke/package_protk_1_2_5
> 
> I have an env.sh that looks like
> 
> GEM_PATH=/home/vagrant/tool_dependencies/protk/1.2.5/iracooke/package_protk_1_2_5/1100ac98dfd2:$GEM_PATH;
>  export GEM_PATH
> PATH=/home/vagrant/tool_dependencies/protk/1.2.5/iracooke/package_protk_1_2_5/1100ac98dfd2/bin:$PATH;
>  export PATH
> 
> Which seems to be enough for me to run the executables in my gem.So I 
> must be wrong about GEM_HOME needing to be set ... sorry for the false alarm 
> there.
> 
> The thing that I'm now having trouble with is that all the other 
> set_environment tags in my tool definition are ignored.
> 
> In my tool_dependencies.xml I have
> 
> 
>  name="PATH">$INSTALL_DIR/bin
>  name="GEM_HOME">$INSTALL_DIR/
>  name="PROTK_BLAST_ROOT">FROMPATH
> 
> 
> 
> Admittedly some of that stuff is redundant ( I now realise ) ... but other 
> stuff (eg PROTK_BLAST_ROOT ) is important ... but it gets ignored.
> 
> Is this intended?  Seems like I should be able to use the set_environment 
> action as well as the setup_ruby_environment action in the same tool 
> definition?

It's implemented in:

https://bitbucket.org/galaxy/galaxy-central/pull-request/248/add-more-env-vars-to-the-standard-envsh/diff

If my last PR will be merged, you should be able to do that.
Thanks for spotting that use-case.

Cheers,
Bjoern

> Hope you can clarify.
> 
> Thanks
> 
> Ira
> 
> 
> 
> 
> 
> On 31/10/2013, at 6:06 AM, Ira Cooke  wrote:
> 
> > Hi Bjoern, 
> > 
> > I saw the same SO post ... but it says that GEM_PATH can be multiple paths 
> > but one of them should be GEM_HOME.  Under your system (I think) GEM_HOME 
> > remains unset?
> > 
> > Anyway ... I'll test again to double check that this is required for my 
> > tool to work.
> > 
> > Cheers
> > Ira
> > 
> > 
> > On 31 Oct 2013, at 6:00 am, Björn Grüning 
> >  wrote:
> > 
> >> Hi Ira,
> >> 
> >>> Hi Bjoern, 
> >>> 
> >>> I'll test, 
> >> 
> >> thanks!
> >> 
> >>> but I wonder if the problem is that GEM_PATH is set instead of GEM_HOME.  
> >>>  I think GEM_HOME needs to be set also.  It's  zoo of environment 
> >>> variables out there :)!!
> >> 
> >> Mh according to 
> >> 
> >> http://stackoverflow.com/questions/11277227/whats-the-difference-between-gem-home-and-gem-path
> >> 
> >> GEM_PATH will contain GEM_HOME and GEM_HOME is used for installation,
> >> and I use it for installation of GEMs, See the code. If you think
> >> GEM_HOME is necessary to export I will do so. Otherwise I would not
> >> export to much.
> >> 
> >> Thanks!
> >> Bjoern
> >> 
> >>> Also ... I think GEM_HOME should be set using "set_to" not  "prepend_to" 
> >>> ... 
> >>> 
> >>> I am using the latest galaxy-central (default branch).
> >>> 
> >>> Cheers
> >>> Ira
> >>> 
> >>> 
> >>> 
> >>> 
> >>> On 31 Oct 2013, at 12:33 am, Bjoern Gruening  
> >>> wrote:
> >>> 
>  Hi Ira,
>  
>  that is strange, because PATH and GEM_HOME should be set automatically
>  for you.
>  
>  Please have a look at
>  https://github.com/bgruening/galaxytools/blob/master/orphan_tool_dependencies/package_ruby2_bioruby_1_4/tool_dependencies.xml
>  http://testtoolshed.g2.bx.psu.edu/view/bgruening/package_ruby2_bioruby_1_4
>   
>  
>  That definition results on my test environment in:
>  
>  GEM_PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1:$GEM_PATH;
>   export GEM_PATH
>  PATH=/home/gruening/projects/code/galaxy-central/tool_deps/bioruby/1.4/bgruening/package_ruby2_bioruby_1_4/0a30368657b1/bin:$PATH;
>   export PATH
>  
>  And the code for that is here:
>  https://bitbucket.org/galaxy/galaxy-central/src/77d58fdd1c2e0dfde374276209279c5e94b1e4c0/lib/tool_shed/galaxy_install/tool_dependencies/fabric_util.py?at=default#cl-431
>  
>  Are you using the latest galaxy central?
>  
>  Regarding RUBYLIB, I think we need to set it to specify the right ruby
>  version, because many can be installed in parallel. Some holds for
>  RUBYHOME or?
>  
>  I see your point in having it set automatically and came with the
>  attached patch. Here I need to assume that package_ruby_x_x will have
>  RUBYLIB and RUBYHOME specified, but I think that is a save assumption.
>  Nevertheless, we should document it. 
>  
>  With that new patch you will end up with
>  
>  RUBYLIB=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63/lib/;
>   export RUBYLIB
>  RUBYHOME=/home/gruening/projects/code/galaxy-central/tool_deps/ruby/2.0/bgruening/package_ruby_2_0/a0494c6e1c63;
>   export RUBYHOME
>  GEM_PATH=/home/gruenin