-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow selection of python version when starting managed Galaxy #874
Allow selection of python version when starting managed Galaxy #874
Conversation
302b226
to
f1b9c9d
Compare
Hmm, this is Paste failing now due to deleting from a dict while iterating over it. The fix is simple and I've done it locally, but Paste looks pretty much unmaintained. |
4e963af
to
7b9a4b9
Compare
6f4d748
to
a4d78b9
Compare
Hmm, so for some reason when installing dependencies by running common_startup.sh we get the wrong shebang (it points to the python in the virtualenv in which planemo was installed), which is a problem for the gunicorn entrypoint. I haven't figured out what's going on there, seems very strange. |
So I'm having |
d3b676e
to
2394309
Compare
2394309
to
35eb2c1
Compare
48d9807
to
fafb98b
Compare
fafb98b
to
c784925
Compare
yay, all green! |
05f66a8
to
dbfec70
Compare
@mvdbeek A bugfix for this has been proposed in python/cpython#9516 |
planemo/galaxy/config.py
Outdated
@@ -400,7 +401,7 @@ def config_join(*args): | |||
template_args = dict( | |||
port=port, | |||
host=kwds.get("host", "127.0.0.1"), | |||
server_name=server_name, | |||
server_name=server_name if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) < 3 else 'main', # gunicorn needs main |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What about:
server_name=server_name if parse_version(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) < parse_version('3') else 'main', # gunicorn needs main
after adding from pkg_resources import parse_version
at the top.
planemo/galaxy/config.py
Outdated
@@ -941,6 +942,14 @@ def startup_command(self, ctx, **kwds): | |||
run_script += " --server-name %s" % shlex_quote(self.server_name) | |||
server_ini = os.path.join(self.config_directory, "galaxy.ini") | |||
self.env["GALAXY_CONFIG_FILE"] = server_ini | |||
if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= 3: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if float(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= 3: | |
if parse_version(kwds.get('galaxy_python_version', DEFAULT_PYTHON_VERSION)) >= parse_version('3'): |
planemo/galaxy/config.py
Outdated
@@ -1240,6 +1254,7 @@ def _install_with_command(ctx, config_directory, command, env, kwds): | |||
else: | |||
pip_install_command = "" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just noticed that, since commit 9867e56, pip_installs
and pip_install_command
could be removed, if desired.
planemo/io.py
Outdated
@@ -182,6 +182,7 @@ def kill_pid_file(pid_file): | |||
|
|||
pid = int(open(pid_file, "r").read()) | |||
kill_posix(pid) | |||
os.unlink(pid_file) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should probably be in a try/except Exception: pass
, since the killed process can remove the pid file before exiting, in which case os.remove
would raise OSError
or FileNotFoundError
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point, thanks!
Thanks @mvdbeek! Should we enable this for tools-iuc testing? 😈 |
Sure! We can start with a blacklist and work our way down like we did with condafying tools. |
Otherwise the `pid_file` is set to the wrong filename, preventing `LocalGalaxyConfig.kill()` from working when running Galaxy under Python 3. Follow-up to galaxyproject#874 .
Make sure python 3 is on PATH and enjoy
planemo {test, serve} --galaxy_branch release_18.09 --galaxy_python_version 3
.