Skip to content
arunaenginePublic

About

The Universal Workflow Executor

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

4,369 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The uwe icon: two task boxes joined into one amber result

A Universal Workflow Executor

uwe (Universal Workflow Executor) runs Nextflow, Snakemake, CWL, Argo and WDL workflows from a single Rust binary. It reads all five languages itself, plans them into one task graph, runs every task in a container, and stores every result once, by its content digest. A Snakemake rule and a Nextflow process that run the same command in the same image on the same inputs, without network access, share one cache entry.

The machine that runs uwe needs no Python, Groovy, JavaScript or Java. A static Linux build is a single file.

$ uwe run hello.smk
uwe 0.1.0: running hello.smk (Snakemake) on local, run 1a1a1d9fb32-186783
[done] greet (greeting=Hola)
[done] greet (greeting=Ciao)
[done] greet (greeting=Hello)
[done] greet (greeting=Bonjour)
[done] collect
executor >  local (6 tasks, 0 running, 4s)
[3] greet (greeting=Bonjour) | 4 of 4 ✔
[5] collect                  | 1 of 1 ✔
[6] all                      | 1 of 1 ✔

Done in 4s: 6 tasks, 6 ran, 0 from the cache, 0 failed

Why

Bioinformatics and science in general has many workflow languages, and each has its own strengths and weaknesses. I kept running into the same problems with them and was always annoyed by their lack of compatibility. I was also annoyed that some of the useful features were only available in cloud offerings, or were paid features tied to API keys.

Most engines have limited or uneven support for containers and Kubernetes, or they need a shared working directory. Almost none can use several cloud storage providers at once, for example two different S3 services. Caches belong to one language or even to one workflow, so the same tool with the same inputs runs again just because a different workflow called it. So I started an experiment: can one Rust binary do all of that?

So far it looks like it can. A Snakemake rule and a Nextflow process that run the same command in the same image on the same inputs share one cache entry. A run moves from a laptop to a cluster or the cloud without changes to the workflow. Every run can be repeated later with its recorded inputs, images and code. And every task runs in a container, without exceptions, which makes runs reproducible and supports the FAIR principles.

What it does

Languages

Language Supported
Nextflow DSL2 Processes, workflows, channels and operators, configs and profiles, publishDir, storeDir and -entry. Groovy is evaluated in Rust, without a JVM.
Snakemake Rules, wildcards, checkpoints, shadow rules, embedded Python, lifecycle hooks, yte and jinja2 templates, and cwl: rules, which use the CWL runtime of uwe. Python is evaluated in Rust.
CWL CommandLineTools and workflows with scatter, when, valueFrom, secondary files, and JavaScript expressions through the Boa engine, without Node.js.
Argo Workflows Steps, DAGs, loops, conditions, artifacts, retries, timeouts, exit hooks, mutexes, semaphores, suspend and resume, sidecars and daemon steps.
WDL 1.0 to 1.2 Tasks, workflows, calls of tasks and subworkflows, imports, scatter, if, structs, runtime and requirements, and most of the standard library. Parsing and type checks use Sprocket's wdl-analysis; expressions are evaluated by uwe.
wir The workflow intermediate representation of uwe: graphs of container task ops, call ops and native ops that run whole CWL documents and Nextflow pipelines with the cache keys of their own runs. See Running wir documents.

Each language is a native subset, not a wrapper around the original engine. uwe check tells you before a run whether a workflow uses something uwe does not support.

Nextflow pipelines can use plugins of the Nextflow registry in the plugins block of their config. uwe implements their functions, reports, file systems and executors in Rust; for a plugin that it does not run, the run and uwe check warn once. See What uwe supports.

Workflows can come straight from GitHub, GitLab, Bitbucket, Gitea or any Git server over HTTPS, pinned to a tag, branch or commit with -r.

Executors

  • Local Docker and Podman.
  • SLURM, with Apptainer, Singularity, Podman or Docker on the nodes.
  • Kubernetes Jobs. uwe kuberun also runs uwe itself in a pod of the cluster.
  • GA4GH TES servers, such as Funnel.
  • AWS Batch, Google Batch, Azure Batch, Nomad, HTCondor, PBS, Flyte, Snowflake, JARVICE and wr. See What uwe supports.
  • A simulator that plans a whole workflow and makes placeholder outputs, without running any tool.

