[ARVADOS] updated: 1.1.4-322-gb01b480
Git user
git at public.curoverse.com
Wed Jun 6 08:31:47 EDT 2018
Summary of changes:
sdk/cwl/arvados_cwl/__init__.py | 14 ++++++++------
sdk/cwl/tests/test_make_output.py | 4 ++--
sdk/cwl/tests/test_submit.py | 11 +++++++++++
3 files changed, 21 insertions(+), 8 deletions(-)
via b01b480adb45c3bbfcfab13e343e08c16854dedc (commit)
from 95c01d22571043d7b6405f928538204cf930d453 (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 b01b480adb45c3bbfcfab13e343e08c16854dedc
Author: Fuad Muhic <fmuhic at capeannenterprises.com>
Date: Tue Jun 5 17:30:05 2018 +0200
Add check for multiple storage classes in arvados-cwl-runner
Arvados-DCO-1.1-Signed-off-by: Fuad Muhic <fmuhic at capeannenterprises.com>
diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 6d4eda4..31995ff 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -601,10 +601,7 @@ class ArvCwlRunner(object):
if self.output_tags is None:
self.output_tags = ""
- storage_classes = ["default"]
- if kwargs.get("storage_classes"):
- storage_classes = kwargs.get("storage_classes").strip().split(",")
-
+ storage_classes = kwargs.get("storage_classes")
self.final_output, self.final_output_collection = self.make_output_collection(self.output_name, storage_classes, self.output_tags, self.final_output)
self.set_crunch_output()
@@ -723,8 +720,8 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
parser.add_argument("--enable-dev", action="store_true",
help="Enable loading and running development versions "
"of CWL spec.", default=False)
- parser.add_argument('--storage-classes',
- help="Specify comma separated list of storage classes to be used when saving wortkflow output to Keep.")
+ parser.add_argument('--storage-classes', default="default",
+ help="Specify comma separated list of storage classes to be used when saving workflow output to Keep.")
parser.add_argument("--intermediate-output-ttl", type=int, metavar="N",
help="If N > 0, intermediate output collections will be trashed N seconds after creation. Default is 0 (don't trash).",
@@ -786,6 +783,11 @@ def main(args, stdout, stderr, api_client=None, keep_client=None,
job_order_object = None
arvargs = parser.parse_args(args)
+ arvargs.storage_classes = arvargs.storage_classes.strip().split(',')
+ if len(arvargs.storage_classes) > 1:
+ logger.error("Multiple storage classes are not supported currently.")
+ sys.exit(1)
+
if install_sig_handlers:
arv_cmd.install_signal_handlers()
diff --git a/sdk/cwl/tests/test_make_output.py b/sdk/cwl/tests/test_make_output.py
index 13b1aff..590c82d 100644
--- a/sdk/cwl/tests/test_make_output.py
+++ b/sdk/cwl/tests/test_make_output.py
@@ -39,7 +39,7 @@ class TestMakeOutput(unittest.TestCase):
final.open.return_value = openmock
openmock.__enter__.return_value = cwlout
- _, runner.final_output_collection = runner.make_output_collection("Test output", ["default"], "tag0,tag1,tag2", {
+ _, runner.final_output_collection = runner.make_output_collection("Test output", ["foo"], "tag0,tag1,tag2", {
"foo": {
"class": "File",
"location": "keep:99999999999999999999999999999991+99/foo.txt",
@@ -56,7 +56,7 @@ class TestMakeOutput(unittest.TestCase):
final.copy.assert_has_calls([mock.call('bar.txt', 'baz.txt', overwrite=False, source_collection=readermock)])
final.copy.assert_has_calls([mock.call('foo.txt', 'foo.txt', overwrite=False, source_collection=readermock)])
- final.save_new.assert_has_calls([mock.call(ensure_unique_name=True, name='Test output', owner_uuid='zzzzz-j7d0g-zzzzzzzzzzzzzzz', storage_classes=['default'])])
+ final.save_new.assert_has_calls([mock.call(ensure_unique_name=True, name='Test output', owner_uuid='zzzzz-j7d0g-zzzzzzzzzzzzzzz', storage_classes=['foo'])])
self.assertEqual("""{
"bar": {
"basename": "baz.txt",
diff --git a/sdk/cwl/tests/test_submit.py b/sdk/cwl/tests/test_submit.py
index 77bef07..d6553aa 100644
--- a/sdk/cwl/tests/test_submit.py
+++ b/sdk/cwl/tests/test_submit.py
@@ -333,6 +333,17 @@ class TestSubmit(unittest.TestCase):
self.assertEqual(capture_stdout.getvalue(),
stubs.expect_pipeline_uuid + '\n')
+ @stubs
+ def test_error_when_multiple_storage_classes_specified(self, stubs):
+ capture_stdout = cStringIO.StringIO()
+ storage_classes = "foo,bar"
+
+ with self.assertRaises(SystemExit):
+ arvados_cwl.main(
+ ["--debug", "--storage-classes", storage_classes,
+ "tests/wf/submit_wf.cwl", "tests/submit_test_job.json"],
+ capture_stdout, sys.stderr, api_client=stubs.api)
+
@mock.patch("time.sleep")
@stubs
def test_submit_on_error(self, stubs, tm):
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list