Skip to content

chore(overlay): auto-create bus networks + document NATS_BIND - #1830

Merged
POWERFULMOVES merged 1 commit into
mainfrom
chore/overlay-net-autocreate
Jun 17, 2026
Merged

POWERFULMOVES merged 1 commit into
mainfrom
chore/overlay-net-autocreate

Conversation

@POWERFULMOVES

@POWERFULMOVES POWERFULMOVES commented Jun 17, 2026

Copy link
Copy Markdown
Owner

Two safe follow-ups from the NATS fleet-bus restoration (#1813/#1824/#1826).

1. overlay-up-bus auto-creates its networks

New ensure-overlay-networks prerequisite creates pmoves_bus + pmoves_external if missing. The split overlays declare networks external: true (so each parses standalone) → they must pre-exist at runtime; base.yml owns them but only materializes them in a full up. This closes the manual docker network create gate hit when bringing NATS up on a fresh node. Subnets match base.yml. The deploy-nats-bus workflow drops its hardcoded create and relies on the target.

2. Documented NATS_BIND in env.shared.example

Blank default = 0.0.0.0. On a public VPS, set it to the node tailnet IP so the bus is mesh-only, not on the public IP (nats:pmoves is a weak cred). Node-specific; never commit a real IP.

Deferred (intentionally)

Per the storage direction (minio is EOLJuiceFS), the dedicated published-bus network (pmoves_bus_pub, option 3) is deferred until JuiceFS is wired into compose, so it's designed with its real co-tenants. nats stays on pmoves_external for now.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Chores
    • Updated deployment workflow to automatically ensure required Docker overlay networks are created before starting the NATS event bus.
    • Added NATS_BIND environment variable configuration option to specify the host interface for NATS port binding.

Two safe follow-ups from the NATS fleet-bus work:

1. overlay-up-bus now depends on a new `ensure-overlay-networks` target that creates
   pmoves_bus + pmoves_external if missing. The split overlays declare networks
   `external: true` (so each overlay parses standalone), so they must pre-exist at
   runtime — base.yml owns them but only materializes them in a full `up`. This
   closes the manual `docker network create` gate hit when bringing NATS up on a
   fresh node. Subnets match docker-compose.base.yml. The deploy-nats-bus workflow
   drops its hardcoded network-create and relies on the target.

2. Document NATS_BIND in env.shared.example (blank default = 0.0.0.0). On a public
   VPS, set it to the node tailnet IP so the bus is mesh-only, not exposed on the
   public IP (nats:pmoves is a weak cred). Node-specific; never commit a real IP.

Note: per the storage direction (minio is EOL → JuiceFS), the dedicated published-bus
network (pmoves_bus_pub) is intentionally deferred until JuiceFS is wired into compose,
so it can be designed with its real co-tenants. nats stays on pmoves_external for now.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Jun 17, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Caution

Review failed

Pull request was closed or merged during review

📝 Walkthrough

Walkthrough

Adds an ensure-overlay-networks Makefile target that idempotently creates the pmoves_bus and pmoves_external Docker overlay networks with fixed subnets/gateways. overlay-up-bus gains this target as a prerequisite. The deployment workflow drops its manual network-creation step, and a NATS_BIND variable is added to the shared env example.

Changes

Overlay Network Pre-creation for NATS Bus

Layer / File(s) Summary
ensure-overlay-networks target and overlay-up-bus wiring
pmoves/Makefile
Adds ensure-overlay-networks target that inspects and conditionally creates pmoves_bus and pmoves_external overlay networks with hard-coded subnet/gateway values. Adds target to .PHONY list and sets it as a prerequisite of overlay-up-bus.
Workflow simplification and NATS_BIND env variable
.github/workflows/deploy-nats-bus.yml, pmoves/env.shared.example
Removes the inline docker network inspect/create block for pmoves_external from the deployment workflow, replacing it with a comment referencing overlay-up-bus. Adds a blank NATS_BIND variable with documentation to the shared env example.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

  • POWERFULMOVES/PMOVES.AI#1813: Both PRs modify the overlay-up-bus target in pmoves/Makefile—one introduces the target, while this PR adds ensure-overlay-networks as its prerequisite.
  • POWERFULMOVES/PMOVES.AI#1824: That PR attaches NATS to pmoves_external for cross-node port reachability, directly motivating the idempotent network-creation logic added here.

Poem

🐇 Hop, hop, the networks appear,
pmoves_bus and pmoves_external are here!
No more inline shell in the CI flow,
ensure-overlay-networks steals the show.
The NATS bus starts with nary a hitch —
A bunny's Makefile without a glitch! 🎉

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description is missing required sections from the template: Testing section with commands/output and the Required Checks checklist are not present. Add a Testing section documenting how the changes were validated, and include the Required Checks checklist as specified in the repository template.
✅ Passed checks (4 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly and concisely summarizes the two main changes: auto-creating bus networks and documenting NATS_BIND configuration.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch chore/overlay-net-autocreate

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@POWERFULMOVES
POWERFULMOVES merged commit df9a2d0 into main Jun 17, 2026
20 of 21 checks passed
@POWERFULMOVES
POWERFULMOVES deleted the chore/overlay-net-autocreate branch June 17, 2026 03:40
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