Skip to content

Commit

Permalink
Merge 710adb4 into 0464d24
Browse files Browse the repository at this point in the history
  • Loading branch information
roksys committed Jan 22, 2020
2 parents 0464d24 + 710adb4 commit 6c61e34
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 15 deletions.
50 changes: 36 additions & 14 deletions docs/userguide.rst
Expand Up @@ -45,7 +45,7 @@ Note that you can also specify a concrete run number:

.. code-block:: console
$ export REANA_WORKON=myfirstanalysis.3
$ export REANA_WORKON=myfirstanalysis.42
which will permit to work on the third run of the "myfirstanalysis" workflow,
for example to check out past input and output files.
Expand Down Expand Up @@ -214,7 +214,7 @@ Non-existing parameters will be skipped.
.. code-block:: console
$ reana-client start -p myparam1=myval1 -p myparam2=myval2
workflow.1 has been started.
myanalysis.42 has been started.
Running analysis
Expand All @@ -229,12 +229,12 @@ analysis inputs, and start the workflow run.
$ vim reana.yaml
$ reana-client run -n myanalysis
[INFO] Creating a workflow...
myanalysis.1
myanalysis.42
[INFO] Uploading files...
File code/helloworld.py was successfully uploaded.
File data/names.txt was successfully uploaded.
[INFO] Starting workflow...
myanalysis.1 has been started.
myanalysis.42 has been started.
$ export REANA_WORKON=myanalysis
$ reana-client status
NAME RUN_NUMBER CREATED STATUS PROGRESS
Expand All @@ -252,9 +252,31 @@ option to the ``reana-client start`` or ``reana-client run`` commands.

.. code-block:: console
$ reana-client start -w workflow.1 -o target='gendata'
$ reana-client start -w myanalysis.42 -o TARGET='gendata'
# or
$ reana-client run -w workflow.1 -o target='gendata'
$ reana-client run -w myanalysis.42 -o TARGET='gendata'
If you want to start workflow execution from a certain step you should use
operational option ``FROM`` with a desired step name.

.. code-block:: console
$ reana-client start -w myanalysis.42 -o FROM='fitdata'
# or
$ reana-client run -w myanalysis.42 -o FROM='fitdata'
If you want to restart workflow on the same workspace you should use
``--restart`` flag of ``reana-client start``.

Note that workflow restarting can be used in a combination with operational
options ``FROM`` and ``TARGET``.

.. code-block:: console
# Restarts workflow on the same workspace from step named fitdata
$ reana-client start -w myanalysis.42 -o FROM='fitdata' --restart
# Restarts workflow on the same workspace and starts execution from mystep3 to mystep7
$ reana-client start -w myanalysis.42 -o FROM='mystep3' -o TARGET='mystep7'--restart
*CWL*

Expand All @@ -264,9 +286,9 @@ the ``reana-client start`` or ``reana-client run`` commands.

.. code-block:: console
$ reana-client start -w workflow.1 -o target='gendata'
$ reana-client start -w myanalysis.42 -o target='gendata'
# or
$ reana-client run -w workflow.1 -o target='gendata'
$ reana-client run -w myanalysis.42 -o target='gendata'
*Yadage*

Expand Down Expand Up @@ -303,7 +325,7 @@ environment spawned on the remote containerised platform.

.. code-block:: console
$ reana-client open -w myanalysis.1 jupyter
$ reana-client open -w myanalysis.42 jupyter
https://reana.cern.ch/7cd4d23e-48d1-4f7f-8a3c-3a6d256fb8bc?token=P-IkL_7w25IDHhes8I7DtICWLNQm2WAZ9gkoKC2vq10
It could take several minutes to start the interactive session.
Expand All @@ -325,8 +347,8 @@ via ``close`` command.

.. code-block:: console
$ reana-client close -w myanalysis.1
Interactive session for workflow myanalysis.1 was successfully closed
$ reana-client close -w myanalysis.42
Interactive session for workflow myanalysis.42 was successfully closed
Deleting workflows
~~~~~~~~~~~~~~~~~~
Expand All @@ -346,15 +368,15 @@ as follows:

.. code-block:: console
$ reana-client delete --workflow=myanalysis.123
$ reana-client delete --workflow=myanalysis.42
After simple deletion the workspace can be accessed to retrieve files uploaded
there. If you are sure the workspace can also be deleted pass the
--include-workspace flag.

.. code-block:: console
$ reana-client delete --workflow=myanalysis.123 --include-workspace
$ reana-client delete --workflow=myanalysis.42 --include-workspace
To delete all runs of a given workflow, pass the --include-all-runs flag and
run:
Expand All @@ -368,7 +390,7 @@ pass the --include-records flag:

.. code-block:: console
$ reana-client delete --workflow=myanalysis.1 --include-records
$ reana-client delete --workflow=myanalysis.42 --include-records
Stopping workflows
~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions reana_client/api/client.py
Expand Up @@ -216,6 +216,8 @@ def start_workflow(workflow, access_token, parameters):
:param access_token: access token of the current user.
:param parameters: dict of workflow parameters to override the original
ones (after workflow creation).
:param restart: boolean if workflow should be restarted on the same
workspace.
"""
try:
(response,
Expand Down
13 changes: 12 additions & 1 deletion reana_client/cli/workflow.py
Expand Up @@ -280,9 +280,19 @@ def workflow_create(ctx, file, name,
default=False,
help='If set, follows the execution of the workflow until termination.',
)
@click.option(
'--restart', 'restart',
is_flag=True,
default=False,
help='If set, allows to restart workflow on the same workspace. If '
'combined with operational options, allows partial workflow '
'execution. '
'E.g --restart --option FROM=gendata (restarts workflow on the same '
'workspace from step named "gendata")',
)
@click.pass_context
def workflow_start(ctx, workflow, access_token,
parameters, options, follow): # noqa: D301
parameters, options, follow, restart): # noqa: D301
"""Start previously created workflow.
The `start` command allows to start previously created workflow. The
Expand All @@ -303,6 +313,7 @@ def workflow_start(ctx, workflow, access_token,
parsed_parameters = {'input_parameters':
dict(p.split('=') for p in parameters)}
parsed_parameters['operational_options'] = ' '.join(options).split()
parsed_parameters['restart'] = restart
if workflow:
if parameters or options:
try:
Expand Down

0 comments on commit 6c61e34

Please sign in to comment.