Skip to content

feat(bootstrap): restore per-gateway Docker bridge networks#303

Merged
drew merged 1 commit intomainfrom
feat/per-gateway-docker-network
Mar 14, 2026
Merged

feat(bootstrap): restore per-gateway Docker bridge networks#303
drew merged 1 commit intomainfrom
feat/per-gateway-docker-network

Conversation

@drew
Copy link
Copy Markdown
Collaborator

@drew drew commented Mar 14, 2026

Summary

  • Restore custom Docker bridge networking for gateways, replacing the default bridge that was left after fix(bootstrap): detect missing sandbox supervisor binary during gateway health check #281 removed the shared openshell-cluster network
  • Each gateway now gets its own isolated network named openshell-cluster-{name}, matching the existing container/volume naming convention
  • Network is created during deploy, attached via network_mode, and torn down during destroy

Context

PR #281 removed the shared openshell-cluster Docker bridge network. This left gateways running on Docker's default bridge, which means multiple gateways share the same network namespace and can't be properly isolated.

This PR restores dedicated bridge networking with a key improvement: instead of a single global network, each gateway gets its own openshell-cluster-{name} network. This ensures multiple gateways on the same Docker daemon don't interfere with each other's networking.

Changes

File Change
crates/openshell-bootstrap/src/constants.rs Add network_name(name) function
crates/openshell-bootstrap/src/docker.rs Add ensure_network() with retry/backoff, force_remove_network(), network_mode on container, network disconnect+removal in destroy
crates/openshell-bootstrap/src/lib.rs Wire ensure_network() into deploy flow before ensure_volume()
architecture/gateway-single-node.md Update docs to reflect per-gateway network isolation

Test Plan

  • cargo check -p openshell-bootstrap passes
  • cargo check --workspace passes (full workspace)
  • cargo fmt --all -- --check passes
  • Architecture docs updated to reflect new behavior

PR #281 removed the shared openshell-cluster Docker network in favor of
the default bridge. This restores custom bridge networking but makes each
gateway use its own isolated network named openshell-cluster-{name},
matching the existing container/volume naming convention.

Changes:
- Add network_name() to constants.rs for per-gateway network naming
- Add ensure_network() with retry/backoff and force_remove_network()
  parameterized by network name instead of a global constant
- Attach containers to their per-gateway network via network_mode
- Disconnect and remove the network during gateway destroy
- Wire ensure_network() into the deploy flow before ensure_volume()
- Update architecture docs to reflect per-gateway network isolation
@drew drew self-assigned this Mar 14, 2026
@drew drew merged commit 2fde214 into main Mar 14, 2026
9 checks passed
@drew drew deleted the feat/per-gateway-docker-network branch March 14, 2026 20:36
drew added a commit that referenced this pull request Mar 16, 2026
PR #281 removed the shared openshell-cluster Docker network in favor of
the default bridge. This restores custom bridge networking but makes each
gateway use its own isolated network named openshell-cluster-{name},
matching the existing container/volume naming convention.

Changes:
- Add network_name() to constants.rs for per-gateway network naming
- Add ensure_network() with retry/backoff and force_remove_network()
  parameterized by network name instead of a global constant
- Attach containers to their per-gateway network via network_mode
- Disconnect and remove the network during gateway destroy
- Wire ensure_network() into the deploy flow before ensure_volume()
- Update architecture docs to reflect per-gateway network isolation
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