add support for custom p2p node listen maddrs and dht announce maddrs #799
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.
Long story short - i'm trying to join multiple LocalAI nodes which is hosted as docker container images on the vast.ai hosting.
The problem is - you can't provide the
network_mode: host
in that environment.The maximum you can do is expose some port locally for the container, and then the vast.ai service will remap it to some random port on public accessed machine address, like:
To work around that i need to provide to the libp2p the address that is exposed locally to listen to using introduced flag
--listen-maddrs "/ip4/0.0.0.0/tcp/8090"
After that, with some patience, using defaults, the node can be actually accessed through the power of auto relay (based on pure luck)
But we can push that further by announcing on DHT the real public rerouted address using another introduced flag
--dht-announce-maddrs /ip4/[ip4]/tcp/13371
Combined both approaches we can successfully reach the node by it's public address right after discovery on the DHT.
The petals project is using the same approach: https://github.com/bigscience-workshop/petals/blob/22afba627a7eb4fcfe9418c49472c6a51334b8ac/src/petals/cli/run_server.py#L54