Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cwl #523

Merged
merged 2 commits into from
Nov 14, 2024
Merged

Cwl #523

Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
80 changes: 71 additions & 9 deletions src/content/docs/cwl/cwl-runner-installation.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,20 @@ title: "CWL Runner Installation"
lastUpdated: 2024-01-18
authors:
- caro-ott
- dominik-brilhaus
sidebar:
order: 2
---

The recommended CWL runner is [cwltool](https://github.com/common-workflow-language/cwltool), the reference implementation for the CWL standards.

import { Steps } from '@astrojs/starlight/components';
import { Tabs, TabItem } from '@astrojs/starlight/components';

The recommended CWL runner is [cwltool](https://github.com/common-workflow-language/cwltool), the reference implementation for the CWL standards.

:::tip
- Please explore the [cwltool docs](https://cwltool.readthedocs.io/en/latest/) for latest installation instructions.
- We also recommend to install a software container engine (e.g. [Docker](https://docs.docker.com/engine/install/) or [Podman](https://podman.io/getting-started/installation)).
:::

<Tabs syncKey="os">
<TabItem label="Windows" icon='seti:windows'>
Expand Down Expand Up @@ -41,19 +46,14 @@ The installation on Windows can be done following the guide [here](https://cwlto
</Steps>
</TabItem>

{/* <TabItem label="Macos" icon="apple">
<Steps>
</Steps>
</TabItem> */}

<TabItem label="Linux" icon='linux'>

For installation on Linux (Debian/Ubuntu):

<Steps>

1. Run `sudo apt-get update`
2. Install Python 3 if it is not already preinstalled `sudo apt install python3`
2. Install Python 3 if it is not already installed `sudo apt install python3`
3. Install python virtual environment `sudo apt install python3.[your version here]-venv`
4. Create a virtual environment `python3 -m venv env` (named env here, name can vary)
5. Activate the virtual environment `source env/bin/activate`
Expand All @@ -63,16 +63,78 @@ For installation on Linux (Debian/Ubuntu):

</TabItem>

<TabItem label="Macos" icon="apple">

<Steps>
1. Install [conda-forge](https://conda-forge.org/)
2. Install cwltool via `conda install -c conda-forge cwltool`
</Steps>

</TabItem>

</Tabs>


## cwltool usage

- If you are on Windows, start the WSL
- Activate the virtual environment `source env/bin/activate`
- Navigate to the results destination directory
- Run `cwltool` by specifying the CWL `Workflow` or `CommandLineTool` description file path and the (optional) inputs file path (you can use relative or full paths):

```bash
cwltool path/to/cwlfile.cwl path/to/jobfile.yml
```

### Minimal example

Here is a very simplified example to check, that your cwltool installation functions

<Steps>

1. Store the following as `echo-tool.cwl`

```yaml
#!/usr/bin/env cwl-runner

cwlVersion: v1.2

class: CommandLineTool

baseCommand: [echo]

stdout: message.txt

inputs:
message:
type: string
inputBinding:
position: 1

outputs:
output:
type: stdout
```

2. In the same folder, store the following as `job.yml`

```yaml
message: "I love ARCs and CWL"
```

3. Now you can execute the tool
- providing an `input` directly via CLI:

```
cwltool echo-tool.cwl --message "ARCs are great"
```
or

- providing the `input` via the `job.yml`:

```
cwltool echo-tool.cwl job.yml
```

4. Both create an `output` file called `message.txt` with your specified message.

</Steps>