Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion src/forge/controller/provisioner.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,13 @@ async def get_remote_info(host_mesh: HostMesh) -> tuple[str, str]:
"""Returns the host name and port of the host mesh."""
throwaway_procs = host_mesh.spawn_procs(per_host={"procs": 1})
fetcher = throwaway_procs.spawn("_fetcher", _RemoteInfoFetcher)
fetcher = fetcher.slice(procs=0)

# This will reduce something like extent = {"hosts": 2, "procs": 1} to
# {"hosts": 1, "procs": 1}.
singleton_slice = {k: slice(0, 1) for k in fetcher.extent.keys()}
fetcher = fetcher.slice(**singleton_slice)
# Fetcher should be a singleton at this point - call_one() will fail otherwise

host, port = await fetcher.get_info.call_one()
await throwaway_procs.stop()
return host, port
Expand Down
Loading