[ARVADOS] updated: cff7d1f42e3818d1ba68edfc225261f335e10184

git at public.curoverse.com git at public.curoverse.com
Thu Jul 24 08:44:56 EDT 2014


Summary of changes:
 crunch_scripts/arvados-bcbio-nextgen.py | 37 +++++++++++++++++++++++++--------
 1 file changed, 28 insertions(+), 9 deletions(-)

       via  cff7d1f42e3818d1ba68edfc225261f335e10184 (commit)
      from  96732928535a2eedd40843fbe86fc90eef03f9fe (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit cff7d1f42e3818d1ba68edfc225261f335e10184
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Thu Jul 24 08:44:54 2014 -0400

    Work in progress on bcbio submitting jobs to arvados.

diff --git a/crunch_scripts/arvados-bcbio-nextgen.py b/crunch_scripts/arvados-bcbio-nextgen.py
index df66cf6..a22d8e7 100755
--- a/crunch_scripts/arvados-bcbio-nextgen.py
+++ b/crunch_scripts/arvados-bcbio-nextgen.py
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#!/usr/local/share/bcbio-nextgen/anaconda/bin/python
 
 import arvados
 import subprocess
@@ -7,10 +7,8 @@ import shutil
 import os
 import sys
 
-if len(arvados.current_task()['parameters']) > 0:
-    p = arvados.current_task()['parameters']
-else:
-    p = arvados.current_job()['script_parameters']
+p = arvados.current_job()['script_parameters']
+taskp = arvados.current_task()['parameters']
 
 t = arvados.current_task().tmpdir
 
@@ -99,15 +97,36 @@ os.symlink(arvados.get_job_param_mount("gemini_data"), "/usr/local/share/bcbio-n
 
 os.chdir(arvados.current_task().tmpdir)
 
-rcode = subprocess.call(["bcbio_nextgen.py", "--workflow", "template", "/tmp/crunch-job/freebayes-variant.yaml", "project1",
+os.mkdirs("/tmp/crunch-job/project1/work")
+os.mkdirs("/tmp/crunch-job/project1/final")
+
+if "runfn" in taskp:
+    with open("/tmp/crunch-job/project1/work/task", "w") as f:
+        yaml.dump_safe(taskp['item'], f)
+    os.chdir("/tmp/crunch-job/project1/work")
+    rcode = subprocess.call(["bcbio_nextgen.py", "runfn", "task"), ])
+elif "runfn" in p:
+    for i in taskp['items']:
+        arvados.api().job_tasks().create(body={
+            'job_uuid': arvados.current_job()['uuid'],
+                'created_by_job_task_uuid': arvados.current_task()['uuid'],
+                'sequence': 1,
+                'parameters': {
+                    'runfn':p['runfn'],
+                    'item':i
+                    }
+        }).execute()
+    sys.exit(0)
+else:
+    rcode = subprocess.call(["bcbio_nextgen.py", "--workflow", "template", "/tmp/crunch-job/freebayes-variant.yaml", "project1",
                          subst.do_substitution(p, "$(file $(R1))"),
                          subst.do_substitution(p, "$(file $(R2))")])
 
-os.chdir("project1/work")
+    os.chdir("/tmp/crunch-job/project1/work")
 
-os.symlink("/usr/local/share/bcbio-nextgen/galaxy/tool-data", "tool-data")
+    os.symlink("/usr/local/share/bcbio-nextgen/galaxy/tool-data", "tool-data")
 
-rcode = subprocess.call(["bcbio_nextgen.py", "../config/project1.yaml", "-n", os.environ['CRUNCH_NODE_SLOTS']])
+    rcode = subprocess.call(["bcbio_nextgen.py", "../config/project1.yaml", "-n", os.environ['CRUNCH_NODE_SLOTS']])
 
 print("run-command: completed with exit code %i (%s)" % (rcode, "success" if rcode == 0 else "failed"))
 

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list