Skip to content

Commit f7a81cc

Browse files
authored
Merge pull request #79 from ResearchObject/rq4
Reference environment files using buildInstructions
2 parents 9bc9923 + b9f5512 commit f7a81cc

File tree

3 files changed

+128
-1
lines changed

3 files changed

+128
-1
lines changed

docs/profiles/0.5-DRAFT/provenance_run_crate/index.md

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -469,6 +469,59 @@ In some workflow systems (e.g., CWL, Galaxy), tools are typically wrappers for a
469469
}
470470
```
471471

472+
## Tool runtime environment
473+
474+
While the `softwareRequirements` of a tool can [specify software dependencies](../process_run_crate#specifying-software-dependencies) (as above) in terms of naming software, a more reproducible definition of a tool's runtime environment may need to include a particular set of binaries that are compiled and/or distributed to work together. (Note that _runtime environment_ here refers to a set of software, configuration and other dependency files, not [environment variables](../workflow_run_crate#environment-variables-as-formal-parameters)).
475+
476+
Some workflow engines support such package systems as a way to distribute tool dependencies, typically by referring to an _environment file_ which can be programmatically instantiated to retrieve and install a given set of binaries. In a Provenance Crate, environment files are indicated as `buildInstructions` for either the `HowToStep` (for a given step) or the `HowTo` (for the whole workflow).
477+
478+
For instance, to indicate a [Conda environment](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) for a Nextflow workflow:
479+
480+
```json
481+
{
482+
"@id": "main.nf",
483+
"@type": ["File", "SoftwareSourceCode", "ComputationalWorkflow", "HowTo"],
484+
"name": "Hello world in Nextflow",
485+
"programmingLanguage": {
486+
"@id": "https://w3id.org/workflowhub/workflow-ro-crate#nextflow"
487+
},
488+
"buildInstructions": {
489+
"@id": "environment.yml"
490+
}
491+
},
492+
{
493+
"@id": "environment.yml",
494+
"@type": "File",
495+
"name": "Conda environment",
496+
"encodingFormat": "application/yaml",
497+
"conformsTo": {
498+
"@id": "https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually",
499+
}
500+
},
501+
{
502+
"@id": "https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#create-env-file-manually",
503+
"@type": "WebPageElement",
504+
"name": "Conda environment file"
505+
}
506+
```
507+
508+
509+
The `encodingFormat` and/or contextual identifier for `conformsTo` SHOULD be provided for machine-readable build/dependency environment files, but it is currently out of scope for this profile to list all possible package environment systems.
510+
511+
The term `buildInstructions` is taken from [CodeMeta terms](https://codemeta.github.io/terms/), which are [scheduled to be included](https://github.com/ResearchObject/ro-crate/pull/276) in the RO-Crate 1.2 JSON-LD context. For RO-Crate 1.1, the term must be added to the `@context` as:
512+
513+
```json
514+
{
515+
"@context": [
516+
"https://w3id.org/ro/crate/1.1/context",
517+
"https://w3id.org/ro/terms/workflow-run",
518+
{ "buildInstructions": "https://codemeta.github.io/terms/buildInstructions" }
519+
],
520+
"@graph": [...]
521+
}
522+
```
523+
524+
472525

473526
## Conditional step execution
474527

docs/profiles/0.5-DRAFT/provenance_run_crate/ro-crate-metadata.json

Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@
4646
{ "@id": "https://w3id.org/ro/terms/workflow-run#ParameterConnection" },
4747
{ "@id": "https://w3id.org/ro/terms/workflow-run#connection" },
4848
{ "@id": "https://w3id.org/ro/terms/workflow-run#sourceParameter" },
49-
{ "@id": "https://w3id.org/ro/terms/workflow-run#targetParameter" }
49+
{ "@id": "https://w3id.org/ro/terms/workflow-run#targetParameter" },
50+
{ "@id": "https://codemeta.github.io/terms/buildInstructions" }
5051
],
5152
"hasResource": [
5253
{ "@id": "#hasSpecification" },
@@ -385,6 +386,21 @@
385386
"inDefinedTermSet": { "@id": "https://w3id.org/ro/terms/workflow-run#" },
386387
"description": "The target (upstream) parameter"
387388
},
389+
{
390+
"@id": "https://codemeta.github.io/terms/buildInstructions",
391+
"@type": "DefinedTerm",
392+
"name": "buildInstructions",
393+
"termCode": "buildInstructions",
394+
"description": "Build environment file (e.g. for Conda)",
395+
"inDefinedTermSet": { "@id": "https://codemeta.github.io/terms/" }
396+
},
397+
{
398+
"@id": "https://codemeta.github.io/terms/",
399+
"@type": "DefinedTermSet",
400+
"name": "Codemeta Terms",
401+
"url": "https://codemeta.github.io/terms/",
402+
"version": "3.0"
403+
},
388404
{
389405
"@id": "https://pypi.org/project/runcrate/",
390406
"@type": "SoftwareApplication",

docs/profiles/0.5-DRAFT/provenance_run_crate/ro-crate-preview.html

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@
8888
},
8989
{
9090
"@id": "https://w3id.org/ro/terms/workflow-run#targetParameter"
91+
},
92+
{
93+
"@id": "https://codemeta.github.io/terms/buildInstructions"
9194
}
9295
],
9396
"hasResource": [
@@ -426,6 +429,16 @@
426429
},
427430
"description": "The target (upstream) parameter"
428431
},
432+
{
433+
"@id": "https://codemeta.github.io/terms/buildInstructions",
434+
"@type": "DefinedTerm",
435+
"name": "buildInstructions",
436+
"termCode": "buildInstructions",
437+
"description": "Build environment file (e.g. for Conda)",
438+
"inDefinedTermSet": {
439+
"@id": "https://codemeta.github.io/terms/"
440+
}
441+
},
429442
{
430443
"@id": "#hasSpecification",
431444
"@type": "ResourceDescriptor",
@@ -841,6 +854,13 @@
841854
"@type": "Person",
842855
"name": "Salvador Capella-Gutierrez"
843856
},
857+
{
858+
"@id": "https://codemeta.github.io/terms/",
859+
"@type": "DefinedTermSet",
860+
"name": "Codemeta Terms",
861+
"url": "https://codemeta.github.io/terms/",
862+
"version": "3.0"
863+
},
844864
{
845865
"@id": "http://schema.org/MediaObject",
846866
"@type": "DefinedTerm",
@@ -970,6 +990,8 @@ <h3><a href="https://w3id.org/ro/wfrun/provenance/0.5-DRAFT">Go to: </a> Provena
970990
<li><a href="#https%3A//w3id.org/ro/terms/workflow-run%23sourceParameter">source parameter</a></li>
971991

972992
<li><a href="#https%3A//w3id.org/ro/terms/workflow-run%23targetParameter">target parameter</a></li>
993+
994+
<li><a href="#https%3A//codemeta.github.io/terms/buildInstructions">buildInstructions</a></li>
973995
</ul></td>
974996
</tr><tr>
975997
<th style="text-align:left;" class="prop">hasResource<span>&nbsp;</span><a href="http://www.w3.org/ns/dx/prof/hasResource">[?]</a></th>
@@ -1678,6 +1700,42 @@ <h3><a href="https://w3id.org/ro/terms/workflow-run#targetParameter">Go to: </a>
16781700
</table>
16791701
</div>
16801702

1703+
</div>
1704+
<hr/><br/><br/>
1705+
<div>
1706+
<h3><a href="https://codemeta.github.io/terms/buildInstructions">Go to: </a> buildInstructions</h3>
1707+
1708+
1709+
1710+
1711+
<div id="https://codemeta.github.io/terms/buildInstructions">
1712+
1713+
<table class="table metadata table-striped" >
1714+
<tbody><tr>
1715+
<th style="text-align:left;" class="prop">@id</th>
1716+
<td style='text-align:left'><a href="https://codemeta.github.io/terms/buildInstructions">https://codemeta.github.io/terms/buildInstructions</a></td>
1717+
</tr><tr>
1718+
<th style="text-align:left;" class="prop">name<span>&nbsp;</span><a href="http://schema.org/name">[?]</a></th>
1719+
<td style='text-align:left'><span>buildInstructions</span></td>
1720+
</tr><tr>
1721+
<th style="text-align:left;" class="prop">@type</th>
1722+
<td style='text-align:left'><span>DefinedTerm</span></td>
1723+
</tr><tr>
1724+
<th style="text-align:left;" class="prop">description<span>&nbsp;</span><a href="http://schema.org/description">[?]</a></th>
1725+
<td style='text-align:left'><span>Build environment file (e.g. for Conda)</span></td>
1726+
</tr><tr>
1727+
<th style="text-align:left;" class="prop">termCode<span>&nbsp;</span><a href="http://schema.org/termCode">[?]</a></th>
1728+
<td style='text-align:left'><span>buildInstructions</span></td>
1729+
</tr><tr>
1730+
<th style="text-align:left;" class="prop">inDefinedTermSet<span>&nbsp;</span><a href="http://schema.org/inDefinedTermSet">[?]</a></th>
1731+
<td style='text-align:left'><a href="#https%3A//codemeta.github.io/terms/">Codemeta Terms</a></td>
1732+
</tr><tr><th colspan="2" style="text-align:center">Items that reference this one</th><tr><tr>
1733+
<th style="text-align:left;" class="prop">hasPart<span>&nbsp;</span><a href="http://schema.org/hasPart">[?]</a></th>
1734+
<td style='text-align:left'><a href="#https%3A//w3id.org/ro/wfrun/provenance/0.5-DRAFT">Provenance Run Crate profile</a></td>
1735+
</tr></tbody>
1736+
</table>
1737+
</div>
1738+
16811739
</div>
16821740
<hr/><br/><br/>
16831741
<div>

0 commit comments

Comments
 (0)