Merge pull request #2253 from mvdbeek/conda-metadata-env

Generate metadata in separate conda environment
This commit is contained in:
John Chilton
2016-04-27 09:55:48 -04:00
3 changed files with 9 additions and 3 deletions
+1 -1
View File
@@ -1665,7 +1665,7 @@ class JobWrapper( object ):
if metadata_tool is not None:
# Due to tool shed hacks for migrate and installed tool tests...
# see (``setup_shed_tools_for_test`` in test/base/driver_util.py).
dependency_shell_commands = metadata_tool.build_dependency_shell_commands(job_directory=self.working_directory)
dependency_shell_commands = metadata_tool.build_dependency_shell_commands(job_directory=self.working_directory, metadata=True)
if dependency_shell_commands:
dependency_shell_commands = "; ".join(dependency_shell_commands)
command = "%s; %s" % (dependency_shell_commands, command)
+2 -1
View File
@@ -1252,13 +1252,14 @@ class Tool( object, Dictifiable ):
visit_input_values( self.inputs, values, validate_inputs )
return messages
def build_dependency_shell_commands( self, job_directory=None ):
def build_dependency_shell_commands( self, job_directory=None, metadata=False ):
"""Return a list of commands to be run to populate the current environment to include this tools requirements."""
return self.app.toolbox.dependency_manager.dependency_shell_commands(
self.requirements,
installed_tool_dependencies=self.installed_tool_dependencies,
tool_dir=self.tool_dir,
job_directory=job_directory,
metadata=metadata,
)
@property
+6 -1
View File
@@ -125,7 +125,12 @@ class CondaDependencyResolver(DependencyResolver, ListableDependencyResolver, In
return INDETERMINATE_DEPENDENCY
# Have installed conda_target and job_directory to send it too.
conda_environment = os.path.join(job_directory, "conda-env")
# If dependency is for metadata generation, store environment in conda-metadata-env
if kwds.get("metadata", False):
conda_env = "conda-metadata-env"
else:
conda_env = "conda-env"
conda_environment = os.path.join(job_directory, conda_env)
env_path, exit_code = build_isolated_environment(
conda_target,
path=conda_environment,