Remote nodes can share a file system with uwe, or get their files through an object store, so no shared folder is needed. See Remote executors and staging.

Argo sidecars and daemon steps run on the local executor and on Kubernetes. SLURM and TES refuse them.

Conda environments are solved in Rust (rattler and resolvo) and turned into container images.

Storage and cache

  • A content-addressed store keeps every result once, by its digest.
  • One cache for all languages. A task without network access (-no-network) whose image has a registry digest reuses results from any earlier run, of any workflow. uwe looks up the digest of an image tag itself. Other tasks reuse results only with -resume, as in Nextflow, which also covers images without a registry digest, such as locally built tags.
  • Storage providers for S3, Google Cloud Storage, Azure Blob Storage, HTTPS, FTP and local folders. You can configure any number of them at once, for example two S3 services side by side.
  • A remote store, for example on S3, with an optional local front store for speed.
  • uwe clean removes data that no run needs anymore. It shows what it would remove before it removes anything.

Runs and provenance

  • Every run is recorded in a local SQLite database. uwe runs lists them.
  • uwe changes <run> shows which workflow files, inputs and images changed since a run. uwe repeat <run> runs it again with its kept workflow files and inputs, and with the recorded image digests where it has them.
  • uwe why explains why a task ran. uwe origin tells where a result came from.
  • uwe page opens a local web page with all runs. uwe run -page shows the run live while it runs.
  • uwe export writes an RO-Crate. uwe time, uwe compare and uwe report show where the time went and how two runs differ. uwe compare -report diff.html writes the comparison as an HTML, JSON (.json) or Markdown (.md) report, and -fail-on-change ends with exit code 3 when the runs differ.

Checks before a run

  • uwe check <workflow> finds problems before any task starts: unsupported features, broken references, missing files and tasks without an image. It plans with made-up data, so it cannot see tasks that only real data creates, and it does not fetch remote inputs.
  • uwe check-machine checks the container engine, the store and the executor setup.
  • uwe check-order <workflow> finds steps whose results depend on which task finished first.
  • uwe inputs and uwe outputs print the inputs and outputs of any workflow as JSON Schema. Every run checks its inputs against that schema.

Recording tools

  • uwe record [-name <name>] [-image <image>] -- <command ...> runs a command once in the current folder and writes it there as a CWL CommandLineTool, <name>.cwl. Words that name a file or folder become File and Directory inputs, other values typed inputs with the recorded value as default, and > and 2> become stdout and stderr. The files and folders that the run writes become the outputs, with EDAM formats for common file endings. -image adds a DockerRequirement hint. Quote |, > and 2> so that your shell passes them on. A failed command writes nothing. The recorder comes from SciWIn.

Install

You need a Rust toolchain from rustup and Docker or Podman. On Linux:

cargo build --release --locked -p uwe
mkdir -p "$HOME/.local/bin"
install -m 755 target/release/uwe "$HOME/.local/bin/uwe"

Add $HOME/.local/bin to your PATH if it is not there yet.

Installing uwe covers macOS, Windows (WSL 2), Podman and the static Linux build.

First run

From the root of the checkout:

uwe check-machine
uwe run demo/snakemake/hello.smk
uwe runs

The example uses a Debian image and writes greetings to demo/snakemake/hello/. uwe help lists all commands, and uwe run -help lists all run options.

Running workflows

uwe run takes a workflow file, a folder or a repository. It tells the language from the file, or from -lang. uwe options take one hyphen (-profile). Workflow parameters take two (--outdir).

Nextflow

uwe run demo/nextflow/main.nf
uwe run demo/nextflow/main.nf -resume
uwe run nf-core/demo -r 1.2.0 -profile test,docker --outdir results

The second run takes all results from the cache. Parameters follow the workflow, like --outdir results or --input samples.csv. -profile picks profiles of nextflow.config, -entry picks a named workflow, and -c FILE adds a Nextflow config file.

Snakemake

uwe run demo/snakemake/hello.smk
uwe run demo/snakemake/hello.smk hello/Hola.txt
uwe run demo/snakemake/hello.smk -forcerun collect

Targets, files or rules, follow the Snakefile. --config name=value sets config values. -until, -omit-from, -forcerun and -forceall work as in Snakemake. Every rule needs a container:, or a -default-image for those without one.

A project folder, like a cloned repository, works in its own folder. -workdir .test works in a folder of the project instead, like Snakemake's --directory .test: the run copies that folder into its launch folder and works there, so relative paths of the config start in it and the run writes nothing into the project.

CWL

uwe run demo/cwl/hello_world.cwl demo/cwl/hello_world-job.json -default-image debian:stable-slim
uwe run demo/cwl/hello_world.cwl --message "Hola mundo" -default-image debian:stable-slim
uwe run demo/cwl/scatter-workflow.cwl demo/cwl/scatter-job.yml -default-image debian:stable-slim

The job file, JSON or YAML, follows the CWL document. Inputs can also be given as --name value. A tool without a DockerRequirement runs in the -default-image. Outputs go to the current folder, or to -output-dir FOLDER.

Argo Workflows

uwe run demo/argo/hello-world.yaml
uwe run demo/argo/dag-diamond.yaml

Workflow parameters are given as --name value, like --message "hola mundo".

WDL

uwe run demo/wdl/hello.wdl
uwe run demo/wdl/scatter.wdl inputs.json
uwe run demo/wdl/conditional.wdl --loud false --text psst

The input file is the JSON of other WDL engines, with keys like hello.greeting; --name value sets one input. -entry picks a workflow or task of the document. A task without a container runs in the -default-image. Output files go to <output>/ in the current folder, or in -output-dir FOLDER, and uwe prints the outputs as JSON.

Where tasks run

Tasks run in local Docker or Podman containers by default. Other executors take the same workflows:

uwe run main.nf -executor slurm
uwe run main.nf -executor kubernetes -kubeconfig ~/.kube/config
uwe run main.nf -executor tes -tes-server https://tes.example.org
uwe run main.nf -executor simulator

The simulator plans the whole run and makes placeholder outputs, without running a tool. Remote executors and staging explains how SLURM, Kubernetes and TES jobs get their files.

Before and after a run

uwe check demo/nextflow/main.nf
uwe inputs demo/cwl/hello_world.cwl -format text
uwe runs
uwe page

uwe check finds problems before any task starts. uwe inputs lists the inputs of a workflow. uwe runs lists recorded runs, and uwe page shows them in the browser.

Documentation

Page Read it when
Installing uwe You set up uwe on Linux, macOS or Windows
What uwe supports You want to know which versions, executors and providers work
Known pitfalls A workflow behaves differently than on its original engine
Remote executors and staging You run on SLURM, Kubernetes or TES
Workflow presets and installed references You offer fixed workflows and reference data to users
Embedding uwe in a service You start runs from your own Rust service
Running wir documents You run a graph in the intermediate representation of uwe
Operating uwe You back up, restore or upgrade uwe for a team
The demo You want to try every language on a laptop or a cluster
Contributing You change the code

Status

uwe is still an experiment. It runs real pipelines such as some nf-core pipelines, locally and on SLURM, but each language is a subset of the original, so check a workflow with uwe check before you rely on it. What uwe supports lists what is tested and how. Not every combination of executor, storage provider and container engine has been tested on live systems yet.

License

uwe is licensed under either the MIT license or the Apache License 2.0, at your option. Bundled upstream examples keep their own notices.

AI Disclaimer

A lot of this code was generated with the help of generative AI using the latest available models at the time (Opus 4.6-5.5, GPT-5.5 / 5.6-Sol / 6 Astra). The code has been manually audited and checked, but a few quirks still exist. It's still a proof of concept nonetheless and needs some additional work to be fully production ready.

About

The Universal Workflow Executor

Resources

Contributing

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages