13  PFTNC

13.1 Introduction

The following sections demonstrate that the HEATWISE Phytoplankton Functional Types now-casting Software follows the OGC Best Practice for Earth Observation Application Package.

The order of demonstration is deliberately different from that given in the best practice document. This is done to make the demonstration easy to follow and group requirements that can be shown together. An effort is made to keep the requirements in order as much as possible to make it easy to find a specific requirement.

The demonstration proceeds in the following steps:

  • Execute the software as docker container and as CWL document (the EOAP)
  • Show that STAC inputs and outputs are handled by the application as required
  • Show that the CWL document is structured as required
  • Show that STAC inputs and outputs are declared in the CWL as required

After each step, the requirements shown are listed.

Chapter 2 contains an overview of all requirements in order and how they are demonstrated in this document. It furthermore shows all utility scripts used in this demonstration. For brevity, the content of utility scripts is only shown in the requirements overview and not in each demonstration.

13.2 Preparation

Activate the pixi environment to make validation tools and scripts available.

eval "$(pixi shell-hook --change-ps1 false)"

Set environment variables to software, cwl documents, inputs and outputs.

set -o pipefail
set -x
SOFTWARE_ROOT="$PIXI_PROJECT_ROOT"/software/heatwise-pftnc
CWL_PATH="$PIXI_PROJECT_ROOT"/application-packages/pftnc.cwl
INPUT_PATH="$PIXI_PROJECT_ROOT"/inputs/pftnc

DOCKER_IMAGE_ID=ghcr.io/esa-heatwise/heatwise-pftnc-inference:v1.0.0
OUTPUT_PATH="$PIXI_PROJECT_ROOT"/outputs/pftnc

ls -ltrAh --color=never "$SOFTWARE_ROOT"
set +x
+ SOFTWARE_ROOT=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-pftnc
+ CWL_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl
+ INPUT_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/pftnc
+ DOCKER_IMAGE_ID=ghcr.io/esa-heatwise/heatwise-pftnc-inference:v1.0.0
+ OUTPUT_PATH=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc
+ ls --color=auto -ltrAh --color=never /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-pftnc
total 36K
-rw-r--r-- 1 runner runner 4.6K Nov 27 10:37 .gitignore
-rw-r--r-- 1 runner runner 3.3K Nov 27 10:37 README.md
-rw-r--r-- 1 runner runner 1.1K Nov 27 10:37 LICENSE
-rw-r--r-- 1 runner runner 3.1K Nov 27 10:37 HOW_TO.md
drwxr-xr-x 3 runner runner 4.0K Nov 27 10:37 eoap
drwxr-xr-x 3 runner runner 4.0K Nov 27 10:37 input
-rw-r--r-- 1 runner runner 3.7K Nov 27 10:37 prepare_inference_input.ipynb
drwxr-xr-x 7 runner runner 4.0K Nov 27 10:37 .git
+ set +x

13.3 Running the software

The first set of requirements is concerned with how the software is executed. It shall be

  • Runnable as a non-interactive script
  • Bundled in (Docker) container
  • Executable as a CWL Workflow containing at least one CWL CommandLineTool

13.3.1 Running as a docker container

We can run the (dockerized) software directly, without using the CWL machinery with docker run:

mkdir -p "$OUTPUT_PATH"
docker run --rm \
    --user "$(id -u):$(id -g)" \
    --workdir /home/mambauser/wd \
    --env HOME=/home/mambauser/wd \
    --volume "$INPUT_PATH/berlin_muggelsee:/home/mambauser/wd/input/berlin_muggelsee:ro" \
    --volume "$OUTPUT_PATH:/home/mambauser/wd" \
    "$DOCKER_IMAGE_ID" \
    --batch \
    --eoap \
    --bundle-path /home/mambauser/hw-berlin_muggelsee_mlrun_20260916_113308 \
    --input-dataset-path /home/mambauser/wd/input/berlin_muggelsee \
    --mode latest \
    --save-index

