Question: Create a galaxy service (run.sh script set environment paths?)
0
gravatar for ggeo1
9 months ago by
ggeo110
ggeo110 wrote:

Hello ,

I am trying to run galaxy as a service. I am using a galaxy.service file:

[Unit]
Description=Galaxy 

[Service]
ExecStart=/bin/sh /theDir/galaxy/run.sh -pidfile=/var/run/galaxy.pid
Restart=always
RestartSec=5                        
 SyslogIdentifier=galaxy

[Install]
WantedBy=multi-user.target

but as soon as the service starts to run after a few seconds it stops.

I checked the journalctl and I show it gives me this error:

Activating virtualenv at .venv
Ignoring indexes: https://pypi.python.org/simple
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 209, in main
   status = self.run(options, args)
   File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 328, in runwb.build(autobuilding=True)
   File "/usr/lib/python2.7/dist-packages/pip/wheel.py", line 748, in build
     self.requirement_set.prepare_files(self.finder)
   File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 360, in prepare_files
     ignore_dependencies=self.ignore_dependencies))
   File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 448, in _prepare_file
     req_to_install, finder)
   File "/usr/lib/python2.7/dist-packages/pip/req/req_set.py", line 387, in _check_skip_installed
     req_to_install.check_if_exists()
   File "/usr/lib/python2.7/dist-packages/pip/req/req_install.py", line 1011, in check_if_exists
     self.req.project_name
   AttributeError: 'Requirement' object has no attribute 'project_name'
myservice.service: Main process exited, code=exited, status=1/FAILURE

I must note that I am using python from anaconda.

which python:
/home/ggeo1/anaconda2/bin/python

So I think this is the issue.

The piece of code in galaxy run.sh file:

# If there is a .venv/ directory, assume it contains a virtualenv that we
# should run this instance in.
GALAXY_VIRTUAL_ENV="${GALAXY_VIRTUAL_ENV:-.venv}"
if [ -d "$GALAXY_VIRTUAL_ENV" -a -z "$skip_venv" ];
then
    [ -n "$PYTHONPATH" ] && { echo 'Unsetting $PYTHONPATH'; unset PYTHONPATH; }
    printf "Activating virtualenv at $GALAXY_VIRTUAL_ENV\n"
    . "$GALAXY_VIRTUAL_ENV/bin/activate"
fi

seems to intefere with pythonpath?

What can I do for this?

I tried to remove the line [ -n "$PYTHONPATH" ] && { echo 'Unsetting $PYTHONPATH'; unset PYTHONPATH; } but I have the same error.

It seems the run.sh is expecting the environment variables to be set from the environment.

I tiried also ti start the script like: run.sh --skip-venv. Then , when I start the service, it seems to start , it starts

Collecting SQLAlchemy==1.0.8 (from -r requirements.txt (line 5))
 Downloading https://wheels.galaxyproject.org/packages/SQLAlchemy-1.0.8-cp27-cp27mu-manylinux1_x86_64....

..... but then it shows again the same error as above and stops and starts again and so on.

galaxy service • 399 views
ADD COMMENTlink modified 9 months ago • written 9 months ago by ggeo110
0
gravatar for ggeo1
9 months ago by
ggeo110
ggeo110 wrote:

Any ideas someone?? :)

ADD COMMENTlink written 9 months ago by ggeo110
Please log in to add an answer.

Help
Access

Use of this site constitutes acceptance of our User Agreement and Privacy Policy.
Powered by Biostar version 16.09
Traffic: 100 users visited in the last hour