Files
alzeo/tests/test_one_engine_units.py
T
Hasan BasbunarandClaude Opus 5.5 4eda8de142 WIP v1.49: the MiniMax-H3-Image lane: its installer, its unit, its switch, install.sh's flags and every lane list
A lane of its own beside Qwen-Image 2.1 (decisions 1288 and 1374): install-image-h3.sh (venv, the
sglang[diffusion] 0.5.23 wheel, SGLang main at 49f1a44 over it, flash-attn-4 4.0.0b38 and FlashInfer
0.7.2's cubins and jit-cache package by sha256, as SGLang's DGX Spark recipe), qwen38-image-h3.service on
:30026, loopback only, with --sleep-on-idle and --http-graceful-shutdown-timeout 5 (the runtime's own
flags at this commit, where the image and video lanes need patches), its text encoder MiniMax-H3's at
the video lane's pin. On demand like every lane (--with-image-h3, --no-image-h3), the switch, prepare
and uninstall, every unit's Conflicts= and After=, the proxy (v6.57: the box serves images while either
image lane serves), the CI's lists, and the tests that hold each list to lane_registry.py.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-15 19:43:15 +01:00

57 lines
2.5 KiB
Python

#!/usr/bin/env python3
"""Every lane's unit tells systemd that it runs alone, and in what order.
Two engines on the unified pool is the livelock this box power-cycles out of. The image
unit said so with Conflicts= and no After=, and Conflicts= orders nothing: its start and
the text lane's stop ran side by side (5 to 60 s in the reference box's journal on
2026-09-23). The two text units said nothing at all to each other, so the 27B and the
flash lane could run together, or both start at boot if both were enabled.
With Conflicts= and After= on every other lane, measured on the box's systemd 255 with
throwaway units (2026-09-24): each switch finished the stop before the start, in all four
directions tried, with no ordering-cycle warning, and a transaction asking for two lanes
at once started one of them only.
"""
import pathlib
import re
import unittest
REPO = pathlib.Path(__file__).resolve().parents[1]
LANES = {
"qwen38-sglang.service": ("qwen38-sglang.service.template", "qwen38-sglang-1m.service.template"),
"qwen38-flash.service": ("qwen38-flash.service.template",),
"qwen38-image.service": ("qwen38-image.service.template",),
"qwen38-video.service": ("qwen38-video.service.template",),
"qwen38-kolibri.service": ("qwen38-kolibri.service.template",),
"qwen38-nemotron.service": ("qwen38-nemotron.service.template",),
"qwen38-nemotron-super.service": ("qwen38-nemotron-super.service.template",),
"qwen38-flash-local.service": ("qwen38-flash-local.service.template",),
"qwen38-ornith-122b.service": ("qwen38-ornith-122b.service.template",),
"qwen38-flash-unsloth.service": ("qwen38-flash-unsloth.service.template",),
"qwen38-image-h3.service": ("qwen38-image-h3.service.template",),
}
ALL = set(LANES)
def unit_list(template, key):
unit = (REPO / template).read_text().split("[Service]")[0]
return {u for line in re.findall(rf"(?m)^{key}=(.*)$", unit) for u in line.split()}
class EveryLaneRunsAlone(unittest.TestCase):
def test_each_lane_conflicts_with_every_other_lane(self):
for lane, templates in LANES.items():
for t in templates:
with self.subTest(template=t):
self.assertEqual(unit_list(t, "Conflicts"), ALL - {lane})
def test_each_lane_is_ordered_after_what_it_conflicts_with(self):
for templates in LANES.values():
for t in templates:
with self.subTest(template=t):
self.assertEqual(unit_list(t, "Conflicts") - unit_list(t, "After"), set())
if __name__ == "__main__":
unittest.main(verbosity=2)