Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Samples and defaults for Conda mapping.
Browse files Browse the repository at this point in the history
- Map R to r-base and blast+ to blast for conda dependencies.
- Add sample environment modules file showing off the new mapping feature.
- Add integration test case to verify the default conda mapping (R -> r-base in particular).
jmchilton committed Jan 18, 2017

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
1 parent f64c9c3 commit a95eebb
Showing 6 changed files with 51 additions and 0 deletions.
2 changes: 2 additions & 0 deletions config/local_conda_mapping.yml.sample
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# See $GALAXY_ROOT/lib/galaxy/tools/deps/default_conda_mapping.yml for example mapping -
# additional site-specific mappings can be added to config/conda_mapping.yml.
11 changes: 11 additions & 0 deletions lib/galaxy/config.py
Original file line number Diff line number Diff line change
@@ -49,6 +49,8 @@
shed_tool_data_table_config=['shed_tool_data_table_conf.xml', 'config/shed_tool_data_table_conf.xml'],
tool_sheds_config_file=['config/tool_sheds_conf.xml', 'tool_sheds_conf.xml', 'config/tool_sheds_conf.xml.sample'],
workflow_schedulers_config_file=['config/workflow_schedulers_conf.xml', 'config/workflow_schedulers_conf.xml.sample'],
modules_mapping_files=['config/environment_modules_mapping.yml', 'config/environment_modules_mapping.yml.sample'],
local_conda_mapping_file=['config/local_conda_mapping.yml', 'config/local_conda_mapping.yml.sample'],
)

PATH_LIST_DEFAULTS = dict(
@@ -393,6 +395,15 @@ def __init__( self, **kwargs ):
self.use_cached_dependency_manager = use_cached_dependency_manager
self.tool_dependency_cache_dir = tool_dependency_cache_dir
self.precache_dependencies = precache_dependencies
# Deployers may either specify a complete list of mapping files or get the default for free and just
# specify a local mapping file to adapt and extend the default one.
if "conda_mapping_files" in kwargs:
self.conda_mapping_files = kwargs["conda_mapping_files"]
else:
self.conda_mapping_files = [
self.local_conda_mapping_file,
os.path.join(self.root, "lib", "galaxy", "tools", "deps", "resolvers", "default_conda_mapping.yml"),
]

self.enable_beta_mulled_containers = string_as_bool( kwargs.get( 'enable_beta_mulled_containers', 'False' ) )
containers_resolvers_config_file = kwargs.get( 'containers_resolvers_config_file', None )
5 changes: 5 additions & 0 deletions lib/galaxy/tools/deps/resolvers/default_conda_mapping.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- from: R
to: r-base
- from: blast+
to: blast

14 changes: 14 additions & 0 deletions test/functional/tools/legacy_r.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
<tool id="legacy_R" name="legacy_R" version="0.1.0">
<command detect_errors="exit_code"><![CDATA[
R --version > $out_file1
]]></command>
<requirements>
<requirement type="package">R</requirement>
</requirements>
<inputs>
<param name="input1" type="text" value="The value" />
</inputs>
<outputs>
<data name="out_file1" format="txt" />
</outputs>
</tool>
2 changes: 2 additions & 0 deletions test/functional/tools/samples_tool_conf.xml
Original file line number Diff line number Diff line change
@@ -123,6 +123,8 @@
<tool file="for_tours/filtering.xml" />
</section>

<!-- Tools for dependency and container testing. -->
<tool file="legacy_r.xml" />
<tool file="mulled_example_multi_1.xml" />
<tool file="mulled_example_conflict.xml" />

17 changes: 17 additions & 0 deletions test/integration/test_resolvers.py
Original file line number Diff line number Diff line change
@@ -4,6 +4,9 @@
from tempfile import mkdtemp

from base import integration_util
from base.populators import (
DatasetPopulator,
)

GNUPLOT = {u'version': u'4.6', u'type': u'package', u'name': u'gnuplot'}

@@ -71,6 +74,20 @@ def test_dependency_status_installed_exact( self ):
response = create_response.json()
self._assert_dependency_type(response)

def test_legacy_r_mapping( self ):
"""
"""
dataset_populator = DatasetPopulator(self.galaxy_interactor)
history_id = dataset_populator.new_history()
payload = dataset_populator.run_tool_payload(
tool_id="legacy_R",
inputs={},
history_id=history_id,
)
create_response = self._post( "tools", data=payload )
self._assert_status_code_is( create_response, 200 )
dataset_populator.wait_for_history( history_id, assert_ok=True )

def test_dependency_status_installed_not_exact( self ):
"""
GET request to dependency_resolvers/dependency with GNUPLOT dependency.

0 comments on commit a95eebb

Please sign in to comment.