[ARVADOS] updated: defaa234ca09f1c0a202a77d7660b75d3c12de02
Git user
git at public.curoverse.com
Fri Sep 16 10:54:21 EDT 2016
Summary of changes:
sdk/cwl/arvados_cwl/__init__.py | 12 ++++++++++++
sdk/cwl/arvados_cwl/arv-cwl-schema.yml | 14 ++++++++++++++
sdk/cwl/setup.py | 1 +
3 files changed, 27 insertions(+)
create mode 100644 sdk/cwl/arvados_cwl/arv-cwl-schema.yml
via defaa234ca09f1c0a202a77d7660b75d3c12de02 (commit)
from 22773dcba5c8f59a01a08c1734dd5249517808c9 (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 defaa234ca09f1c0a202a77d7660b75d3c12de02
Author: Peter Amstutz <peter.amstutz at curoverse.com>
Date: Fri Sep 16 10:54:14 2016 -0400
10081: Custom extension of v1.0 schema to recognize RunInSingleContainer.
diff --git a/sdk/cwl/arvados_cwl/__init__.py b/sdk/cwl/arvados_cwl/__init__.py
index 1256260..20bbc41 100644
--- a/sdk/cwl/arvados_cwl/__init__.py
+++ b/sdk/cwl/arvados_cwl/__init__.py
@@ -15,6 +15,7 @@ import pkg_resources # part of setuptools
from cwltool.errors import WorkflowException
import cwltool.main
import cwltool.workflow
+import schema_salad
import arvados
import arvados.config
@@ -364,6 +365,15 @@ def arg_parser(): # type: () -> argparse.ArgumentParser
return parser
+def add_arv_hints():
+ cache = {}
+ res = pkg_resources.resource_stream(__name__, 'arv-cwl-schema.yml')
+ cache["https://w3id.org/cwl/arv-cwl-schema.yml"] = res.read()
+ res.close()
+ _, cwlnames, _, _ = cwltool.process.get_schema("v1.0")
+ _, extnames, _, _ = schema_salad.schema.load_schema("https://w3id.org/cwl/arv-cwl-schema.yml", cache=cache)
+ for n in extnames.names:
+ cwlnames.add_name("http://arvados.org/cwl#"+n, "", extnames.get_name(n, ""))
def main(args, stdout, stderr, api_client=None):
parser = arg_parser()
@@ -373,6 +383,8 @@ def main(args, stdout, stderr, api_client=None):
if (arvargs.create_template or arvargs.create_workflow or arvargs.update_workflow) and not arvargs.job_order:
job_order_object = ({}, "")
+ add_arv_hints()
+
try:
if api_client is None:
api_client=arvados.api('v1', model=OrderedJsonModel())
diff --git a/sdk/cwl/arvados_cwl/arv-cwl-schema.yml b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
new file mode 100644
index 0000000..2e5044d
--- /dev/null
+++ b/sdk/cwl/arvados_cwl/arv-cwl-schema.yml
@@ -0,0 +1,14 @@
+$base: "http://arvados.org/cwl#"
+$graph:
+- name: RunInSingleContainer
+ type: record
+ doc: |
+ Indicates that a subworkflow should run in a single container
+ and not be scheduled as separate steps.
+ fields:
+ - name: class
+ type: string
+ doc: "Always 'arv:RunInSingleContainer'"
+ jsonldPredicate:
+ _id: "@type"
+ _type: "@vocab"
diff --git a/sdk/cwl/setup.py b/sdk/cwl/setup.py
index a6e4c5e..b558744 100644
--- a/sdk/cwl/setup.py
+++ b/sdk/cwl/setup.py
@@ -25,6 +25,7 @@ setup(name='arvados-cwl-runner',
download_url="https://github.com/curoverse/arvados.git",
license='Apache 2.0',
packages=find_packages(),
+ package_data={'arvados_cwl': ['arv-cwl-schema.yml']},
scripts=[
'bin/cwl-runner',
'bin/arvados-cwl-runner'
-----------------------------------------------------------------------
hooks/post-receive
--
More information about the arvados-commits
mailing list