mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2026-11-29 14:30:52 +00:00
feat(i18n): deploy libretranslate in an isolated compose runner
The i18n toolchain gets its own runner behind the `i18n` compose profile, with its own inner docker daemon and docker state, so an i18n deploy shares no ansible run and no container state with `infinito`. It reuses the image that service builds (pull_policy: never), which starts it in under a second. cache-consumer.yml holds the package-cache extra_hosts once and both runners take them through `extends`; a YAML anchor cannot cross a compose file, an extends can. GPU reservation moves from a layered override file to INFINITO_GPU_COUNT on both services. `gpus:` only accepts the literal `all`, so a variable there invalidates the project on a CPU host, while a device reservation takes `count: 0`. compose/gpu.override.yml and gpu_runtime_available() go with it. test_compose_override_services_defined.py fails when an override extends a service no compose file defines, which renders the whole project invalid. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
a78ea1fcf5
commit
3475b8ae6f
13 files changed
+283
-44
No files matched your search
@@ -126,6 +126,8 @@ class TestComposeUpRetries(unittest.TestCase):
|
||||
"compose",
|
||||
"-f",
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
"ps",
|
||||
"-q",
|
||||
"infinito",
|
||||
@@ -169,6 +171,8 @@ class TestComposeUpRetries(unittest.TestCase):
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
"ps",
|
||||
"-q",
|
||||
"infinito",
|
||||
|
||||
+34
-8
@@ -37,7 +37,14 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
def test_primary_instance_loads_the_cache_stack(self) -> None:
|
||||
self.assertEqual(
|
||||
compose_file_args(),
|
||||
["-f", "compose.yml", "-f", "compose/cache.override.yml"],
|
||||
[
|
||||
"-f",
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@patch.dict(os.environ, _WORKTREE, clear=False)
|
||||
@@ -53,6 +60,8 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"compose/cache.shared.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -60,7 +69,14 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
def test_a_stray_slot_alone_changes_nothing(self) -> None:
|
||||
self.assertEqual(
|
||||
compose_file_args(),
|
||||
["-f", "compose.yml", "-f", "compose/cache.override.yml"],
|
||||
[
|
||||
"-f",
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@patch.dict(os.environ, {**_LOCAL_PRIMARY, "INFINITO_GIT_COMMON_DIR": "/repo/.git"})
|
||||
@@ -74,6 +90,8 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
"compose/worktree.override.yml",
|
||||
"-f",
|
||||
"compose/cache.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -81,22 +99,30 @@ class TestComposeFileArgs(unittest.TestCase):
|
||||
def test_ci_keeps_the_git_mount_but_drops_every_cache_override(self) -> None:
|
||||
self.assertEqual(
|
||||
compose_file_args(),
|
||||
["-f", "compose.yml", "-f", "compose/worktree.override.yml"],
|
||||
[
|
||||
"-f",
|
||||
"compose.yml",
|
||||
"-f",
|
||||
"compose/worktree.override.yml",
|
||||
"-f",
|
||||
"i18n/compose.override.yml",
|
||||
],
|
||||
)
|
||||
|
||||
@patch.dict(os.environ, {**_LOCAL_PRIMARY, "CI": "true"}, clear=False)
|
||||
def test_ci_loads_no_override_at_all(self) -> None:
|
||||
self.assertEqual(compose_file_args(), ["-f", "compose.yml"])
|
||||
self.assertEqual(
|
||||
compose_file_args(),
|
||||
["-f", "compose.yml", "-f", "i18n/compose.override.yml"],
|
||||
)
|
||||
|
||||
@patch.dict(
|
||||
os.environ,
|
||||
{**_LOCAL_PRIMARY, "INFINITO_PUBLISH_PORTS": "false"},
|
||||
clear=False,
|
||||
)
|
||||
def test_unpublished_ports_append_the_noports_override(self) -> None:
|
||||
self.assertEqual(
|
||||
compose_file_args()[-2:], ["-f", "compose/noports.override.yml"]
|
||||
)
|
||||
def test_unpublished_ports_add_the_noports_override(self) -> None:
|
||||
self.assertIn("compose/noports.override.yml", compose_file_args())
|
||||
|
||||
|
||||
if __name__ == "__main__": # pragma: no cover
|
||||
|
||||
Reference in new issue
Block a user