Skip to content

Fix reported ports and handle mutliple docker networks#63

Merged
martypitt merged 11 commits into
mainfrom
fix-reported-ports
Jun 23, 2026
Merged

Fix reported ports and handle mutliple docker networks#63
martypitt merged 11 commits into
mainfrom
fix-reported-ports

Conversation

@martypitt

Copy link
Copy Markdown
Contributor

No description provided.

martypitt and others added 4 commits June 22, 2026 17:00
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>
Show how to enable network connectivity mode via NEBULA_CONNECTIVITY (or a
command: override) in docker-compose, the primary deployment for that mode.

Refs #61 #62

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@netlify

netlify Bot commented Jun 23, 2026

Copy link
Copy Markdown

Deploy Preview for orbital-nebula canceled.

Name Link
🔨 Latest commit e194294
🔍 Latest deploy log https://app.netlify.com/projects/orbital-nebula/deploys/6a3a180f96b71f00083280ef

martypitt and others added 7 commits June 23, 2026 05:42
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>
@martypitt martypitt merged commit 333622c into main Jun 23, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant