Skip to content
Public template

About

This is an example workflow.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

12 Commits

Folders and files

Repository files navigation

Application Package example

This repository is a learning template for building and publishing Application Packages. It demonstrates how to describe a command-line tool and workflow in CWL, package the tool in a container, and publish versioned, reproducible releases. Use it as a starting point: adapt the example code, CWL descriptions, and metadata for your own application.

The example application is a small Python program that splits a string into words, sorts them alphabetically without regard to case, and writes the result to a file. It uses only the Python standard library.

Run

python process_data.py "pear apple Banana" sorted.txt

The output file contains apple Banana pear on one line. The original spelling of each word is kept.

Run with Docker

docker build -t word-sorter .

docker run --rm -v "$PWD:/output" word-sorter word-sorter "pear apple Banana" /output/sorted.txt

The sorted result is written to sorted.txt in the current directory. The image has no entry point: the command word-sorter is given explicitly, as the CWL baseCommand does.

The checked-in CWL files use <owner> and <repo> as placeholders for the GitHub repository owner and name. Replace them with your repository's values before running the files directly. Tagged releases substitute both automatically.

Published images: ghcr.io/<owner>/<repo> (tags X.Y.Z, edge for main, sha-<commit>), with SBOM, SLSA provenance and a cosign signature. Verify an image with:

OWNER=your-github-owner
REPO=your-repository-name
TAG=0.1.0
gh attestation verify "oci://ghcr.io/${OWNER}/${REPO}:${TAG}" --owner "$OWNER"

Run with CWL

cwltool tool.cwl#word_sorter --text "pear apple Banana"
cwltool workflow.cwl#word_sorter_pipeline --text "pear apple Banana"

Create a new release

  1. Choose a new semantic version, such as 0.2.0.

  2. Update every s:softwareVersion value in tool.cwl and workflow.cwl to that version. This example has three values: one for the workflow and one for each tool definition. Do not manually update dockerPull; the release workflow sets it to the published image for this version, pinned by digest.

  3. Commit and push the changes to your default branch.

  4. Create and push a matching version tag:

    git tag v0.2.0
    git push origin v0.2.0

The tag must be v followed by the version, and the CWL s:softwareVersion values must match it without the v prefix. The GitHub Actions workflow builds and publishes the container, updates dockerPull in the release CWL files to the image tagged with that version and pinned by digest, then attaches tool.0.2.0.cwl and workflow.0.2.0.cwl to the GitHub release. These released Application Packages can be deployed on an OGC API - Processes server.

About

This is an example workflow.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages