Re: [galaxy-dev] Upstart script to manage a multi instance load balanced installation

2013-08-14 Thread Seth Sims
Dear Nate,

Actually... no, galaxy's home was set to a non-existent directory so
the working directory was being changed to the root of the file system.
However the script still seemed to work. I changed the script to use su -
galaxy -c like you show anyway. There seem to be no significant change to
the log files with the change. But i'm going to use su -c it as you show
anyway.

Sincerely,
Seth Sims


On Wed, Aug 14, 2013 at 1:03 PM, Nate Coraor n...@bx.psu.edu wrote:

 On Aug 9, 2013, at 11:53 AM, Seth Sims wrote:

  Dear Nate,
 
  Adding su - galaxy as the first line of the pre-start script seems
 to work reasonably well. Also it looks like the line that sets the egg
 cache is not working properly. My egg cache ends up being
 /tmp/${SERVER_NAME}_egg/ but things still seem to be working so I've
 changed that part to use one directory in /tmp/ for all instances.

 Hi Seth,

 Is your Galaxy user's home directory /srv/galaxy-dist?  Otherwise, `su -
 galaxy` would change the working directory to that user's home directory
 and the rest of the script would fail.

 I was thinking it might work to just use `su -c` for individual commands,
 e.g.:

 pre-start script
 echo checking python version
 su - galaxy -c cd /srv/galaxy-dist ; python ./scripts/check_python.py
 [ $? -ne 0 ]  exit 1

 echo pre-fetching tossing out expired eggs
 su - galaxy -c cd /srv/galaxy-dist ; python ./scripts/check_eggs.py
 -q
 if [ $? -eq 0 ]; then
 echo Some eggs are out of date, attempting to fetch...
 su - galaxy -c cd /srv/galaxy-dist ; python
 ./scripts/fetch_eggs.py
 if [ $? -eq 0 ]; then
 echo Fetch Successful.
 else
 echo Fetch failed.
 fi
 fi

 echo starting servers
 SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini |
 xargs echo`
 for SERVER in ${SERVERS} ; do
 echo starting server ${SERVER}
 start galaxy-worker SERVER_NAME=${SERVER}
 done
 end script

 
  Sincerely,
  Seth Sims
 
  *galaxy.conf*
  
  author Seth Sims seth.s...@gmail.com
  version 0.0.2
  description galaxy master process. Fetches eggs and spawns all of the
 servers it finds configured
 
  start on started network-services
 
  # put galaxy root directory here
  chdir /srv/galaxy-dist/
 
  pre-start script
  su - galaxy
  date
  echo checking python version
  python ./scripts/check_python.py
  [ $? -ne 0 ]  exit 1
 
  echo pre-fetching tossing out expired eggs
  python ./scripts/check_eggs.py -q
  if [ $? -eq 0 ]; then
  echo Some eggs are out of date, attempting to fetch...
  python ./scripts/fetch_eggs.py
  if [ $? -eq 0 ]; then
  echo Fetch Successful.
  else
  echo Fetch failed.
  fi
  fi
 
  echo starting servers
  SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini |
 xargs echo`
  for SERVER in ${SERVERS} ; do
  echo starting server ${SERVER}
  start galaxy-worker SERVER_NAME=${SERVER}
  done
  end script
 
  post-stop script
  SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini |
 xargs echo`
  date
  echo stopping galaxy servers.
  for SERVER in ${SERVERS} ; do
  echo stopping ${SERVER}
  stop galaxy-worker SERVER_NAME=${SERVER}
  done
  end script
  ---
  *galaxy-worker*
  author Seth Sims seth.s...@gmail.com
  version 0.0.2
  description Starts a galaxy server instance. This is run from the
 galaxy.conf file
 
  instance $SERVER_NAME
 
  #make sure we are running as the galaxy user
  setuid galaxy
  setgid galaxy
 
  #put the galaxy root directory here
  chdir /srv/galaxy-dist/
 
  #system users don't have /home/ directories; so point the egg unpack to
 a directory in /tmp/
  env PYTHON_EGG_CACHE=/tmp/galaxy_eggs/
 
  respawn
 
  script
  exec python ./scripts/paster.py serve universe_wsgi.ini
 --server-name=${SERVER_NAME}
  end script
 
 
  On Thu, Aug 8, 2013 at 1:52 PM, Nate Coraor n...@bx.psu.edu wrote:
  On Jul 15, 2013, at 6:29 PM, Seth Sims wrote:
 
   After some work i've created an Upstart script which can manage a load
 balanced galaxy configuration as described in the wiki. I thought that I
 would put it on this list for other people to use. The script parses
 universe_wsgi.ini just like run.sh and spawns all of the servers it finds.
 It comes in two pieces galaxy.conf and galaxy-worker.conf. Once you place
 them both in /etc/init and make the proper edits for the environment a
 server can be started with sudo start galaxy. The configuration starts
 the server at boot time and puts all of the instances under the management
 of upstart which deals with pids, logging to syslog and respawning if an
 instance crashes.
   I have just gotten this working reasonably well but have done
 basically no testing so there are bugs to be found. Any comments

