From 2875146d7a8fa11073531121c75c263b461915bd Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Mon, 3 Sep 2018 18:54:17 +0200 Subject: [PATCH 1/4] openapi: updates to latest REANA Server * Harmonises date time format (closes #162). --- reana_client/openapi_connections/reana_server.json | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/reana_client/openapi_connections/reana_server.json b/reana_client/openapi_connections/reana_server.json index 21f794be..a1c4203e 100644 --- a/reana_client/openapi_connections/reana_server.json +++ b/reana_client/openapi_connections/reana_server.json @@ -223,24 +223,28 @@ "examples": { "application/json": [ { + "created": "2018-06-13T09:47:35.66097", "id": "256b25f4-4cfb-4684-b7a8-73872ef455a1", "name": "mytest-1", "status": "running", "user": "00000000-0000-0000-0000-000000000000" }, { + "created": "2018-06-13T09:47:35.66097", "id": "3c9b117c-d40a-49e3-a6de-5f89fcada5a3", "name": "mytest-2", "status": "finished", "user": "00000000-0000-0000-0000-000000000000" }, { + "created": "2018-06-13T09:47:35.66097", "id": "72e3ee4f-9cd3-4dc7-906c-24511d9f5ee3", "name": "mytest-3", "status": "created", "user": "00000000-0000-0000-0000-000000000000" }, { + "created": "2018-06-13T09:47:35.66097", "id": "c4c0a1a6-beef-46c7-be04-bf4b3beca5a1", "name": "mytest-4", "status": "created", @@ -251,6 +255,9 @@ "schema": { "items": { "properties": { + "created": { + "type": "string" + }, "id": { "type": "string" }, @@ -505,7 +512,7 @@ "description": "Request succeeded. Info about a workflow, including the status is returned.", "examples": { "application/json": { - "created": "2018-06-13 09:47:35.660977", + "created": "2018-06-13T09:47:35.66097", "id": "256b25f4-4cfb-4684-b7a8-73872ef455a1", "name": "mytest-1", "status": "created", @@ -720,7 +727,6 @@ "items": { "properties": { "last-modified": { - "format": "date-time", "type": "string" }, "name": { From 48f037be80f1c7be74969338c3136346ebe3a3f5 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Tue, 4 Sep 2018 15:27:28 +0200 Subject: [PATCH 2/4] installation: bump REANA-Commons version --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index f23900b4..2a615efa 100644 --- a/setup.py +++ b/setup.py @@ -69,7 +69,7 @@ 'click>=6.7', 'cwltool==1.0.20180326152342', 'pyOpenSSL==17.3.0', # FIXME remove once yadage-schemas solves deps. - 'reana-commons>=0.3.0', + 'reana-commons>=0.3.1', 'rfc3987==1.3.7', # FIXME remove once yadage-schemas solves deps. 'strict-rfc3339==0.7', # FIXME remove once yadage-schemas solves deps. 'tablib>=0.12.1', From e57f5b6b3ffed45f74a29fb47e19664ef8f09982 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Mon, 3 Sep 2018 18:52:36 +0200 Subject: [PATCH 3/4] docs: document serial CACHING parameter --- reana_client/cli/workflow.py | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/reana_client/cli/workflow.py b/reana_client/cli/workflow.py index eacac7e7..b1a377e6 100644 --- a/reana_client/cli/workflow.py +++ b/reana_client/cli/workflow.py @@ -212,7 +212,17 @@ def workflow_create(ctx, file, name, skip_validation, access_token): @click.command( 'start', - help='Start previously created workflow.') + help=""" + Start previously created workflow + + The workflow execution can be modified by setting operational + parameters using -p or --parameter, for example, for disabling + caching: + + $ reana-client start -p CACHING=false + + For now this functionality is only supported by serial workflows. + """) @click.option( '-w', '--workflow', @@ -225,13 +235,15 @@ def workflow_create(ctx, file, name, skip_validation, access_token): '--access-token', default=os.environ.get('REANA_ACCESS_TOKEN', None), help='Access token of the current user.') -@click.argument( - 'parameters', - nargs=-1, +@click.option( + '-p', '--parameter', + multiple=True, + help='Operatinal parameters. For now only CACHING=[true|false] is ' + 'supported in serial workflows.', ) @click.pass_context @with_api_client -def workflow_start(ctx, workflow, access_token, parameters): +def workflow_start(ctx, workflow, access_token, parameter): # noqa: D301 """Start previously created workflow.""" logging.debug('command: {}'.format(ctx.command_path.replace(" ", "."))) for p in ctx.params: @@ -244,7 +256,7 @@ def workflow_start(ctx, workflow, access_token, parameters): sys.exit(1) parsed_parameters = {'parameters': - dict(p.split('=') for p in parameters)} + dict(p.split('=') for p in parameter)} if workflow: try: From 3579191f6c51af74e4b2b4464522300e52f8bf15 Mon Sep 17 00:00:00 2001 From: Diego Rodriguez Date: Tue, 4 Sep 2018 15:13:49 +0200 Subject: [PATCH 4/4] global: standarise naming for reana components * We should use the form REANA-[Client|Server] when making reference to the package programatically, and the form REANA [client|server] when making reference to it in documentation. --- reana_client/__init__.py | 2 +- reana_client/api/client.py | 8 ++++---- reana_client/cli/__init__.py | 2 +- reana_client/cli/cwl_runner.py | 2 +- reana_client/cli/ping.py | 4 ++-- reana_client/cli/workflow.py | 2 +- reana_client/decorators.py | 4 ++-- reana_client/version.py | 2 +- 8 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reana_client/__init__.py b/reana_client/__init__.py index d6d4995b..195e2ae2 100644 --- a/reana_client/__init__.py +++ b/reana_client/__init__.py @@ -21,7 +21,7 @@ # granted to it by virtue of its status as an Intergovernmental Organization or # submit itself to any jurisdiction. -"""REANA-client.""" +"""REANA-Client.""" from __future__ import absolute_import, print_function diff --git a/reana_client/api/client.py b/reana_client/api/client.py index 36410d0a..75bc2139 100644 --- a/reana_client/api/client.py +++ b/reana_client/api/client.py @@ -38,7 +38,7 @@ class Client(object): """REANA API client code.""" def __init__(self, server_url): - """Create a OpenAPI client for REANA Server.""" + """Create a OpenAPI client for REANA server.""" json_spec = self._get_spec('reana_server.json') self._client = SwaggerClient.from_spec( json_spec, @@ -60,7 +60,7 @@ def _get_spec(self, spec_file): return json_spec def ping(self): - """Health check REANA Server.""" + """Health check REANA server.""" try: response, http_response = self._client.api.get_api_ping().result() if http_response.status_code == 200: @@ -73,7 +73,7 @@ def ping(self): except HTTPError as e: logging.debug( - 'REANA Server health check failed: ' + 'REANA server health check failed: ' '\nStatus: {}\nReason: {}\n' 'Message: {}'.format(e.response.status_code, e.response.reason, @@ -312,7 +312,7 @@ def get_files(self, workflow_id, access_token): raise e def upload_to_server(self, workflow, paths, access_token): - """Upload file or directory to REANA-Server. + """Upload file or directory to REANA server. Shared e.g. by `code upload` and `inputs upload`. diff --git a/reana_client/cli/__init__.py b/reana_client/cli/__init__.py index ae24da17..c7c9c06a 100644 --- a/reana_client/cli/__init__.py +++ b/reana_client/cli/__init__.py @@ -53,7 +53,7 @@ def __init__(self): default='WARNING') @click.pass_context def cli(ctx, loglevel): - """REANA Client for interacting with REANA Server.""" + """REANA client for interacting with REANA server.""" logging.basicConfig( format=DEBUG_LOG_FORMAT if loglevel == 'DEBUG' else LOG_FORMAT, stream=sys.stderr, diff --git a/reana_client/cli/cwl_runner.py b/reana_client/cli/cwl_runner.py index cfa9eef3..629f6912 100644 --- a/reana_client/cli/cwl_runner.py +++ b/reana_client/cli/cwl_runner.py @@ -52,7 +52,7 @@ def cwl_runner(client, quiet, outdir, processfile, jobfile): """Run CWL files in a standard format .""" server_url = os.environ.get('REANA_SERVER_URL', 'http://reana.cern.ch') - logging.info('REANA Server URL ($REANA_SERVER_URL) is: {}' + logging.info('REANA server URL ($REANA_SERVER_URL) is: {}' .format(server_url)) client = Client(server_url) diff --git a/reana_client/cli/ping.py b/reana_client/cli/ping.py index bbd9807e..68f0eab6 100644 --- a/reana_client/cli/ping.py +++ b/reana_client/cli/ping.py @@ -29,11 +29,11 @@ from reana_client.decorators import with_api_client -@click.command('ping', help='Health check REANA Server.') +@click.command('ping', help='Health check REANA server.') @click.pass_context @with_api_client def ping(ctx): - """Health check REANA Server.""" + """Health check REANA server.""" try: logging.info('Connecting to {0}'.format(ctx.obj.client.server_url)) response = ctx.obj.client.ping() diff --git a/reana_client/cli/workflow.py b/reana_client/cli/workflow.py index b1a377e6..dd719b45 100644 --- a/reana_client/cli/workflow.py +++ b/reana_client/cli/workflow.py @@ -165,7 +165,7 @@ def workflow_workflows(ctx, _filter, output_format, access_token, '--skip-validation', is_flag=True, help="If set, specifications file is not validated before " - "submitting it's contents to REANA Server.") + "submitting it's contents to REANA server.") @click.option( '-at', '--access-token', diff --git a/reana_client/decorators.py b/reana_client/decorators.py index 6439cb0d..d539ea83 100644 --- a/reana_client/decorators.py +++ b/reana_client/decorators.py @@ -31,7 +31,7 @@ def with_api_client(f): - """Decorator to inject the REANA Server API client to a Click command.""" + """Decorator to inject the REANA server API client to a Click command.""" def wrapper(*args, **kwargs): """Initialize config for API client. @@ -53,7 +53,7 @@ def wrapper(*args, **kwargs): 'REANA_SERVER_URL=https://reana.cern.ch/') sys.exit(1) - logging.info('REANA Server URL ($REANA_SERVER_URL) is: {}' + logging.info('REANA server URL ($REANA_SERVER_URL) is: {}' .format(server_url)) ctx.obj.client = Client(server_url) else: diff --git a/reana_client/version.py b/reana_client/version.py index a32a8273..5c2f8b1e 100644 --- a/reana_client/version.py +++ b/reana_client/version.py @@ -20,7 +20,7 @@ # granted to it by virtue of its status as an Intergovernmental Organization or # submit itself to any jurisdiction. -"""Version information for REANA-client. +"""Version information for REANA-Client. This file is imported by ``reana_client.__init__`` and parsed by ``setup.py``.