Hosts clusterer/campaign-clusterer/attribution/reuse-correlate in one process. The two O(n^2) connected-components kernels (cluster_observations, cluster_identities) offload to ONE shared forkserver pool via decnet.offload .run_kernel, so they run in parallel instead of serialising under the GIL. - offload.run_kernel: pool when installed + offload_if holds, else inline. Standalone workers and all tests run inline => behaviour unchanged (424 clustering/correlation tests green). - offload_if gates on input size (>=256) to skip pickle cost on small passes. - forkserver (not fork): supervisor is multithreaded via bus clients. - attribution/reuse co-located but not offloaded yet (lighter; same run_kernel path extends to them if profiling shows contention). - systemd unit Conflicts= the 4 units it replaces; no docker/raw-socket priv.
28 lines
722 B
Python
28 lines
722 B
Python
# SPDX-License-Identifier: AGPL-3.0-or-later
|
|
"""CLI surface for ``decnet supervise`` (DECNET 1.1 consolidation)."""
|
|
from __future__ import annotations
|
|
|
|
from typer.testing import CliRunner
|
|
|
|
from decnet.cli import app
|
|
from decnet.cli.supervise import _GROUPS
|
|
|
|
runner = CliRunner()
|
|
|
|
|
|
def test_supervise_is_registered():
|
|
result = runner.invoke(app, ["supervise", "--help"])
|
|
assert result.exit_code == 0
|
|
assert "group" in result.stdout.lower()
|
|
|
|
|
|
def test_unknown_group_exits_2():
|
|
result = runner.invoke(app, ["supervise", "definitely-not-a-group"])
|
|
assert result.exit_code == 2
|
|
assert "unknown group" in result.stdout
|
|
|
|
|
|
def test_known_groups():
|
|
assert "batch" in _GROUPS
|
|
assert "cpu" in _GROUPS
|