Repository navigation
feat: containers can serve the main ports (ADR-0048) - #194
Merged
Merged
Conversation
# Conflicts: # CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements ADR-0048 (accepted in #190); part 2 of #184. UDP is out of scope (#192).
What
[compose.<group>] main_ports = ["web"]names containers whose published TCP ports devstack holds in the main tree:.devstack/compose/<group>.main.yml, fromdevstack_compose::main_overlay) publishes their TCP ports on a loopback port Docker assigns (127.0.0.1::<target>). UDP ports, ranges and ports Docker assigns stay as the files say.compose uphas let it go (Supervisor::hold_ports). It usestcpfwd::Front::bind_at, on the address the Compose file names: every interface (IPv4 and IPv6) without one, loopback for127.0.0.1.sync_held, after every refresh, points each front:take_main/give_backflip the fronts (hold_for_lane).moves_main_slotcountsmain_ports, so a container-only stack with them is no longer refused (fix(daemon): serving the main ports refuses a stack of containers only #188). The refusal now namesmain_ports.published_portsstays the instance address, so there is no crosstalk. A lane's shared ports and its range are computed from the fixed ports (published_fixed).ContainerView.portsnames the fixed port, and the newContainerView.heldgives the fixed and upstream port. The container detail page shows:8290 → :53994.main_portsmust name services ofservices, and none ofshared.Tested by hand on Windows (Docker 29.8)
I built a busybox
httpdstack with18290:8080andmain_ports = ["web"]; the main tree servesmain, and a lane's worktree serveslane:devstack up: the container is on127.0.0.1:53994, devstack listens on0.0.0.0:18290and[::]:18290, andcurl :18290returnsmain;:18390returnslane;promote --lane app-feat::18290returnslane;promote --lane main::18290returnsmainagain.One unrelated observation:
devstack down --all --infraleft both projects' containers running ("lanes were using it"). That predates this PR.Tests
main_overlayholds only the TCP ports of named services, keeps UDP and Docker-assigned ports, and errors on unknown names.moves_main_slotcountsmain_ports.main_ports.cargo clippy --workspace --all-targets -- -D warnings,cargo fmt --checkand the workspace unit tests pass; UI typecheck and vitest pass.Docs
docs/stack-file.md,docs/dashboard-api.md, thedevstack-configskill, the CHANGELOG, and an as-built note in ADR-0048.🤖 Generated with Claude Code