Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(interop): allow specifying port to bind to #220

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

achingbrain
Copy link
Member

@achingbrain achingbrain commented Jul 5, 2023

Ping listeners implementations seem to all bind to random ports during test runs, then report their multiaddr to redis. Dialers receive the multiaddr from redis and dial it.

This is great when everything is under Docker.

If you are trying to run one half of the test from locally running code and the other from a docker container in order to debug things you need to know the port the docker half will be listening on when you build the container in order to EXPOSE the port and make it available to the host machine, so the docker half can't use random ports.

Running the non-local half of the test as a Docker image is preferable to building from source since it reduces the amount of assumed knowledge the developer has about how to build a rust/nim/zig/go/js/java project and doesn't require them to set up esoteric toolchains for what is hopefully an infrequent task.

The change here is to specify a port env var that can be used to control this, defaulting to '0', the value that seems to be used everywhere currently.

Ping listeners implementations seem to all bind to random ports during test runs, then report their multiaddr to redis.  Dialers receive the multiaddr from redis and dial it.

This is great when everything is under Docker.

If you are trying to run one half of the test from locally running code and the other from a docker container in order to debug things you need to know the port the docker half will be listening on when you build the container in order to `EXPOSE` the port and make it available to the host machine, so the docker half can't use random ports.

The change here is to specify a `port` env var that can be used to control this, defaulting to `'0'`, the value that seems to be used everywhere currently.
@MarcoPolo
Copy link
Contributor

This is fine by me. Although I wouldn't expect this change to be backported to all released versions. It would be easy to have newer versions support this though.

As a workaround, you could use net=host on Docker. This might not work on a macOS docker setup.

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.

None yet

2 participants