Re: [galaxy-dev] Upstart script to manage a multi instance load balanced installation

2013-08-09 Thread Seth Sims
Dear Nate,

Adding su - galaxy as the first line of the pre-start script seems to
work reasonably well. Also it looks like the line that sets the egg cache
is not working properly. My egg cache ends up being
/tmp/${SERVER_NAME}_egg/ but things still seem to be working so I've
changed that part to use one directory in /tmp/ for all instances.

Sincerely,
Seth Sims

*galaxy.conf*

author Seth Sims seth.s...@gmail.com
version 0.0.2
description galaxy master process. Fetches eggs and spawns all of the
servers it finds configured

start on started network-services

# put galaxy root directory here
chdir /srv/galaxy-dist/

pre-start script
su - galaxy
date
echo checking python version
python ./scripts/check_python.py
[ $? -ne 0 ]  exit 1

echo pre-fetching tossing out expired eggs
python ./scripts/check_eggs.py -q
if [ $? -eq 0 ]; then
echo Some eggs are out of date, attempting to fetch...
python ./scripts/fetch_eggs.py
if [ $? -eq 0 ]; then
echo Fetch Successful.
else
echo Fetch failed.
fi
fi

echo starting servers
SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini | xargs
echo`
for SERVER in ${SERVERS} ; do
echo starting server ${SERVER}
start galaxy-worker SERVER_NAME=${SERVER}
done
end script

post-stop script
SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini | xargs
echo`
date
echo stopping galaxy servers.
for SERVER in ${SERVERS} ; do
echo stopping ${SERVER}
stop galaxy-worker SERVER_NAME=${SERVER}
done
end script
---
*galaxy-worker*
author Seth Sims seth.s...@gmail.com
version 0.0.2
description Starts a galaxy server instance. This is run from the
galaxy.conf file

instance $SERVER_NAME

#make sure we are running as the galaxy user
setuid galaxy
setgid galaxy

#put the galaxy root directory here
chdir /srv/galaxy-dist/

#system users don't have /home/ directories; so point the egg unpack to a
directory in /tmp/
env PYTHON_EGG_CACHE=/tmp/galaxy_eggs/

respawn

script
exec python ./scripts/paster.py serve universe_wsgi.ini
--server-name=${SERVER_NAME}
end script


On Thu, Aug 8, 2013 at 1:52 PM, Nate Coraor n...@bx.psu.edu wrote:

 On Jul 15, 2013, at 6:29 PM, Seth Sims wrote:

  After some work i've created an Upstart script which can manage a load
 balanced galaxy configuration as described in the wiki. I thought that I
 would put it on this list for other people to use. The script parses
 universe_wsgi.ini just like run.sh and spawns all of the servers it finds.
 It comes in two pieces galaxy.conf and galaxy-worker.conf. Once you place
 them both in /etc/init and make the proper edits for the environment a
 server can be started with sudo start galaxy. The configuration starts
 the server at boot time and puts all of the instances under the management
 of upstart which deals with pids, logging to syslog and respawning if an
 instance crashes.
  I have just gotten this working reasonably well but have done basically
 no testing so there are bugs to be found. Any comments are welcome if
 anyone knows a better way to do something here.
 
  - Seth

 Hi Seth,

 Thanks for submitting these.  I was about to commit them to the contrib/
 directory along with the rest of the start scripts, but I was wondering if
 you could avoid running the check/fetch scripts as root by just using `su
 -c`?

 --nate

 
  *galaxy.conf*
  
  author Seth Sims seth.s...@gmail.com
  version 0.0.1 test
  description galaxy master process. Fetches eggs and spawns all of the
 servers it finds configured
 
  start on started network-services
 
  # make sure that any eggs we download are at least owned by the galaxy
 group.
  # we cannot use setuid in this script because only root can issue the
 start galaxy-worker
  # command. But this way the galaxy instances should still be able to use
 their eggs.
  setgid galaxy
 
  # put galaxy root directory here
  chdir /srv/galaxy-dist/
 
  pre-start script
  date
  echo checking python version
  python ./scripts/check_python.py
  [ $? -ne 0 ]  exit 1
 
  echo pre-fetching tossing out expired eggs
  python ./scripts/check_eggs.py -q
  if [ $? -eq 0 ]; then
  echo Some eggs are out of date, attempting to fetch...
  python ./scripts/fetch_eggs.py
  if [ $? -eq 0 ]; then
  echo Fetch Successful.
  else
  echo Fetch failed.
  fi
  fi
 
  echo starting servers
  SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini |
 xargs echo`
  for SERVER in ${SERVERS} ; do
  echo starting server ${SERVER}
  start galaxy-worker SERVER_NAME=${SERVER}
  done
  end script
 
  post-stop script
  SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini |
 xargs echo`
  date
  echo

