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

fix(test-tooling): macOS ledger containers unreachable on the IP layer #186

Closed
petermetz opened this issue Jun 16, 2020 · 0 comments · Fixed by #209
Closed

fix(test-tooling): macOS ledger containers unreachable on the IP layer #186

petermetz opened this issue Jun 16, 2020 · 0 comments · Fixed by #209
Assignees
Labels
bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience

Comments

@petermetz
Copy link
Contributor

Describe the bug

Can't ping containers through their own IP address (e.g. non-localhost IP).

The solution I've come up with on a feature branch for @jweate is to bind to port 0 via the -P parameter (publish all ports) of Docker container creation. This allows for multiple containers to co-exist just listen on different ports (and we can find out which ports got assigned on a per container basis which is a slight added complexity but at least this way it works).

Ideally all the *TestLedger classes should be refactored so that they apply the workaround explained in the above paragraph.

To Reproduce

I pull up a test ledger, let's say a BesuTestLedger on macOS and try to ping the IP address that docker has assigned to the container.
The pinging fails because of some deficiency of macOS virtualization/networking stack.

Expected behavior

I'd want to be able to reach the docker containers through their dedicated IP address so that I don't have to bind ports to the host's ports. I want to avoid the latter because the hosts ports are a shared resource and disallows me from running multiple containers of the same image in parallel.

Operating system name, version, build:

macOS, all versions AFAIK

Hyperledger Cactus release version or commit (git rev-parse --short HEAD):

All recent versions that have the test ledger classes in them.

Additional context

More info here: https://stackoverflow.com/a/39217691/698470

cc: @jweate @jonathan-m-hamilton @sfuji822 @sownak @takeutak

@petermetz petermetz added the bug Something isn't working label Jun 16, 2020
@petermetz petermetz self-assigned this Jun 16, 2020
@petermetz petermetz added dependencies Pull requests that update a dependency file Developer_Experience labels Jun 16, 2020
@petermetz petermetz changed the title *TestLegders Unreachable on macOS Due to IP layer Routing Issue fix(test-tooling): macOS ledger containers unreachable on the IP layer Jun 25, 2020
petermetz added a commit to petermetz/cacti that referenced this issue Jun 26, 2020
This makes the ledger container based integration tests pass
on macOS that also leads to the CI script finally passing
on Macs in general. Yaaay!

Fixes hyperledger-cacti#186
petermetz added a commit to petermetz/cacti that referenced this issue Jun 26, 2020
This makes the ledger container based integration tests pass
on macOS that also leads to the CI script finally passing
on Macs in general. Yaaay!

Fixes hyperledger-cacti#186

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
petermetz added a commit that referenced this issue Jun 30, 2020
This makes the ledger container based integration tests pass
on macOS that also leads to the CI script finally passing
on Macs in general. Yaaay!

Fixes #186

Signed-off-by: Peter Somogyvari <peter.somogyvari@accenture.com>
ryjones pushed a commit that referenced this issue Feb 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working dependencies Pull requests that update a dependency file Developer_Experience
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant