Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

KKRunner

Program-independent Python execution, durable run history, file manifests, local/MPI processes, SSH transport and optional PSI/J scheduler support. The core depends on platformdirs and psutil; scheduler support is an optional extra.

python -m pip install .
python -m pip install '.[psij]'  # optional scheduler support
kkrunner --help

Run these commands from the KKRunner checkout in a virtual environment. Use python -m pip install --editable . instead when editing the source.

Raw execution

import sys
from kkrunner import ExecutionSpec, Run
from kkrunner.backends import DirectBackend
from kkrunner.client import EndpointClient

run = Run.untracked(EndpointClient(DirectBackend), ExecutionSpec([sys.executable, '-c', 'print(42)']))
outcome = run.run()
assert outcome.return_code == 0

Before local or SSH process backends launch a process, they check the selected serial or MPI executable on the execution host using its working directory and PATH. Missing programs and files without execute permission produce explicit launch errors instead of relying on MPI's diagnostics. PSI/J does not apply this preflight on the submission host, because its filesystem and environment can differ from those of the compute nodes.

Persistent execution

A RunManager records runs in a RunStore so a later client can reconnect. Projects are optional; see the project guide for grouping.

import sys
from pathlib import Path
from kkrunner import ExecutionSpec, RunManager, RunStore
from kkrunner.backends import SupervisedBackend
from kkrunner.client import EndpointClient

root = Path('example').absolute()
root.mkdir(exist_ok=True)
manager = RunManager(RunStore(root / 'runs'))
run = manager.create_run(
    EndpointClient(SupervisedBackend),
    ExecutionSpec([sys.executable, '-c', 'print(42)'],
                  directory=root, output_file='stdout.txt'),
    metadata={'example': {'label': 'answer'}},
)
outcome = run.run()
assert manager.store.get(run.id).state.value == 'finished'

manager.attach(run_id) resumes monitoring and required transfers. A result callback is optional; when supplied it receives an ExecutionOutcome and may return any Python object. To defer processing, create a run with processing_required=True, then supply process_result= on a later attach. Without that callback the durable state remains postprocessing and wait() raises ProcessingPending. The same exception tells an application observer that another client owns/already performed processing; load the historical application result instead of treating a raw outcome as a parsed result.

manager.retry_postprocessing(run_id, callback) retries failed/interrupted processing against the captured files without submitting another process. manager.resume_download(run_id) reopens a failed download before attach. run.stop_observation() detaches observation without cancelling the backend; run.cancel() requests backend cancellation. Untracked raw local runs have no restart/reconnect guarantee; managed local runs use the same supervisor as SSH.

See the documentation guide and architecture for usage, ownership, recovery and format rules.

Development and distribution

For development, install an editable checkout with test dependencies:

python -m pip install --editable '.[test]'
python -m pytest -q

To produce archives for sharing, install the build tool with python -m pip install build, then run python -m build. This creates a source archive and an installable wheel in dist/. CI validates these artifacts on Linux with Python 3.9, 3.12 and 3.14, plus macOS tests on Apple Silicon and Intel with Python 3.12, including durable local supervision and reconnect. See development for test scope and packaging details.

Publish to PyPI

The publish-pypi.yml workflow runs on a v<version> tag from any branch. The tag must exactly match [project].version in pyproject.toml; publication is independent of branch names. The version is defined in pyproject.toml; kkrunner.__version__ reads the installed distribution metadata automatically.

Configure a PyPI Trusted Publisher for project kkrunner, GitHub owner ase2sprkkr, repository kkrunner, workflow publish-pypi.yml and environment pypi. Protect the GitHub pypi environment with required reviewers and v* tag rules. If hosted under another owner, use that owner in the publisher configuration. No PyPI API token is needed.

The workflow verifies the tag, builds one source archive and wheel, then tests that wheel on Python 3.9, 3.12 and 3.14 and builds/tests the documentation. Only after all checks pass does the publish job upload those exact artifacts using the pypi environment and GitHub's OIDC token.

For nonpublic evaluation, use a prerelease version and do not push a version tag. Branch CI retains wheel/sdist artifacts for evaluation. Use access-controlled storage when sharing with testers: GitHub artifacts in a public repository are not private, and an upload to PyPI is public even for a development version.

Documentation

Documentation is published at https://ase2sprkkr.github.io/kkrunner/ after successful release-tag documentation checks.

The user guide and API reference use Sphinx with the Read the Docs theme. Install the documentation extra and build the HTML and examples:

python -m venv .venv
.venv/bin/python -m pip install -e '.[docs]'
make docs PYTHON=.venv/bin/python
make docs-test PYTHON=.venv/bin/python

Use the same Python for dependency installation and Makefile targets; the docs extra includes MyST and the theme. Open build/docs/html/index.html. See the guide for raw and persistent execution, manifests, projects, schedulers, remote execution and the CLI; development covers builds and releases. Generated API pages and HTML are not committed. CI validates documentation against the installed wheel and uploads the HTML artifact. The separate documentation workflow checks the same wheel and documentation, omits the runtime test matrices, and deploys to GitHub Pages when a release is published or on manual runs. Enable Settings → Pages → Build and deployment → GitHub Actions and allow release tags and manually selected source branches in the github-pages environment deployment rules.

Source provenance is recorded in development remarks; the license is in LICENCE.

Metadata

Release files for kkrunner 0.3.0b3

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

Source distribution (sdist)

Source distribution for kkrunner 0.3.0b3
File Size Uploaded Provenance Actions
kkrunner-0.3.0b3.tar.gz 342.7 kB With provenance Details for kkrunner-0.3.0b3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for kkrunner 0.3.0b3
File Interpreter ABI Platform Actions
kkrunner-0.3.0b3-py3-none-any.whl Python 3 none any Details for kkrunner-0.3.0b3-py3-none-any.whl

Total release size: 529.1 kB

Release files / kkrunner-0.3.0b3.tar.gz

Download URL kkrunner-0.3.0b3.tar.gz
Size 342.7 kB
Tags Source
SHA-256 checksum
How to use checksums
03bc82735ed730637b13c1ba21003ba39791f2a8d9235816b4b406960e603933
BLAKE2b-256 checksum
How to use checksums
105630aef3a2003accd5c87593f828ed3238ed41fda36ee459277b4199084e8a
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 26, 2026.

Transparency log

Release files / kkrunner-0.3.0b3-py3-none-any.whl

Download URL kkrunner-0.3.0b3-py3-none-any.whl
Size 186.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
43172d9748f75c8ea27409b8827c9a74be20430369a603bbc36501cbf9097bc4
BLAKE2b-256 checksum
How to use checksums
c2a4970b866d67bba6d37c9af3e83bbfc38b9a6212715f45428a987265d1d8bf
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 26, 2026.

Transparency log

Security for kkrunner 0.3.0b3

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 kkrunner-0.3.0b3.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 26, 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