[ARVADOS] updated: 92f63fe18f3b6d8e4ee589e7a962d39ed4754e9e

git at public.curoverse.com git at public.curoverse.com
Mon Aug 4 14:55:31 EDT 2014


Summary of changes:
 crunch_scripts/decompress-all.py | 40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100755 crunch_scripts/decompress-all.py

       via  92f63fe18f3b6d8e4ee589e7a962d39ed4754e9e (commit)
      from  a4f3031bb766ca8a9b9dfbc738dbf0dc9bcd5b67 (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 92f63fe18f3b6d8e4ee589e7a962d39ed4754e9e
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date:   Mon Aug 4 14:55:25 2014 -0400

    Decompress-all wip

diff --git a/crunch_scripts/decompress-all.py b/crunch_scripts/decompress-all.py
new file mode 100755
index 0000000..a3858d2
--- /dev/null
+++ b/crunch_scripts/decompress-all.py
@@ -0,0 +1,40 @@
+#!/usr/bin/env python
+
+import arvados
+import re
+import subprocess
+
+arvados.job_setup.one_task_per_input_file(if_sequence=0, and_end_task=True,
+                                          input_as_path=True)
+
+task = arvados.current_task()
+
+input_file = arvados.gettaskparam('input')
+
+result = re.match(r"(^[a-f0-9]{32}\+\d+)(\+\S+)*(/.*)(/.*)?$", input_file)
+
+outdir = os.path.join(task.tmpdir, "output")
+os.mkdirs(outdir)
+os.chdir(outdir)
+
+if result != None:
+    cr = arvados.CollectionReader(re.group(1))
+    streamname = '.'
+    if re.group(3) != None:
+        streamname += re.group(2)
+        filename = re.group(3)[1:]
+    else:
+        filename = re.group(2)[1:]
+
+    os.mkdirs(streamname)
+    os.chdir(streamname)
+    streamreader = filter(lambda s: s.name() == streamname, cr.all_streams())[0]
+    filereader = stream.files()[filename]
+    rc = subprocess.call("dtrx", "-r", "-n", arvados.get_task_param_mount('input'))
+    if rc == 0:
+        out.write_directory_tree(outdir, max_manifest_depth=0)
+        arvados.task_set_output(out.finish())
+    else:
+        arvados.task_set_output(streamname + filereader.as_manifest()[1:])
+else:
+    sys.exit(1)

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list