ls -ltrAh --color=never $OUTPUT_PATH

Generating rolling features:   0%|          | 0/480 [00:00<?, ?it/s]CWD /home/mambauser/wd

Generating rolling features:   5%|▍         | 22/480 [00:00<00:02, 209.14it/s]
Generating rolling features:  10%|▉         | 46/480 [00:00<00:01, 220.91it/s]
Generating rolling features:  15%|█▍        | 70/480 [00:00<00:01, 225.72it/s]
Generating rolling features:  20%|█▉        | 94/480 [00:00<00:01, 228.08it/s]
Generating rolling features:  25%|██▍       | 118/480 [00:00<00:01, 230.11it/s]
Generating rolling features:  30%|██▉       | 142/480 [00:00<00:01, 230.13it/s]
Generating rolling features:  35%|███▍      | 166/480 [00:00<00:01, 230.78it/s]
Generating rolling features:  40%|███▉      | 190/480 [00:00<00:01, 231.66it/s]
Generating rolling features:  45%|████▍     | 214/480 [00:00<00:01, 232.84it/s]
Generating rolling features:  50%|████▉     | 238/480 [00:01<00:01, 230.56it/s]
Generating rolling features:  55%|█████▍    | 262/480 [00:01<00:00, 232.04it/s]
Generating rolling features:  60%|█████▉    | 286/480 [00:01<00:00, 232.66it/s]
Generating rolling features:  65%|██████▍   | 310/480 [00:01<00:00, 233.03it/s]
Generating rolling features:  70%|██████▉   | 334/480 [00:01<00:00, 233.20it/s]
Generating rolling features:  75%|███████▍  | 358/480 [00:01<00:00, 234.10it/s]
Generating rolling features:  80%|███████▉  | 382/480 [00:01<00:00, 234.01it/s]
Generating rolling features:  85%|████████▍ | 406/480 [00:01<00:00, 232.86it/s]
Generating rolling features:  90%|████████▉ | 430/480 [00:01<00:00, 232.90it/s]
Generating rolling features:  95%|█████████▍| 454/480 [00:01<00:00, 233.44it/s]
Generating rolling features: 100%|█████████▉| 478/480 [00:02<00:00, 230.63it/s]
Generating rolling features: 100%|██████████| 480/480 [00:02<00:00, 231.86it/s]
INFO:pftnc.preprocess.features:Removed 0 synthetic rows added by fill_missing_dates
INFO:pftnc.preprocess.features:Generated 495 engineered features
INFO:util:Saving predictions to /home/mambauser/wd/predictions...
pftnc predictions successfully generated
{'geospatial_lon_min': 13.647400000000005, 'geospatial_lon_max': 13.647400000000005, 'geospatial_lat_min': 52.437300000000015, 'geospatial_lat_max': 52.437300000000015}
attrs updated successfully
total 16K
drwxr-xr-x 3 root   root   4.0K Nov 27 10:54 input
drwxr-xr-x 3 runner runner 4.0K Nov 27 10:54 .config
-rw-r--r-- 1 runner runner    0 Nov 27 10:54 datasets_saved
drwxr-xr-x 2 runner runner 4.0K Nov 27 10:54 predictions
-rw-r--r-- 1 runner runner  337 Nov 27 10:54 catalog.json

The image should not only be available locally, but also in a container registry.

check-container-registry.sh $DOCKER_IMAGE_ID || FAIL_REQ_3=1
SUCCESS: Image ghcr.io/esa-heatwise/heatwise-pftnc-inference:v1.0.0 found on registry

13.3.1.1 Requirements Validated

req/app/cmd-line (Requirement 1)

The Application SHALL be a non-interactive executable as a command-line application.

req/app/container (Requirement 2)

The environment, libraries, binaries, executable and configuration files necessary to execute the Application SHALL be bundled in a container image.

req/app/registry (Requirement 3)

The Application container image SHALL be accessible in a container registry.

13.3.2 Running as an EOAP

First, we validate that the CWL document is valid.

