Skip to content

Route local-provider agents over a dedicated docker network - #71

Open
Saaketh0 wants to merge 1 commit into
fixes/ventis-cli-fixesfrom
cli/local-provider-routing
Open

Route local-provider agents over a dedicated docker network#71
Saaketh0 wants to merge 1 commit into
fixes/ventis-cli-fixesfrom
cli/local-provider-routing

Conversation

@Saaketh0

@Saaketh0 Saaketh0 commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

Before, the GC was running directly on the machine, and communicated with the LC containers through a roundabout way of going outside the host gateway and back into the port, but now that GC is itself running inside a container, that won't work.

This fix creates a docker internal network that allows all containers to communicate with each other.

Claude Explanation Below:

Agents used to be reached at host.docker.internal:<host_port>, which only works when whatever is doing the reaching shares the host's network namespace. They now join a ventis-local docker network and are addressed by container name at the fixed container port, so routing no longer depends on the caller's vantage point.

  • Local/_runtime.py: --network ventis-local instead of --add-host, VENTIS_AGENT_PORT is the container port, VENTIS_AGENT_HOST is the container name, routing_endpoint_for returns <runtime_id>:50051.
  • global_controller.py: creates the network alongside the local Redis container, and derives status/metrics Redis keys from instance_manager._routing_endpoint_for instead of the host string.

Conflict resolution notes:

  • Kept this branch's MAX_PORT_ATTEMPTS retry loop and env_file support around the docker run, applying the new network/env flags inside it.
  • Kept _is_local_host in Local/_runtime.py; a0efb5a dropped it, but env_file_args (added later on the CLI line) still needs it.
  • The controller::agent_id key written after launch, which postdates a0efb5a, now uses the container-name endpoint so it matches the keys global_controller reads back.

Cherry-picked from a0efb5a on bug/local-provider-routing, resolved
against the .car/CLI packaging changes already on this branch.

Agents used to be reached at host.docker.internal:<host_port>, which
only works when whatever is doing the reaching shares the host's network
namespace. They now join a `ventis-local` docker network and are
addressed by container name at the fixed container port, so routing no
longer depends on the caller's vantage point.

- Local/_runtime.py: --network ventis-local instead of --add-host,
  VENTIS_AGENT_PORT is the container port, VENTIS_AGENT_HOST is the
  container name, routing_endpoint_for returns <runtime_id>:50051.
- global_controller.py: creates the network alongside the local Redis
  container, and derives status/metrics Redis keys from
  instance_manager._routing_endpoint_for instead of the host string.

Conflict resolution notes:
- Kept this branch's MAX_PORT_ATTEMPTS retry loop and env_file support
  around the docker run, applying the new network/env flags inside it.
- Kept _is_local_host in Local/_runtime.py; a0efb5a dropped it, but
  env_file_args (added later on the CLI line) still needs it.
- The controller:<endpoint>:agent_id key written after launch, which
  postdates a0efb5a, now uses the container-name endpoint so it matches
  the keys global_controller reads back.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@Saaketh0 Saaketh0 self-assigned this Sep 4, 2026
@coderabbitai

coderabbitai Bot commented Sep 4, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

🗂️ Base branches to auto review (1)
  • main

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Team

Run ID: e3b4aefb-e70b-4a8a-a07a-295eeb61cf31

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

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