Skip to main content

kajenn-orchestra

PyPI Tests Codecov Documentation Python License

Status: Beta · version 0.4.0.

Orchestration for kajenn: one mountable application, SpaApplication, and a supervised pool of worker processes behind it. Every page a user opens is served by the same process and his state lives in that process's memory, so the second request finds what the first one built.

A commander in the server process owns the indexes — whose a connection is, which connection a page belongs to, where each user lives — and one group per worker grammar owns the processes. A group launches one worker at boot and grows only when a real user finds none that can admit him; nothing in the recipe says how many workers there are.

A user reaches another process through one path: he is held, his state is written to the freezer on disk, his placement is cleared, and his next request wakes him wherever the placement lands. Idleness, CPU pressure and the departure of a worker all take that same path. Nothing replicates between processes; the only shared state is one dictionary the commander owns and every worker reaches by call.

The setpoints of a group — memory shares, admission thresholds, the idle horizon — are composed defaults ⊕ recipe ⊕ profile ⊕ environment and can be replaced on a running pool, validated whole or refused whole.

kajenn_orchestra imports kajenn; kajenn never imports kajenn_orchestra. The core loads the front by class reference from the configuration recipe. The modules of kajenn this package may import are listed in kajenn_imports.txt and checked by tools/import_graph.py in the pre-commit hook.

Based on genropy history and genro-modules.

Installation

pip install kajenn-orchestra

kajenn is installed with it. Beside a kajenn checkout, [tool.uv.sources] in pyproject.toml points at ../kajenn:

uv venv .venv
uv pip install -p .venv/bin/python -e ".[dev,docs,internals]"

A minimal pool

# worker.py
from kajenn_orchestra.orchestration.spa_worker import SpaWorker


class SiteWorker(SpaWorker):
    def __init__(self, name, **kwargs):
        super().__init__(name, **kwargs)
        self.wsgi_app = my_wsgi_site


# config.py
from kajenn.config import AsgiConfigBuilder
from kajenn_orchestra.spa_app import SpaApplication


class ServerConfiguration(AsgiConfigBuilder):
    default_config = False

    def main(self, root):
        cfg = root.configuration()
        cfg.server(host="127.0.0.1", port=8000)
        front = cfg.applications().application(
            code="site", mount="", app_class=SpaApplication
        )
        commander = front.orchestration().commander(
            frozen_users_path="/var/spa/frozen", instance_dir="/run/kajenn"
        )
        commander.groups(default="standard").group(
            name="standard",
            entry_module="kajenn_orchestra.orchestration.worker_entry",
            worker_class="worker:SiteWorker",
        )
kajenn serve ./config.py

The front answers on /, mints nothing, and writes the spa_connection_id cookie with the connection id the hosted site named while serving.

Project

License

Apache License 2.0, copyright Softwell S.r.l.

Metadata

Release files for kajenn-orchestra 0.5.0

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

Source distribution (sdist)

Source distribution for kajenn-orchestra 0.5.0
File Size Uploaded
kajenn_orchestra-0.5.0.tar.gz 3.8 MB Details

Built distribution (wheel)

Table of built distributions (wheels) for kajenn-orchestra 0.5.0
File Interpreter ABI Platform
kajenn_orchestra-0.5.0-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 MB

Release files / kajenn_orchestra-0.5.0.tar.gz

Download URL kajenn_orchestra-0.5.0.tar.gz
Size 3.8 MB
Tags Source
SHA-256 checksum
How to use checksums
0dd285aa37eda0d6a3f9590efaba4a61df6ef60cea24f61697e6d48daec9a919
BLAKE2b-256 checksum
How to use checksums
c779ce4ed0a564c66389df501fb4e7299f982af5bc59ebf01c1a0b1c4e59dba4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release files / kajenn_orchestra-0.5.0-py3-none-any.whl

Download URL kajenn_orchestra-0.5.0-py3-none-any.whl
Size 208.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bab0a4b404145fb0d9ab9cfdf0fac78133ccf1fc42a6464997f6669b7eca4082
BLAKE2b-256 checksum
How to use checksums
bd8d6765e17757a537b38332935953dd279b09addab578a4bc748adf87dee7c4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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 Oct 13, 2026.

Transparency log

Release history Release notifications | RSS feed

0.5.1

2 release files

This release

0.5.0 This release

2 release files

0.4.5

2 release files

0.4.0

2 release files

0.3.0

2 release files

0.2.0

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.0

2 release files

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