Skip to main content

canary

canary is an application testing framework and workflow engine for scientific software. It finds your tests, figures out how they depend on each other and what resources they need, then runs them as fast as your hardware allows and tells you what happened. The same machinery scales from a quick run on a laptop to thousands of jobs spread across an HPC allocation.

python3 -m pip install canary-wm
canary run ./tests

Heritage

canary grows out of vvtest, the test harness that Sandia teams have relied on for years to test large scientific codes. vvtest proved out the ideas that matter most: tests are ordinary scripts, a passing test is one that exits 0, and a test harness has to understand real HPC resources instead of pretending every machine is a single box.

canary keeps those ideas and rebuilds around them. It reads vvtest's .vvt files directly, so existing test suites keep working, and it adds a native Python test format (.pyt), a plugin system, a persistent results database, and first class support for batch schedulers. If you are coming from vvtest, the mental model is the same and your tests come along with you.

What it does

Point canary at a directory and it will:

  1. Discover test and job definitions by walking the filesystem.
  2. Generate concrete jobs from those definitions, expanding parameterized tests into the full set of cases.
  3. Resolve dependencies into an execution graph and match each job against the resources it asks for (CPUs, GPUs, nodes).
  4. Schedule and run the graph with hierarchical parallelism, so independent work runs concurrently and dependent work waits only for what it needs.
  5. Record everything to a queryable results database and render reports.

A "job" does not have to be a test. It can be a simulation, an analysis step, a data-processing stage, or any other executable unit of work, which is why the same tool that runs a test suite can also drive an analysis pipeline.

Why people use it

It understands HPC. canary models CPUs, GPUs, and nodes as real resources and packs work onto them accordingly. It can run directly, or submit and manage batches through Slurm, Flux, and PBS, or fan work out across a distributed pool of machines.

Tests are just Python. A .pyt test is a small Python script with a few directives. You get the entire Python ecosystem for setup, checking, and analysis, and there is no bespoke DSL to learn.

import canary_pyt

canary_pyt.directives.keywords("fast", "regression")
canary_pyt.directives.parameterize("cpus", [1, 2, 4])


def test():
    # your check here; return nonzero to fail
    return 0

Results stick around and answer questions. Every run is written to a persistent workspace and database. You can ask things like "what failed in the last session," "which jobs ran longer than a minute," or run SQL directly:

canary status
canary query jobs --where status.category==FAIL
canary query session latest --expand-jobs --watch

It fits your toolchain. Built-in integrations cover CMake/CTest, CDash, and GitLab CI, so canary slots into existing build and continuous-integration setups instead of replacing them.

It is extensible. canary is built on pluggy. Discovery, generation, scheduling, execution, reporting, and even the job-definition format are all plugin points. The bundled schedulers and integrations are themselves plugins and double as worked examples.

A quick tour

canary run ./tests                 # discover and run everything under ./tests
canary run -k fast ./tests         # only tests tagged "fast"
canary status                      # summarize the most recent run
canary log <job-id>                # show a job's output
canary run -b scheduler=slurm ./tests   # submit as Slurm batches
canary fetch examples && canary run ./examples   # grab the bundled examples

See the user's guide for the full command reference, the directive catalog, resource configuration, and the plugin API.

Requirements

Python 3.10 or newer.

Install

Latest release from PyPI:

python3 -m pip install canary-wm

Latest development version from git:

python3 -m pip install "canary-wm@git+https://github.com/sandialabs/canary"

Note that the development branch may depend on unreleased versions of its own dependencies. For reproducible installs, use a published release.

Developing

Install in editable mode with the development extras:

git clone git@github.com:sandialabs/canary
cd canary
python3 -m pip install --editable .[dev]

Before committing, run the internal checks:

canary pre-commit

canary pre-commit adds any missing license headers, formats and lints the tree, type-checks, runs bandit, runs Semgrep, runs Vulture, runs Deptry, runs Codespell, runs the test suite, and, if everything passes, stamps pyproject.toml with today's date-based version (YY.M.D).

For documentation changes, run the same docs build that CI uses:

bin/check-docs

To preview the eventual strict gate, run:

bin/check-docs-strict

Cutting a release

main always depends on hpc-connect from git, because canary and hpc-connect are developed together. A PyPI release instead pins a published hpc-connect version. bin/release prepares a release without touching main:

bin/release --hpc-connect 26.9.11

It creates a throwaway releases/<date> branch, stamps the date-based version, pins hpc-connect==<version>, then validates by running the tests, building the wheel, installing it into a fresh virtual environment, and running the fetched examples. On success it commits on the branch and tags release/<date>, leaving main untouched. Review, then publish:

git push origin releases/<date> release/<date>

Pushing the release/* tag triggers the GitHub workflow that uploads to PyPI.

License

canary is distributed under the terms of the MIT license. See LICENSE and COPYRIGHT for details.

SPDX-License-Identifier: MIT

SCR#:3170.0

Metadata

Release files for canary-wm 26.11.7

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for canary-wm 26.11.7
File Size Uploaded Provenance Actions
canary_wm-26.11.7.tar.gz 3.0 MB With provenance Details for canary_wm-26.11.7.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for canary-wm 26.11.7
File Interpreter ABI Platform Actions
canary_wm-26.11.7-py3-none-any.whl Python 3 none any Details for canary_wm-26.11.7-py3-none-any.whl

Total release size: 6.2 MB

Release files / canary_wm-26.11.7.tar.gz

Download URL canary_wm-26.11.7.tar.gz
Size 3.0 MB
Tags Source
SHA-256 checksum
How to use checksums
877c163258fd2121569a50c2c2762cd8a8eee076d8dab04acf525d94916028de
BLAKE2b-256 checksum
How to use checksums
2ae8f17c904f3514bf98adb493e5809e1649bc21ae8d80784211ef5701bb9d16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Release files / canary_wm-26.11.7-py3-none-any.whl

Download URL canary_wm-26.11.7-py3-none-any.whl
Size 3.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
70b6c63e78082d51121b1e9f4d838b74ab974cacbb956c3aba557b920a83e0d6
BLAKE2b-256 checksum
How to use checksums
187e439278075a50e2141b1659a466bf43adc7665de923e08357006b5895bd88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

Security for canary-wm 26.11.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for canary_wm-26.11.7.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 7, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page