Skip to content

Commit f2cadbf

Browse files
committed
fixes
1 parent ff7b0ad commit f2cadbf

File tree

3 files changed

+33
-250
lines changed

3 files changed

+33
-250
lines changed

docs/cwl-cli/inference.md

+26-11
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,6 @@ This step has a dedicated lab available at `/workspace/inference-eoap/practice-l
1111

1212
The CWL document below shows the inference Python command line tool step wrapped as a CWL CommandLineTool:
1313

14-
TODO
15-
1614
```yaml linenums="1" hl_lines="9-12 49-53" title="cwl-cli/inference"
1715
--8<--
1816
cwl-cli/inference.cwl
@@ -32,13 +30,7 @@ Let's break down the key components of this CWL document:
3230
* `baseCommand`: Defines the base command to be executed in the container. In this case, it's running a Python module called "app" with the command `python -m app`.
3331
* `arguments`: This section is empty, meaning there are no additional command-line arguments specified here. The tool is expected to receive its arguments via the input parameters.
3432
* `inputs`: Describes the input parameters for the tool, including their types and how they are bound to command-line arguments. The tool expects the following inputs:
35-
36-
TODO
37-
38-
* `item`: A string representing the input STAC item (image) to be processed, bound to the `--input-item` argument.
39-
* `aoi`: A string representing the area of interest (AOI) as a bounding box, bound to the `--aoi` argument.
40-
* `epsg`: A string representing the EPSG code for the coordinate system, bound to the `--epsg` argument.
41-
* `band`: An array of strings representing the name of the bands to be extracted, bound to the `--band` argument.
33+
* `--input-item`: the path to the folder where a Sentinel-2 Level-1C has been staged and converted to COG.
4234
* `outputs`: Specifies the tool's output. It defines an output parameter named `stac_catalog`, which is of type `Directory`. The outputBinding section specifies that the tool is expected to produce one or more files (glob: .) as output.
4335

4436
### Steps
@@ -59,6 +51,29 @@ The folder `/workspace/inference-eoap/runs` contains:
5951
```
6052
(base) jovyan@jupyter-fbrito--training:~/inference-eoap$ tree runs
6153
runs
62-
TODO
63-
2 directories, 4 files
54+
├── am8yu9it
55+
│ ├── S2A_T33TVM_20240125T100359_L1C-classification
56+
│ │ ├── S2A_T33TVM_20240125T100359_L1C-classification.json
57+
│ │ └── classification.tif
58+
│ └── catalog.json
59+
├── results.json
60+
└── ydmns4od
61+
├── S2A_T33TVM_20240125T100359_L1C
62+
│ ├── S2A_T33TVM_20240125T100359_L1C.json
63+
│ ├── blue.tif
64+
│ ├── cirrus.tif
65+
│ ├── coastal.tif
66+
│ ├── green.tif
67+
│ ├── nir.tif
68+
│ ├── nir08.tif
69+
│ ├── nir09.tif
70+
│ ├── red.tif
71+
│ ├── rededge1.tif
72+
│ ├── rededge2.tif
73+
│ ├── rededge3.tif
74+
│ ├── swir16.tif
75+
│ └── swir22.tif
76+
└── catalog.json
77+
78+
4 directories, 19 files
6479
```

practice-labs/_Container.ipynb

-238
This file was deleted.

scripts/cwl-cli.sh

+7-1
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
export WORKSPACE=/workspace/inference-eoap
22

3+
# check if the results.json file exists
4+
if [ ! -f ${WORKSPACE}/runs/results.json ]; then
5+
echo "results.json file not found, run the stage-and-cog.cwl workflow first."
6+
exit 1
7+
fi
8+
39
command -v podman >/dev/null 2>&1 && {
410
flag="--podman"
511
}
612

713
cwltool ${flag} \
814
--outdir ${WORKSPACE}/runs \
915
${WORKSPACE}/cwl-cli/inference.cwl \
10-
TODO
16+
$( cat ${WORKSPACE}/runs/results.json | jq -r .stac_catalog.path )

0 commit comments

Comments
 (0)