Esempio n. 1
0
def _install_galaxy(env):
    """
    Used to install Galaxy and setup its environment, including tools.
    This method is somewhat targeted for the cloud deployment so some
    tweaking of the code may be desirable. This method cannot be used
    to update an existing Galaxy.
    """
    _clone_galaxy_repo(env)
    _chown_galaxy(env, env.galaxy_home)  # Make sure env.galaxy_user owns env.galaxy_home
    sudo("chmod 755 %s" % os.path.split(env.galaxy_home)[0])
    setup_db = _read_boolean(env, "galaxy_setup_database", False)
    if setup_db:
        _setup_galaxy_db(env)
    setup_service = _read_boolean(env, "galaxy_setup_service", False)
    if setup_service:
        _setup_service(env)
    _setup_trackster(env)
    _setup_shed_tools_dir(env)
    _install_tools(env)
    setup_xvfb = _read_boolean(env, "galaxy_setup_xvfb", False)
    if setup_xvfb:
        _setup_xvfb(env)
    _chown_galaxy(env, env.galaxy_home)  # Make sure env.galaxy_user owns env.galaxy_home
    _chown_galaxy(env, env.galaxy_loc_files)  # Make sure env.galaxy_user owns env.galaxy_loc_files
    return True
Esempio n. 2
0
def install_proteomics_tools(env):
    _prep_galaxy(env)
    tools_conf_path = env.get("galaxyp_tools_conf",
                              os.path.join(env.config_dir, os.pardir,
                                           "contrib", "flavor", "proteomics", "galaxyp", "galaxyp_tools.yaml"))
    galaxyp_tools_conf = yaml.load(open(tools_conf_path, "r"))
    _install_tools(env, galaxyp_tools_conf)
Esempio n. 3
0
def install_proteomics_tools(env):
    _prep_galaxy(env)
    tools_conf_path = env.get(
        "galaxyp_tools_conf",
        os.path.join(env.config_dir, os.pardir, "contrib", "flavor",
                     "proteomics", "galaxyp", "galaxyp_tools.yaml"))
    galaxyp_tools_conf = yaml.load(open(tools_conf_path, "r"))
    _install_tools(env, galaxyp_tools_conf)
Esempio n. 4
0
def _install_galaxy(env):
    """ Used to install Galaxy and setup its environment.
    This method cannot be used to update an existing instance of Galaxy code;
    see volume_manipulations_fab.py script for that functionality.
    Also, this method is somewhat targeted for the EC2 deployment so some
    tweaking of the code may be desirable."""
    # MP: we need to have a tmp directory available if files already exist
    # in the galaxy install directory
    install_cmd = sudo if env.get("use_sudo", True) else run

    base_tmp_dir = env.get("galaxy_tmp_dir", "/mnt")
    tmp_dir = os.path.join(base_tmp_dir, "fab_tmp")
    if exists(tmp_dir):
        install_cmd("rm -rf %s" % tmp_dir)
    if exists(env.galaxy_home):
        if exists(os.path.join(env.galaxy_home, '.hg')):
            env.logger.info("Galaxy install dir '%s' exists and seems to have a Mercurial repository already there. Galaxy already installed.")
            return False
        else:
            # MP: need to move any files already in galaxy home so that hg
            # can checkout files.
            if not exists(tmp_dir):
                install_cmd("mkdir %s" % tmp_dir)
                install_cmd("chown %s %s" % (env.user, tmp_dir))
            install_cmd("mv %s/* %s" % (env.galaxy_home, tmp_dir))
    ## This is slightly different than mi-deployment to handle the
    ## case when the bucket url doesn't match the desired path.
    if not exists(env.galaxy_home):
        sudo("mkdir -p '%s'" % env.galaxy_home)
        _chown_galaxy(env, env.galaxy_home)
    with cd(env.galaxy_home):
        # MP needs to be done as non galaxy user, otherwise we have a
        # permissions problem.
        galaxy_repository = env.get("galaxy_repository", 'https://bitbucket.org/galaxy/galaxy-central/')
        sudo('hg clone %s .' % galaxy_repository)
    # MP: now we need to move the files back into the galaxy directory.
    if exists(tmp_dir):
        install_cmd("cp -R %s/* %s" % (tmp_dir, env.galaxy_home))
        install_cmd("rm -rf %s" % tmp_dir)
    # MP: Ensure that everything under install dir is owned by env.galaxy_user
    sudo("chown --recursive %s:%s %s"
       % (env.galaxy_user, env.galaxy_user, os.path.split(env.galaxy_tools_dir)[0]))
    sudo("chmod 755 %s" % os.path.split(env.galaxy_tools_dir)[0])
    env.get("galaxy_preconfigured_repository", False)
    preconfigured = _read_boolean(env, "galaxy_preconfigured_repository", False)
    if not preconfigured:
        _configure_galaxy_repository(env)
    _install_tools(env)
    return True
