Skip to content

Commit

Permalink
Several improvements in documentation generator, plus additional docu…
Browse files Browse the repository at this point in the history
…mentation.

* Added MyST plugin, to allow writing the documentation in MarkDown.
* Copied documentation from the main branch, already written in MarkDown, regarding command line directives.
  • Loading branch information
jmfernandez committed Jun 25, 2024
1 parent 0eb4c71 commit f1f7fae
Show file tree
Hide file tree
Showing 8 changed files with 1,665 additions and 7 deletions.
4 changes: 2 additions & 2 deletions docs/source/cli.rst
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
CLI
===
CLI directives
==============


.. argparse::
Expand Down
36 changes: 36 additions & 0 deletions docs/source/command-line.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
Command-line description
===

WfExS main directives are:

![WfExS-backend commands](images/wfexs-commands.svg)

* `init`: This command is used to initialize a WfExS installation. It takes a local configuration file through `-L` parameter, and it can both generate crypt4gh paired keys for installation work and identification purposes and update the path to them in case they are not properly defined. Those keys are needed to decrypt encrypted working directories, and in the future to decrypt secure requests and encrypt secure results.

* `config-validate`: This command is used to validate workflow staging configuration file, as well as its paired security context configuration file using the corresponding JSON Schemas. It honours `-L`, `-W`, `-Z` parameters and `WFEXS_CONFIG_FILE` environment variable. If command is not set, this is the default command to be run.

* `cache`: This command is used to manage the different caches, helping in their own lifecycle (list, fetch, inject, validate, remove). It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable.

* `stage`: This command is used to first validate workflow staging and security context configuration files, then fetch all the workflow preconditions and files, staging them for an execution. It honours `-L`, `-W`, `-Z` parameters and `WFEXS_CONFIG_FILE` environment variable, and once the staging is finished it prints the path to the parent execution environment.

* `re-stage`: This command is used to reuse an already staged workflow in a completely uncoupled working directory. The command allows replacing some of the parameters.

* `import`: This command is used to fetch and import a previously generated Workflow Run RO-Crate, for reproducibility. The command allows replacing some of the original parameters, for replicability.

* `staged-workdir`: This command is complementary to `stage`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable. This command has several subcommands which help on the workflow execution lifecycle (list available working directories and their statuses, remove some of them, execute either a shell or a custom command in a working directory context, execute, export prospective and retrospective provenance to RO-Crate, ...).

* `export`: This command is complementary to `stage`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter to locate the execution environment directory to be used, properly staged through `stage`. It also depends on both -E and -Z parameters, to declare the different export patterns and the needed credentials to complete the rules. This command has a couple of subcommands to list previously exported items and to do those exports.

* `export-stage` _(to be done)_: This command is complementary to `stage`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter to locate the execution environment directory to be used, properly staged through `stage`. It will bundle the description of the staged environment in an RO-Crate, in order to be reused later, or uploaded to places like WorkflowHub. All of this assuming there is an stage there.

* `offline-execute`: This command is complementary to `stage`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter to locate the execution environment directory to be used, properly staged through `stage`. It executes the workflow, assuming all the preconditions are in place.

* `export-results`: This command is complementary to `offline-execute`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter to locate the execution environment directory to be used, properly staged through `stage` and executed through `offline-execute`. It export the results from an execution at a working directory, assuming there is an execution there. Export rules should be described in the file used in `-W` parameter when the working directory was staged.

* `export-crate`: This command is complementary to `export-results`. It recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter to locate the execution environment directory to be used, properly staged through `stage` and executed through `offline-execute` and `export-results`. It bundles the metadata and provenance results from an execution at a working directory in an RO-Crate, assuming there is an execution there.

* `mount-workdir`: This command is a helper to inspect encrypted execution environments, as it mounts its working directory for a limited time. As `export-stage`, `offline-execute` or `export-results`, it recognizes both `-L` parameter and `WFEXS_CONFIG_FILE` environment variable, and depends on `-J` parameter.

* `execute`: This command's behaviour is equivalent to `stage` followed by `export-stage`, `offline-execute`, `export-results` and `export-crate`.

When the execution has finished properly, the working directory `outputs` subdirectory should contain both the outputs and an `execution.crate.zip`, which can be used to create a workflow entry in <https://workflowhub.eu>.
18 changes: 14 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@

# -- Project information

import wfexs_backend

project = 'WfExS-backend'
copyright = '2022-2023, Barcelona Supercomputing Center'
author = 'José Mª Fernández, Laura Rodríguez-Navas'
copyright = wfexs_backend.__copyright__
author = wfexs_backend.__author__

release = '0.1'
version = '0.1.0'
release = wfexs_backend.__version__
version = wfexs_backend.get_WfExS_version_str()

# -- General configuration

Expand All @@ -29,6 +31,7 @@
'sphinx_copybutton',
'sphinxarg.ext',
'sphinxcontrib.datatemplates',
'myst_parser',
]

intersphinx_mapping = {
Expand All @@ -39,6 +42,13 @@

templates_path = ['_templates']

source_suffix = {
'.rst': 'restructuredtext',
'.md': 'markdown',
}

myst_enable_extensions = ['colon_fence']

# -- Options for HTML output

html_theme = 'sphinx_rtd_theme'
Expand Down
Loading

0 comments on commit f1f7fae

Please sign in to comment.