Skip to content

Scope

When developers package and EO, they are in fact packaging their own software, written in a specific programming language, as a containerized application (or a set of containerized applications), to be described as an EO Application Package using the Common Workflow Language as described in the OGC proposed best practices.

To achieve this, developers follow the steps described below.

  • Prepare one or more container images containing the execution dependencies of the software.
  • Prepare the CWL CommandLineTool document(s) wrapping the command line tool available container(s).
  • Prepare the CWL Workflow orchestrating CWL CommandLineTool document(s) wrapping the command line tool available container(s).
  • Test the application package in one or more execution scenarios.

This page shows how to do the step:

  • Prepare one or more container images containing the execution dependencies of the software.

The container recipes

Each step has its own recipe to build the container image.

The crop step container image recipe is:

crop/Dockerfile
1
2
3
4
5
6
7
8
FROM docker.io/python:3.10-slim

RUN pip install --no-cache-dir rasterio click pystac loguru pyproj shapely && \
    python -c "import rasterio"

ADD app.py /app/app.py

ENTRYPOINT []

The norm_diff step container image recipe is:

norm_diff/Dockerfile
1
2
3
4
5
6
7
8
FROM docker.io/python:3.10-slim

RUN pip install --no-cache-dir rasterio click loguru && \
    python -c "import rasterio"

ADD app.py /app/app.py

ENTRYPOINT []

The otsu step container image recipe is:

otsu/Dockerfile
1
2
3
4
5
6
7
8
FROM docker.io/python:3.10-slim

RUN pip install --no-cache-dir rasterio scikit-image click loguru && \
    python -c "import rasterio"

ADD app.py /app/app.py

ENTRYPOINT []

The stac step container image recipe is:

stac/Dockerfile
1
2
3
4
5
6
7
8
FROM docker.io/python:3.10-slim

RUN pip install --no-cache-dir pystac rio_stac loguru click && \
    python -c "import rio_stac"

ADD app.py /app/app.py

ENTRYPOINT []

Building the containers:

Build the container images with:

terminal
1
2
3
4
5
6
export WORKSPACE=/workspace/app-package-training-bids23

podman build --format docker -t localhost/crop:latest ${WORKSPACE}/water-bodies/command-line-tools/crop
podman build --format docker -t localhost/norm-diff:latest ${WORKSPACE}/water-bodies/command-line-tools/norm_diff
podman build --format docker -t localhost/otsu:latest ${WORKSPACE}/water-bodies/command-line-tools/otsu
podman build --format docker -t localhost/stac:latest ${WORKSPACE}/water-bodies/command-line-tools/stac
sh ${WORKSPACE}/scripts/build_containers.sh

Expected outcome

The local container registry lists the built images:

(base) jovyan@coder-mrossi:~/runs$ podman images | grep localhost
localhost/stac                                                  latest      1e8ca97d1619  About a minute ago  288 MB
localhost/otsu                                                  latest      3b8c17119f85  About a minute ago  477 MB
localhost/norm-diff                                             latest      a69126fa050c  2 minutes ago       285 MB
localhost/crop                                                  latest      b66603b11c46  2 minutes ago       325 MB