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

support custom IP address from rpc server to tracker (PUT) #1243

Merged
merged 9 commits into from
Jun 8, 2018

Conversation

eqy
Copy link
Contributor

@eqy eqy commented Jun 6, 2018

Currently the tracker uses the IP address of the connection when a new rpc server registers.
In the case of a network topology where the tracker is behind a NAT/firewall, the registering RPC server's connection will appear to come from another device from within the NAT (e.g., if we use an ssh tunnel).
This PR allows the registering RPC server to specify a custom IP at PUT time so RPC requests to the tracker can receive the actual address of the server.

@tqchen
Copy link
Member

tqchen commented Jun 7, 2018

need rebase from master

@@ -92,8 +91,12 @@ def _accept_conn(listen_sock, tracker_conn, ping_period=2):
# Report resource to tracker
if tracker_conn:
matchkey = base.random_key(rpc_key + ":")
base.sendjson(tracker_conn,
[TrackerCode.PUT, rpc_key, (port, matchkey)])
if custom_addr is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since we will be breaking the RPC protocol anyway in this cycle, maybe just always send the custom_addr

self._tracker.put(key, (self, self._addr[0], port, matchkey))
# got custom address (from rpc server)
if args[3] is not None:
self._tracker.put(key, (self, args[3], port, matchkey))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can we directly also put None in here?

@@ -195,6 +195,9 @@ def call_handler(self, args):
port, matchkey = args[2]
self.pending_matchkeys.add(matchkey)
self._tracker.put(key, (self, self._addr[0], port, matchkey))
# got custom address (from rpc server)
if args[3] is not None:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sorry, seems previous if else way is correct

@tqchen tqchen merged commit 088939f into apache:master Jun 8, 2018
sergei-mironov pushed a commit to sergei-mironov/tvm that referenced this pull request Aug 8, 2018
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.

2 participants