o2r-project / erc-spec

Executable Research Compendium specification and guides
https://o2r.info/erc-spec/
Creative Commons Zero v1.0 Universal
7 stars 5 forks source link

Alternative control commands: bash, Makefile #63

Open nuest opened 6 years ago

nuest commented 6 years ago

Currently the ERC is focused on Docker and implementations must construct the execution command themselves, most importantly to support substitution.

Alternatively, the ERC could support bash commands (similar to a Travis config file) or Makefile - based execution. In case for this, the following draft of control commands can be extended:

Implementations SHOULD support a list of [bash](https://en.wikipedia.org/wiki/Bash_(Unix_shell)) commands as control statements.
These commands are given as a list under the node `cmd` under the root-level node `execution`.
Non-bash commands MUST be defined under own nodes under the `execution` node.
The current/working directory for these commands MUST be the [ERC base directory](#base-directory).

The execution commands MAY ensure the re-computation is independent from the environment.
For example, the time zone could be fixed via an environment variable `TZ=CET`, so output formatting of timestamps does not break [checking](../glossary.md#check).
This is in addition to ERC creators handling reproducibility at a script level.

!!! tip "Examples for control statements"
    ```yml
    execution:
      cmd:
        - `./prepare.sh --input my_data`
        - `./execute.sh --output results --iterations 3`
```yml
id: 12345
execution:
  cmd: >-
    'docker run -it --rm --volume $(pwd):/erc --volume $(pwd)/other_data.csv:/erc/data.csv:ro -e TZ=CET erc:12345'
```