Re: [galaxy-dev] lessc compiler error on blue_colors.ini

2013-08-05 Thread Seth Sims
Dear Carl,

You are using a more recent version of lessc then I am so it is
probably just a versioning error. Ubuntu Precise Pangolin's repositories
are still at lessc-1.2.1. So apparently I need to manually install a more
recent version of the compiler. Here is a description of the error if
anyone else has this problem:

I have not edited anything, when attempting to compile the vanilla
blue_colors.ini from the repo I receive an error like so:

$sudo lessc blue_colors.ini
ParseError: Syntax Error on line 1 in
/srv/galaxy-dist/static/style/blue_colors.ini:1:9
1 base_text=#303030
2 base_bg_top=#FF

However the only reason I used that command is because the makefile gives a
different error:

$ sudo make OUT=blue
make[1]: Entering directory `/srv/galaxy-dist/static/style/blue'
lessc -x ../base.less base.css
TypeError: Cannot call method 'charAt' of undefined
at getLocation (/usr/lib/nodejs/less/parser.js:204:34)
at new LessError (/usr/lib/nodejs/less/parser.js:213:19)
at Object.toCSS (/usr/lib/nodejs/less/parser.js:379:31)
at /usr/bin/lessc:103:28
at /usr/lib/nodejs/less/parser.js:428:40
at /usr/lib/nodejs/less/parser.js:94:48
at /usr/lib/nodejs/less/index.js:113:15
at /usr/lib/nodejs/less/parser.js:428:40
at /usr/lib/nodejs/less/parser.js:94:48
at /usr/lib/nodejs/less/index.js:113:15
make[1]: *** [base.css] Error 2
make[1]: Leaving directory `/srv/galaxy-dist/static/style/blue'
make: *** [all] Error 2

Which is apparently a bug in the version of lessc I have.


On Mon, Aug 5, 2013 at 11:09 AM, Carl Eberhard carlfeberh...@gmail.comwrote:

 Hey, Seth

 I'm using npm less 1.3.3. That error isn't a known issue, no.

 Is that the full stack trace/error report? Which files have you edited?

 Thanks,
 Carl



 On Tue, Jul 30, 2013 at 2:39 PM, Seth Sims seth.s...@gmail.com wrote:

 Dear Galaxy devs,

 I am attempting to create a style directory to match my school's look
 and feel. I am mainly trying to get the development environment setup to do
 this right now. My current problem is that when I attempt to compile the
 standard blue_colors.ini which comes with galaxy I am receiving a syntax
 error:

 ParseError: Syntax Error on line 1 in
 /srv/galaxy-dist/static/style/blue_colors.ini:1:10
 1 base_text=#303030
 2 base_bg_top=#FF

 I have not edited that file at all. So the first question is, what
 version of lessc is being used to compile the styles for the basic
 installation? Also are there any pitfalls I should be aware of with this
 process.

 - Seth

 ___
 Please keep all replies on the list by using reply all
 in your mail client.  To manage your subscriptions to this
 and other Galaxy lists, please use the interface at:
   http://lists.bx.psu.edu/

 To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/



___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] lessc compiler error on blue_colors.ini

2013-08-05 Thread Seth Sims
Dear Carl,

   OK, I have been casting about to find out what the problem was; invoking
lessc on the ini was just something I tried since the error from the
makefile is completely opaque. I already had PIL and pyparsing installed,
just checked again to make sure...

After fighting a bit with npm to get lessc installed I now have
lessc-1.4.2 which is giving this error:

