Permalink
Browse files

Use ephemeris to handle shed tools for workflows.

  • Loading branch information...
jmchilton committed Jun 15, 2016
1 parent 72f6740 commit 1c6cfbb1b496b4748cc24e60fac6a34f5b1817f6
@@ -64,7 +64,6 @@ def cli(ctx, paths, **kwds):
against that same Galaxy root - but this may not be bullet proof yet so
please careful and do not try this against production Galaxy instances.
"""
kwds["for_tests"] = True
runnables = for_paths(paths)
enable_beta_test = any([r.type not in [RunnableType.galaxy_tool, RunnableType.directory] for r in runnables])
enable_beta_test = enable_beta_test or not is_galaxy_engine(**kwds)
@@ -74,6 +73,7 @@ def cli(ctx, paths, **kwds):
test_data = engine.test(runnables)
return_value = handle_reports_and_summary(ctx, test_data.structured_data, kwds=kwds)
else:
kwds["for_tests"] = True
with galaxy_config(ctx, runnables, **kwds) as config:
return_value = run_in_config(ctx, config, **kwds)

@@ -81,6 +81,7 @@ def _execute(config, runnable, job_path, **kwds):
history_id=history_id,
inputs=job_dict,
inputs_by="name",
allow_tool_state_corrections=True,
)
invocations_url = "%s/%s/invocations" % (
user_gi._make_url(user_gi.workflows),
@@ -29,6 +29,7 @@
)
from .workflows import (
import_workflow,
install_shed_repos,
)
from planemo.conda import build_conda_context
from planemo.docker import docker_host_args
@@ -610,6 +611,7 @@ def install_workflows(self):
self._install_workflow(runnable.path)

def _install_workflow(self, path):
install_shed_repos(path, self.gi)
workflow = import_workflow(path, admin_gi=self.gi, user_gi=self.user_gi)
self._workflow_ids[path] = workflow["id"]

@@ -12,9 +12,32 @@
BioBlendImporterGalaxyInterface = None
ImporterGalaxyInterface = object

try:
from ephemeris import shed_install
except ImportError:
shed_install = None

import yaml


def load_shed_repos(path):
# TODO: This is crap - doesn't have nested repositories at all.
if path.endswith(".ga"):
with open(path, "r") as f:
workflow = json.load(f)
else:
with open(path, "r") as f:
workflow = yaml.load(f)

return workflow.get("tools", [])


def install_shed_repos(path, admin_gi):
tools_info = load_shed_repos(path)
if tools_info:
shed_install.install_tools(tools_info, admin_gi, path, default_install_tool_dependencies=False)


def import_workflow(path, admin_gi, user_gi):
"""Import a workflow path to specified Galaxy instance."""
importer = BioBlendImporterGalaxyInterface(
@@ -8,5 +8,6 @@ jinja2
glob2
virtualenv
gxformat2
ephemeris
galaxy-lib>=16.7.9
cwltool>=1.0.20160511162129 ; python_version == '2.7'
@@ -0,0 +1 @@
Hello!
@@ -0,0 +1,8 @@
- doc: Simple test replacing some text.
job:
input1:
class: File
path: hello.txt
outputs:
wf_output_1:
checksum: "sha1$a8d191538209e335154750d2df575b9ddfb16fc7"
@@ -0,0 +1,17 @@
class: GalaxyWorkflow
name: "Test Workflow Shed Stuffs"
tools:
- name: text_processing
owner: bgruening
inputs:
- id: input1
outputs:
- id: wf_output_1
source: sed#output
steps:
- tool_id: tp_sed_tool
label: sed
state:
infile:
$link: input1
code: "s/ World//g"

0 comments on commit 1c6cfbb

Please sign in to comment.