[ARVADOS] created: 1.1.4-362-gad5f111
Git user
git at public.curoverse.com
Thu Jun 7 10:13:21 EDT 2018
at ad5f111b67e2bf1c43ce9bc37e6b11b8c753f62d (commit)
commit ad5f111b67e2bf1c43ce9bc37e6b11b8c753f62d
Author: Peter Amstutz <pamstutz at veritasgenetics.com>
Date: Thu Jun 7 09:44:16 2018 -0400
11907: Add option to uploadfiles to disable packing.
Arvados-DCO-1.1-Signed-off-by: Peter Amstutz <pamstutz at veritasgenetics.com>
diff --git a/sdk/python/arvados/commands/run.py b/sdk/python/arvados/commands/run.py
index 831e496..c4748fa 100644
--- a/sdk/python/arvados/commands/run.py
+++ b/sdk/python/arvados/commands/run.py
@@ -136,20 +136,21 @@ def statfile(prefix, fn, fnPattern="$(file %s/%s)", dirPattern="$(dir %s/%s/)",
return prefix+fn
-def write_file(collection, pathprefix, fn):
+def write_file(collection, pathprefix, fn, flush=False):
with open(os.path.join(pathprefix, fn)) as src:
dst = collection.open(fn, "w")
r = src.read(1024*128)
while r:
dst.write(r)
r = src.read(1024*128)
- dst.close(flush=False)
+ dst.close(flush=flush)
def uploadfiles(files, api, dry_run=False, num_retries=0,
project=None,
fnPattern="$(file %s/%s)",
name=None,
- collection=None):
+ collection=None,
+ packed=True):
# Find the smallest path prefix that includes all the files that need to be uploaded.
# This starts at the root and iteratively removes common parent directory prefixes
# until all file paths no longer have a common parent.
@@ -199,12 +200,12 @@ def uploadfiles(files, api, dry_run=False, num_retries=0,
continue
prev = localpath
if os.path.isfile(localpath):
- write_file(collection, pathprefix, f.fn)
+ write_file(collection, pathprefix, f.fn, not packed)
elif os.path.isdir(localpath):
for root, dirs, iterfiles in os.walk(localpath):
root = root[len(pathprefix):]
for src in iterfiles:
- write_file(collection, pathprefix, os.path.join(root, src))
+ write_file(collection, pathprefix, os.path.join(root, src), not packed)
filters=[["portable_data_hash", "=", collection.portable_data_hash()]]
if name:
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list