/srv/galaxy-dist/static/style$ sudo make OUT=blue
make[1]: Entering directory `/srv/galaxy-dist/static/style/blue'
lessc -x ../base.less base.css
util.error: Use console.error instead
ParseError: Unrecognised input in
/srv/galaxy-dist/static/style/bootstrap/mixins.less on line 561, column 7:
560 .spanX (@index) when (@index  0) {
561   (~.span@{index}) { .span(@index); }
562   .spanX(@index - 1);

make[1]: *** [base.css] Error 1
make[1]: Leaving directory `/srv/galaxy-dist/static/style/blue'
make: *** [all] Error 2

So now I guess i'm going to try and downgrade specifically to lessc 1.3.3

- Seth


On Mon, Aug 5, 2013 at 11:56 AM, Carl Eberhard carlfeberh...@gmail.comwrote:

 The ini file is not a .less file so it will error if you call lessc
 directly with it.

 It may be that you're lacking some (not obvious) dependencies. Do you have
 pyparsing and PIL installed and available in your terminal (pip install
 will work with both)?

 You can also use npm to update/install your node modules (sudo npm install
 -g less) if you have npm installed.


 On Mon, Aug 5, 2013 at 11:28 AM, Seth Sims seth.s...@gmail.com wrote:

 Dear Carl,

 You are using a more recent version of lessc then I am so it is
 probably just a versioning error. Ubuntu Precise Pangolin's repositories
 are still at lessc-1.2.1. So apparently I need to manually install a more
 recent version of the compiler. Here is a description of the error if
 anyone else has this problem:

 I have not edited anything, when attempting to compile the vanilla
 blue_colors.ini from the repo I receive an error like so:

 $sudo lessc blue_colors.ini
 ParseError: Syntax Error on line 1 in
 /srv/galaxy-dist/static/style/blue_colors.ini:1:9
 1 base_text=#303030
 2 base_bg_top=#FF

 However the only reason I used that command is because the makefile gives
 a different error:

 $ sudo make OUT=blue
 make[1]: Entering directory `/srv/galaxy-dist/static/style/blue'
 lessc -x ../base.less base.css
 TypeError: Cannot call method 'charAt' of undefined
 at getLocation (/usr/lib/nodejs/less/parser.js:204:34)
 at new LessError (/usr/lib/nodejs/less/parser.js:213:19)
 at Object.toCSS (/usr/lib/nodejs/less/parser.js:379:31)
 at /usr/bin/lessc:103:28
 at /usr/lib/nodejs/less/parser.js:428:40
 at /usr/lib/nodejs/less/parser.js:94:48
 at /usr/lib/nodejs/less/index.js:113:15
 at /usr/lib/nodejs/less/parser.js:428:40
 at /usr/lib/nodejs/less/parser.js:94:48
 at /usr/lib/nodejs/less/index.js:113:15
 make[1]: *** [base.css] Error 2
 make[1]: Leaving directory `/srv/galaxy-dist/static/style/blue'
 make: *** [all] Error 2

 Which is apparently a bug in the version of lessc I have.


 On Mon, Aug 5, 2013 at 11:09 AM, Carl Eberhard 
 carlfeberh...@gmail.comwrote:

 Hey, Seth

 I'm using npm less 1.3.3. That error isn't a known issue, no.

 Is that the full stack trace/error report? Which files have you edited?

 Thanks,
 Carl



 On Tue, Jul 30, 2013 at 2:39 PM, Seth Sims seth.s...@gmail.com wrote:

 Dear Galaxy devs,

 I am attempting to create a style directory to match my school's
 look and feel. I am mainly trying to get the development environment setup
 to do this right now. My current problem is that when I attempt to compile
 the standard blue_colors.ini which comes with galaxy I am receiving a
 syntax error:

 ParseError: Syntax Error on line 1 in
 /srv/galaxy-dist/static/style/blue_colors.ini:1:10
 1 base_text=#303030
 2 base_bg_top=#FF

 I have not edited that file at all. So the first question is, what
 version of lessc is being used to compile the styles for the basic
 installation? Also are there any pitfalls I should be aware of with this
 process.

 - Seth

 ___
 Please keep all replies on the list by using reply all
 in your mail client.  To manage your subscriptions to this
 and other Galaxy lists, please use the interface at:
   http://lists.bx.psu.edu/

 To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/





___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Re: [galaxy-dev] lessc compiler error on blue_colors.ini