cwltool --disable-color --validate "$CWL_PATH" | cat
INFO /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/.pixi/envs/dev/bin/cwltool 3.2.20260413085819
INFO Resolved '/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl' to 'file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl'
WARNING:root:File contains $graph of multiple objects and no default process (#main). Validating all objects:
file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl#pftnc_inference is valid CWL.
file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl#xce_script is valid CWL.
/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl is valid CWL.

The CWL should contain a Workflow and at least one CommandLineTool object. We inspect the classes in the CWL graph to make sure.

show-cwl-graph-classes.sh "$CWL_PATH"
class: Workflow
id: pftnc_inference
---
class: CommandLineTool
id: xce_script

The EOAP can be executed from its CWL description with cwltool.

cwltool --outdir $OUTPUT_PATH/cwlruns \
    $CWL_PATH#pftnc_inference \
    --input_dataset_path $INPUT_PATH/berlin_muggelsee \
    --bundle_path $SOFTWARE_ROOT/eoap/hw-berlin_muggelsee_mlrun_20260916_113308 \
    || FAIL_REQ_7=1
INFO /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/.pixi/envs/dev/bin/cwltool 3.2.20260413085819

INFO Resolved '/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl#pftnc_inference' to 'file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/application-packages/pftnc.cwl#pftnc_inference'

INFO [workflow ] start

INFO [workflow ] starting step run_script

INFO [step run_script] start

INFO [job run_script] /tmp/_fcr5iaq$ docker \

    run \

    -i \

    --mount=type=bind,source=/tmp/_fcr5iaq,target=/IdmMLN \

    --mount=type=bind,source=/tmp/e4nzfw2e,target=/tmp \

    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/software/heatwise-pftnc/eoap/hw-berlin_muggelsee_mlrun_20260916_113308,target=/var/lib/cwl/stg8dba47dd-6723-431e-9347-2abe8bc08772/hw-berlin_muggelsee_mlrun_20260916_113308,readonly \

    --mount=type=bind,source=/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/inputs/pftnc/berlin_muggelsee,target=/var/lib/cwl/stg30414fb5-a5ba-42f3-8ed0-2f54c18bf4f7/berlin_muggelsee,readonly \

    --workdir=/IdmMLN \

    --read-only=true \

    --user=1001:1001 \

    --rm \

    --cidfile=/tmp/3xg6kn1x/20261127105439-190857.cid \

    --env=TMPDIR=/tmp \

    --env=HOME=/IdmMLN \

    ghcr.io/esa-heatwise/heatwise-pftnc-inference:v1.0.0 \

    /usr/local/bin/_entrypoint.sh \

    python \

    /home/mambauser/execute.py \

    --batch \

    --eoap \

    --bundle-path \

    /var/lib/cwl/stg8dba47dd-6723-431e-9347-2abe8bc08772/hw-berlin_muggelsee_mlrun_20260916_113308 \

    --input-dataset-path \

    /var/lib/cwl/stg30414fb5-a5ba-42f3-8ed0-2f54c18bf4f7/berlin_muggelsee \

    --mode \

    from_date \

    --save-index \

    --selection \

    ensemble_simple \

    --start-date \

    2023-12-01


Generating rolling features:   0%|          | 0/480 [00:00<?, ?it/s]CWD /IdmMLN


Generating rolling features:   5%|▍         | 22/480 [00:00<00:02, 213.10it/s]
Generating rolling features:  10%|▉         | 46/480 [00:00<00:01, 224.68it/s]
Generating rolling features:  15%|█▍        | 70/480 [00:00<00:01, 228.85it/s]
Generating rolling features:  20%|█▉        | 94/480 [00:00<00:01, 229.51it/s]
Generating rolling features:  25%|██▍       | 118/480 [00:00<00:01, 231.60it/s]
Generating rolling features:  30%|██▉       | 142/480 [00:00<00:01, 231.85it/s]
Generating rolling features:  35%|███▍      | 166/480 [00:00<00:01, 233.00it/s]
Generating rolling features:  40%|███▉      | 190/480 [00:00<00:01, 233.88it/s]
Generating rolling features:  45%|████▍     | 214/480 [00:00<00:01, 231.64it/s]
Generating rolling features:  50%|████▉     | 238/480 [00:01<00:01, 232.18it/s]
Generating rolling features:  55%|█████▍    | 262/480 [00:01<00:00, 232.37it/s]
Generating rolling features:  60%|█████▉    | 286/480 [00:01<00:00, 233.46it/s]
Generating rolling features:  65%|██████▍   | 310/480 [00:01<00:00, 233.90it/s]
Generating rolling features:  70%|██████▉   | 334/480 [00:01<00:00, 234.15it/s]
Generating rolling features:  75%|███████▍  | 358/480 [00:01<00:00, 234.58it/s]
Generating rolling features:  80%|███████▉  | 382/480 [00:01<00:00, 233.61it/s]
Generating rolling features:  85%|████████▍ | 406/480 [00:01<00:00, 233.50it/s]
Generating rolling features:  90%|████████▉ | 430/480 [00:01<00:00, 233.40it/s]
Generating rolling features:  95%|█████████▍| 454/480 [00:01<00:00, 234.34it/s]
Generating rolling features: 100%|█████████▉| 478/480 [00:02<00:00, 234.10it/s]
Generating rolling features: 100%|██████████| 480/480 [00:02<00:00, 233.37it/s]

INFO:pftnc.preprocess.features:Removed 0 synthetic rows added by fill_missing_dates

INFO:pftnc.preprocess.features:Generated 495 engineered features

INFO:util:Saving predictions to /IdmMLN/predictions...

pftnc predictions successfully generated

{'geospatial_lon_min': 13.647400000000005, 'geospatial_lon_max': 13.647400000000005, 'geospatial_lat_min': 52.437300000000015, 'geospatial_lat_max': 52.437300000000015}

attrs updated successfully

INFO [job run_script] Max memory used: 1278MiB

INFO [job run_script] completed success

INFO [step run_script] completed success

INFO [workflow ] completed success

{

    "stac_catalog": {

        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq",

        "basename": "_fcr5iaq",

        "class": "Directory",

        "listing": [

            {

                "class": "File",

                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/catalog.json",

                "basename": "catalog.json",

                "size": 337,

                "checksum": "sha1$571bdbca08ff90d24b5fd8704fcad833244e051f",

                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/catalog.json"

            },

            {

                "class": "File",

                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/datasets_saved",

                "basename": "datasets_saved",

                "size": 0,

                "checksum": "sha1$da39a3ee5e6b4b0d3255bfef95601890afd80709",

                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/datasets_saved"

            },

            {

                "class": "Directory",

                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions",

                "basename": "predictions",

                "listing": [

                    {

                        "class": "File",

                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions/predictions.json",

                        "basename": "predictions.json",

                        "size": 1237,

                        "checksum": "sha1$c06d2c4c452477d55df4306c929dfca9a7dba3bc",

                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions/predictions.json"

                    },

                    {

                        "class": "File",

                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions/predictions.csv",

                        "basename": "predictions.csv",

                        "size": 167072,

                        "checksum": "sha1$d089a8e12bfa40dd0d492fbcb44ba947d52ea5b7",

                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions/predictions.csv"

                    }

                ],

                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/predictions"

            },

            {

                "class": "Directory",

                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config",

                "basename": ".config",

                "listing": [

                    {

                        "class": "Directory",

                        "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config/mlflow",

                        "basename": "mlflow",

                        "listing": [

                            {

                                "class": "File",

                                "location": "file:///home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config/mlflow/telemetry.json",

                                "basename": "telemetry.json",

                                "size": 159,

                                "checksum": "sha1$9115e1cb6154604d5756d73abe25df4510b96a0a",

                                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config/mlflow/telemetry.json"

                            }

                        ],

                        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config/mlflow"

                    }

                ],

                "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/.config"

            }

        ],

        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq"

    }

}INFO Final process status is success

Cwltool creates a new output directory with a random name when it is run. We save the last run in a variable to access it later.

CWLRUN_PATH=$(find-newest-directory-entry.sh "$OUTPUT_PATH/cwlruns")
echo "Path to last cwl run: $CWLRUN_PATH"
Path to last cwl run: /home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq

13.3.2.1 Requirements Validated

req/app-pck/cwl (Requirement 7)

The Application Package SHALL be a valid CWL document with a “Workflow” class and one or more “CommandLineTool” classes.

13.3.2.2 EOAP Output

tree -n $CWLRUN_PATH || :
/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq
├── catalog.json
├── datasets_saved
└── predictions
    ├── predictions.csv
    └── predictions.json

2 directories, 4 files
python -c "import pandas as pd; \
    df = pd.read_csv(\"$OUTPUT_PATH/predictions/predictions.csv\"); \
    columns = ['time', 'site', 'diatoms_ug_per_l_pred', 'cyanobacterial_ug_per_l_pred', 'others_ug_per_l_pred']; \
    df_formatted = df.T.reset_index(); \
    df_formatted.columns = ['Variable', 'Value']; \
    print(df_formatted);" \
   || :
                         Variable                            Value
0                      Unnamed: 0                              350
1                            time              2023-12-18 12:00:00
2                            site  berlin_muggelsee_IOP_daily_v0.3
3                            date                       2023-12-18
4                        site_lat                          52.4373
..                            ...                              ...
503       s3_cdom_1_per_m_std_100                         0.035576
504     s3_cdom_1_per_m_count_100                            100.0
505         diatoms_ug_per_l_pred                         0.774383
506  cyanobacterial_ug_per_l_pred                          0.04663
507          others_ug_per_l_pred                         0.529957

[508 rows x 2 columns]

13.4 STAC input / output

13.4.1 Inputs

The EO Products of the input are provided as directories with a catalog.json describing the products each:

ls -lAhX --color=never $INPUT_PATH/*
total 124K
-rw-r--r-- 1 runner runner 116K Nov 27 10:37 inference_input.csv
-rw-r--r-- 1 runner runner  382 Nov 27 10:37 catalog.json
-rw-r--r-- 1 runner runner  509 Nov 27 10:37 pftnc_berlin_muggelsee_item.json

These same inputs are classed as Directory in the workflow:

extract-directory-inputs-from.sh Workflow "$CWL_PATH" || FAIL_REQ_4=1
Running
inputs_with_directory_type:
  - label: bundle_path
    doc: bundle_path
    type: Directory
    default:
      class: Directory
      location: null
  - label: input_dataset_path
    doc: input_dataset_path
    type: Directory
    default:
      class: Directory
      location: null

13.4.2 Outputs

The output contains a single catalog.json and item, describing the output. Using the recursive validation, both the catalog and item are confirmed to be valid STAC.

(stac-validator validate --recursive $CWLRUN_PATH/catalog.json | cat) || FAIL_REQ_5=1

Thanks for using STAC version 1.1.0!

[
    {
        "version": "1.1.0",
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/catalog.json",
        "schema": [
            "https://schemas.stacspec.org/v1.1.0/catalog-spec/json-schema/catalog.json"
        ],
        "valid_stac": true,
        "asset_type": "CATALOG",
        "validation_method": "recursive",
        "validator_engine": "jsonschema"
    },
    {
        "version": "1.1.0",
        "path": "/home/runner/work/heatwise-interoperability-demonstration/heatwise-interoperability-demonstration/outputs/pftnc/cwlruns/_fcr5iaq/./predictions/predictions.json",
        "schema": [
            "https://schemas.stacspec.org/v1.1.0/item-spec/json-schema/item.json"
        ],
        "valid_stac": true,
        "asset_type": "ITEM",
        "validation_method": "recursive",
        "validator_engine": "jsonschema"
    }
]

-- Recursive Validation Summary:
  Stac objects passed: 2/2 (100.0%)

  Breakdown by type:
    Catalog: 1/1 (100.0%)
    Item: 1/1 (100.0%)

Validation completed in 206.29ms

The EOAP best practice mandates that the item contains at least geometry, bbox and datetime keys.

extract-output-keys-from-stac-item.sh $CWLRUN_PATH/predictions/predictions.json || FAIL_REQ_6=1
geometry:
  type: Polygon
  coordinates: '[...truncated...]'
bbox:
  - 13.647400000000005
  - 52.437300000000015
  - 13.647400000000005
  - 52.437300000000015
properties:
  datetime: null
  start_datetime: '2000-01-01T00:00:00Z'
  end_datetime: '2001-01-01T00:00:00Z'

Required keys present: true

13.4.3 Requirements Validated

req/app/stac-input (Requirement 4)

An Application input argument that requires staged EO product files SHALL be defined as an argument that points to a folder where a STAC Catalog, named catalog.json, contains a list of one or more STAC Items and associated STAC Assets referencing the files.

req/app/stac-out (Requirement 5)

An Application that creates EO product files to be stage-out SHALL generate a valid STAC Catalog, named catalog.json, and include the STAC Item(s) and corresponding STAC Assets pointing to the results of the processing.

rec/app/stac-out-metadata (Requirement 6)

The STAC Catalog created by the Application SHALL include metadata elements for each STAC Item with at least their spatial (geometry, box) and temporal (datetime) properties.

13.5 CWL

The fields id, baseCommand, inputs, requirements should be present in the CommandLineTool. One of the requirements should be DockerRequirement.

check-commandlinetool-fields.sh "$CWL_PATH" || FAIL_REQ_8=1
id: xce_script
baseCommand:
  - /usr/local/bin/_entrypoint.sh
  - python
  - /home/mambauser/execute.py
requirements:
  DockerRequirement:
    dockerPull: ghcr.io/esa-heatwise/heatwise-pftnc-inference:v1.0.0
Required keys present: true

The fields id, label, and doc should be present in the Workflow.

check-workflow-fields.sh "$CWL_PATH" || FAIL_REQ_9=1
id: pftnc_inference
label: xcengine notebook
doc: xcengine notebook
Required keys present: true

Each input of the Workflow should have fields id, label, and doc

check-workflow-input-fields.sh $CWL_PATH || FAIL_REQ_10=1
inputs:
  - id: bundle_path
    label: bundle_path
    doc: bundle_path
  - id: input_dataset_path
    label: input_dataset_path
    doc: input_dataset_path
  - id: mode
    label: mode
    doc: mode
  - id: save_index
    label: save_index
    doc: save_index
  - id: save_outputs
    label: save_outputs
    doc: save_outputs
  - id: selection
    label: selection
    doc: selection
  - id: start_date
    label: start_date
    doc: start_date

The CWL document should contain a version:

check-version.sh $CWL_PATH || FAIL_REQ_11=1
s:version: 1.0.0
https://schema.org/version: null
Found version:  true

13.5.1 Requirements Validated

req/app-pck/clt (Requirement 8)

The Application Package CWL CommandLineTool classes SHALL contain the following elements:

  • Identifier (“id”)
  • Command line name (“baseCommand”)
  • Input parameters (“inputs”)
  • Environment requirements (“requirements”)
  • Docker information (“DockerRequirement”)

req/app-pck/wf (Requirement 9)

The Application Package CWL Workflow class SHALL contain the following elements:

  • Identifier (“id”)
  • Title (“label”)
  • Abstract (“doc”)

req/app-pck/wf-inputs (Requirement 10)

The Application Package CWL Workflow class “inputs” fields SHALL contain the following elements:

  • Identifier (“id”)
  • Title (“label”)
  • Abstract (“doc”)

req/app-pck/metadata (Requirement 11)

The Application Package CWL Workclass classes SHALL include additional metadata as defined in Table 1

Required in table 1: version

13.6 CWL STAC / IO

Inputs and outputs are staged in and out using STAC catalogs. Each input that is an “EO Product” like a vector or raster dataset is declared as type Directory and is described by a STAC catalog catalog.json and accompanying STAC item(s) placed in that directory.

Outputs are handled in much the same way, the application in the application package is responsible for generating a STAC catalog (also named catalog.json) and stage out all the contents of its working directory together with the STAC metadata describing the outputs.

13.6.1 Inputs

There are inputs of type directory in the CommandLineTool description.

extract-directory-inputs-from.sh CommandLineTool "$CWL_PATH" || FAIL_REQ_12=1
Running
inputs_with_directory_type:
  - label: bundle_path
    doc: bundle_path
    type: Directory
    default:
      class: Directory
      location: null
    inputBinding:
      prefix: --bundle-path
  - label: input_dataset_path
    doc: input_dataset_path
    type: Directory
    default:
      class: Directory
      location: null
    inputBinding:
      prefix: --input-dataset-path

There are inputs of type directory in the Workflow description.

extract-directory-inputs-from.sh Workflow "$CWL_PATH" || FAIL_REQ_13=1
Running
inputs_with_directory_type:
  - label: bundle_path
    doc: bundle_path
    type: Directory
    default:
      class: Directory
      location: null
  - label: input_dataset_path
    doc: input_dataset_path
    type: Directory
    default:
      class: Directory
      location: null

13.6.2 Outputs

The CommandLineTool stages out all the contents of the working directory.

extract-commandlinetool-outputs.sh "$CWL_PATH" || FAIL_REQ_14=1
results:
  type: Directory
  outputBinding:
    glob: .
Extracts all items from Working directory: true

13.6.3 Requirements validated

req/app-pck-stage-in/clt-stac (Requirement 12)

All input parameters of the CWL ComandLineTool that require the staging of EO products SHALL be of type Directory.

req/app-pck-stage-in/wf-stac (Requirement 13)

Input parameters of the CWL Workflow that require the staging of EO products SHALL be of type Directory.

req/app-pck-stage-out/output-stac (Requirement 14)

The outputs field of the CommandLineTool that requires the stage-out of EO products SHALL retrieve all the files produced in the working directory.

13.7 Summary

for i in {1..14}; do
    var="FAIL_REQ_$i"
    req=${var#FAIL_}
    if [[ "${!var:-}" == "1" ]]; then
        #echo "$req: FAILED"
        printf '%s\t\033[31mFAILED\033[0m\n' "$req"
    else
        printf '%s\t\033[32mPASSED\033[0m\n' "$req"
    fi
done
REQ_1  PASSED

REQ_2   PASSED

REQ_3   PASSED

REQ_4   PASSED

REQ_5   PASSED

REQ_6   PASSED

REQ_7   PASSED

REQ_8   PASSED

REQ_9   PASSED

REQ_10  PASSED

REQ_11  PASSED

REQ_12  PASSED

REQ_13  PASSED

REQ_14  PASSED

The Phytoplankton Functional Types now-casting Software has been shown to be non-interactively executable from the command line and using a CWL runner (cwltool). Furthermore it follows the CWL structure and mandatory fields prescribed by the OGC Best Practice for Earth Observation Application Package (EOAP). Inputs and outputs are processed as CWL Directories and valid STAC metadata is generated for the output. It may therefore be concluded that the software behaves as expected by the EOAP best practice in the example scenario.

No conclusive judgment on the adherence to all requirements listed in Chapter 2 under all valid input conditions can be made without inspection of the source code. The demonstration evaluates the statically available information (the CWL document, and container image) as well as the outputs produced by a single example input dataset. It does not show how the validity and content of the generated output depends on the input dataset. While inputs are shown to be a directory containing STAC metadata, only inspection of the source code can establish whether the STAC is actually processed.

Furthermore, the demonstration purely evaluates the adherence of the software to the interoperability best practice and makes no attempt to judge the scientific validity of the data products produced.