boatyard 0.6.1.dev174__tar.gz → 0.6.2.dev177__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 (81) hide show
  1. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/PKG-INFO +1 -1
  2. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/closeout.md +26 -11
  3. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/pyproject.toml +1 -1
  4. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/config/config.py +13 -5
  5. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/up.py +1 -1
  6. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_assembly.py +6 -8
  7. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_compose.py +10 -10
  8. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_config.py +68 -19
  9. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_lock.py +4 -3
  10. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_score_generate.py +1 -1
  11. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.gitattributes +0 -0
  12. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.github/workflows/cleanup-pr-releases.yml +0 -0
  13. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.github/workflows/integrate.yml +0 -0
  14. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.github/workflows/merge-gate.yml +0 -0
  15. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.github/workflows/release.yml +0 -0
  16. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.gitignore +0 -0
  17. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/.python-version +0 -0
  18. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/AGENTS.md +0 -0
  19. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/CLAUDE.md +0 -0
  20. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/LICENSE +0 -0
  21. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/NOTICE +0 -0
  22. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/README.md +0 -0
  23. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/AGENTS.md +0 -0
  24. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/CLAUDE.md +0 -0
  25. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/adoption-semver-wave.md +0 -0
  26. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/apt-hermeticity.md +0 -0
  27. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/dev-overlay.md +0 -0
  28. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/gpu-template-collapse.md +0 -0
  29. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/mirror-digest-retention.md +0 -0
  30. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/precision-attribution.md +0 -0
  31. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/design/semver-image-bundle-lines.md +0 -0
  32. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/publish.yml +0 -0
  33. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/ruff.base.toml +0 -0
  34. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/ruff.toml +0 -0
  35. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/scripts/preflight.py +0 -0
  36. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/__init__.py +0 -0
  37. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/build.py +0 -0
  38. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/cli.py +0 -0
  39. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/compose.py +0 -0
  40. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/config/__init__.py +0 -0
  41. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/config/lock.py +0 -0
  42. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/config/values.py +0 -0
  43. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/crane.py +0 -0
  44. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/dockerfiles.py +0 -0
  45. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/lock.py +0 -0
  46. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/markers.py +0 -0
  47. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/paths.py +0 -0
  48. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/publish.py +0 -0
  49. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/py.typed +0 -0
  50. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score.py +0 -0
  51. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_compose.py +0 -0
  52. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_k8s.py +0 -0
  53. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/gpu-cuda.tpl +0 -0
  54. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/gpu-pod.tpl +0 -0
  55. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/gpu-rocm.tpl +0 -0
  56. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/probe-adapter-healthchecks.tpl +0 -0
  57. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/restart.tpl +0 -0
  58. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/score_patch_templates/scale-to-zero.tpl +0 -0
  59. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/temp.py +0 -0
  60. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/__init__.py +0 -0
  61. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/build.py +0 -0
  62. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/down.py +0 -0
  63. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/lock.py +0 -0
  64. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/matrix.py +0 -0
  65. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/mirror.py +0 -0
  66. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/publish.py +0 -0
  67. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/score.py +0 -0
  68. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/verbs/tree_tags.py +0 -0
  69. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/src/boatyard/yaml.py +0 -0
  70. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/conftest.py +0 -0
  71. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_build_docker.py +0 -0
  72. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_daemon_gc.py +0 -0
  73. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_markers.py +0 -0
  74. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_matrix.py +0 -0
  75. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_mirror.py +0 -0
  76. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_provisioners.py +0 -0
  77. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_publish_compose.py +0 -0
  78. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_secrets.py +0 -0
  79. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_service_builds.py +0 -0
  80. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/tests/test_tree_tags.py +0 -0
  81. {boatyard-0.6.1.dev174 → boatyard-0.6.2.dev177}/uv.lock +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: boatyard
3
- Version: 0.6.1.dev174
3
+ Version: 0.6.2.dev177
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
@@ -65,17 +65,21 @@ separate commits.
65
65
  toolkit SHA bump incl. its local setup-release-devkit composite, the docs
