boatyard 0.9.11.dev278__tar.gz → 0.9.12.dev282__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (85) hide show
  1. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/AGENTS.md +5 -0
  2. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/PKG-INFO +1 -1
  3. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/pyproject.toml +1 -1
  4. boatyard-0.9.12.dev282/src/boatyard/compose.py +61 -0
  5. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/down.py +3 -1
  6. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/publish.py +3 -1
  7. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/up.py +3 -1
  8. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_assembly.py +15 -7
  9. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_compose.py +35 -57
  10. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_publish_compose.py +4 -3
  11. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.gitattributes +0 -0
  12. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.github/workflows/cleanup-pr-releases.yml +0 -0
  13. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.github/workflows/integrate.yml +0 -0
  14. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.github/workflows/merge-gate.yml +0 -0
  15. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.github/workflows/release.yml +0 -0
  16. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.gitignore +0 -0
  17. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/.python-version +0 -0
  18. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/CLAUDE.md +0 -0
  19. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/LICENSE +0 -0
  20. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/NOTICE +0 -0
  21. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/README.md +0 -0
  22. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/AGENTS.md +0 -0
  23. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/CLAUDE.md +0 -0
  24. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/apt-hermeticity.md +0 -0
  25. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/mirror-digest-retention.md +0 -0
  26. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/precision-attribution.md +0 -0
  27. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/design/semver-image-bundle-lines.md +0 -0
  28. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/publish.yml +0 -0
  29. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/ruff.base.toml +0 -0
  30. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/ruff.toml +0 -0
  31. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/scripts/preflight.py +0 -0
  32. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/__init__.py +0 -0
  33. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/build.py +0 -0
  34. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/cli.py +0 -0
  35. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/crane.py +0 -0
  36. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/lock.py +0 -0
  37. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/markers.py +0 -0
  38. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/__init__.py +0 -0
  39. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/config_file.py +0 -0
  40. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/image.py +0 -0
  41. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/k8s_pins.py +0 -0
  42. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/lock_file.py +0 -0
  43. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/pyproject.py +0 -0
  44. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/values_file.py +0 -0
  45. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/models/workload.py +0 -0
  46. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/paths.py +0 -0
  47. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/publish.py +0 -0
  48. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/py.typed +0 -0
  49. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/resolve.py +0 -0
  50. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score.py +0 -0
  51. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_compose.py +0 -0
  52. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_generate.py +0 -0
  53. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_k8s.py +0 -0
  54. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/docker-socket.tpl +0 -0
  55. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/gpu-cuda.tpl +0 -0
  56. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/gpu-pod.tpl +0 -0
  57. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/gpu-rocm.tpl +0 -0
  58. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/probe-adapter-healthchecks.tpl +0 -0
  59. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/restart.tpl +0 -0
  60. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/score_patch_templates/scale-to-zero.tpl +0 -0
  61. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/temp.py +0 -0
  62. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/__init__.py +0 -0
  63. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/build.py +0 -0
  64. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/bump.py +0 -0
  65. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/lock.py +0 -0
  66. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/matrix.py +0 -0
  67. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/mirror.py +0 -0
  68. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/score.py +0 -0
  69. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/verbs/tree_tags.py +0 -0
  70. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/src/boatyard/yaml.py +0 -0
  71. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/conftest.py +0 -0
  72. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_build_docker.py +0 -0
  73. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_bump.py +0 -0
  74. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_config.py +0 -0
  75. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_daemon_gc.py +0 -0
  76. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_image_builds.py +0 -0
  77. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_lock.py +0 -0
  78. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_markers.py +0 -0
  79. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_matrix.py +0 -0
  80. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_mirror.py +0 -0
  81. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_provisioners.py +0 -0
  82. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_score_generate.py +0 -0
  83. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_tree_tags.py +0 -0
  84. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/tests/test_values.py +0 -0
  85. {boatyard-0.9.11.dev278 → boatyard-0.9.12.dev282}/uv.lock +0 -0
@@ -29,6 +29,10 @@ Design intent and silent-failure traps, one fact per bullet.
29
29
  (the barrier rides the global `BOATYARD_BARRIER_IMAGE` slot, minted at resolve; the
30
30
  gateway document renders its pin literally); boatyard hosting its own mirror retires the
31
31
  exception.
32
+ - The compose CLI is pinned and cached per user (`compose.py`), and every verb invokes the
33
+ standalone `docker-compose` spelling after `install_compose()` puts it on PATH — shelling
34
+ the host's `docker compose` plugin would make interpolation and artifact behavior vary by
35
+ machine.
32
36
  - Substrate split: compose renderings bake the lock's per-platform manifests (the exact bytes
33
37
  one machine runs); k8s renderings bake the index form (kubelet resolves per node).
34
38
  `helm template` is a renderer, never a deployer.
@@ -158,6 +162,7 @@ Quick loop: `uv run pytest`, `uv run ruff check`. Full gate:
158
162
  rendering / k8s rendering / generation verb.
159
163
  - `publish.py` — publish preparation.
160
164
  - `crane.py` — pinned crane installer.
165
+ - `compose.py` — pinned compose installer.
161
166
  - `paths.py` — consumer-repo document paths.
162
167
  - `temp.py` — shared digest/platform/tree-tag regex spellings and the platform quoting
163
168
  helper for bashrun command tokens.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: boatyard
3
- Version: 0.9.11.dev278
3
+ Version: 0.9.12.dev282
4
4
  Summary: Deploy-files definition language and compiler, plus a runtime for the compose target
5
5
  License-File: LICENSE
6
6
  License-File: NOTICE
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boatyard"
3
- version = "0.9.11.dev278"
3
+ version = "0.9.12.dev282"
4
4
  description = "Deploy-files definition language and compiler, plus a runtime for the compose target"
5
5
  requires-python = ">=3.13"
6
6
  dependencies = [
@@ -0,0 +1,61 @@
1
+ from __future__ import annotations
2
+
3
+ import os
4
+ import platform
5
+ import sys
6
+ from pathlib import Path
7
+
8
+ from bashrun.bash import bash, bash_check, bash_output
9
+
10
+ COMPOSE_VERSION = "v5.6.1"
11
+
12
+ COMPOSE_CACHE_DIRECTORY = Path.home() / ".cache" / "boatyard" / "compose"
13
+
14
+ _installed = False
15
+
16
+
17
+ def install_compose() -> None:
18
+ global _installed
19
+ if _installed:
20
+ return
21
+ directory = compose_binary().parent.as_posix()
22
+ os.environ["PATH"] = f"{directory}{os.pathsep}{os.environ['PATH']}"
23
+ _installed = True
24
+
25
+
26
+ def compose_binary() -> Path:
27
+ if sys.platform == "win32":
28
+ return _compose_binary_windows()
29
+ return _compose_binary_posix()
30
+
31
+
32
+ def _compose_binary_posix() -> Path:
33
+ architecture = {"x86_64": "x86_64", "aarch64": "aarch64"}[platform.machine()]
34
+ binary = COMPOSE_CACHE_DIRECTORY / COMPOSE_VERSION / architecture / "docker-compose"
35
+ release = (
36
+ f"https://github.com/docker/compose/releases/download/{COMPOSE_VERSION}/docker-compose-linux-{architecture}"
37
+ )
38
+ return _resolved_binary(binary, release)
39
+
40
+
41
+ def _compose_binary_windows() -> Path:
42
+ binary = COMPOSE_CACHE_DIRECTORY / COMPOSE_VERSION / "x86_64" / "docker-compose.exe"
43
+ release = f"https://github.com/docker/compose/releases/download/{COMPOSE_VERSION}/docker-compose-Windows-x86_64.exe"
44
+ return _resolved_binary(binary, release)
45
+
46
+
47
+ def _resolved_binary(binary: Path, release: str) -> Path:
48
+ # The exact compose binary every verb invokes, cached under ~/.cache/boatyard so one
49
+ # download serves every run. The download lands on a partial name and renames into
50
+ # place only after its version output checks out — a killed or corrupt download
51
+ # never poisons the cache.
52
+ if binary.is_file() and bash_check(f"{binary.as_posix()} version"):
53
+ return binary
54
+ binary.parent.mkdir(parents=True, exist_ok=True)
55
+ partial = binary.with_name(f"{binary.name}.partial")
56
+ bash(f"curl -fsSL {release} -o {partial.as_posix()}")
57
+ partial.chmod(0o755)
58
+ if COMPOSE_VERSION not in bash_output(f"{partial.as_posix()} version"):
59
+ raise ValueError(f"{partial.as_posix()}: the downloaded binary does not report version {COMPOSE_VERSION}")
60
+ partial.replace(binary)
61
+ return binary
@@ -6,6 +6,7 @@ from typing import Annotated
6
6
  import typer
7
7
  from bashrun.bash import bash, bash_check
8
8
 
9
+ from boatyard.compose import install_compose
9
10
  from boatyard.models.config_file import ConfigFile
10
11
  from boatyard.paths import DEFAULT_CONFIG_PATH
11
12
  from boatyard.temp import quote_command_token
@@ -19,6 +20,7 @@ def down(
19
20
  ) -> None:
20
21
  root = Path.cwd()
21
22
  config = ConfigFile.load(root / DEFAULT_CONFIG_PATH)
23
+ install_compose()
22
24
 
23
25
  # Config only: every declared entry names a candidate project, selected or not, and the
24
26
  # bare project name removes the un-suffixed project.
@@ -28,7 +30,7 @@ def down(
28
30
  volumes_argument = " -v" if volumes else ""
29
31
  for candidate in candidates:
30
32
  bash(
31
- f"docker compose -p {candidate} --project-directory {project_directory} "
33
+ f"docker-compose -p {candidate} --project-directory {project_directory} "
32
34
  f"down --remove-orphans{volumes_argument}"
33
35
  )
34
36
 
@@ -11,6 +11,7 @@ import typer
11
11
  from bashrun.bash import bash, bash_output
12
12
 
13
13
  from boatyard.models.config_file import ConfigFile, compose_bundle_output_path, env_lock_slot, env_tree_slot
14
+ from boatyard.compose import install_compose
14
15
  from boatyard.crane import install_crane
15
16
  from boatyard.models.lock_file import LOCK_PATH, LockFile
16
17
  from boatyard.paths import DEFAULT_CONFIG_PATH
@@ -110,9 +111,10 @@ def publish_compose(
110
111
  finalize_baked(baked_path, repository)
111
112
 
112
113
  # Publish once under the sha tag and alias the branch tag.
114
+ install_compose()
113
115
  sha_reference = f"{repository}/{bundle_name}:{sha}"
114
116
  print(f"Publish {sha_reference}")
115
- bash(f"docker compose -f {shlex.quote(str(baked_path))} publish {shlex.quote(sha_reference)} --yes")
117
+ bash(f"docker-compose -f {shlex.quote(str(baked_path))} publish {shlex.quote(sha_reference)} --yes")
116
118
  branch_reference = f"{repository}/{bundle_name}:{branch_tag}"
117
119
  print(f"Tag {branch_reference}")
118
120
  bash(f"crane tag {shlex.quote(sha_reference)} {shlex.quote(branch_tag)}")
@@ -12,6 +12,7 @@ import yaml
12
12
  from bashrun.bash import CalledProcessError, bash, bash_check
13
13
 
14
14
  from boatyard.build import run_build
15
+ from boatyard.compose import install_compose
15
16
  from boatyard.crane import install_crane
16
17
  from boatyard.lock import OciArtifactManifest
17
18
  from boatyard.models.config_file import (
@@ -175,12 +176,13 @@ def _run_compose(
175
176
  arguments: list[str],
176
177
  ) -> None:
177
178
  # Spell the one compose invocation; the scrub defeats env-file precedence
179
+ install_compose()
178
180
  root = plan.config.root
179
181
  quoted_arguments = [quote_command_token(argument) for argument in arguments]
180
182
  files_argument = "".join(f" -f {quote_command_token(str(compose_file))}" for compose_file in compose_files)
181
183
  scrub = "".join(f" -u {quote_command_token(name)}" for name in sorted(set(plan.env)))
182
184
  prefix = (
183
- f"docker compose -p {quote_command_token(project_name)}{files_argument} "
185
+ f"docker-compose -p {quote_command_token(project_name)}{files_argument} "
184
186
  f"--project-directory {quote_command_token(str(root))} --env-file {quote_command_token(str(env_file))}"
185
187
  )
186
188
  # If not on Windows, prefix the env scrub
@@ -212,6 +212,7 @@ def _invoke_up(
212
212
  monkeypatch.setattr(up, "bash", spy.run)
213
213
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
214
214
  monkeypatch.setattr(up, "install_crane", lambda: None)
215
+ monkeypatch.setattr(up, "install_compose", lambda: None)
215
216
  monkeypatch.setattr(
216
217
  up,
217
218
  "OciArtifactManifest",
@@ -481,6 +482,7 @@ class TestOverrideDocument:
481
482
  monkeypatch.setattr(up, "bash", declared_spy.run)
482
483
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
483
484
  monkeypatch.setattr(up, "install_crane", lambda: None)
485
+ monkeypatch.setattr(up, "install_compose", lambda: None)
484
486
  monkeypatch.setattr(up, "OciArtifactManifest", StubArtifacts({LIVEKIT_PINNED: [declaring]}))
485
487
 
486
488
  result = runner.invoke(app, ["up"])
@@ -503,6 +505,7 @@ class TestOverrideDocument:
503
505
  monkeypatch.setattr(up, "bash", spy.run)
504
506
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
505
507
  monkeypatch.setattr(up, "install_crane", lambda: None)
508
+ monkeypatch.setattr(up, "install_compose", lambda: None)
506
509
  monkeypatch.setattr(up, "OciArtifactManifest", StubArtifacts({LIVEKIT_PINNED: [LIVEKIT_TEXT]}))
507
510
 
508
511
  result = runner.invoke(app, ["up"])
@@ -526,19 +529,19 @@ class TestUpProjects:
526
529
  [bundle_create, bundle_start, gateway_command] = spy.commands
527
530
  assert bundle_create.startswith(
528
531
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PUBLIC_HOST -u PUBLIC_PORT -u PUBLIC_SCHEME "
529
- "-u PUBLIC_URL -u PUBLIC_URL_PATH docker compose -p edge-demo-livekit -f "
532
+ "-u PUBLIC_URL -u PUBLIC_URL_PATH docker-compose -p edge-demo-livekit -f "
530
533
  )
531
534
  assert "boatyard-bundle-" in bundle_create
532
535
  assert "boatyard-override-" in bundle_create
533
536
  assert bundle_create.endswith("up --pull missing -d --no-start")
534
537
  assert bundle_start.startswith(
535
538
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PUBLIC_HOST -u PUBLIC_PORT -u PUBLIC_SCHEME "
536
- "-u PUBLIC_URL -u PUBLIC_URL_PATH docker compose -p edge-demo-livekit -f "
539
+ "-u PUBLIC_URL -u PUBLIC_URL_PATH docker-compose -p edge-demo-livekit -f "
537
540
  )
538
541
  assert bundle_start.endswith("start livekit")
539
542
  assert gateway_command.startswith(
540
543
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PUBLIC_HOST -u PUBLIC_PORT -u PUBLIC_SCHEME "
541
- "-u PUBLIC_URL -u PUBLIC_URL_PATH docker compose -p edge-demo -f "
544
+ "-u PUBLIC_URL -u PUBLIC_URL_PATH docker-compose -p edge-demo -f "
542
545
  )
543
546
  assert "boatyard-gateway-" in gateway_command
544
547
  assert gateway_command.endswith("up --pull missing -d")
@@ -555,6 +558,7 @@ class TestUpProjects:
555
558
  monkeypatch.setattr(up, "bash", spy.run)
556
559
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
557
560
  monkeypatch.setattr(up, "install_crane", lambda: None)
561
+ monkeypatch.setattr(up, "install_compose", lambda: None)
558
562
  monkeypatch.setattr(up, "OciArtifactManifest", StubArtifacts({LIVEKIT_PINNED: [LIVEKIT_TEXT]}))
559
563
 
560
564
  result = runner.invoke(app, ["up"])
@@ -596,6 +600,7 @@ class TestUpProjects:
596
600
  monkeypatch.setattr(up, "bash", spy.run)
597
601
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
598
602
  monkeypatch.setattr(up, "install_crane", lambda: None)
603
+ monkeypatch.setattr(up, "install_compose", lambda: None)
599
604
  monkeypatch.setattr(up, "OciArtifactManifest", StubArtifacts({LIVEKIT_PINNED: [text]}))
600
605
 
601
606
  result = runner.invoke(app, ["up"])
@@ -617,6 +622,7 @@ class TestUpProjects:
617
622
  raise CalledProcessError(1, command)
618
623
 
619
624
  monkeypatch.setattr(up, "bash", fail_from_second)
625
+ monkeypatch.setattr(up, "install_compose", lambda: None)
620
626
 
621
627
  result = runner.invoke(app, ["up"])
622
628
 
@@ -669,6 +675,7 @@ class TestUpProjects:
669
675
  monkeypatch.setattr(up, "bash", spy.run)
670
676
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
671
677
  monkeypatch.setattr(up, "install_crane", lambda: None)
678
+ monkeypatch.setattr(up, "install_compose", lambda: None)
672
679
  monkeypatch.setattr(up, "OciArtifactManifest", StubArtifacts({LIVEKIT_PINNED: [LIVEKIT_TEXT]}))
673
680
 
674
681
  result = runner.invoke(app, ["up"])
@@ -684,6 +691,7 @@ class TestDownLoop:
684
691
  commands: list[str] = []
685
692
  monkeypatch.setattr(down, "bash", commands.append)
686
693
  monkeypatch.setattr(down, "bash_check", _bash_check_true)
694
+ monkeypatch.setattr(down, "install_compose", lambda: None)
687
695
 
688
696
  result = runner.invoke(app, ["down", *arguments])
689
697
 
@@ -694,9 +702,9 @@ class TestDownLoop:
694
702
  commands = self._invoke_down(tmp_path, monkeypatch)
695
703
 
696
704
  assert commands == [
697
- f"docker compose -p edge-demo-auth-keycloak --project-directory {tmp_path} down --remove-orphans",
698
- f"docker compose -p edge-demo-livekit --project-directory {tmp_path} down --remove-orphans",
699
- f"docker compose -p edge-demo --project-directory {tmp_path} down --remove-orphans",
705
+ f"docker-compose -p edge-demo-auth-keycloak --project-directory {tmp_path} down --remove-orphans",
706
+ f"docker-compose -p edge-demo-livekit --project-directory {tmp_path} down --remove-orphans",
707
+ f"docker-compose -p edge-demo --project-directory {tmp_path} down --remove-orphans",
700
708
  "docker network rm edge-demo-shared",
701
709
  ]
702
710
 
@@ -710,7 +718,7 @@ class TestDownLoop:
710
718
  commands = self._invoke_down(tmp_path, monkeypatch)
711
719
 
712
720
  assert commands[-1] == "docker network rm edge-demo-shared"
713
- assert all(command.startswith("docker compose") for command in commands[:-1])
721
+ assert all(command.startswith("docker-compose") for command in commands[:-1])
714
722
 
715
723
 
716
724
  class TestRenderCaddyfile:
@@ -1,16 +1,17 @@
1
1
  import platform
2
2
  import re
3
- import sys
4
3
  from collections.abc import Mapping
5
4
  from pathlib import Path
6
5
  from typing import Any
7
6
 
8
7
  import pytest
9
8
  import yaml
10
- from bashrun.bash import CalledProcessError, bash, bash_check, bash_output
9
+ from bashrun.bash import CalledProcessError, bash_output
11
10
  from typer.testing import CliRunner
12
11
 
12
+ from boatyard import compose as compose_module
13
13
  from boatyard.cli import app
14
+ from boatyard.compose import COMPOSE_VERSION, compose_binary
14
15
  from boatyard.models.image import Image
15
16
  from boatyard.verbs import down, up
16
17
  from boatyard.models.lock_file import LOCK_PATH
@@ -47,7 +48,7 @@ AUTH_KEYCLOAK_BUNDLE_ENTRY = {
47
48
  }
48
49
  EDGE_BASE_URL_LINE = "EDGE_BASE_URL=http://boatyard-gateway:8443\n"
49
50
  BARRIER_MINT_LINE = "BOATYARD_BARRIER_IMAGE=docker.io/library/alpine:3.20\n"
50
- PINNED_COMPOSE_VERSION = "5.6.1"
51
+ PINNED_COMPOSE_VERSION = COMPOSE_VERSION.removeprefix("v")
51
52
 
52
53
  ASSEMBLY_ARGUMENT_PATTERN = re.compile(r"-f (\S*boatyard-gateway-\S+\.yaml)")
53
54
  LOCK_ENV_ARGUMENT_PATTERN = re.compile(r"(\S*boatyard-env-\S+\.env)")
@@ -109,6 +110,7 @@ class UpSpy:
109
110
  def spy_up(self, monkeypatch: pytest.MonkeyPatch):
110
111
  monkeypatch.setattr(up, "bash", self.run)
111
112
  monkeypatch.setattr(up, "bash_check", _bash_check_true)
113
+ monkeypatch.setattr(up, "install_compose", lambda: None)
112
114
  monkeypatch.setattr(up, "install_crane", lambda: None)
113
115
  monkeypatch.setattr(up, "OciArtifactManifest", self.artifacts)
114
116
  return self
@@ -125,47 +127,13 @@ class UpSpy:
125
127
  runner = CliRunner()
126
128
 
127
129
 
128
- COMPOSE_CACHE_DIRECTORY = Path.home() / ".cache" / "boatyard" / "compose"
129
-
130
-
131
- def _cached_compose_binary() -> str:
132
- # The exact compose binary the include-merge assertions run against, cached
133
- # under ~/.cache/boatyard so one download serves every run. The download
134
- # lands on a partial name and renames into place only after its version
135
- # output checks out — a killed or corrupt download never poisons the cache.
136
- architecture = {"x86_64": "x86_64", "aarch64": "aarch64"}[platform.machine()]
137
- directory = COMPOSE_CACHE_DIRECTORY / f"v{PINNED_COMPOSE_VERSION}" / architecture
138
- binary = directory / "docker-compose"
139
- if binary.is_file() and bash_check(f"{binary} version"):
140
- return str(binary)
141
- directory.mkdir(parents=True, exist_ok=True)
142
- partial = directory / "docker-compose.partial"
143
- release = (
144
- "https://github.com/docker/compose/releases/download/"
145
- f"v{PINNED_COMPOSE_VERSION}/docker-compose-linux-{architecture}"
146
- )
147
- bash(f"curl -fsSL {release} -o {partial}")
148
- partial.chmod(0o755)
149
- if PINNED_COMPOSE_VERSION not in bash_output(f"{partial} version"):
150
- raise ValueError(f"{partial}: the downloaded binary does not report version {PINNED_COMPOSE_VERSION}")
151
- partial.replace(binary)
152
- return str(binary)
153
-
154
-
155
- @pytest.fixture(scope="session")
156
- def pinned_compose() -> str:
157
- return _cached_compose_binary()
158
-
159
-
160
130
  def _patch_compose_shell(monkeypatch: pytest.MonkeyPatch, cache: Path, version_output: str | None = None) -> list[str]:
161
- # Record every shell call _cached_compose_binary makes against a fake cache
162
- # directory; the curl stub materializes the downloaded file so the promote
163
- # path runs for real.
131
+ # Record every shell call compose_binary makes against a fake cache directory;
132
+ # the curl stub materializes the downloaded file so the promote path runs for real.
164
133
  commands: list[str] = []
165
134
  resolved_version = (
166
135
  version_output if version_output is not None else f"Docker Compose version v{PINNED_COMPOSE_VERSION}\n"
167
136
  )
168
- module = sys.modules[__name__]
169
137
 
170
138
  def record(command: str) -> None:
171
139
  commands.append(command)
@@ -185,13 +153,18 @@ def _patch_compose_shell(monkeypatch: pytest.MonkeyPatch, cache: Path, version_o
185
153
  commands.append(command)
186
154
  return resolved_version
187
155
 
188
- monkeypatch.setattr(module, "bash", record)
189
- monkeypatch.setattr(module, "bash_check", probe)
190
- monkeypatch.setattr(module, "bash_output", output)
191
- monkeypatch.setattr(module, "COMPOSE_CACHE_DIRECTORY", cache)
156
+ monkeypatch.setattr(compose_module, "bash", record)
157
+ monkeypatch.setattr(compose_module, "bash_check", probe)
158
+ monkeypatch.setattr(compose_module, "bash_output", output)
159
+ monkeypatch.setattr(compose_module, "COMPOSE_CACHE_DIRECTORY", cache)
192
160
  return commands
193
161
 
194
162
 
163
+ @pytest.fixture(scope="session")
164
+ def pinned_compose() -> str:
165
+ return str(compose_binary())
166
+
167
+
195
168
  def _write_config(root: Path, sections: dict[str, Any] | None = None) -> None:
196
169
  payload: dict[str, Any] = {"requires": ">=0.0", "project_name": "demo"}
197
170
  if sections is not None:
@@ -1054,15 +1027,16 @@ class TestSharedNames:
1054
1027
  recorder = HandoffRecorder()
1055
1028
  monkeypatch.setattr(down, "bash", recorder.run)
1056
1029
  monkeypatch.setattr(down, "bash_check", _bash_check_true)
1030
+ monkeypatch.setattr(down, "install_compose", lambda: None)
1057
1031
  monkeypatch.chdir(tmp_path)
1058
1032
 
1059
1033
  result = runner.invoke(app, ["down"])
1060
1034
 
1061
1035
  assert result.exit_code == 0, result.output
1062
1036
  assert recorder.commands == [
1063
- f"docker compose -p demo-left-a --project-directory {tmp_path} down --remove-orphans",
1064
- f"docker compose -p demo-right-b --project-directory {tmp_path} down --remove-orphans",
1065
- f"docker compose -p demo --project-directory {tmp_path} down --remove-orphans",
1037
+ f"docker-compose -p demo-left-a --project-directory {tmp_path} down --remove-orphans",
1038
+ f"docker-compose -p demo-right-b --project-directory {tmp_path} down --remove-orphans",
1039
+ f"docker-compose -p demo --project-directory {tmp_path} down --remove-orphans",
1066
1040
  "docker network rm demo-shared",
1067
1041
  ]
1068
1042
 
@@ -1073,6 +1047,7 @@ class TestDownTeardown:
1073
1047
  recorder = HandoffRecorder()
1074
1048
  monkeypatch.setattr(down, "bash", recorder.run)
1075
1049
  monkeypatch.setattr(down, "bash_check", _bash_check_true)
1050
+ monkeypatch.setattr(down, "install_compose", lambda: None)
1076
1051
  monkeypatch.chdir(tmp_path)
1077
1052
 
1078
1053
  result = runner.invoke(app, ["down"])
@@ -1080,7 +1055,7 @@ class TestDownTeardown:
1080
1055
  assert result.exit_code == 0, result.output
1081
1056
  assert len(recorder.commands) == 6
1082
1057
  for command in recorder.commands[:5]:
1083
- assert command.startswith("docker compose -p ")
1058
+ assert command.startswith("docker-compose -p ")
1084
1059
  assert " -f " not in command
1085
1060
  assert "--env-file" not in command
1086
1061
  assert command.endswith("down --remove-orphans")
@@ -1095,6 +1070,7 @@ class TestDownTeardown:
1095
1070
  recorder = HandoffRecorder()
1096
1071
  monkeypatch.setattr(down, "bash", recorder.run)
1097
1072
  monkeypatch.setattr(down, "bash_check", _bash_check_true)
1073
+ monkeypatch.setattr(down, "install_compose", lambda: None)
1098
1074
  monkeypatch.chdir(tree)
1099
1075
 
1100
1076
  result = runner.invoke(app, ["down"])
@@ -1109,6 +1085,7 @@ class TestDownTeardown:
1109
1085
  recorder = HandoffRecorder()
1110
1086
  monkeypatch.setattr(down, "bash", recorder.run)
1111
1087
  monkeypatch.setattr(down, "bash_check", _bash_check_true)
1088
+ monkeypatch.setattr(down, "install_compose", lambda: None)
1112
1089
  monkeypatch.chdir(tmp_path)
1113
1090
 
1114
1091
  result = runner.invoke(app, ["down", "--volumes"])
@@ -1132,14 +1109,15 @@ class TestDownTeardown:
1132
1109
  recorder = HandoffRecorder()
1133
1110
  monkeypatch.setattr(down, "bash", recorder.run)
1134
1111
  monkeypatch.setattr(down, "bash_check", _bash_check_false)
1112
+ monkeypatch.setattr(down, "install_compose", lambda: None)
1135
1113
  monkeypatch.chdir(tmp_path)
1136
1114
 
1137
1115
  result = runner.invoke(app, ["down"])
1138
1116
 
1139
1117
  assert result.exit_code == 0, result.output
1140
1118
  assert recorder.commands == [
1141
- f"docker compose -p demo-ext --project-directory {tmp_path} down --remove-orphans",
1142
- f"docker compose -p demo --project-directory {tmp_path} down --remove-orphans",
1119
+ f"docker-compose -p demo-ext --project-directory {tmp_path} down --remove-orphans",
1120
+ f"docker-compose -p demo --project-directory {tmp_path} down --remove-orphans",
1143
1121
  ]
1144
1122
 
1145
1123
 
@@ -1458,19 +1436,19 @@ class TestBundleOverrides:
1458
1436
  (
1459
1437
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PLACEFRAME_CUDA__BOATYARD_LOCK__ALPINE_IMAGE "
1460
1438
  "-u PLACEFRAME_CUDA__BOATYARD_LOCK__LOKI_IMAGE "
1461
- "docker compose -p demo-placeframe-cuda -f PRODUCER -f OVERRIDE "
1439
+ "docker-compose -p demo-placeframe-cuda -f PRODUCER -f OVERRIDE "
1462
1440
  "--project-directory ROOT --env-file LOCKENV up --pull missing -d --no-start"
1463
1441
  ),
1464
1442
  (
1465
1443
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PLACEFRAME_CUDA__BOATYARD_LOCK__ALPINE_IMAGE "
1466
1444
  "-u PLACEFRAME_CUDA__BOATYARD_LOCK__LOKI_IMAGE "
1467
- "docker compose -p demo-placeframe-cuda -f PRODUCER -f OVERRIDE "
1445
+ "docker-compose -p demo-placeframe-cuda -f PRODUCER -f OVERRIDE "
1468
1446
  "--project-directory ROOT --env-file LOCKENV start api grafana"
1469
1447
  ),
1470
1448
  (
1471
1449
  "env -u BOATYARD_BARRIER_IMAGE -u EDGE_BASE_URL -u PLACEFRAME_CUDA__BOATYARD_LOCK__ALPINE_IMAGE "
1472
1450
  "-u PLACEFRAME_CUDA__BOATYARD_LOCK__LOKI_IMAGE "
1473
- "docker compose -p demo -f GATEWAY --project-directory ROOT --env-file LOCKENV up --pull missing -d"
1451
+ "docker-compose -p demo -f GATEWAY --project-directory ROOT --env-file LOCKENV up --pull missing -d"
1474
1452
  ),
1475
1453
  ]
1476
1454
  assert spy.env_content == (
@@ -1762,9 +1740,9 @@ class TestPinnedComposeCache:
1762
1740
  binary.write_bytes(b"fake-binary")
1763
1741
  commands = _patch_compose_shell(monkeypatch, cache)
1764
1742
 
1765
- resolved = _cached_compose_binary()
1743
+ resolved = compose_binary()
1766
1744
 
1767
- assert resolved == str(binary)
1745
+ assert resolved == binary
1768
1746
  assert commands == []
1769
1747
 
1770
1748
  def test_a_missing_binary_downloads_validates_and_promotes(
@@ -1773,10 +1751,10 @@ class TestPinnedComposeCache:
1773
1751
  cache = tmp_path / "cache"
1774
1752
  commands = _patch_compose_shell(monkeypatch, cache)
1775
1753
 
1776
- resolved = _cached_compose_binary()
1754
+ resolved = compose_binary()
1777
1755
 
1778
1756
  binary = cache / f"v{PINNED_COMPOSE_VERSION}" / platform.machine() / "docker-compose"
1779
- assert resolved == str(binary)
1757
+ assert resolved == binary
1780
1758
  assert binary.is_file()
1781
1759
  assert not (binary.parent / "docker-compose.partial").exists()
1782
1760
  assert len([command for command in commands if command.startswith("curl ")]) == 1
@@ -1788,7 +1766,7 @@ class TestPinnedComposeCache:
1788
1766
  commands = _patch_compose_shell(monkeypatch, cache, version_output="Docker Compose version v0.0.0\n")
1789
1767
 
1790
1768
  with pytest.raises(ValueError, match="does not report version"):
1791
- _cached_compose_binary()
1769
+ compose_binary()
1792
1770
 
1793
1771
  binary = cache / f"v{PINNED_COMPOSE_VERSION}" / platform.machine() / "docker-compose"
1794
1772
  assert not binary.exists()
@@ -79,6 +79,7 @@ def _invoke_publishing(monkeypatch: pytest.MonkeyPatch, tmp_path: Path) -> Publi
79
79
  monkeypatch.setenv("REGISTRY_USERNAME", "publisher")
80
80
  monkeypatch.setenv("REGISTRY_TOKEN", "secret")
81
81
  monkeypatch.setattr(publish_verb, "bash", recorder.run)
82
+ monkeypatch.setattr(publish_verb, "install_compose", lambda: None)
82
83
  monkeypatch.setattr(crane, "bash", recorder.run)
83
84
  monkeypatch.setattr(publish_verb, "bash_output", _command_output)
84
85
  monkeypatch.setattr(Image, "compute_sha", _livekit_tree_sha)
@@ -293,7 +294,7 @@ class TestPublishComposeVerb:
293
294
 
294
295
  assert result.exit_code == 0, result.output
295
296
  assert recorder.commands[0].startswith("docker login ghcr.io -u publisher")
296
- publish_commands = [command for command in recorder.commands if command.startswith("docker compose")]
297
+ publish_commands = [command for command in recorder.commands if command.startswith("docker-compose")]
297
298
  assert len(publish_commands) == 1
298
299
  assert f"publish {REPOSITORY}/livekit-tier:{FAKE_SHA} --yes" in publish_commands[0]
299
300
  tag_commands = [command for command in recorder.commands if command.startswith("crane tag")]
@@ -395,7 +396,7 @@ class TestBundleMode:
395
396
  result = runner.invoke(app, ["publish-compose", "--bundle", "core-cuda"])
396
397
 
397
398
  assert result.exit_code == 0, result.output
398
- publish_commands = [command for command in recorder.commands if command.startswith("docker compose")]
399
+ publish_commands = [command for command in recorder.commands if command.startswith("docker-compose")]
399
400
  assert len(publish_commands) == 1
400
401
  assert f"publish {REPOSITORY}/core-cuda:{FAKE_SHA} --yes" in publish_commands[0]
401
402
  assert [command for command in recorder.commands if command.startswith("crane tag")] == [
@@ -412,7 +413,7 @@ class TestBundleMode:
412
413
  result = runner.invoke(app, ["publish-compose"])
413
414
 
414
415
  assert result.exit_code == 0, result.output
415
- publish_commands = [command for command in recorder.commands if command.startswith("docker compose")]
416
+ publish_commands = [command for command in recorder.commands if command.startswith("docker-compose")]
416
417
  assert len(publish_commands) == 3
417
418
  published = [command.split("publish ")[1].rsplit(":", 1)[0] for command in publish_commands]
418
419
  assert published == [