2013-08-05 Thread Seth Sims
Dear Carl,

   lessc 1.3.3 successfully compiles the scripts. So you've got a bit of a
goldielocks situation going on. Looks like only 1.3.* versions of less are
useable with galaxy as it stands.

- Seth


On Mon, Aug 5, 2013 at 12:09 PM, Seth Sims seth.s...@gmail.com wrote:

 Dear Carl,

OK, I have been casting about to find out what the problem was;
 invoking lessc on the ini was just something I tried since the error from
 the makefile is completely opaque. I already had PIL and pyparsing
 installed, just checked again to make sure...

 After fighting a bit with npm to get lessc installed I now have
 lessc-1.4.2 which is giving this error:

 /srv/galaxy-dist/static/style$ sudo make OUT=blue
 make[1]: Entering directory `/srv/galaxy-dist/static/style/blue'
 lessc -x ../base.less base.css
 util.error: Use console.error instead
 ParseError: Unrecognised input in
 /srv/galaxy-dist/static/style/bootstrap/mixins.less on line 561, column 7:
 560 .spanX (@index) when (@index  0) {
 561   (~.span@{index}) { .span(@index); }
 562   .spanX(@index - 1);

 make[1]: *** [base.css] Error 1
 make[1]: Leaving directory `/srv/galaxy-dist/static/style/blue'
 make: *** [all] Error 2

 So now I guess i'm going to try and downgrade specifically to lessc 1.3.3

 - Seth


 On Mon, Aug 5, 2013 at 11:56 AM, Carl Eberhard carlfeberh...@gmail.comwrote:

 The ini file is not a .less file so it will error if you call lessc
 directly with it.

 It may be that you're lacking some (not obvious) dependencies. Do you
 have pyparsing and PIL installed and available in your terminal (pip
 install will work with both)?

 You can also use npm to update/install your node modules (sudo npm
 install -g less) if you have npm installed.


 On Mon, Aug 5, 2013 at 11:28 AM, Seth Sims seth.s...@gmail.com wrote:

 Dear Carl,

 You are using a more recent version of lessc then I am so it is
 probably just a versioning error. Ubuntu Precise Pangolin's repositories
 are still at lessc-1.2.1. So apparently I need to manually install a more
 recent version of the compiler. Here is a description of the error if
 anyone else has this problem:

 I have not edited anything, when attempting to compile the vanilla
 blue_colors.ini from the repo I receive an error like so:

 $sudo lessc blue_colors.ini
 ParseError: Syntax Error on line 1 in
 /srv/galaxy-dist/static/style/blue_colors.ini:1:9
 1 base_text=#303030
 2 base_bg_top=#FF

 However the only reason I used that command is because the makefile
 gives a different error:

 $ sudo make OUT=blue
 make[1]: Entering directory `/srv/galaxy-dist/static/style/blue'
 lessc -x ../base.less base.css
 TypeError: Cannot call method 'charAt' of undefined
 at getLocation (/usr/lib/nodejs/less/parser.js:204:34)
 at new LessError (/usr/lib/nodejs/less/parser.js:213:19)
 at Object.toCSS (/usr/lib/nodejs/less/parser.js:379:31)
 at /usr/bin/lessc:103:28
 at /usr/lib/nodejs/less/parser.js:428:40
 at /usr/lib/nodejs/less/parser.js:94:48
 at /usr/lib/nodejs/less/index.js:113:15
 at /usr/lib/nodejs/less/parser.js:428:40
 at /usr/lib/nodejs/less/parser.js:94:48
 at /usr/lib/nodejs/less/index.js:113:15
 make[1]: *** [base.css] Error 2
 make[1]: Leaving directory `/srv/galaxy-dist/static/style/blue'
 make: *** [all] Error 2

 Which is apparently a bug in the version of lessc I have.


 On Mon, Aug 5, 2013 at 11:09 AM, Carl Eberhard 
 carlfeberh...@gmail.comwrote:

 Hey, Seth

 I'm using npm less 1.3.3. That error isn't a known issue, no.

 Is that the full stack trace/error report? Which files have you edited?

 Thanks,
 Carl



 On Tue, Jul 30, 2013 at 2:39 PM, Seth Sims seth.s...@gmail.com wrote:

 Dear Galaxy devs,

 I am attempting to create a style directory to match my school's
 look and feel. I am mainly trying to get the development environment setup
 to do this right now. My current problem is that when I attempt to compile
 the standard blue_colors.ini which comes with galaxy I am receiving a
 syntax error:

 ParseError: Syntax Error on line 1 in
 /srv/galaxy-dist/static/style/blue_colors.ini:1:10
 1 base_text=#303030
 2 base_bg_top=#FF

 I have not edited that file at all. So the first question is, what
 version of lessc is being used to compile the styles for the basic
 installation? Also are there any pitfalls I should be aware of with this
 process.

 - Seth

 ___
 Please keep all replies on the list by using reply all
 in your mail client.  To manage your subscriptions to this
 and other Galaxy lists, please use the interface at:
   http://lists.bx.psu.edu/

 To search Galaxy mailing lists use the unified search at:
   http://galaxyproject.org/search/mailinglists/






