Skip to content

(2/n torchx-allocator)(monarch/tools) implement a way to resolve hostname to ipv6 or ipv4 address #295

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

Closed
wants to merge 1 commit into from

Conversation

kiukchung
Copy link
Contributor

Summary:
implement monarch.tools.network.get_ip_addr(hostname) that resolves a hostname to an ip address by:

  1. Look up a TCP (SOCK_STREAM) compatible ipv6 address
  2. If not found, fall-back to TCP compatible ipv4 address
  3. Error if no ipv6 or ipv4

This is required since hyperactor's ChannelAddr for the tcp transport (e.g. tcp!slurm-compute-node-0:26600) takes a socketaddr (ip + port) not a hostname. So the caller has to resolve the hostname (typically queried from the scheduler) to an ip.

Differential Revision: D76846286

@facebook-github-bot facebook-github-bot added the CLA Signed This label is managed by the Meta Open Source bot. label Jun 17, 2025
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76846286

facebook-github-bot pushed a commit that referenced this pull request Jun 17, 2025
…name to ipv6 or ipv4 address (#295)

Summary:

implement `monarch.tools.network.get_ip_addr(hostname)` that resolves a hostname to an ip address by:

1. Look up a TCP (`SOCK_STREAM`) compatible ipv6 address
2. If not found, fall-back to TCP compatible ipv4 address
3. Error if no ipv6 or ipv4

This is required since hyperactor's `ChannelAddr` for the `tcp` transport (e.g. `tcp!slurm-compute-node-0:26600`) takes a socketaddr (ip + port) not a hostname. So the caller has to resolve the hostname (typically queried from the scheduler) to an ip.

Reviewed By: ahmadsharif1

Differential Revision: D76846286
…name to ipv6 or ipv4 address (#295)

Summary:

implement `monarch.tools.network.get_ip_addr(hostname)` that resolves a hostname to an ip address by:

1. Look up a TCP (`SOCK_STREAM`) compatible ipv6 address
2. If not found, fall-back to TCP compatible ipv4 address
3. Error if no ipv6 or ipv4

This is required since hyperactor's `ChannelAddr` for the `tcp` transport (e.g. `tcp!slurm-compute-node-0:26600`) takes a socketaddr (ip + port) not a hostname. So the caller has to resolve the hostname (typically queried from the scheduler) to an ip.

Reviewed By: ahmadsharif1

Differential Revision: D76846286
@facebook-github-bot
Copy link
Contributor

This pull request was exported from Phabricator. Differential Revision: D76846286

facebook-github-bot pushed a commit that referenced this pull request Jun 17, 2025
…name to ipv6 or ipv4 address (#295)

Summary:

implement `monarch.tools.network.get_ip_addr(hostname)` that resolves a hostname to an ip address by:

1. Look up a TCP (`SOCK_STREAM`) compatible ipv6 address
2. If not found, fall-back to TCP compatible ipv4 address
3. Error if no ipv6 or ipv4

This is required since hyperactor's `ChannelAddr` for the `tcp` transport (e.g. `tcp!slurm-compute-node-0:26600`) takes a socketaddr (ip + port) not a hostname. So the caller has to resolve the hostname (typically queried from the scheduler) to an ip.

Reviewed By: ahmadsharif1

Differential Revision: D76846286
@facebook-github-bot
Copy link
Contributor

This pull request has been merged in c14038c.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed This label is managed by the Meta Open Source bot. fb-exported Merged
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants