Skip to content

Commit 0a7f0fd

Browse files
committed
Galaxy: Enable Brad's cool direct installation process (is_local, no ssh) to work for Galaxy tool dependency installs.
1 parent a3f255e commit 0a7f0fd

File tree

6 files changed

+162
-168
lines changed

6 files changed

+162
-168
lines changed

cloudbio/custom/bio_proteomics.py

+27-28
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,13 @@
33

44
import os
55

6-
from fabric.api import cd, run, settings
7-
from fabric.contrib.files import append
6+
from fabric.api import cd
87

98
from shared import (_if_not_installed, _make_tmp_dir,
10-
_get_install, _get_install_local, _make_copy, _configure_make,
9+
_get_install, _make_copy,
1110
_java_install, _symlinked_java_version_dir,
1211
_get_bin_dir, _get_install_subdir,
13-
_fetch_and_unpack, _python_make,
12+
_fetch_and_unpack,
1413
_create_python_virtualenv)
1514
import re
1615

@@ -44,15 +43,15 @@ def _chdir_src(work_cmd):
4443
def do_work(env):
4544
src_dir = "trans_proteomic_pipeline/src" if version == "4.6.1-occupy" else "src"
4645
with cd(src_dir):
47-
append("Makefile.config.incl", "TPP_ROOT=%s/" % env["system_install"])
48-
append("Makefile.config.incl", "TPP_WEB=/tpp/")
49-
append("Makefile.config.incl", "XSLT_PROC=/usr/bin/xsltproc")
50-
append("Makefile.config.incl", "CGI_USERS_DIR=${TPP_ROOT}cgi-bin")
46+
env.safe_append("Makefile.config.incl", "TPP_ROOT=%s/" % env["system_install"])
47+
env.safe_append("Makefile.config.incl", "TPP_WEB=/tpp/")
48+
env.safe_append("Makefile.config.incl", "XSLT_PROC=/usr/bin/xsltproc")
49+
env.safe_append("Makefile.config.incl", "CGI_USERS_DIR=${TPP_ROOT}cgi-bin")
5150
work_cmd(env)
5251
return do_work
5352

5453
def _make(env):
55-
run("make")
54+
env.safe_run("make")
5655
env.safe_sudo("make install")
5756
_get_install(url, env, _chdir_src(_make))
5857

@@ -81,10 +80,10 @@ def install_openms(env):
8180

8281
def _make(env):
8382
with cd("contrib"):
84-
run("cmake -DINSTALL_PREFIX=%s ." % env.get('system_install'))
85-
run("make")
86-
run("cmake -DINSTALL_PREFIX=%s ." % env.get('system_install'))
87-
run("make")
83+
env.safe_run("cmake -DINSTALL_PREFIX=%s ." % env.get('system_install'))
84+
env.safe_run("make")
85+
env.safe_run("cmake -DINSTALL_PREFIX=%s ." % env.get('system_install'))
86+
env.safe_run("make")
8887
env.safe_sudo("make install")
8988
_get_install(url, env, _make)
9089

@@ -114,9 +113,9 @@ def install_ms2preproc(env):
114113
install_dir = _get_bin_dir(env)
115114
with _make_tmp_dir() as work_dir:
116115
with cd(work_dir):
117-
run(get_cmd)
118-
run("unzip ms2preproc.zip")
119-
run("chmod +x ms2preproc-x86_64")
116+
env.safe_run(get_cmd)
117+
env.safe_run("unzip ms2preproc.zip")
118+
env.safe_run("chmod +x ms2preproc-x86_64")
120119
env.safe_sudo("mv ms2preproc-x86_64 '%s'/ms2preproc" % install_dir)
121120

122121

@@ -290,9 +289,9 @@ def install_percolator(env):
290289

291290
def make(env):
292291
with cd(".."):
293-
run("env")
294-
run("cmake -DCMAKE_INSTALL_PREFIX='%s' . " % env.system_install)
295-
run("make -j8")
292+
env.safe_run("env")
293+
env.safe_run("cmake -DCMAKE_INSTALL_PREFIX='%s' . " % env.system_install)
294+
env.safe_run("make -j8")
296295
env.safe_sudo("make install")
297296

298297
_get_install(url, env, make)
@@ -306,7 +305,7 @@ def install_pepnovo(env):
306305

307306
def install_fn(env, install_dir):
308307
with cd("src"):
309-
run("make")
308+
env.safe_run("make")
310309
env.safe_sudo("mkdir -p '%s/bin'" % env.system_install)
311310
env.safe_sudo("mkdir -p '%s/share/pepnovo'" % env.system_install)
312311
env.safe_sudo("mv PepNovo_bin '%s/bin/PepNovo'" % env.system_install)
@@ -338,11 +337,11 @@ def install_fido(env):
338337
def _chdir_src(work_cmd):
339338
def do_work(env):
340339
with cd("src/cpp"):
341-
append('tmpmake', 'SHELL=/bin/bash')
342-
append('tmpmake', 'prefix=%s' % env.get("system_install"))
343-
append('tmpmake', 'CPPFLAGS=-Wall -ffast-math -march=x86-64 -pipe -O4 -g')
344-
run('cat makefile |grep BINPATH -A 9999 >> tmpmake')
345-
run('cp tmpmake makefile')
340+
env.safe_append('tmpmake', 'SHELL=/bin/bash')
341+
env.safe_append('tmpmake', 'prefix=%s' % env.get("system_install"))
342+
env.safe_append('tmpmake', 'CPPFLAGS=-Wall -ffast-math -march=x86-64 -pipe -O4 -g')
343+
env.safe_run('cat makefile |grep BINPATH -A 9999 >> tmpmake')
344+
env.safe_run('cp tmpmake makefile')
346345
work_cmd(env)
347346
return do_work
348347

@@ -357,7 +356,7 @@ def install_ipig(env):
357356
url = 'http://downloads.sourceforge.net/project/ipig/ipig_%s.zip' % version
358357
pkg_name = 'ipig'
359358
install_dir = os.path.join(env.galaxy_jars_dir, pkg_name)
360-
install_cmd = env.safe_sudo if env.use_sudo else run
359+
install_cmd = env.safe_sudo if env.use_sudo else env.safe_run
361360
install_cmd("mkdir -p %s" % install_dir)
362361
with cd(install_dir):
363362
install_cmd("wget %s -O %s" % (url, os.path.split(url)[-1]))
@@ -412,8 +411,8 @@ def install_idpqonvert(env):
412411
default_version = "3.0.475"
413412
version = env.get("tool_version", default_version)
414413
url = "%s/idpQonvert_%s" % (PROTEOMICS_APP_ARCHIVE_URL, version)
415-
run("wget --no-check-certificate -O %s '%s'" % ("idpQonvert", url))
416-
run("chmod 755 idpQonvert")
414+
env.safe_run("wget --no-check-certificate -O %s '%s'" % ("idpQonvert", url))
415+
env.safe_run("chmod 755 idpQonvert")
417416
env.safe_sudo("mkdir -p '%s/bin'" % env["system_install"])
418417
env.safe_sudo("mv %s '%s/bin'" % ("idpQonvert", env["system_install"]))
419418
env.safe_sudo("chmod +x '%s/bin/idpQonvert'" % env["system_install"])

cloudbio/custom/bio_proteomics_wine.py

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
from fabric.api import put, cd
2-
from fabric.contrib.files import exists
1+
from fabric.api import cd
32

43
from shared import (_make_tmp_dir, _fetch_and_unpack, _write_to_file, _get_bin_dir)
54

@@ -9,8 +8,8 @@
98
def install_proteomics_wine_env(env):
109
script_src = env.get("setup_proteomics_wine_env_script")
1110
script_dest = "%s/bin/setup_proteomics_wine_env.sh" % env.get("system_install")
12-
if not exists(script_dest):
13-
put(script_src, script_dest, mode=0755, use_sudo=True)
11+
if not env.safe_exists(script_dest):
12+
env.safe_put(script_src, script_dest, mode=0755, use_sudo=True)
1413

1514

1615
def install_multiplierz(env):

cloudbio/galaxy/__init__.py

+5-5
Original file line numberDiff line numberDiff line change
@@ -26,17 +26,17 @@
2626
def _setup_users(env):
2727
def _add_user(username, uid=None):
2828
""" Add user with username to the system """
29-
if not contains('/etc/passwd', "%s:" % username):
29+
if not env.safe_contains('/etc/passwd', "%s:" % username):
3030
uid_str = "--uid %s" % uid if uid else ""
31-
sudo('useradd -d /home/%s --create-home --shell /bin/bash '
32-
'-c"Galaxy-required user" %s --user-group %s' %
33-
(username, uid_str, username))
31+
env.safe_sudo('useradd -d /home/%s --create-home --shell /bin/bash '
32+
'-c"Galaxy-required user" %s --user-group %s' %
33+
(username, uid_str, username))
3434
# Must specify uid for 'galaxy' user because of the
3535
# configuration for proFTPd
3636
_add_user('galaxy', '1001')
3737
_add_user('sgeadmin')
3838
_add_user('postgres')
39-
env.logger.debug("Done setting up CloudMan users")
39+
env.logger.debug("Done setting up Galaxy/CloudMan users")
4040

4141

4242
def _setup_galaxy_env_defaults(env):

0 commit comments

Comments
 (0)