mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 14:30:52 +00:00
feat(tools): rename the i18n lane to tools and give the cache paths one spot
The lane is no longer LibreTranslate-only, so `i18n` is the wrong name for the runner, its compose override, its inventory and its env keys. Renames to `tools` throughout and points the lane at `svc-ai-libretranslate-engine`, which is the role that actually owns the `libretranslate-engine` service key. The six cache host paths were each written out in full. They now derive from `DIR_CACHE`, one plain string in `group_vars/all/05_paths.yml`, via a `cache_paths` handler; the generated values are byte-identical. The handler is registered directly after `cache_stack` rather than late, because `registry_cache_max_size` reads `INFINITO_CACHE_REGISTRY_HOST_PATH` and returns early when it is empty, which silently dropped `INFINITO_CACHE_REGISTRY_MAX_SIZE` from the generated `.env` and broke every `docker compose` invocation that layers `cache.override.yml`. `INFINITO_TOOLS_MODELS_HOST_PATH` derives from the same base, so the model bind the lane mounts follows the cache layout instead of repeating it. The inventory pins `DOCKER_BIND_HOST=0.0.0.0`: the group_vars default keys off `DOCKER_IN_CONTAINER`, which evaluates false for the inner deploy and would leave the lane's services on the runner's loopback. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
9b683cc45c
commit
c782208f99
20 files changed
+419
-103
No files matched your search
@@ -128,7 +128,7 @@ class TestComposeUpRetries(unittest.TestCase):
|
||||
"-f",
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
"ps",
|
||||
"-q",
|
||||
"infinito",
|
||||
@@ -174,7 +174,7 @@ class TestComposeUpRetries(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
"ps",
|
||||
"-q",
|
||||
"infinito",
|
||||
|
||||
+27
-6
@@ -23,6 +23,8 @@ _LOCAL_PRIMARY = {
|
||||
"INFINITO_CACHE_STACK": "",
|
||||
"INFINITO_PUBLISH_PORTS": "",
|
||||
"INFINITO_GPU_COUNT": "0",
|
||||
"INFINITO_TOOLS_LIBRETRANSLATE_PORT": "8097",
|
||||
"INFINITO_TOOLS_MODELS_HOST_PATH": "/var/cache/infinito/core/cache/models",
|
||||
}
|
||||
|
||||
_WORKTREE = {
|
||||
@@ -44,7 +46,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -62,7 +64,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/cache.shared.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -76,7 +78,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -92,7 +94,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -106,7 +108,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"-f",
|
||||
"compose/worktree.override.yml",
|
||||
"-f",
|
||||
"compose/i18n.override.yml",
|
||||
"compose/tools.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -114,7 +116,7 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
def test_ci_loads_no_override_at_all(self) -> None:
|
||||
self.assertEqual(
|
||||
compose_file_args(),
|
||||
["-f", "compose.yml", "-f", "compose/i18n.override.yml"],
|
||||
["-f", "compose.yml", "-f", "compose/tools.override.yml"],
|
||||
)
|
||||
|
||||
@patch.dict(
|
||||
@@ -137,6 +139,25 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
def test_a_host_with_a_gpu_adds_the_reservation(self) -> None:
|
||||
self.assertIn("compose/gpu.override.yml", compose_file_args())
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{**_LOCAL_PRIMARY, "INFINITO_TOOLS_LIBRETRANSLATE_PORT": ""},
|
||||
clear=False,
|
||||
)
|
||||
def test_a_stale_env_drops_the_tools_lane_instead_of_aborting(self) -> None:
|
||||
"""The lane's override carries `:?` guards, which fire even behind its
|
||||
profile, so layering it in against an .env that predates those keys
|
||||
would abort every compose command rather than only the lane."""
|
||||
self.assertNotIn("compose/tools.override.yml", compose_file_args())
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{**_LOCAL_PRIMARY, "INFINITO_TOOLS_MODELS_HOST_PATH": ""},
|
||||
clear=False,
|
||||
)
|
||||
def test_the_models_path_gates_the_tools_lane_too(self) -> None:
|
||||
self.assertNotIn("compose/tools.override.yml", compose_file_args())
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
unittest.main()
|
||||
Reference in new issue
Block a user