66
66
  flip). Battery green locally (ruff, format, basedpyright, matrix `[]`,
67
67
  plan, `lock --check`, lint-workflows at the new pin); zero
68
- docker-devkit/`--lock-only`/`--gpu`/hole mentions remain. CI-green is
69
- blocked on the two boatyard defects above — the branch awaits the fix
70
- release and the operator push.
68
+ docker-devkit/`--lock-only`/`--gpu`/hole mentions remain. Landed: the
69
+ branch was rebased to a clean three commits on `origin/dev` (bundle+cutover
70
+ code pinning `0.6.1`; `Run generate-score`; docs), force-pushed, and the
71
+ rathole-client bundle is published carrying the 0.6.1 rendering —
72
+ Make-it-Sing's ref flip targets the fresh digest's sha tag.
71
73
  - Both boatyard defects fixed on `dev` (2026-11-06, `abd6236` prose +
72
74
  `dde430a` code, full preflight green): `generate-score`'s `--target`
73
75
  default now derives from the config (explicit misspellings still refuse),
74
76
  and `ensure_tools` presence-probes with `shutil.which` plus installs only
75
77
  the tools the target needs. Verified end-to-end: the dev verb, bare
76
78
  invocation against swept infra-rathole, regenerates byte-identically.
77
- Next: operator releases (0.6.1 expected) → repin infra-rathole → next
78
- consumer sweep (lbe-toolkit or Make-it-Sing, one per session).
79
+ Released as 0.6.1; the sweep's remaining consumers pin it from the start.
80
+ Sweep order set (2026-11-06): placeframe, placeframe-capture-tool,
81
+ lbe-toolkit, then Make-it-Sing (its local checkout needs `git switch
82
+ compose-bundles` before editing).
79
83
  - The values-file session (2026-11-04, battery green) landed atop Work 1 and
80
84
  rewrote the consumer surface: `.env` is dead — `boatyard.values.yaml`
81
85
  (gitignored, typed; `ConfigValues` in `values_file.py`) is the only
@@ -162,7 +166,8 @@ These rulings bind every work unit below.
162
166
  1 build-out the iteration unit on the refactor branch: disk-state service
163
167
  hashes, qualified selection grammar, ref tag grammar + _BUNDLE
164
168
  lock entries, path-form bundle overrides
165
- 2 release boatyard 0.6.0 — operator; one release, the pin target
169
+ 2 release boatyard 0.6.0, then 0.6.1 (the mid-wave defect fixes) —
170
+ operator; the wave pins 0.6.1, never bare 0.6.0
166
171
  3 toolkit cutover onto boatyard spellings; the SHA the wave bumps to
167
172
  4 sweep all five consumers repin once, relock, rename, drop imports,
168
173
  adopt the iteration unit
@@ -440,9 +445,7 @@ wherever the release actually landed. Upstream defects the sweep surfaces in
440
445
  github-actions-toolkit or boatyard itself are fixable mid-wave — surface, fix
441
446
  the upstream, record here; the wave's pin target follows whatever release
442
447
  carries the fixes. Found in infra-rathole (both boatyard 0.6.0, both blocked
443
- the CI-green verify) and fixed on boatyard `dev` at `dde430a` — awaiting the
444
- operator release (0.6.1 expected; every consumer pin — including swept
445
- infra-rathole's — repins to it in a one-line + `uv lock` commit):
448
+ the CI-green verify), fixed and released as `0.6.1`:
446
449
  - `generate-score` defaults `--target both` and a one-substrate repo refuses
447
450
  under that default — the toolkit getter hardcodes the bare
