Fix reported ports and handle mutliple docker networks#63
Merged
Conversation
Containers' host + port are now resolved by an explicit connectivity mode rather than always emitting host-mapped ports and patching the host after the fact via the HTTP Host header. - Add ConsumerConnectivity (HOST | NETWORK) to NebulaConfig, plus a --connectivity CLI flag (NEBULA_CONNECTIVITY), defaulting to host. - Add NebulaConfig.endpointFor(...) resolver: - HOST -> container.host + host-mapped port - NETWORK -> network alias (componentName) + internal port - Emit a discrete host + port on every *ContainerConfig, and rebuild the embedded connection strings (jdbcUrl, mongo connectionString, localstack endpoint, kafka bootstrapServers) from the same resolved endpoint so they can't drift. - Kafka: drop the external-listener/Host-header machinery; emit the host-mapped PLAINTEXT listener in host mode and the in-network BROKER listener (alias:9092) in network mode. - Remove updateHostReferences / HostNameAwareContainerConfig and the server-side Host-header rewrite entirely. Nebula's own internal clients (Hikari, Kafka admin, S3) keep using the TestContainers host-mapped route, unchanged. Refs #61 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add a concise CLI & networking page covering the nebula CLI options (--http, --network, --connectivity, --verbose) and the host vs network connectivity modes, and register it in the docs nav. Refs #61 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
In network connectivity mode, attach child containers to the network Nebula itself is running on, rather than guessing by name. Nebula reads its own container id from /etc/hostname, inspects itself, and selects the attached network whose name contains --network (default nebula_network). This fixes startup failures when multiple Orbital/Nebula compose projects run on the same host and several *_nebula_network networks exist - name-based lookup matched all of them and bailed out. Host mode keeps the existing name-lookup / create-isolated behaviour. Network selection is extracted as a pure function with unit coverage. Closes #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
✅ Deploy Preview for orbital-nebula canceled.
|
Host mode reached containers via host port-mapping, so the network they sit on is irrelevant - yet it still called discoverActualNetworkName(), which queried docker and failed when multiple *_nebula_network networks existed (the same failure as #62, just on the host path). Host mode now always creates an isolated network (enough for intra-stack DNS aliases), removing that docker round-trip entirely. discoverActualNetworkName() is deleted. Network mode additionally fails fast when Nebula isn't running inside a container (detected via /.dockerenv, /run/.containerenv, or /proc/1/cgroup), giving a clear "use --connectivity=host" message instead of an inspect error. Refs #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
A container can be attached to several docker networks, so --network is a disambiguator, not a required exact name. selectAttachedNetwork now uses the single attached network when there is only one (even if it doesn't match the identifier), and only needs --network when the container is on multiple networks. Refs #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
When host mode creates an isolated docker network, log its name so it can be identified (eg. docker network inspect). Uses NetworkImpl.getName(), which unlike getId() doesn't force the network to be created early. Refs #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Name the isolated network nebula-<adjective>-<surname> (eg. nebula-focused-turing) instead of testcontainers' default UUID, so it's identifiable in `docker network ls`. Adds a Names util (Moby random-name generator, ported from vyne) and sets the docker network name via a createNetworkCmdModifier, since the testcontainers Network builder has no name() setter. Refs #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Names the isolated host-mode network nebula-<adjective>-<surname>-<5 random chars> (eg. nebula-focused-turing-a3k9z), so it can't collide with a network left over from an earlier run when ryuk cleanup is disabled. Refs #62 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The s3 DSL defaulted to localstack/localstack:latest - the only component on a floating tag. CI runners pull a fresh :latest (now LocalStack 4.x), which the pinned testcontainers 1.19.0 LocalStackContainer can't drive reliably: the container reports started but the S3 edge isn't serving, so the test fails with "Connection refused" on the mapped port. Locally a cached 3.0.x :latest kept working, hiding it. Pin to 3.0.2 (a stable tag from the 3.0.x line that has been working locally), matching the explicit pinning of every other component's image. Verified by pulling 3.0.2 fresh and running S3ExecutorTest. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
No description provided.