Skip to content

Commit

Permalink
cwl cli
Browse files Browse the repository at this point in the history
  • Loading branch information
fabricebrito committed Oct 31, 2023
1 parent e029136 commit 0b56507
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 15 deletions.
2 changes: 1 addition & 1 deletion docs/cwl-cli/crop.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@

### Goal

Wrap the `crop` step as a Common Workflow Language CommandLineTool and exectute it with a CWL runner.
Wrap the `crop` step as a Common Workflow Language CommandLineTool and execute it with a CWL runner.

### How to wrap a step as a CWL CommandLineTool

Expand Down
32 changes: 19 additions & 13 deletions docs/cwl-cli/norm-diff.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### Goal

Wrap the `norm_diff` step as a Common Workflow Language CommandLineTool and execute it with a CWL runner.

### CWL CommandLineTool wrapping the step

The CWL document below shows the `norm_diff` step wrapped as a CWL CommandLineTool:

```yaml linenums="1" hl_lines="9-12 49-53" title="cwl-cli/norm-diff.cwl"
--8<--
Expand All @@ -12,20 +18,20 @@ scripts/cwl-cli-norm-diff.sh
--8<--
```

Or

```yaml
item: "https://earth-search.aws.element84.com/v0/collections/sentinel-s2-l2a-cogs/items/S2B_10TFK_20210713_0_L2A"
aoi: "-121.399,39.834,-120.74,40.472"
epsg: "EPSG:4326"
band: "green"
```
sh -x ${WORKSPACE}/scripts/cwl-cli-norm-diff.sh
```

### Expected outcome

The folder `/workspace/runs` contains:

```
(base) jovyan@coder-mrossi:~/runs$ tree .
.
├── crop_green.tif
├── crop_nir.tif
└── norm_diff.tif
```bash
cwltool \
--podman \
--outdir /workspace/runs \
crop.cwl \
params.yaml
0 directories, 3 files
```
25 changes: 25 additions & 0 deletions docs/cwl-cli/otsu.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### Goal

Wrap the `crop` step as a Common Workflow Language CommandLineTool and exectute it with a CWL runner.

### CWL CommandLineTool wrapping the step

The CWL document below shows the `crop` step wrapped as a CWL CommandLineTool:

```yaml linenums="1" hl_lines="9-12 49-53"
--8<--
Expand All @@ -10,4 +16,23 @@ cwl-cli/otsu.cwl
--8<--
scripts/cwl-cli-otsu.sh
--8<--
```

```
sh -x ${WORKSPACE}/scripts/cwl-cli-otsu.sh
```

### Expected outcome

The folder `/workspace/runs` contains:

```
(base) jovyan@coder-mrossi:~/runs$ tree .
.
├── crop_green.tif
├── crop_nir.tif
├── norm_diff.tif
└── otsu.tif
0 directories, 4 files
```
34 changes: 33 additions & 1 deletion docs/cwl-cli/stac.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
### Goal

Wrap the `stac` step as a Common Workflow Language CommandLineTool and execute it with a CWL runner.

### CWL CommandLineTool wrapping the step

The CWL document below shows the `stac` step wrapped as a CWL CommandLineTool:

```yaml linenums="1" hl_lines="9-12 49-53"
--8<--
Expand All @@ -10,4 +16,30 @@ cwl-cli/stac.cwl
--8<--
scripts/cwl-cli-stac.sh
--8<--
```
```

```
sh -x ${WORKSPACE}/scripts/cwl-cli-stac.sh
```

### Expected outcome

The folder `/workspace/runs` contains:

``` hl_lines="6"
(base) jovyan@coder-fbrito:~/runs$ tree .
.
├── crop_green.tif
├── crop_nir.tif
├── norm_diff.tif
├── otsu.tif
└── p371fwrs
├── S2B_10TFK_20210713_0_L2A
│ ├── S2B_10TFK_20210713_0_L2A.json
│ └── otsu.tif
└── catalog.json
2 directories, 7 files
```

Line #6 shows the folder created by the execution.

0 comments on commit 0b56507

Please sign in to comment.