Skip to content

Sentinel-2

Goal

Run the app-water-body-cloud-native.1.0.0.cwl released application package using cwltool.

Relationship to the current lab

This page demonstrates a historical released package using the download and execution scripts below. Its input format and container versions belong to that release.

The current notebook, practice-labs/4-CWL-Workflows/1-cloud-native.ipynb, runs the checked-out typed CWL and locally built images instead. Follow the current workflow guide for its job format and commands.

Step 1 - Configure the workspace

The results produced will be available in the local folder /workspace/mastering-app-package/runs

terminal
1
2
3
4
export WORKSPACE=/workspace/mastering-app-package
export RUNTIME=${WORKSPACE}/runs
mkdir -p ${RUNTIME}
cd ${RUNTIME}
source /workspace/mastering-app-package/scripts/setup.sh

Step 2 - Download the released Application package

scripts/download-app-water-body-cloud-native.sh
1
2
3
4
5
version="1.0.0"

wget \
    -O ${WORKSPACE}/runs/app-water-body-cloud-native.${version}.cwl \
    https://github.com/eoap/mastering-app-package/releases/download/${version}/app-water-body-cloud-native.${version}.cwl
sh ${WORKSPACE}/scripts/download-app-water-body-cloud-native.sh

Step 3 - Execute the Application Package

scripts/exec-app-water-body-cloud-native.sh
1
2
3
4
5
6
7
8
9
version="1.0.0"

cwltool \
    --podman \
    --outdir ${WORKSPACE}/runs \
    ${WORKSPACE}/runs/app-water-body-cloud-native.${version}.cwl \
    --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"
sh ${WORKSPACE}/scripts/exec-app-water-body-cloud-native.sh

Expected outcome

The folder /workspace/mastering-app-package/runs contains:

(base) jovyan@coder-fbrito:~/runs$ tree .
/workspace/mastering-app-package/runs/
├── app-water-body-cloud-native.1.0.0.cwl
└── cmtriamc
    ├── S2B_10TFK_20210713_0_L2A
    │   ├── S2B_10TFK_20210713_0_L2A.json
    │   └── otsu.tif
    └── catalog.json

2 directories, 4 files

These commands target downloaded release packages and retain those releases' input format. For local typed CWL files, use the YAML job examples in the workflow authoring labs.