___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use

[galaxy-dev] lessc compiler error on blue_colors.ini

2013-07-30 Thread Seth Sims
Dear Galaxy devs,

I am attempting to create a style directory to match my school's look
and feel. I am mainly trying to get the development environment setup to do
this right now. My current problem is that when I attempt to compile the
standard blue_colors.ini which comes with galaxy I am receiving a syntax
error:

ParseError: Syntax Error on line 1 in
/srv/galaxy-dist/static/style/blue_colors.ini:1:10
1 base_text=#303030
2 base_bg_top=#FF

I have not edited that file at all. So the first question is, what version
of lessc is being used to compile the styles for the basic installation?
Also are there any pitfalls I should be aware of with this process.

- Seth
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

[galaxy-dev] Upstart script to manage a multi instance load balanced installation

2013-07-15 Thread Seth Sims
After some work i've created an Upstart script which can manage a load
balanced galaxy configuration as described in the wiki. I thought that I
would put it on this list for other people to use. The script parses
universe_wsgi.ini just like run.sh and spawns all of the servers it finds.
It comes in two pieces galaxy.conf and galaxy-worker.conf. Once you place
them both in /etc/init and make the proper edits for the environment a
server can be started with sudo start galaxy. The configuration starts
the server at boot time and puts all of the instances under the management
of upstart which deals with pids, logging to syslog and respawning if an
instance crashes.
I have just gotten this working reasonably well but have done basically no
testing so there are bugs to be found. Any comments are welcome if anyone
knows a better way to do something here.

- Seth

*galaxy.conf*

author Seth Sims seth.s...@gmail.com
version 0.0.1 test
description galaxy master process. Fetches eggs and spawns all of the
servers it finds configured

start on started network-services

# make sure that any eggs we download are at least owned by the galaxy
group.
# we cannot use setuid in this script because only root can issue the
start galaxy-worker
# command. But this way the galaxy instances should still be able to use
their eggs.
setgid galaxy

# put galaxy root directory here
chdir /srv/galaxy-dist/

pre-start script
date
echo checking python version
python ./scripts/check_python.py
[ $? -ne 0 ]  exit 1

echo pre-fetching tossing out expired eggs
python ./scripts/check_eggs.py -q
if [ $? -eq 0 ]; then
echo Some eggs are out of date, attempting to fetch...
python ./scripts/fetch_eggs.py
if [ $? -eq 0 ]; then
echo Fetch Successful.
else
echo Fetch failed.
fi
fi

echo starting servers
SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini | xargs
echo`
for SERVER in ${SERVERS} ; do
echo starting server ${SERVER}
start galaxy-worker SERVER_NAME=${SERVER}
done
end script

post-stop script
SERVERS=`sed -n 's/^\[server:\(.*\)\]/\1/  p' universe_wsgi.ini | xargs
echo`
date
echo stopping galaxy servers.
for SERVER in ${SERVERS} ; do
echo stopping ${SERVER}
stop galaxy-worker SERVER_NAME=${SERVER}
done
end script
---
*galaxy-worker*
author Seth Sims seth.s...@gmail.com
version 0.0.1 test
description Starts a galaxy server instance. This is run from the
galaxy.conf file

instance $SERVER_NAME

#make sure we are running as the galaxy user
setuid galaxy
setgid galaxy

#put the galaxy root directory here
chdir /srv/galaxy-dist/

#having multiple instances of galaxy using the same egg directory was
causing a race
#condition that was stopping the instances from starting correctly. So give
each instance
#its own directory under /tmp
env PYTHON_EGG_CACHE=/tmp/${SERVER_NAME}_egg/

respawn

script
exec python ./scripts/paster.py serve universe_wsgi.ini
--server-name=${SERVER_NAME}
end script
___
Please keep all replies on the list by using reply all
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/