448
451
  `generate-score --check`, so every compose-only repo (infra-rathole,
@@ -455,6 +458,16 @@ infra-rathole's — repins to it in a one-line + `uv lock` commit):
455
458
  (runner or sandbox); `generate-score` 0.6.0 has never run clean off a fresh
456
459
  environment. Rider: compose-only runs still install score-k8s + helm.
457
460
 
461
+ Found in the placeframe sweep (2026-11-06), fixed on `dev` (full preflight
462
+ green), unreleased — the wave's pin target becomes the release carrying it
463
+ (placeframe's `requires:` floor and dep pin ride up with it):
464
+ - `PortOrSlot` was string-typed, so a natural YAML int port
465
+ (`published: 4040`) refused with a coercion error and only the quoted
466
+ digit-string loaded. Literal ports are now int-typed (strict; digit strings
467
+ refuse naming the env-slot alternative), env slots stay the string branch,
468
+ and the edge emission drops its `str()` coercion. infra-rathole declares no
469
+ ports; unswept configs flip in their own sweeps.
470
+
458
471
  Sweep mechanics discovered in infra-rathole, carried to the rest: the
459
472
  score-tool trio (score-compose 0.42.0, score-k8s 0.15.0, helm 3.22.1) must
460
473
  pre-exist in `/usr/local/bin` to run generate-score locally (the defect
@@ -474,8 +487,10 @@ its `up` assembly (the path-override verify) surfaces whether the
474
487
 
475
488
  Common to all five, order within a repo code → lockfiles → prose:
476
489
 
477
- 1. Dependency: `docker-devkit…` → `boatyard==0.6.0` (or `>=`); `uv lock
478
- --upgrade-package boatyard`. `requires:` floor → `>=0.6.0`.
490
+ 1. Dependency: `docker-devkit…` → `boatyard==0.6.1` (or `>=`); `uv lock
491
+ --upgrade-package boatyard`. `requires:` floor → `>=0.6.1` (0.6.0 carries
492
+ the two sweep defects; infra-rathole landed `>=0.6.0` before this ruling —
493
+ bump it in passing when next touched).
479
494
  2. `git mv docker-devkit.yaml boatyard.yml`; `git mv docker-devkit.lock
480
495
  boatyard.lock.yml`, then truncate the lock to the empty file before the
481
496
  relock — the old env format never parses at relock's committed
@@ -1,6 +1,6 @@
1
1
  [project]
2
2
  name = "boatyard"
3
- version = "0.6.1.dev174"
3
+ version = "0.6.2.dev177"
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 = [
@@ -48,7 +48,6 @@ COMPOSE_SLOT = re.compile(r"(\$+)\{([A-Z][A-Z0-9_]*)(:[^{}]*)?\}")
48
48
 
49
49
  # Match compose env slots: ${NAME}, ${NAME:?err}, ${NAME:-default}.
50
50
  ENV_SLOT_PATTERN = re.compile(r"^\$\{[A-Z][A-Z0-9_]*(?::[^{}]*)?\}$")
51
- PORT_PATTERN = re.compile(r"^[0-9]+$")
52
51
 
53
52
  type Yaml = str | int | float | bool | list[Yaml] | dict[str, Yaml] | None
54
53
 
@@ -58,13 +57,22 @@ class BundleScan(NamedTuple):
58
57
  requires: list[str]
59
58
 
60
59
 
61
- def _require_port_or_slot(value: str) -> str:
62
- if PORT_PATTERN.fullmatch(value) is None and ENV_SLOT_PATTERN.fullmatch(value) is None:
63
- raise ValueError(f"{value!r} must be a literal port number or a ${{…}} env slot")
60
+ def _require_port_range(value: int) -> int:
61
+ if not 1 <= value <= 65535:
62
+ raise ValueError(f"{value} is outside the port range 1-65535")
64
63
  return value
65
64
 
66
65
 
67
- PortOrSlot = Annotated[str, AfterValidator(_require_port_or_slot)]
66
+ def _require_env_slot(value: str) -> str:
67
+ if ENV_SLOT_PATTERN.fullmatch(value) is None:
68
+ raise ValueError(f"{value!r} must be a ${{…}} env slot; a literal port is an int")
69
+ return value
70
+
71
+
72
+ PortOrSlot = (
73
+ Annotated[int, Field(strict=True), AfterValidator(_require_port_range)]
74
+ | Annotated[str, Field(strict=True), AfterValidator(_require_env_slot)]
75
+ )
68
76
 
69
77
 
70
78
  def _require_all_caps_name(value: str) -> str:
@@ -159,7 +159,7 @@ def up(
159
159
  edge: dict[str, Yaml] = {
160
160
  "image": consumer_entries[CADDY_IMAGE],
161
161
  "configs": [{"source": EDGE_CONFIG_NAME, "target": "/etc/caddy/Caddyfile"}],
162
- "ports": [{"target": str(EDGE_LISTEN_PORT), "published": config.gateway, "protocol": "tcp"}],
162
+ "ports": [{"target": EDGE_LISTEN_PORT, "published": config.gateway, "protocol": "tcp"}],
163
163
  # Attach the edge to every selected bundle's network
164
164
  "networks": dict.fromkeys(f"{service.name}-net" for service in services),
165
165
  }
@@ -8,7 +8,7 @@ from typer.testing import CliRunner
8
8
 
9
9
  from boatyard.cli import app
10
10
  from boatyard.config import values
11
- from boatyard.config.config import ConfigFile
11
+ from boatyard.config.config import ConfigFile, PortOrSlot
12
12
  from boatyard.verbs import up
13
13
  from boatyard.config.lock import LOCK_PATH
14
14
 
@@ -39,7 +39,7 @@ def _write_edge_tree(
39
39
  routes: list[dict[str, object]],
40
40
  *,
41
41
  auth: bool = False,
42
- gateway: str | None = "${GATEWAY_PORT:?err}",
42
+ gateway: PortOrSlot | None = "${GATEWAY_PORT:?err}",
43
43
  public_url: str = "http://192.168.8.10:58080",
44
44
  ) -> None:
45
45
  services: dict[str, object] = {
@@ -102,7 +102,7 @@ def _assembly_document(
102
102
  routes: list[dict[str, object]],
103
103
  *,
104
104
  auth: bool = False,
105
- gateway: str | None = "${GATEWAY_PORT:?err}",
105
+ gateway: PortOrSlot | None = "${GATEWAY_PORT:?err}",
106
106
  public_url: str = "http://192.168.8.10:58080",
107
107
  ) -> dict[str, Any]:
108
108
  _write_edge_tree(tmp_path, monkeypatch, routes, auth=auth, gateway=gateway, public_url=public_url)
@@ -221,16 +221,14 @@ class TestEdgeStanza:
221
221
  assert document["services"]["edge"] == {
222
222
  "image": CADDY_LOCK_ENTRY,
223
223
  "configs": [{"source": "devkit-edge-caddyfile", "target": "/etc/caddy/Caddyfile"}],
224
- "ports": [{"target": "8443", "published": "${GATEWAY_PORT:?err}", "protocol": "tcp"}],
224
+ "ports": [{"target": 8443, "published": "${GATEWAY_PORT:?err}", "protocol": "tcp"}],
225
225
  "networks": {"livekit-net": None},
226
226
  }
227
227
 
228
228
  def test_the_published_port_uses_a_literal_gateway(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
229
- document = _assembly_document(
230
- tmp_path, monkeypatch, [{"path": "/*", "upstream": "livekit:8000"}], gateway="8080"
231
- )
229
+ document = _assembly_document(tmp_path, monkeypatch, [{"path": "/*", "upstream": "livekit:8000"}], gateway=8080)
232
230
 
233
- assert document["services"]["edge"]["ports"] == [{"target": "8443", "published": "8080", "protocol": "tcp"}]
231
+ assert document["services"]["edge"]["ports"] == [{"target": 8443, "published": 8080, "protocol": "tcp"}]
234
232
 
235
233
  def test_routes_without_a_gateway_refuse_at_load(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch) -> None:
236
234
  _write_edge_tree(tmp_path, monkeypatch, [{"path": "/*", "upstream": "livekit:8000"}], gateway=None)
@@ -56,7 +56,7 @@ def _write_config(root: Path, sections: dict[str, Any] | None = None) -> None:
56
56
  if sections is not None:
57
57
  payload.update(sections)
58
58
  if "services" in payload and "gateway" not in payload:
59
- payload["gateway"] = "8080"
59
+ payload["gateway"] = 8080
60
60
  if payload.get("gateway") is not None:
61
61
  payload.setdefault("platforms", ["linux/amd64"])
62
62
  payload["base_images"] = {
@@ -433,12 +433,12 @@ class TestSelectionLaw:
433
433
  "project_name": "demo",
434
434
  "platforms": ["linux/amd64"],
435
435
  "base_images": {"CADDY_IMAGE": "docker.io/library/caddy:2.8.4-alpine"},
436
- "gateway": "8080",
436
+ "gateway": 8080,
437
437
  "services": {
438
438
  "livekit": {
439
439
  "ref": LIVEKIT_REF,
440
440
  "routes": [{"path": "/*", "upstream": "livekit:8000"}],
441
- "ports": [{"service": "livekit", "published": "6178", "target": "6178"}],
441
+ "ports": [{"service": "livekit", "published": 6178, "target": 6178}],
442
442
  }
443
443
  },
444
444
  },
@@ -464,7 +464,7 @@ class TestSelectionLaw:
464
464
  "project_name": "demo",
465
465
  "platforms": ["linux/amd64"],
466
466
  "base_images": {"CADDY_IMAGE": "docker.io/library/caddy:2.8.4-alpine"},
467
- "gateway": "8080",
467
+ "gateway": 8080,
468
468
  "services": {
469
469
  "placeframe": {
470
470
  "options": {
@@ -492,7 +492,7 @@ class TestSelectionLaw:
492
492
  [document] = recorder.documents
493
493
  assert document["name"] == "demo"
494
494
  assert list(document) == ["name", "configs", "services"]
495
- assert document["services"]["edge"]["ports"] == [{"target": "8443", "published": "8080", "protocol": "tcp"}]
495
+ assert document["services"]["edge"]["ports"] == [{"target": 8443, "published": 8080, "protocol": "tcp"}]
496
496
  assert document["configs"]["devkit-edge-caddyfile"]["content"] == ":8443 {\n}\n"
497
497
 
498
498
  def test_unknown_name_refuses_listing_the_vocabulary(self, tmp_path: Path, monkeypatch: pytest.MonkeyPatch):
@@ -596,7 +596,7 @@ class TestUpMaterialization:
596
596
  ])
597
597
  edge = document["services"]["edge"]
598
598
  assert edge["image"] == MIRROR_PREFIX + "/docker.io/library/caddy:2.8.4-alpine@" + FAKE_DIGEST
599
- assert edge["ports"] == [{"target": "8443", "published": "${GATEWAY_PORT:?err}", "protocol": "tcp"}]
599
+ assert edge["ports"] == [{"target": 8443, "published": "${GATEWAY_PORT:?err}", "protocol": "tcp"}]
600
600
  assert edge["networks"] == {
601
601
  "auth-keycloak-net": None,
602
602
  "placeframe-cuda-net": None,
@@ -696,13 +696,13 @@ class TestUpValidation:
696
696
  "project_name": "demo",
697
697
  "repository": "ghcr.io/org/demo",
698
698
  "platforms": ["linux/amd64"],
699
- "gateway": "8080",
699
+ "gateway": 8080,
700
700
  "services": {
701
701
  "placeframe": {
702
702
  "options": {
703
703
  "cuda": {
704
704
  "workloads": ["api.yaml"],
705
- "ports": [{"service": "grafana", "published": "3306", "target": "3306"}],
705
+ "ports": [{"service": "grafana", "published": 3306, "target": 3306}],
706
706
  }
707
707
  }
708
708
  }
@@ -849,7 +849,7 @@ class TestSharedNames:
849
849
  "project_name": "demo",
850
850
  "platforms": ["linux/amd64"],
851
851
  "base_images": {"CADDY_IMAGE": "docker.io/library/caddy:2.8.4-alpine"},
852
- "gateway": "8080",
852
+ "gateway": 8080,
853
853
  "repository": "ghcr.io/org/demo",
854
854
  "services": {
855
855
  "left": {
@@ -888,7 +888,7 @@ class TestSharedNames:
888
888
  "project_name": "demo",
889
889
  "platforms": ["linux/amd64"],
890
890
  "base_images": {"CADDY_IMAGE": "docker.io/library/caddy:2.8.4-alpine"},
891
- "gateway": "8080",
891
+ "gateway": 8080,
892
892
  "repository": "ghcr.io/org/demo",
893
893
  "services": {
894
894
  "left": {
@@ -795,7 +795,7 @@ class TestServices:
795
795
  {
796
796
  "requires": ">=0.1",
797
797
  "project_name": "example",
798
- "gateway": "8080",
798
+ "gateway": 8080,
799
799
  "services": {"core": {"workloads": ["api.yaml"]}},
800
800
  },
801
801
  )
@@ -809,7 +809,7 @@ class TestServices:
809
809
  {
810
810
  "requires": ">=0.1",
811
811
  "project_name": "example",
812
- "gateway": "8080",
812
+ "gateway": 8080,
813
813
  "base_images": EDGE_BASE_IMAGES,
814
814
  "platforms": EDGE_PLATFORMS,
815
815
  "services": {
@@ -889,7 +889,7 @@ class TestAuthGroup:
889
889
  return {
890
890
  "requires": ">=0.1",
891
891
  "project_name": "example",
892
- "gateway": "8080",
892
+ "gateway": 8080,
893
893
  "base_images": EDGE_BASE_IMAGES,
894
894
  "platforms": EDGE_PLATFORMS,
895
895
  "services": {"auth": {"options": options}},
@@ -953,7 +953,7 @@ class TestRoutes:
953
953
  return {
954
954
  "requires": ">=0.1",
955
955
  "project_name": "example",
956
- "gateway": "8080",
956
+ "gateway": 8080,
957
957
  "base_images": EDGE_BASE_IMAGES,
958
958
  "platforms": EDGE_PLATFORMS,
959
959
  "services": {"livekit": {"ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG, "routes": routes}},
@@ -965,7 +965,7 @@ class TestRoutes:
965
965
  {
966
966
  "requires": ">=0.1",
967
967
  "project_name": "example",
968
- "gateway": "8080",
968
+ "gateway": 8080,
969
969
  "services": {
970
970
  "one": {
971
971
  "options": {
@@ -1046,7 +1046,7 @@ class TestGatewayKey:
1046
1046
  {
1047
1047
  "requires": ">=0.1",
1048
1048
  "project_name": "example",
1049
- "gateway": "8443",
1049
+ "gateway": 8443,
1050
1050
  "services": {"livekit": {"ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG}},
1051
1051
  },
1052
1052
  )
@@ -1063,7 +1063,7 @@ class TestGatewayKey:
1063
1063
  "project_name": "example",
1064
1064
  "platforms": ["linux/amd64"],
1065
1065
  "base_images": {"CADDY_IMAGE": "docker.io/library/caddy:2.8.4-alpine"},
1066
- "gateway": "8080",
1066
+ "gateway": 8080,
1067
1067
  "services": {"livekit": {"ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG}},
1068
1068
  },
1069
1069
  )
@@ -1078,7 +1078,7 @@ class TestGatewayKey:
1078
1078
  {
1079
1079
  "requires": ">=0.1",
1080
1080
  "project_name": "example",
1081
- "gateway": "8443",
1081
+ "gateway": 8443,
1082
1082
  "base_images": EDGE_BASE_IMAGES,
1083
1083
  "platforms": EDGE_PLATFORMS,
1084
1084
  "services": {
@@ -1108,7 +1108,7 @@ class TestGatewayKey:
1108
1108
  },
1109
1109
  )
1110
1110
 
1111
- with pytest.raises(ValidationError, match="literal port number or a"):
1111
+ with pytest.raises(ValidationError, match="env slot; a literal port is an int"):
1112
1112
  ConfigFile.load(tmp_path / "boatyard.yml")
1113
1113
 
1114
1114
 
@@ -1118,7 +1118,7 @@ class TestPorts:
1118
1118
  "requires": ">=0.1",
1119
1119
  "repository": "ghcr.io/org/repo",
1120
1120
  "project_name": "example",
1121
- "gateway": "8080",
1121
+ "gateway": 8080,
1122
1122
  "base_images": EDGE_BASE_IMAGES,
1123
1123
  "platforms": EDGE_PLATFORMS,
1124
1124
  "services": services,
@@ -1132,8 +1132,8 @@ class TestPorts:
1132
1132
  "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1133
1133
  "routes": [{"path": "/*", "upstream": "livekit:8000"}],
1134
1134
  "ports": [
1135
- {"service": "livekit", "published": "${PORT:?err}", "target": "6178"},
1136
- {"service": "livekit", "published": "6179", "target": "6179", "protocol": "udp"},
1135
+ {"service": "livekit", "published": "${PORT:?err}", "target": 6178},
1136
+ {"service": "livekit", "published": 6179, "target": 6179, "protocol": "udp"},
1137
1137
  ],
1138
1138
  }
1139
1139
  }),
@@ -1145,10 +1145,44 @@ class TestPorts:
1145
1145
  livekit = config.services["livekit"]
1146
1146
  assert isinstance(livekit, ServiceEntry)
1147
1147
  assert [(port.service, port.published, port.target, port.protocol) for port in livekit.ports] == [
1148
- ("livekit", "${PORT:?err}", "6178", "tcp"),
1149
- ("livekit", "6179", "6179", "udp"),
1148
+ ("livekit", "${PORT:?err}", 6178, "tcp"),
1149
+ ("livekit", 6179, 6179, "udp"),
1150
1150
  ]
1151
1151
 
1152
+ def test_an_int_port_loads(self, tmp_path: Path) -> None:
1153
+ write_config(
1154
+ tmp_path,
1155
+ self._ports_config({
1156
+ "livekit": {
1157
+ "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1158
+ "routes": [{"path": "/*", "upstream": "livekit:8000"}],
1159
+ "ports": [{"service": "livekit", "published": 6179, "target": 6179}],
1160
+ }
1161
+ }),
1162
+ )
1163
+
1164
+ config = ConfigFile.load(tmp_path / "boatyard.yml")
1165
+
1166
+ assert config is not None
1167
+ livekit = config.services["livekit"]
1168
+ assert isinstance(livekit, ServiceEntry)
1169
+ assert [(port.published, port.target) for port in livekit.ports] == [(6179, 6179)]
1170
+
1171
+ def test_an_out_of_range_int_port_refuses(self, tmp_path: Path) -> None:
1172
+ write_config(
1173
+ tmp_path,
1174
+ self._ports_config({
1175
+ "livekit": {
1176
+ "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1177
+ "routes": [{"path": "/*", "upstream": "livekit:8000"}],
1178
+ "ports": [{"service": "livekit", "published": 65536, "target": 6179}],
1179
+ }
1180
+ }),
1181
+ )
1182
+
1183
+ with pytest.raises(ValidationError, match="outside the port range"):
1184
+ ConfigFile.load(tmp_path / "boatyard.yml")
1185
+
1152
1186
  def test_a_string_port_refuses(self, tmp_path: Path) -> None:
1153
1187
  write_config(
1154
1188
  tmp_path,
@@ -1169,7 +1203,7 @@ class TestPorts:
1169
1203
  write_config(
1170
1204
  tmp_path,
1171
1205
  self._ports_config({
1172
- "tunnel": {"options": None, "ports": [{"service": "ngrok", "published": "4040", "target": "4040"}]},
1206
+ "tunnel": {"options": None, "ports": [{"service": "ngrok", "published": 4040, "target": 4040}]},
1173
1207
  "livekit": {
1174
1208
  "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1175
1209
  "routes": [{"path": "/*", "upstream": "livekit:8000"}],
@@ -1192,7 +1226,7 @@ class TestPorts:
1192
1226
  "service": "api",
1193
1227
  "host_ip": "127.0.0.1",
1194
1228
  "published": "${API_DEBUG_PORT:-5679}",
1195
- "target": "5678",
1229
+ "target": 5678,
1196
1230
  }
1197
1231
  ],
1198
1232
  },
@@ -1214,12 +1248,27 @@ class TestPorts:
1214
1248
  "livekit": {
1215
1249
  "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1216
1250
  "routes": [{"path": "/*", "upstream": "livekit:8000"}],
1217
- "ports": [{"service": "livekit", "published": "eight", "target": "5678"}],
1251
+ "ports": [{"service": "livekit", "published": "eight", "target": 5678}],
1252
+ }
1253
+ }),
1254
+ )
1255
+
1256
+ with pytest.raises(ValidationError, match="env slot; a literal port is an int"):
1257
+ ConfigFile.load(tmp_path / "boatyard.yml")
1258
+
1259
+ def test_a_digit_string_port_refuses(self, tmp_path: Path) -> None:
1260
+ write_config(
1261
+ tmp_path,
1262
+ self._ports_config({
1263
+ "livekit": {
1264
+ "ref": "oci://ghcr.io/org/repo/x:" + SHA_TAG,
1265
+ "routes": [{"path": "/*", "upstream": "livekit:8000"}],
1266
+ "ports": [{"service": "livekit", "published": "6179", "target": 6179}],
1218
1267
  }
1219
1268
  }),
1220
1269
  )
1221
1270
 
1222
- with pytest.raises(ValidationError, match="literal port number or a"):
1271
+ with pytest.raises(ValidationError, match="env slot; a literal port is an int"):
1223
1272
  ConfigFile.load(tmp_path / "boatyard.yml")
1224
1273
 
1225
1274
 
@@ -1379,7 +1428,7 @@ def test_direct_model_construction_is_valid_for_tests(tmp_path: Path) -> None:
1379
1428
  "requires": ">=0.1",
1380
1429
  "repository": "ghcr.io/org/repo",
1381
1430
  "project_name": "example",
1382
- "gateway": "8080",
1431
+ "gateway": 8080,
1383
1432
  "services": {"core": {"workloads": ["api.yaml"]}},
1384
1433
  })
1385
1434
  config.root = tmp_path
@@ -10,6 +10,7 @@ from typer.testing import CliRunner
10
10
 
11
11
  from boatyard.cli import app
12
12
  from boatyard.config import config as config_module
13
+ from boatyard.config.config import PortOrSlot
13
14
  from boatyard import lock as lock_module
14
15
  from boatyard import dockerfiles as dockerfiles_module
15
16
  from boatyard.verbs.up import render_env_entries
@@ -118,7 +119,7 @@ def _write_repo(
118
119
  charts: dict[str, str] | None = None,
119
120
  platforms: list[str] | None = None,
120
121
  ref_services: dict[str, Any] | None = None,
121
- gateway: str | None = None,
122
+ gateway: PortOrSlot | None = None,
122
123
  ) -> None:
123
124
  payload: dict[str, Any] = {"requires": ">=0", "project_name": "demo"}
124
125
  if gateway is not None:
@@ -605,7 +606,7 @@ class TestBundleRecording:
605
606
  caddy_base = MIRROR_PREFIX + "/" + caddy_declaration
606
607
  _write_repo(
607
608
  tmp_path,
608
- gateway="8080",
609
+ gateway=8080,
609
610
  platforms=["linux/amd64"],
610
611
  base_images={"CADDY_IMAGE": caddy_declaration},
611
612
  ref_services=services,
@@ -707,7 +708,7 @@ class TestBundleRecording:
707
708
  "options": {
708
709
  "rathole": {
709
710
  "ref": self.TUNNEL_RATHOLE,
710
- "ports": [{"service": "database", "published": "5432", "target": "5432"}],
711
+ "ports": [{"service": "database", "published": 5432, "target": 5432}],
711
712
  }
712
713
  }
713
714
  }
@@ -28,7 +28,7 @@ def _root_config(**sections: object) -> ConfigFile:
28
28
  payload: dict[str, object] = {"requires": ">=0.1", "project_name": "example"}
29
29
  payload.update(sections)
30
30
  if "services" in payload and "gateway" not in payload:
31
- payload["gateway"] = "8080"
31
+ payload["gateway"] = 8080
32
32
  return ConfigFile.model_validate(payload)
33
33
 
34
34
 
File without changes
File without changes
File without changes