Esempio n. 5
0
def _install_galaxy(env):
    """ Used to install Galaxy and setup its environment.
    This method cannot be used to update an existing instance of Galaxy code;
    see volume_manipulations_fab.py script for that functionality.
    Also, this method is somewhat targeted for the EC2 deployment so some
    tweaking of the code may be desirable."""
    _clone_galaxy_repo(env)
    # MP: Ensure that everything under install dir is owned by env.galaxy_user
    sudo("chown --recursive %s:%s %s"
       % (env.galaxy_user, env.galaxy_user, os.path.split(env.galaxy_tools_dir)[0]))
    sudo("chmod 755 %s" % os.path.split(env.galaxy_tools_dir)[0])
    setup_service = _read_boolean(env, "galaxy_setup_service", False)
    if setup_service:
        _setup_service(env)
    _install_tools(env)
    setup_xvfb = _read_boolean(env, "galaxy_setup_xvfb", False)
    if setup_xvfb:
        _setup_xvfb(env)
    return True
Esempio n. 6
0
def _install_galaxy(env):
    """ Used to install Galaxy and setup its environment.
    This method cannot be used to update an existing instance of Galaxy code;
    see volume_manipulations_fab.py script for that functionality.
    Also, this method is somewhat targeted for the EC2 deployment so some
    tweaking of the code may be desirable."""
    _clone_galaxy_repo(env)
    # MP: Ensure that everything under install dir is owned by env.galaxy_user
    sudo("chown --recursive %s:%s %s"
       % (env.galaxy_user, env.galaxy_user, os.path.split(env.galaxy_tools_dir)[0]))
    sudo("chmod 755 %s" % os.path.split(env.galaxy_tools_dir)[0])
    setup_service = _read_boolean(env, "galaxy_setup_service", False)
    if setup_service:
        _setup_service(env)
    _install_tools(env)
    setup_xvfb = _read_boolean(env, "galaxy_setup_xvfb", False)
    if setup_xvfb:
        _setup_xvfb(env)
    return True
Esempio n. 7
0
def install_proteomics_tools(env):
    _prep_galaxy(env)
    galaxyp_tools_conf = yaml.load(open("contrib/flavor/cloudman/galaxyp_tools.yaml", "r"))
    _install_tools(env, galaxyp_tools_conf)
Esempio n. 8
0
def install_cbl_galaxy_tools(env):
    _prep_galaxy(env)
    _install_tools(env)
Esempio n. 9
0
def install_tools(tools_conf):
    """
    """
    _install_tools(env, tools_conf)
Esempio n. 10
0
def install_proteomics_tools(env):
    _prep_galaxy(env)
    galaxyp_tools_conf = yaml.load(
        open("contrib/flavor/cloudman/galaxyp_tools.yaml", "r"))
    _install_tools(env, galaxyp_tools_conf)
Esempio n. 11
0
def install_tools(tools_conf):
    """Deploy a Galaxy server along with some tools.
    """
    _install_tools(env, tools_conf)