mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-12-05 09:18:53 +00:00
fix(ci): narrow a row's architectures by what its variant deploys
row_architectures intersected the run's pool with the declarations of every role in the complexity closure. That closure follows every conditional provider flag through the base graph, so tor -> web-svc-mirror -> prometheus -> openwebui -> litellm -> lmstudio put the amd64-only lmstudio into the closure of 93 of 128 roles, including the minimal variants that never deploy it. A single amd64 pin would have withdrawn arm64 from nearly the whole matrix. The matrix now replaces a row's services with the include set that plan_dev_inventory_matrix, the planner the deploy step itself uses, resolves for that variant. Against CI run 35674334334 it matches every data point: lmstudio for zammad#2, moodle#2 and xwiki#2, which pulled it on arm64, and not for docs#0 or legal#0, which did not. With the pins of the next commit, 126 of 128 roles keep arm64 rows instead of 34. Without any architecture declaration the emitted matrix is byte-identical to before under a fixed discovery seed. The planner adds about 37 s per matrix build, and a role whose plan errors now stops the matrix instead of only its own deploy job. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fa7eba3771
commit
c7fb6e60c5
5 files changed
+63
-10
No files matched your search
@@ -192,5 +192,32 @@ class TestCandidates(unittest.TestCase):
|
||||
self.assertEqual(discovered.call_args.kwargs["blacklist"], "web-app-b")
|
||||
|
||||
|
||||
class TestWithDeployedServices(unittest.TestCase):
|
||||
def setUp(self) -> None:
|
||||
matrix.deployed_rounds.cache_clear()
|
||||
self.addCleanup(matrix.deployed_rounds.cache_clear)
|
||||
|
||||
def test_each_variant_takes_the_apps_its_own_round_deploys(self) -> None:
|
||||
plan = [
|
||||
(0, "plan-0", {}, ("web-app-a", "svc-db-postgres"), ()),
|
||||
(1, "plan-1", {}, ("web-app-a", "svc-ai-lmstudio"), ()),
|
||||
]
|
||||
with mock.patch.object(
|
||||
matrix, "plan_dev_inventory_matrix", return_value=plan
|
||||
) as planner:
|
||||
rows = [
|
||||
matrix.with_deployed_services(
|
||||
{"name": "web-app-a", "variant": variant, "services": ["x"]}
|
||||
)
|
||||
for variant in (0, 1)
|
||||
]
|
||||
|
||||
self.assertEqual(
|
||||
[row["services"] for row in rows],
|
||||
[("web-app-a", "svc-db-postgres"), ("web-app-a", "svc-ai-lmstudio")],
|
||||
)
|
||||
planner.assert_called_once()
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user